org.jikesrvm.compilers.opt.lir2mir.ia32
Class BURS_Helpers

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.IRTools
      extended by org.jikesrvm.compilers.opt.ir.GenericPhysicalRegisterTools
          extended by org.jikesrvm.compilers.opt.ir.ia32.PhysicalRegisterTools
              extended by org.jikesrvm.ArchitectureSpecificOpt.PhysicalRegisterTools
                  extended by org.jikesrvm.compilers.opt.lir2mir.BURS_Common_Helpers
                      extended by org.jikesrvm.compilers.opt.lir2mir.BURS_MemOp_Helpers
                          extended by org.jikesrvm.compilers.opt.lir2mir.ia32.BURS_Helpers
Direct Known Subclasses:
BURS_STATE

abstract class BURS_Helpers
extends BURS_MemOp_Helpers

Contains IA32-specific helper functions for BURS.


Field Summary
private  ConditionOperand cc
          When emitting certain rules this holds the condition code state to be consumed by a parent rule
private static Offset doubleAbsMask
          Mask to abs an XMM registers
private static Offset doubleSignMask
          Mask to flip sign bits in XMM registers
private static Offset floatAbsMask
          Mask to abs an XMM registers
private static Offset floatSignMask
          Mask to flip sign bits in XMM registers
private static double L2E
          Constant log2(e), supported as an x87 constant
private static double L2T
          Constant log2(10), supported as an x87 constant
private static double LG2
          Constant log10(2), supported as an x87 constant
private static double LN2
          Constant ln(2), supported as an x87 constant
 
Fields inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS_MemOp_Helpers
B, B_S, DW, DW_S, PARAGRAPH, QW, QW_S, W, W_S
 
Fields inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS_Common_Helpers
burs, INFINITE, regpool
 
Constructor Summary
BURS_Helpers(BURS burs)
          Constructor
 
Method Summary
private  Operand asReg(Instruction s, Operator movop, Operand op)
          Move op into a register operand if it isn't one already.
protected  void ATTEMPT_IFCMP(MemoryOperand mo, Operand oldValue, Operand newValue, ConditionOperand cond, BranchOperand target, BranchProfileOperand bp)
          This routine expands the compound pattern IFCMP(ATTEMPT, ZERO) into an atomic compare/exchange followed by a branch on success/failure of the attempted atomic compare/exchange.
protected  void ATTEMPT_LONG(RegisterOperand result, MemoryOperand mo, Operand oldValue, Operand newValue)
          This routine expands an ATTEMPT instruction into an atomic compare exchange.
protected  void ATTEMPT(RegisterOperand result, MemoryOperand mo, Operand oldValue, Operand newValue)
          This routine expands an ATTEMPT instruction into an atomic compare exchange.
protected static ConditionOperand BIT_TEST(int x, ConditionOperand cond)
          Convert the given comparison with a boolean (int) value into a condition suitable for the carry flag
protected  void BOOLEAN_CMP_DOUBLE(Instruction s, RegisterOperand res, ConditionOperand cond, Operand val1, Operand val2)
          Expansion of BOOLEAN_CMP_DOUBLE
protected  void BOOLEAN_CMP_INT(Instruction s, RegisterOperand res, ConditionOperand cond)
          Expansion of a special case of BOOLEAN_CMP_INT when the condition registers have already been set by the previous ALU op.
protected  void BOOLEAN_CMP_INT(Instruction s, RegisterOperand res, Operand val1, Operand val2, ConditionOperand cond)
          Expansion of BOOLEAN_CMP_INT
protected  void BOOLEAN_CMP_LONG(Instruction s, RegisterOperand res, Operand val1, Operand val2, ConditionOperand cond)
          Expansion of BOOLEAN_CMP_LONG
protected  void CALL(Instruction s, Operand address)
          Expansion of CALL.
protected  void CMOV_FMOV(Instruction s, RegisterOperand result, ConditionOperand cond, Operand trueValue, Operand falseValue)
          Generate a floating point move portion of a conditional move.
protected  void CMOV_MOV(Instruction s, RegisterOperand result, ConditionOperand cond, Operand trueValue, Operand falseValue)
          Generate an integer move portion of a conditional move.
protected  boolean CMP_TO_TEST(ConditionOperand op)
          Can the given condition for a compare be converted to a test?
protected  IA32ConditionOperand COND(ConditionOperand op)
           
protected  ConditionOperand consumeCOND()
          Acquire remembered condition code in parent
protected  void EMIT_Commutative(Operator operator, Instruction s, Operand result, Operand val1, Operand val2)
          Create the MIR instruction given by operator from the Binary LIR operands
protected  void EMIT_Lea(Instruction s, RegisterOperand result, MemoryOperand mo)
          Create the MIR LEA instruction performing a few simplifications if possible
