use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitForeignCallOp.
@Override
protected void emitForeignCallOp(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info) {
currentRuntimeCallInfo = info;
HotSpotForeignCallLinkage hsLinkage = (HotSpotForeignCallLinkage) linkage;
AMD64 arch = (AMD64) target().arch;
if (arch.getFeatures().contains(AMD64.CPUFeature.AVX) && hsLinkage.mayContainFP() && !hsLinkage.isCompiledStub()) {
/*
* If the target may contain FP ops, and it is not compiled by us, we may have an
* AVX-SSE transition.
*
* We exclude the argument registers from the zeroing LIR instruction since it violates
* the LIR semantics of @Temp that values must not be live. Note that the emitted
* machine instruction actually zeros _all_ XMM registers which is fine since we know
* that their upper half is not used.
*/
append(new AMD64VZeroUpper(arguments));
}
super.emitForeignCallOp(linkage, result, arguments, temps, info);
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class StubAVXTest method checkAMD64.
@Before
public void checkAMD64() {
Assume.assumeTrue("skipping AMD64 specific test", getTarget().arch instanceof AMD64);
Assume.assumeTrue("skipping AVX test", ((AMD64) getTarget().arch).getFeatures().contains(CPUFeature.AVX));
if (getBackend() instanceof HotSpotBackend) {
HotSpotBackend backend = (HotSpotBackend) getBackend();
Assume.assumeTrue("skipping because of MaxVectorSize", backend.getRuntime().getVMConfig().maxVectorSize >= 32);
}
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitNegate.
@Override
public Variable emitNegate(Value inputVal) {
AllocatableValue input = getLIRGen().asAllocatable(inputVal);
Variable result = getLIRGen().newVariable(LIRKind.combine(input));
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) input.getPlatformKind()) {
case DWORD:
getLIRGen().append(new AMD64Unary.MOp(NEG, DWORD, result, input));
break;
case QWORD:
getLIRGen().append(new AMD64Unary.MOp(NEG, QWORD, result, input));
break;
case SINGLE:
if (isAvx) {
getLIRGen().append(new AMD64Binary.DataThreeOp(AVXOp.XOR, PS, result, input, JavaConstant.forFloat(Float.intBitsToFloat(0x80000000)), 16));
} else {
getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.XOR, PS, result, input, JavaConstant.forFloat(Float.intBitsToFloat(0x80000000)), 16));
}
break;
case DOUBLE:
if (isAvx) {
getLIRGen().append(new AMD64Binary.DataThreeOp(AVXOp.XOR, PD, result, input, JavaConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)), 16));
} else {
getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.XOR, PD, result, input, JavaConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)), 16));
}
break;
default:
throw GraalError.shouldNotReachHere(input.getPlatformKind().toString());
}
return result;
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitAdd.
@Override
public Variable emitAdd(LIRKind resultKind, Value a, Value b, boolean setFlags) {
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
if (isJavaConstant(b) && !setFlags) {
long displacement = asJavaConstant(b).asLong();
if (NumUtil.isInt(displacement) && displacement != 1 && displacement != -1) {
return emitBaseOffsetLea(resultKind, a, (int) displacement, OperandSize.DWORD);
}
}
return emitBinary(resultKind, ADD, DWORD, true, a, b, setFlags);
case QWORD:
if (isJavaConstant(b) && !setFlags) {
long displacement = asJavaConstant(b).asLong();
if (NumUtil.isInt(displacement) && displacement != 1 && displacement != -1) {
return emitBaseOffsetLea(resultKind, a, (int) displacement, OperandSize.QWORD);
}
}
return emitBinary(resultKind, ADD, QWORD, true, a, b, setFlags);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.ADD, SS, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.ADD, SS, true, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.ADD, SD, true, a, b);
} else {
return emitBinary(resultKind, SSEOp.ADD, SD, true, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
use of jdk.vm.ci.amd64.AMD64.rax in project graal by oracle.
the class AMD64ArithmeticLIRGenerator method emitSub.
@Override
public Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
TargetDescription target = getLIRGen().target();
boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX);
switch((AMD64Kind) a.getPlatformKind()) {
case DWORD:
return emitBinary(resultKind, SUB, DWORD, false, a, b, setFlags);
case QWORD:
return emitBinary(resultKind, SUB, QWORD, false, a, b, setFlags);
case SINGLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.SUB, SS, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.SUB, SS, false, a, b);
}
case DOUBLE:
if (isAvx) {
return emitBinary(resultKind, AVXOp.SUB, SD, false, a, b);
} else {
return emitBinary(resultKind, SSEOp.SUB, SD, false, a, b);
}
default:
throw GraalError.shouldNotReachHere();
}
}
Aggregations