use of jdk.vm.ci.aarch64.AArch64 in project graal by oracle.
the class AArch64LIRGenerator method emitCompare.
/**
* This method emits the compare instruction, and may reorder the operands. It returns true if
* it did so.
*
* @param a the left operand of the comparison. Has to have same type as b. Non null.
* @param b the right operand of the comparison. Has to have same type as a. Non null.
* @return true if mirrored (i.e. "b cmp a" instead of "a cmp b" was done).
*/
protected boolean emitCompare(PlatformKind cmpKind, Value a, Value b, Condition condition, boolean unorderedIsTrue) {
Value left;
Value right;
boolean mirrored;
AArch64Kind kind = (AArch64Kind) cmpKind;
if (kind.isInteger()) {
Value aExt = a;
Value bExt = b;
int compareBytes = cmpKind.getSizeInBytes();
// AArch64 compares 32 or 64 bits: sign extend a and b as required.
if (compareBytes < a.getPlatformKind().getSizeInBytes()) {
aExt = arithmeticLIRGen.emitSignExtend(a, compareBytes * 8, 64);
}
if (compareBytes < b.getPlatformKind().getSizeInBytes()) {
bExt = arithmeticLIRGen.emitSignExtend(b, compareBytes * 8, 64);
}
if (LIRValueUtil.isVariable(bExt)) {
left = load(bExt);
right = loadNonConst(aExt);
mirrored = true;
} else {
left = load(aExt);
right = loadNonConst(bExt);
mirrored = false;
}
append(new AArch64Compare.CompareOp(left, loadNonCompareConst(right)));
} else if (kind.isSIMD()) {
if (AArch64Compare.FloatCompareOp.isFloatCmpConstant(a, condition, unorderedIsTrue)) {
left = load(b);
right = a;
mirrored = true;
} else if (AArch64Compare.FloatCompareOp.isFloatCmpConstant(b, condition, unorderedIsTrue)) {
left = load(a);
right = b;
mirrored = false;
} else {
left = load(a);
right = loadReg(b);
mirrored = false;
}
append(new AArch64Compare.FloatCompareOp(left, asAllocatable(right), condition, unorderedIsTrue));
} else {
throw GraalError.shouldNotReachHere();
}
return mirrored;
}
use of jdk.vm.ci.aarch64.AArch64 in project graal by oracle.
the class AArch64MacroAssemblerTest method createTarget.
private static TargetDescription createTarget() {
final int stackFrameAlignment = 16;
final int implicitNullCheckLimit = 4096;
final boolean inlineObjects = true;
Architecture arch = new AArch64(computeFeatures(), computeFlags());
return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
}
Aggregations