protected  void EMIT_NonCommutative(Operator operator, Instruction s, Operand result, Operand val1, Operand val2)
          Create the MIR instruction given by operator from the Binary LIR operands
protected  void EMIT_Unary(Operator operator, Instruction s, Operand result, Operand value)
          Create the MIR instruction given by operator from the Binary LIR operands
protected static Operand follow(Operand use)
          Follow a chain of Move operations filtering back to a def
protected  void FP_MOV_OP_MOV(Instruction s, Operator op, Operand result, Operand val1, Operand val2)
          Expansion of FP_ADD_ACC, FP_MUL_ACC, FP_SUB_ACC, and FP_DIV_ACC.
protected  void FP_REM(Instruction s, Operand val1, Operand val2)
          Expansion of FP_REM
protected  void FPR_2INT(Instruction s, RegisterOperand result, Operand value)
          Expansion of FLOAT_2INT and DOUBLE_2INT, using the FIST instruction.
protected  void FPR2GPR_64(Instruction s)
          Emit code to move 64 bits from FPRs to GPRs
protected  void GET_EXCEPTION_OBJECT(Instruction s)
          Emit code to get a caught exception object into a register
protected  void GET_TIME_BASE(Instruction s, RegisterOperand result)
          Expansion of RDTSC (called GET_TIME_BASE for consistency with PPC)
protected  Operator get387_FPC(Instruction s)
           
protected  Register getEAX()
           
protected  Register getEBP()
           
protected  Register getEBX()
           
protected  Register getECX()
           
protected  Register getEDI()
           
protected  Register getEDX()
           
protected  Register getESI()
           
protected  Register getESP()
           
protected  Register getFPR(int n)
           
protected  Register getST0()
           
protected  void GPR2FPR_64(Instruction s)
          Emit code to move 64 bits from GPRs to FPRs
protected  void IFCMP(Instruction s, RegisterOperand guardResult, Operand val1, Operand val2, ConditionOperand cond)
          Generate a compare and branch sequence.
protected  void INT_2LONG(Instruction s, RegisterOperand result, Operand value, boolean signExtend)
          Expansion of INT_2LONG
protected  void INT_DIVIDES(Instruction s, RegisterOperand result, Operand val1, Operand val2, boolean isDiv)
          Expansion of INT_DIV and INT_REM
protected  boolean IS_MATERIALIZE_ZERO(Instruction s)
           
protected  int is387_FPC(Instruction s, int trueCost)
          Is the given instruction's constant operand a x87 floating point constant
protected  void LCMP_CMOV(Instruction s, RegisterOperand result, Operand val1, Operand val2, ConditionOperand cond, Operand trueValue, Operand falseValue)
          Generate a long compare and cmov
protected  byte LEA_SHIFT(Operand op)
           
protected  int LEA_SHIFT(Operand op, int trueCost)
          Can an IV be the scale in a LEA instruction?
protected  int LEA_SHIFT(Operand op, int trueCost, int falseCost)
          Can an IV be the scale in a LEA instruction?
(package private) static MemoryOperand loadFromJTOC(Offset offset, byte size)
          Create memory operand to load from a given jtoc offset
protected  void LONG_ADD(Instruction s, RegisterOperand result, Operand value1, Operand value2)
          Expansion of LONG_ADD
protected  void LONG_AND(Instruction s, RegisterOperand result, Operand value1, Operand value2)
          Expansion of LONG_AND
protected  void LONG_CMP(Instruction s, RegisterOperand res, Operand val1, Operand val2)
          Expansion of LONG_CMP: compare to values and set result to -1, 0, 1 for <, =, >, respectively
protected  void LONG_MUL(Instruction s, RegisterOperand result, Operand value1, Operand value2)
          Expansion of LONG_MUL
protected  void LONG_NEG(Instruction s, RegisterOperand result, Operand value)
          Expansion of LONG_NEG
protected  void LONG_NOT(Instruction s, RegisterOperand result, Operand value)
          Expansion of LONG_NOT
protected  void LONG_OR(Instruction s, RegisterOperand result, Operand value1, Operand value2)
          Expansion of LONG_OR
protected  void LONG_SHL(Instruction s, Operand result, Operand val1, Operand val2, boolean maskWith3f)
          Expansion of LONG_SHL
protected  void LONG_SHR(Instruction s, Operand result, Operand val1, Operand val2, boolean maskWith3f)
          Expansion of LONG_SHR
protected  void LONG_SUB(Instruction s, Operand result, Operand val1, Operand val2)
          Expansion of LONG_SUB
protected  void LONG_USHR(Instruction s, Operand result, Operand val1, Operand val2, boolean maskWith3f)
          Expansion of LONG_USHR
protected  void LONG_XOR(Instruction s, RegisterOperand result, Operand value1, Operand value2)
          Expansion of LONG_XOR
