Search in sources :

Example 1 with StoreConstantOp

use of org.graalvm.compiler.lir.sparc.SPARCMove.StoreConstantOp in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitStore.

@Override
public void emitStore(ValueKind<?> kind, Value address, Value inputVal, LIRFrameState state) {
    SPARCAddressValue storeAddress = getLIRGen().asAddressValue(address);
    if (isJavaConstant(inputVal)) {
        JavaConstant c = asJavaConstant(inputVal);
        if (c.isDefaultForKind()) {
            getLIRGen().append(new StoreConstantOp(kind.getPlatformKind(), storeAddress, c, state));
            return;
        }
    }
    Variable input = getLIRGen().load(inputVal);
    getLIRGen().append(new StoreOp(kind.getPlatformKind(), storeAddress, input, state));
}
Also used : Variable(org.graalvm.compiler.lir.Variable) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) JavaConstant(jdk.vm.ci.meta.JavaConstant) LIRValueUtil.asJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant) LIRValueUtil.isJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant) StoreOp(org.graalvm.compiler.lir.sparc.SPARCMove.StoreOp) StoreConstantOp(org.graalvm.compiler.lir.sparc.SPARCMove.StoreConstantOp)

Aggregations

JavaConstant (jdk.vm.ci.meta.JavaConstant)1 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)1 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)1 Variable (org.graalvm.compiler.lir.Variable)1 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)1 StoreConstantOp (org.graalvm.compiler.lir.sparc.SPARCMove.StoreConstantOp)1 StoreOp (org.graalvm.compiler.lir.sparc.SPARCMove.StoreOp)1