Search in sources :

Example 46 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class ReinterpretNode method generate.

@Override
public void generate(NodeLIRBuilderTool builder, ArithmeticLIRGeneratorTool gen) {
    LIRKind kind = builder.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
    builder.setResult(this, gen.emitReinterpret(kind, builder.operand(getValue())));
}
Also used : LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 47 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class WriteReturnAddressNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    TargetDescription target = gen.getLIRGeneratorTool().target();
    assert target.arch.getReturnAddressSize() > 0;
    LIRKind wordKind = LIRKind.fromJavaKind(target.arch, target.wordJavaKind);
    gen.getLIRGeneratorTool().emitMove(StackSlot.get(wordKind, -target.arch.getReturnAddressSize(), true), gen.operand(value));
}
Also used : TargetDescription(jdk.vm.ci.code.TargetDescription) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 48 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class ReadRegisterFixedNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
    LIRKind lirKind = tool.getLIRKind(FrameAccess.getWordStamp());
    RegisterValue value = registerSupplier.apply(registerConfig).asValue(lirKind);
    gen.setResult(this, tool.emitMove(value));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) LIRKind(org.graalvm.compiler.core.common.LIRKind) SubstrateRegisterConfig(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 49 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitUShr.

@Override
public Variable emitUShr(Value a, Value b) {
    SPARCKind aKind = (SPARCKind) a.getPlatformKind();
    LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
    Op3s op;
    switch(aKind) {
        case WORD:
            op = Op3s.Srl;
            break;
        case XWORD:
            op = Op3s.Srlx;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return emitBinary(resultKind, op, a, b);
}
Also used : Op3s(org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s) LIRKind(org.graalvm.compiler.core.common.LIRKind) SPARCKind(jdk.vm.ci.sparc.SPARCKind)

Example 50 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitMul.

@Override
public Variable emitMul(Value a, Value b, boolean setFlags) {
    LIRKind resultKind = LIRKind.combine(a, b);
    PlatformKind aKind = a.getPlatformKind();
    if (isNumericInteger(aKind)) {
        if (setFlags) {
            Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
            if (aKind == XWORD) {
                getLIRGen().append(new SPARCLMulccOp(result, getLIRGen().load(a), getLIRGen().load(b), getLIRGen()));
            } else if (aKind == WORD) {
                getLIRGen().append(new SPARCIMulccOp(result, getLIRGen().load(a), getLIRGen().load(b)));
            } else {
                throw GraalError.shouldNotReachHere();
            }
            return result;
        } else {
            return emitBinary(resultKind, Op3s.Mulx, a, b);
        }
    } else {
        boolean isDouble = a.getPlatformKind().equals(DOUBLE);
        return emitBinary(resultKind, isDouble ? Fmuld : Fmuls, a, b);
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) PlatformKind(jdk.vm.ci.meta.PlatformKind) SPARCIMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCIMulccOp) SPARCLMulccOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.SPARCLMulccOp)

Aggregations

LIRKind (org.graalvm.compiler.core.common.LIRKind)60 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)20 Variable (org.graalvm.compiler.lir.Variable)19 Value (jdk.vm.ci.meta.Value)15 RegisterValue (jdk.vm.ci.code.RegisterValue)11 TargetDescription (jdk.vm.ci.code.TargetDescription)7 PlatformKind (jdk.vm.ci.meta.PlatformKind)7 LIRGeneratorTool (org.graalvm.compiler.lir.gen.LIRGeneratorTool)7 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)6 JavaConstant (jdk.vm.ci.meta.JavaConstant)4 SPARCKind (jdk.vm.ci.sparc.SPARCKind)4 ComplexMatchValue (org.graalvm.compiler.core.match.ComplexMatchValue)4 AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)4 AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)4 ComplexMatchResult (org.graalvm.compiler.core.match.ComplexMatchResult)3 MatchRule (org.graalvm.compiler.core.match.MatchRule)3 ConstantValue (org.graalvm.compiler.lir.ConstantValue)3 AMD64MulDivOp (org.graalvm.compiler.lir.amd64.AMD64MulDivOp)3 SubstrateRegisterConfig (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig)2 Op3s (org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s)2