protected  void LOWTABLESWITCH(Instruction s)
          Expansion of LOWTABLESWITCH.
protected  Operand MO_CONV(byte size)
          Create a slot on the stack in memory for a conversion
protected  Operand myFP0()
           
protected  Operand myFP1()
           
(package private)  void OSR(BURS burs, Instruction s)
           
protected  void PROLOGUE(Instruction s)
          Expand a prologue by expanding out longs into pairs of ints
protected  void pushCOND(ConditionOperand c)
          Remember a condition code in a child node
protected  void RESOLVE(Instruction s)
          Expansion of RESOLVE.
protected  void SET_EXCEPTION_OBJECT(Instruction s)
          Emit code to move a value in a register to the stack location where a caught exception object is expected to be.
protected  MemoryOperand setSize(MemoryOperand mo, int size)
          Set the size field of the given memory operand and return it
protected  boolean SIMILAR_REGISTERS(Operand... ops)
           
protected  void SSE2_ABS(boolean single, Instruction s, Operand result, Operand value)
           
protected static Operator SSE2_CMP_OP(ConditionOperand cond, boolean single)
           
protected  void SSE2_CONV(Operator op, Instruction s, Operand result, Operand value)
          Expansion of SSE2 conversions double <-> float
protected  void SSE2_COP(Operator operator, Instruction s, Operand result, Operand val1, Operand val2)
          BURS expansion of a commutative SSE2 operation.
protected  void SSE2_FCMP_FCMOV(Instruction s, RegisterOperand result, Operand lhsCmp, Operand rhsCmp, ConditionOperand cond, Operand trueValue, Operand falseValue)
           
protected  void SSE2_FPCONSTANT(Instruction s)
          Expansion of SSE2 floating point constant loads
protected  void SSE2_FPR2GPR_32(Instruction s)
          Emit code to move 32 bits from FPRs to GPRs
protected  void SSE2_FPR2GPR_64(Instruction s)
          Emit code to move 64 bits from SSE2 FPRs to GPRs
protected  void SSE2_GPR2FPR_32(Instruction s)
          Emit code to move 32 bits from GPRs to FPRs
protected  void SSE2_GPR2FPR_64(Instruction s)
          Emit code to move 64 bits from GPRs to SSE2 FPRs
protected  void SSE2_IFCMP(Operator op, Instruction s, Operand val1, Operand val2)
          Expansion of SSE2 comparison operations
protected  boolean SSE2_IS_GT_OR_GE(ConditionOperand cond)
           
protected  boolean SSE2_IS_LT_OR_LE(ConditionOperand cond)
           
protected  Operator SSE2_MOVE(Operand o)
          Returns the appropriate move operator based on the type of operand.
protected  void SSE2_NCOP(Operator operator, Instruction s, Operand result, Operand val1, Operand val2)
          BURS expansion of a non commutative SSE2 operation.
protected  void SSE2_NEG(boolean single, Instruction s, Operand result, Operand value)
          Expansion of SSE2 negation ops
protected  byte SSE2_SIZE(Operand o)
          Returns the size based on the type of operand.
protected  void SSE2_X87_FROMLONG(Instruction s)
          Performs a long -> double/float conversion using x87 and marshalls back to XMMs.
protected  void SSE2_X87_REM(Instruction s)
          Performs a long -> double/float conversion using x87 and marshalls between to XMMs.
protected  void STORE_LONG_FOR_CONV(Operand op)
          Create a 64bit slot on the stack in memory for a conversion and store the given long
protected  void SYSCALL(Instruction s, Operand address)
          Expansion of SYSCALL.
protected  void threeValueFPCmp(Instruction s)
          Expansion for [DF]CMP[GL] compare to values and set result to -1, 0, 1 for <, =, >, respectively
protected  void TRAP_IF_IMM(Instruction s, boolean longConstant)
          Expansion of TRAP_IF, with an int constant as the second value.
 
Methods inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS_MemOp_Helpers
ADDRESS_EQUAL, ADDRESS_EQUAL, ARRAY_ADDRESS_EQUAL, ARRAY_ADDRESS_EQUAL, augmentAddress, combineAddresses, consumeAddress, consumeMO, MO_AL, MO_AL, MO_AS, MO_AS, MO_B, MO_BD, MO_BI, MO_BID, MO_BIS, MO_D, MO_L, MO_L, MO_MC, MO_S, MO_S, MO, MO, MO, pushAddress, pushMO
 
