|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.ir.operand.Operand org.jikesrvm.compilers.opt.ir.operand.ConditionOperand
public final class ConditionOperand
Encodes the condition codes for branches.
Operand
Field Summary | |
---|---|
static int |
CMPG_GREATER
Branch if > or unordered |
static int |
CMPG_GREATER_EQUAL
Branch if >= or unordered |
static int |
CMPG_LESS
Branch if < |
static int |
CMPG_LESS_EQUAL
Branch if <= |
static int |
CMPL_EQUAL
Branch if == (equivalent to CMPG_EQUAL) |
static int |
CMPL_GREATER
Branch if > |
static int |
CMPL_GREATER_EQUAL
Branch if >= |
static int |
CMPL_LESS
Branch if < or unordered |
static int |
CMPL_LESS_EQUAL
Branch if <= or unordered |
static int |
CMPL_NOT_EQUAL
Branch if ! |
static int |
EQUAL
|
static int |
FALSE
|
static int |
GREATER
|
static int |
GREATER_EQUAL
|
static int |
HIGHER
|
static int |
HIGHER_EQUAL
|
static int |
LESS
|
static int |
LESS_EQUAL
|
static int |
LOWER
|
static int |
LOWER_EQUAL
|
static int |
NOT_EQUAL
|
static int |
TRUE
|
static int |
UNKNOWN
|
int |
value
Value of this operand. |
Fields inherited from class org.jikesrvm.compilers.opt.ir.operand.Operand |
---|
instruction |
Constructor Summary | |
---|---|
private |
ConditionOperand(int code)
|
Method Summary | |
---|---|
boolean |
branchIfUnordered()
Will this floating point compare branch if the results are unordered? |
Operand |
copy()
Return a new operand that is semantically equivalent to this . |
static ConditionOperand |
EQUAL()
Create the condition code operand for EQUAL |
int |
evaluate(Address v1,
Address v2)
Given two Addresses, evaluate the condition on them. |
int |
evaluate(double v1,
double v2)
Given two doubles, evaluate the condition on them. |
int |
evaluate(float v1,
float v2)
Given two floats, evaluate the condition on them. |
int |
evaluate(int v1,
int v2)
Given two ints, evaluate the condition on them. |
int |
evaluate(long v1,
long v2)
Given two longs, evaluate the condition on them. |
int |
evaluate(Operand v1,
Operand v2)
Given two operands, evaluate the condition on them. |
ConditionOperand |
flipCode()
Flip the direction of the condition. |
ConditionOperand |
flipOperands()
Change the condition code to allow the order of the operands to be flipped. i.e. |
static ConditionOperand |
GREATER_EQUAL()
Create the condition code operand for GREATER_EQUAL |
static ConditionOperand |
GREATER()
Create the condition code operand for GREATER |
static ConditionOperand |
HIGHER_EQUAL()
Create the condition code operand for HIGHER_EQUAL |
static ConditionOperand |
HIGHER()
Create the condition code operand for HIGHER |
boolean |
isEQUAL()
Is the condition code EQUAL? |
boolean |
isFLOATINGPOINT()
Is the condition code a floating point compare? |
boolean |
isGREATER_EQUAL()
Is the condition code GREATER_EQUAL? |
boolean |
isGREATER()
Is the condition code GREATER? |
boolean |
isHIGHER_EQUAL()
Is the condition code HIGHER_EQUAL? |
boolean |
isHIGHER()
Is the condition code HIGHER? |
boolean |
isLESS_EQUAL()
Is the condition code LESS EQUAL? |
boolean |
isLESS()
Is the condition code LESS? |
boolean |
isLOWER_EQUAL()
Is the condition code LOWER_EQUAL? |
boolean |
isLOWER()
Is the condition code LOWER? |
boolean |
isNOT_EQUAL()
Is the condition code NOT_EQUAL? |
boolean |
isUNSIGNED()
Is the condition code an unsigned comparison? |
static ConditionOperand |
LESS_EQUAL()
Create the condition code operand for LESS_EQUAL |
static ConditionOperand |
LESS()
Create the condition code operand for LESS |
static ConditionOperand |
LOWER_EQUAL()
Create the condition code operand for LOWER_EQUAL |
static ConditionOperand |
LOWER()
Create the condition code operand for LOWER |
static ConditionOperand |
NOT_EQUAL()
Create the condition code operand for NOT_EQUAL |
boolean |
similar(Operand op)
Are two operands semantically equivalent? |
String |
toString()
Returns the string representation of this operand. |
void |
translateCMPG()
Convert this integer compare to a floating point cmpg compare. |
void |
translateCMPL()
Convert this integer compare to a floating point cmpl compare. |
ConditionOperand |
translateUNSIGNED()
Convert this floating point compare to the equivalent unsigned integer compare. |
Methods inherited from class org.jikesrvm.compilers.opt.ir.operand.Operand |
---|
asAddressConstant, asBlock, asBranch, asClassConstant, asCondition, asDoubleConstant, asFloatConstant, asIntConstant, asLocation, asLongConstant, asMemory, asMethod, asNullConstant, asObjectConstant, asRegister, asStackLocation, asStringConstant, asTIBConstant, asType, conservativelyApproximates, getIndexInInstruction, getType, isAddress, isAddressConstant, isBlock, isBranch, isClassConstant, isConstant, isDefinitelyNull, isDouble, isDoubleConstant, isFloat, isFloatConstant, isInt, isIntConstant, isIntLike, isLocation, isLong, isLongConstant, isMemory, isMethod, isMovableObjectConstant, isNullConstant, isObjectConstant, isRef, isRegister, isStackLocation, isStringConstant, isTIBConstant, isTrueGuard, isType, meet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EQUAL
public static final int NOT_EQUAL
public static final int LESS
public static final int GREATER_EQUAL
public static final int GREATER
public static final int LESS_EQUAL
public static final int HIGHER
public static final int LOWER
public static final int HIGHER_EQUAL
public static final int LOWER_EQUAL
public static final int CMPL_EQUAL
public static final int CMPL_GREATER
public static final int CMPG_LESS
public static final int CMPL_GREATER_EQUAL
public static final int CMPG_LESS_EQUAL
public static final int CMPL_NOT_EQUAL
public static final int CMPL_LESS
public static final int CMPG_GREATER_EQUAL
public static final int CMPG_GREATER
public static final int CMPL_LESS_EQUAL
public int value
public static final int FALSE
public static final int TRUE
public static final int UNKNOWN
Constructor Detail |
---|
private ConditionOperand(int code)
code
- the condition codeMethod Detail |
---|
public static ConditionOperand EQUAL()
public static ConditionOperand NOT_EQUAL()
public static ConditionOperand LESS()
public static ConditionOperand GREATER_EQUAL()
public static ConditionOperand GREATER()
public static ConditionOperand LESS_EQUAL()
public static ConditionOperand HIGHER()
public static ConditionOperand LOWER()
public static ConditionOperand HIGHER_EQUAL()
public static ConditionOperand LOWER_EQUAL()
public boolean isEQUAL()
true
if it is or false
if it is notpublic boolean isNOT_EQUAL()
true
if it is or false
if it is notpublic boolean isLESS_EQUAL()
true
if it is or false
if it is notpublic boolean isGREATER_EQUAL()
true
if it is or false
if it is notpublic boolean isGREATER()
true
if it is or false
if it is notpublic boolean isLESS()
true
if it is or false
if it is notpublic boolean isHIGHER()
true
if it is or false
if it is notpublic boolean isLOWER()
true
if it is or false
if it is notpublic boolean isHIGHER_EQUAL()
true
if it is or false
if it is notpublic boolean isLOWER_EQUAL()
true
if it is or false
if it is notpublic boolean isUNSIGNED()
true
if it is or false
if it is notpublic boolean isFLOATINGPOINT()
true
if it is or false
if it is notpublic boolean branchIfUnordered()
true
if it is or false
if it is notpublic void translateCMPL()
public void translateCMPG()
public ConditionOperand translateUNSIGNED()
NB this doesn't respect ordered/unordered operation, so it should only be used when it's safe to.
public Operand copy()
Operand
this
.
copy
in class Operand
this
public boolean similar(Operand op)
Operand
similar
in class Operand
op
- other operand
true
if this
and op
are semantically equivalent or false
if they are not.public int evaluate(Operand v1, Operand v2)
v1
- first operand to conditionv2
- second operand to condition
TRUE
if (v1 cond v2) or
FALSE
if !(v1 cond v2) or
UNKNOWN
public int evaluate(int v1, int v2)
v1
- first operand to conditionv2
- second operand to condition
TRUE
if (v1 cond v2) or
FALSE
if !(v1 cond v2) or
UNKNOWN
public int evaluate(long v1, long v2)
v1
- first operand to conditionv2
- second operand to condition
TRUE
if (v1 cond v2) or
FALSE
if !(v1 cond v2) or
UNKNOWN
public int evaluate(float v1, float v2)
v1
- first operand to conditionv2
- second operand to condition
true
if (v1 cond v2) or
false
otherwisepublic int evaluate(double v1, double v2)
v1
- first operand to conditionv2
- second operand to condition
true
if (v1 cond v2) or
false
otherwisepublic int evaluate(Address v1, Address v2)
v1
- first operand to conditionv2
- second operand to condition
TRUE
if (v1 cond v2) or
FALSE
if !(v1 cond v2) or
UNKNOWN
public ConditionOperand flipCode()
if (condition) goto A
goto B
A:
into:
if (!condition) goto B
A:
Note that this is not the same as calling flipOperands()
.
public ConditionOperand flipOperands()
if x < y then goto A
becomes:
if y >e; x then goto A
Note that this is not the same as calling flipCode()
.
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |