Search in sources :

Example 1 with AMD64VZeroUpper

use of org.graalvm.compiler.lir.amd64.AMD64VZeroUpper 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);
}
Also used : AMD64VZeroUpper(org.graalvm.compiler.lir.amd64.AMD64VZeroUpper) AMD64(jdk.vm.ci.amd64.AMD64) HotSpotForeignCallLinkage(org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)

Aggregations

AMD64 (jdk.vm.ci.amd64.AMD64)1 HotSpotForeignCallLinkage (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)1 AMD64VZeroUpper (org.graalvm.compiler.lir.amd64.AMD64VZeroUpper)1