Methods inherited from class org.jikesrvm.compilers.opt.lir2mir.BURS_Common_Helpers
AC, AV, EMIT, EQ_GT_GE, EQ_LT_LE, EQ_NE, FITS, FITS, getIR, IC, isONE, isONE, isZERO, isZERO, IV, LC, MINUSONE, ONE, P, PL, PLL, PLLL, PLLLL, PLLLLLL, PLLLLLLL, PLLLRL, PLLLRLL, PLLLRLLL, PLLR, PLLRL, PLLRLL, PLLRLLL, PLLRLLR, PLR, PLRL, PLRLL, PLRLLRL, PLRR, PR, PRL, PRLL, PRLLL, PRLLLL, PRLLR, PRLLRLLL, PRLR, PRLRL, PRR, PRRL, PRRR, R, V, VL, VLL, VLLL, VLLLL, VLLLLLLLR, VLLLLLLR, VLLLLLR, VLLLLR, VLLLR, VLLLRLLLR, VLLLRLLR, VLLLRLR, VLLLRR, VLLR, VLLRLLLR, VLLRLLR, VLLRLLRR, VLLRLR, VLLRR, VLR, VLRL, VLRLL, VLRLLRR, VLRLR, VLRR, VLRRR, VR, VRL, VRLL, VRLLLLR, VRLLLR, VRLLR, VRLLRLLLR, VRLLRLLR, VRLLRR, VRLR, VRLRLR, VRLRR, VRR, VRRL, VRRLR, VRRR, ZERO
 
Methods inherited from class org.jikesrvm.compilers.opt.ir.ia32.PhysicalRegisterTools
makeMoveInstruction
 
Methods inherited from class org.jikesrvm.compilers.opt.ir.GenericPhysicalRegisterTools
A, I
 
Methods inherited from class org.jikesrvm.compilers.opt.ir.IRTools
A, AC, AC, CPOS, CR, D, DC, defDoublesAsUse, definedIn, F, FC, getCondMoveOp, getDefaultOperand, getLoadOp, getLoadOp, getMoveOp, getStoreOp, getStoreOp, I, IC, insertInstructionsAfter, L, LC, makeBlockOnEdge, mayBeVolatileFieldLoad, moveInstruction, moveIntoRegister, moveIntoRegister, nonPEIGC, TG, usedIn, useDoublesAsDef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LG2

private static final double LG2
Constant log10(2), supported as an x87 constant


LN2

private static final double LN2
Constant ln(2), supported as an x87 constant


L2E

private static final double L2E
Constant log2(e), supported as an x87 constant


L2T

private static final double L2T
Constant log2(10), supported as an x87 constant


floatSignMask

private static final Offset floatSignMask
Mask to flip sign bits in XMM registers


doubleSignMask

private static final Offset doubleSignMask
Mask to flip sign bits in XMM registers


floatAbsMask

private static final Offset floatAbsMask
Mask to abs an XMM registers


doubleAbsMask

private static final Offset doubleAbsMask
Mask to abs an XMM registers


cc

private ConditionOperand cc
When emitting certain rules this holds the condition code state to be consumed by a parent rule

Constructor Detail

BURS_Helpers

BURS_Helpers(BURS burs)
Constructor

Method Detail

EMIT_Commutative

protected void EMIT_Commutative(Operator operator,
                                Instruction s,
                                Operand result,
                                Operand val1,
                                Operand val2)
Create the MIR instruction given by operator from the Binary LIR operands

Parameters:
operator - the MIR operator
s - the instruction being replaced
result - the destination register/memory
val1 - the first operand
val2 - the second operand

EMIT_NonCommutative

protected void EMIT_NonCommutative(Operator operator,
                                   Instruction s,
                                   Operand result,
                                   Operand val1,
                                   Operand val2)
Create the MIR instruction given by operator from the Binary LIR operands

Parameters:
operator - the MIR operator
s - the instruction being replaced
result - the destination register/memory
val1 - the first operand
val2 - the second operand

EMIT_Unary

protected void EMIT_Unary(Operator operator,
                          Instruction s,
                          Operand result,
                          Operand value)
Create the MIR instruction given by operator from the Binary LIR operands

Parameters:
operator - the MIR operator
s - the instruction being replaced
result - the destination register/memory
value - the first operand

EMIT_Lea

protected void EMIT_Lea(Instruction s,
                        RegisterOperand result,
                        MemoryOperand mo)
Create the MIR LEA instruction performing a few simplifications if possible

Parameters:
s - the instruction being replaced
result - the destination register
mo - the memory operand

BIT_TEST

protected static ConditionOperand BIT_TEST(int x,
                                           ConditionOperand cond)
Convert the given comparison with a boolean (int) value into a condition suitable for the carry flag

Parameters:
x - the value 1 (true) or 0 (false)
cond - either equal or not equal
Returns:
lower or higher equal

follow

protected static Operand follow(Operand use)
Follow a chain of Move operations filtering back to a def

Parameters:
use - the place to start from
Returns:
the operand at the start of the chain

pushCOND

protected final void pushCOND(ConditionOperand c)
Remember a condition code in a child node

Parameters:
c - condition code to record

consumeCOND

protected final ConditionOperand consumeCOND()
Acquire remembered condition code in parent

