use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitOr.
@Override
public Variable emitOr(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, OR, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, OR, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.OR, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.OR, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitAnd.
@Override
public Variable emitAnd(Value a, Value b) {
LIRKind resultKind = LIRKind.combine(a, b);
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, AND, DWORD, true, a, b, false);
case QWORD:
return emitBinary(resultKind, AND, QWORD, true, a, b, false);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.AND, PD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.AND, PD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64LIRGenerator method emitCompareAndSwapBranch.
public void emitCompareAndSwapBranch(ValueKind<?> kind, AMD64AddressValue address, Value expectedValue, Value newValue, Condition condition, LabelRef trueLabel, LabelRef falseLabel, double trueLabelProbability) {
assert kind.equals(expectedValue.getValueKind());
assert kind.equals(newValue.getValueKind());
assert condition == Condition.EQ || condition == Condition.NE;
AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
RegisterValue raxValue = AMD64.rax.asValue(kind);
emitMove(raxValue, expectedValue);
append(new CompareAndSwapOp(memKind, raxValue, address, raxValue, asAllocatable(newValue)));
append(new BranchOp(condition, trueLabel, falseLabel, trueLabelProbability));
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64LIRGenerator method emitValueCompareAndSwap.
@Override
public Value emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
ValueKind<?> kind = newValue.getValueKind();
assert kind.equals(expectedValue.getValueKind());
AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
AMD64AddressValue addressValue = asAddressValue(address);
RegisterValue raxRes = AMD64.rax.asValue(kind);
emitMove(raxRes, expectedValue);
append(new CompareAndSwapOp(memKind, raxRes, addressValue, raxRes, asAllocatable(newValue)));
Variable result = newVariable(kind);
emitMove(result, raxRes);
return result;
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64AddressLoweringTest method checkAMD64.
@Before
public void checkAMD64() {
assumeTrue("skipping AMD64 specific test", getTarget().arch instanceof AMD64);
graph = new StructuredGraph.Builder(getInitialOptions(), getDebugContext()).build();
lowering = new AMD64AddressLowering();
}
Aggregations