harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Egor Pasko <egor.pa...@gmail.com>
Subject Re: [drlvm][optimizer] What does 'Modifier' mean?
Date Tue, 08 Jan 2008 21:32:30 GMT
On the 0x3C5 day of Apache Harmony Simon Chow wrote:
> I finds that an 'Operation' instance contains opcode, modifer, typetag in
> optimizer of Harmony. Each of them is in a enum set.
> My understanding is that opcodes are the HIR elements of Harmony optimizer,
> and typetag is the result type of this operator, are these right?

yes, you are right

> And for modifer, I do not know what it means. Anyone can help me for this?


modifiers are intended to modify sematics of instructions
slightly. That allows us to avoid creating great lots of opcodes. 

for example, ComparisonModifier indicates what kind of comparison it
is, whether comparison is signed, etc., while opcode is the same:

enum ComparisonModifier {
    Cmp_EQ              = 0x1 << 4,
    Cmp_NE_Un           = 0x2 << 4,
    Cmp_GT              = 0x3 << 4,
    Cmp_GT_Un           = 0x4 << 4,

jitrino/src/optimizer/Opcode.h lists the modifiers. All modifiers
together behave like a single mask, hence you can change one modifier
having others unchanged.

Egor Pasko

View raw message