Returns:
condition code

LEA_SHIFT

protected final int LEA_SHIFT(Operand op,
                              int trueCost)
Can an IV be the scale in a LEA instruction?

Parameters:
op - operand to examine
trueCost - the cost if this can be part of an LEA
Returns:
trueCost or INFINITE

LEA_SHIFT

protected final int LEA_SHIFT(Operand op,
                              int trueCost,
                              int falseCost)
Can an IV be the scale in a LEA instruction?

Parameters:
op - operand to examine
trueCost - the cost if this can be part of an LEA
falseCost - the cost if this can't be part of an LEA
Returns:
trueCost or falseCost

LEA_SHIFT

protected final byte LEA_SHIFT(Operand op)

is387_FPC

protected final int is387_FPC(Instruction s,
                              int trueCost)
Is the given instruction's constant operand a x87 floating point constant

Parameters:
s - the instruction to examine
trueCost - the cost if this is a valid constant
Returns:
trueCost or INFINITE depending on the given constant

get387_FPC

protected final Operator get387_FPC(Instruction s)

CMP_TO_TEST

protected final boolean CMP_TO_TEST(ConditionOperand op)
Can the given condition for a compare be converted to a test?


COND

protected final IA32ConditionOperand COND(ConditionOperand op)

getEAX

protected final Register getEAX()

getECX

protected final Register getECX()

getEDX

protected final Register getEDX()

getEBX

protected final Register getEBX()

getESP

protected final Register getESP()

getEBP

protected final Register getEBP()

getESI

protected final Register getESI()

getEDI

protected final Register getEDI()

getFPR

protected final Register getFPR(int n)

myFP0

protected final Operand myFP0()

myFP1

protected final Operand myFP1()

getST0

protected final Register getST0()

asReg

private Operand asReg(Instruction s,
                      Operator movop,
                      Operand op)
Move op into a register operand if it isn't one already.


setSize

protected final MemoryOperand setSize(MemoryOperand mo,
                                      int size)
Set the size field of the given memory operand and return it

Parameters:
mo - memory operand size to set
size - the new size
Returns:
mo

MO_CONV

protected final Operand MO_CONV(byte size)
Create a slot on the stack in memory for a conversion

Parameters:
size - for memory operand
Returns:
memory operand of slot in stack

STORE_LONG_FOR_CONV

protected final void STORE_LONG_FOR_CONV(Operand op)
Create a 64bit slot on the stack in memory for a conversion and store the given long


loadFromJTOC

static MemoryOperand loadFromJTOC(Offset offset,
                                  byte size)
Create memory operand to load from a given jtoc offset

Parameters:
offset - location in JTOC
size - of value in JTOC
Returns:
created memory operand

GET_EXCEPTION_OBJECT

protected final void GET_EXCEPTION_OBJECT(Instruction s)
Emit code to get a caught exception object into a register

Parameters:
s - the instruction to expand

SET_EXCEPTION_OBJECT

protected final void SET_EXCEPTION_OBJECT(Instruction s)
Emit code to move a value in a register to the stack location where a caught exception object is expected to be.

Parameters:
s - the instruction to expand

INT_2LONG

protected final void INT_2LONG(Instruction s,
                               RegisterOperand result,
                               Operand value,
                               boolean signExtend)
Expansion of INT_2LONG

Parameters:
s - the instruction to expand
result - the result operand
value - the second operand
signExtend - should the value be sign or zero extended?

FPR_2INT

protected final void FPR_2INT(Instruction s,
                              RegisterOperand result,
                              Operand value)
Expansion of FLOAT_2INT and DOUBLE_2INT, using the FIST instruction. This expansion does some boolean logic and conditional moves in order to avoid changing the floating-point rounding mode or inserting branches. Other expansions are possible, and may be better?

Parameters:
s - the instruction to expand
result - the result operand
value - the second operand

FPR2GPR_64

protected final void FPR2GPR_64(Instruction s)
Emit code to move 64 bits from FPRs to GPRs


GPR2FPR_64

protected final void GPR2FPR_64(Instruction s)
Emit code to move 64 bits from GPRs to FPRs


SSE2_MOVE

protected final Operator SSE2_MOVE(Operand o)
Returns the appropriate move operator based on the type of operand.


SSE2_SIZE

protected final byte SSE2_SIZE(Operand o)
Returns the size based on the type of operand.


SSE2_X87_FROMLONG

protected final void SSE2_X87_FROMLONG(Instruction s)
Performs a long -> double/float conversion using x87 and marshalls back to XMMs.


SSE2_X87_REM

protected final void SSE2_X87_REM(Instruction s)
Performs a long -> double/float conversion using x87 and marshalls between to XMMs.


SSE2_FPR2GPR_64

protected final void SSE2_FPR2GPR_64(Instruction s)
Emit code to move 64 bits from SSE2 FPRs to GPRs


SSE2_GPR2FPR_64

protected final void SSE2_GPR2FPR_64(Instruction s)
Emit code to move 64 bits from GPRs to SSE2 FPRs


SSE2_FPR2GPR_32

protected final void SSE2_FPR2GPR_32(Instruction s)
Emit code to move 32 bits from FPRs to GPRs


SSE2_GPR2FPR_32

protected final void SSE2_GPR2FPR_32(Instruction s)
Emit code to move 32 bits from GPRs to FPRs


SSE2_COP

protected void SSE2_COP(Operator operator,
                        Instruction s,
                        Operand result,
                        Operand val1,
                        Operand val2)
BURS expansion of a commutative SSE2 operation.


SSE2_NCOP

protected void SSE2_NCOP(Operator operator,
                         Instruction s,
                         Operand result,
                         Operand val1,
                         Operand val2)
BURS expansion of a non commutative SSE2 operation.


SSE2_NEG

protected final void SSE2_NEG(boolean single,
                              Instruction s,
                              Operand result,
                              Operand value)
Expansion of SSE2 negation ops


SSE2_CONV

protected final void SSE2_CONV(Operator op,
                               Instruction s,
                               Operand result,
                               Operand value)
Expansion of SSE2 conversions double <-> float


SSE2_IFCMP

protected final void SSE2_IFCMP(Operator op,
                                Instruction s,
                                Operand val1,
                                Operand val2)
Expansion of SSE2 comparison operations


SSE2_CMP_OP

protected static Operator SSE2_CMP_OP(ConditionOperand cond,
                                      boolean single)

SSE2_FCMP_FCMOV

protected final void SSE2_FCMP_FCMOV(Instruction s,
                                     RegisterOperand result,
                                     Operand lhsCmp,
                                     Operand rhsCmp,
                                     ConditionOperand cond,
                                     Operand trueValue,
                                     Operand falseValue)

IS_MATERIALIZE_ZERO

protected final boolean IS_MATERIALIZE_ZERO(Instruction s)

SIMILAR_REGISTERS

protected final boolean SIMILAR_REGISTERS(Operand... ops)

SSE2_IS_GT_OR_GE

protected final boolean SSE2_IS_GT_OR_GE(ConditionOperand cond)

SSE2_IS_LT_OR_LE

protected final boolean SSE2_IS_LT_OR_LE(ConditionOperand cond)

SSE2_ABS

protected final void SSE2_ABS(boolean single,
                              Instruction s,
                              Operand result,
                              Operand value)

SSE2_FPCONSTANT

protected final void SSE2_FPCONSTANT(Instruction s)
Expansion of SSE2 floating point constant loads


INT_DIVIDES

protected final void INT_DIVIDES(Instruction s,
                                 RegisterOperand result,
                                 Operand val1,
                                 Operand val2,
                                 boolean isDiv)
Expansion of INT_DIV and INT_REM

Parameters:
s - the instruction to expand
result - the result operand
val1 - the first operand
val2 - the second operand
isDiv - true for div, false for rem

LONG_ADD

protected final void LONG_ADD(Instruction s,
                              RegisterOperand result,
                              Operand value1,
                              Operand value2)
Expansion of LONG_ADD

Parameters:
s - the instruction to expand
result - the result operand
value1 - the first operand
value2 - the second operand

LONG_SUB

protected final void LONG_SUB(Instruction s,
                              Operand result,
                              Operand val1,
                              Operand val2)
Expansion of LONG_SUB

Parameters:
s - the instruction to expand
result - the result operand
val1 - the first operand
val2 - the second operand

LONG_MUL

protected final void LONG_MUL(Instruction s,
                              RegisterOperand result,
                              Operand value1,
                              Operand value2)
Expansion of LONG_MUL

Parameters:
s - the instruction to expand
result - the result operand
value1 - the first operand
value2 - the second operand

LONG_NEG

protected final void LONG_NEG(Instruction s,
                              RegisterOperand result,
                              Operand value)
Expansion of LONG_NEG

Parameters:
s - the instruction to expand
result - the result operand
value - the first operand

LONG_NOT

protected final void LONG_NOT(Instruction s,
                              RegisterOperand result,
                              Operand value)
Expansion of LONG_NOT

Parameters:
s - the instruction to expand
result - the result operand
value - the first operand

LONG_AND

protected final void LONG_AND(Instruction s,
                              RegisterOperand result,
                              Operand value1,
                              Operand value2)
Expansion of LONG_AND

Parameters:
s - the instruction to expand
result - the result operand
value1 - the first operand
value2 - the second operand

LONG_OR

protected final void LONG_OR(Instruction s,
                             RegisterOperand result,
                             Operand value1,
                             Operand value2)
Expansion of LONG_OR

Parameters:
s - the instruction to expand
result - the result operand
value1 - the first operand
value2 - the second operand

LONG_XOR

protected final void LONG_XOR(Instruction s,
                              RegisterOperand result,
                              Operand value1,
                              Operand value2)
Expansion of LONG_XOR

Parameters:
s - the instruction to expand
result - the result operand
value1 - the first operand
value2 - the second operand

LONG_SHL

protected final void LONG_SHL(Instruction s,
                              Operand result,
                              Operand val1,
                              Operand val2,
                              boolean maskWith3f)
Expansion of LONG_SHL

Parameters:
s - the instruction to expand
result - the result operand
val1 - the shifted operand
val2 - the shift amount operand
maskWith3f - should the shift operand by masked with 0x3f? This is default behaviour on Intel but it differs from how we combine shift operands in HIR

LONG_SHR

protected final void LONG_SHR(Instruction s,
                              Operand result,
                              Operand val1,
                              Operand val2,
                              boolean maskWith3f)
Expansion of LONG_SHR

Parameters:
s - the instruction to expand
result - the result operand
val1 - the shifted operand
val2 - the shift amount operand
maskWith3f - should the shift operand by masked with 0x3f? This is default behaviour on Intel but it differs from how we combine shift operands in HIR

LONG_USHR

protected final void LONG_USHR(Instruction s,
                               Operand result,
                               Operand val1,
                               Operand val2,
                               boolean maskWith3f)
Expansion of LONG_USHR

Parameters:
s - the instruction to expand
result - the result operand
val1 - the shifted operand
val2 - the shift amount operand
maskWith3f - should the shift operand by masked with 0x3f? This is default behaviour on Intel but it differs from how we combine shift operands in HIR

GET_TIME_BASE

protected final void GET_TIME_BASE(Instruction s,
                                   RegisterOperand result)
Expansion of RDTSC (called GET_TIME_BASE for consistency with PPC)

Parameters:
s - the instruction to expand
result - the result/first operand

LONG_CMP

protected final void LONG_CMP(Instruction s,
                              RegisterOperand res,
                              Operand val1,
                              Operand val2)
Expansion of LONG_CMP: compare to values and set result to -1, 0, 1 for <, =, >, respectively

Parameters:
s - the compare instruction
res - the result/first operand
val1 - the first value
val2 - the second value

FP_MOV_OP_MOV

protected final void FP_MOV_OP_MOV(Instruction s,
                                   Operator op,
                                   Operand result,
                                   Operand val1,
                                   Operand val2)
Expansion of FP_ADD_ACC, FP_MUL_ACC, FP_SUB_ACC, and FP_DIV_ACC. Moves first value into fp0, accumulates second value into fp0 using op, moves fp0 into result.

Parameters:
s - the instruction to expand
op - the floating point op to use
result - the result operand
val1 - the first operand
val2 - the second operand

FP_REM

protected final void FP_REM(Instruction s,
                            Operand val1,
                            Operand val2)
Expansion of FP_REM

Parameters:
s - the instruction to expand
val1 - the first operand
val2 - the second operand

threeValueFPCmp

protected final void threeValueFPCmp(Instruction s)
Expansion for [DF]CMP[GL] compare to values and set result to -1, 0, 1 for <, =, >, respectively

Parameters:
s - the compare instruction

BOOLEAN_CMP_INT

protected final void BOOLEAN_CMP_INT(Instruction s,
                                     RegisterOperand res,
                                     Operand val1,
                                     Operand val2,
                                     ConditionOperand cond)
Expansion of BOOLEAN_CMP_INT

Parameters:
s - the instruction to copy position info from
res - the result operand
val1 - the first value
val2 - the second value
cond - the condition operand

BOOLEAN_CMP_INT

protected final void BOOLEAN_CMP_INT(Instruction s,
                                     RegisterOperand res,
                                     ConditionOperand cond)
Expansion of a special case of BOOLEAN_CMP_INT when the condition registers have already been set by the previous ALU op.

Parameters:
s - the instruction to copy position info from
res - the result operand
cond - the condition operand

BOOLEAN_CMP_DOUBLE

protected final void BOOLEAN_CMP_DOUBLE(Instruction s,
                                        RegisterOperand res,
                                        ConditionOperand cond,
                                        Operand val1,
                                        Operand val2)
Expansion of BOOLEAN_CMP_DOUBLE

Parameters:
s - the instruction to copy position info from
res - the result operand
val1 - the first value
val2 - the second value
cond - the condition operand

BOOLEAN_CMP_LONG

protected final void BOOLEAN_CMP_LONG(Instruction s,
                                      RegisterOperand res,
                                      Operand val1,
                                      Operand val2,
                                      ConditionOperand cond)
Expansion of BOOLEAN_CMP_LONG

Parameters:
s - the instruction to copy position info from
res - the result operand
val1 - the first value
val2 - the second value
cond - the condition operand

LCMP_CMOV

protected final void LCMP_CMOV(Instruction s,
                               RegisterOperand result,
                               Operand val1,
                               Operand val2,
                               ConditionOperand cond,
                               Operand trueValue,
                               Operand falseValue)
Generate a long compare and cmov

Parameters:
s - the instruction to copy position info from
result - the result of the conditional move
val1 - the first value
val2 - the second value
cond - the condition operand
trueValue - the value to move to result if cond is true
falseValue - the value to move to result if cond is not true

IFCMP

protected final void IFCMP(Instruction s,
                           RegisterOperand guardResult,
                           Operand val1,
                           Operand val2,
                           ConditionOperand cond)
Generate a compare and branch sequence. Used in the expansion of trees where INT_IFCMP is a root

Parameters:
s - the ifcmp instruction
guardResult - the guard result of the ifcmp
val1 - the first value operand
val2 - the second value operand
cond - the condition operand

CMOV_MOV

protected final void CMOV_MOV(Instruction s,
                              RegisterOperand result,
                              ConditionOperand cond,
                              Operand trueValue,
                              Operand falseValue)
Generate an integer move portion of a conditional move.

Parameters:
s - the instruction to copy position info from
result - the result of the conditional move
cond - the condition operand
trueValue - the value to move to result if cond is true
falseValue - the value to move to result if cond is not true

CMOV_FMOV

protected final void CMOV_FMOV(Instruction s,
                               RegisterOperand result,
                               ConditionOperand cond,
                               Operand trueValue,
                               Operand falseValue)
Generate a floating point move portion of a conditional move.

Parameters:
s - the instruction to copy position info from
result - the result of the conditional move
cond - the condition operand
trueValue - the value to move to result if cond is true
falseValue - the value to move to result if cond is not true

PROLOGUE

protected final void PROLOGUE(Instruction s)
Expand a prologue by expanding out longs into pairs of ints


CALL

protected final void CALL(Instruction s,
                          Operand address)
Expansion of CALL. Expand longs registers into pairs of int registers.

Parameters:
s - the instruction to expand
address - the operand containing the target address

SYSCALL

protected final void SYSCALL(Instruction s,
                             Operand address)
Expansion of SYSCALL. Expand longs registers into pairs of int registers.

Parameters:
s - the instruction to expand
address - the operand containing the target address

LOWTABLESWITCH

protected final void LOWTABLESWITCH(Instruction s)
Expansion of LOWTABLESWITCH.

Parameters:
s - the instruction to expand

RESOLVE

protected final void RESOLVE(Instruction s)
Expansion of RESOLVE. Dynamic link point. Build up MIR instructions for Resolve.

Parameters:
s - the instruction to expand

TRAP_IF_IMM

protected final void TRAP_IF_IMM(Instruction s,
                                 boolean longConstant)
Expansion of TRAP_IF, with an int constant as the second value.

Parameters:
s - the instruction to expand
longConstant - is the argument a long constant?

ATTEMPT

protected final void ATTEMPT(RegisterOperand result,
                             MemoryOperand mo,
                             Operand oldValue,
                             Operand newValue)
This routine expands an ATTEMPT instruction into an atomic compare exchange. The atomic compare and exchange will place at mo the value of newValue if the value of mo is oldValue. The result register is set to 0/1 depending on whether the valye was replaced or not.

Parameters:
result - the register operand that is set to 0/1 as a result of the attempt
mo - the address at which to attempt the exchange
oldValue - the old value at the address mo
newValue - the new value at the address mo

ATTEMPT_LONG

protected final void ATTEMPT_LONG(RegisterOperand result,
                                  MemoryOperand mo,
                                  Operand oldValue,
                                  Operand newValue)
This routine expands an ATTEMPT instruction into an atomic compare exchange. The atomic compare and exchange will place at mo the value of newValue if the value of mo is oldValue. The result register is set to 0/1 depending on whether the valye was replaced or not.

Parameters:
result - the register operand that is set to 0/1 as a result of the attempt
mo - the address at which to attempt the exchange
oldValue - the old value to check for at the address mo
newValue - the new value to place at the address mo

ATTEMPT_IFCMP

protected final void ATTEMPT_IFCMP(MemoryOperand mo,
                                   Operand oldValue,
                                   Operand newValue,
                                   ConditionOperand cond,
                                   BranchOperand target,
                                   BranchProfileOperand bp)
This routine expands the compound pattern IFCMP(ATTEMPT, ZERO) into an atomic compare/exchange followed by a branch on success/failure of the attempted atomic compare/exchange.

Parameters:
mo - the address at which to attempt the exchange
oldValue - the old value at the address mo
newValue - the new value at the address mo
cond - the condition to branch on
target - the branch target
bp - the branch profile information

OSR

void OSR(BURS burs,
         Instruction s)