Search in sources :

Example 21 with Variable

use of org.graalvm.compiler.lir.Variable in project graal by oracle.

the class AMD64LIRGenerator method emitIntegerTestMove.

@Override
public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {
    emitIntegerTest(left, right);
    Variable result = newVariable(trueValue.getValueKind());
    append(new CondMoveOp(result, Condition.EQ, load(trueValue), loadNonConst(falseValue)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) CondMoveOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.CondMoveOp) FloatCondMoveOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.FloatCondMoveOp)

Example 22 with Variable

use of org.graalvm.compiler.lir.Variable in project graal by oracle.

the class AMD64LIRGenerator method emitAtomicReadAndWrite.

@Override
public Value emitAtomicReadAndWrite(Value address, Value newValue) {
    ValueKind<?> kind = newValue.getValueKind();
    Variable result = newVariable(kind);
    AMD64AddressValue addressValue = asAddressValue(address);
    append(new AMD64Move.AtomicReadAndWriteOp((AMD64Kind) kind.getPlatformKind(), result, addressValue, asAllocatable(newValue)));
    return result;
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) Variable(org.graalvm.compiler.lir.Variable) AMD64Move(org.graalvm.compiler.lir.amd64.AMD64Move)

Example 23 with Variable

use of org.graalvm.compiler.lir.Variable in project graal by oracle.

the class AArch64ArithmeticLIRGenerator method emitBitScanReverse.

@Override
public Value emitBitScanReverse(Value value) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD));
    getLIRGen().append(new AArch64BitManipulationOp(BSR, result, getLIRGen().asAllocatable(value)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64BitManipulationOp(org.graalvm.compiler.lir.aarch64.AArch64BitManipulationOp)

Example 24 with Variable

use of org.graalvm.compiler.lir.Variable in project graal by oracle.

the class AArch64ArithmeticLIRGenerator method emitSignExtend.

@Override
public Value emitSignExtend(Value inputVal, int fromBits, int toBits) {
    LIRKind resultKind = getResultLirKind(toBits, inputVal);
    assert fromBits <= toBits && toBits <= 64;
    if (fromBits == toBits) {
        return inputVal;
    } else if (isJavaConstant(inputVal)) {
        JavaConstant javaConstant = asJavaConstant(inputVal);
        long constant;
        if (javaConstant.isNull()) {
            constant = 0;
        } else {
            constant = javaConstant.asLong();
        }
        int shiftCount = QWORD.getSizeInBytes() * 8 - fromBits;
        return new ConstantValue(resultKind, JavaConstant.forLong((constant << shiftCount) >> shiftCount));
    }
    Variable result = getLIRGen().newVariable(resultKind);
    getLIRGen().append(new AArch64SignExtendOp(result, getLIRGen().asAllocatable(inputVal), fromBits, toBits));
    return result;
}
Also used : AArch64SignExtendOp(org.graalvm.compiler.lir.aarch64.AArch64SignExtendOp) Variable(org.graalvm.compiler.lir.Variable) LIRValueUtil.asJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant) LIRValueUtil.isJavaConstant(org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant) JavaConstant(jdk.vm.ci.meta.JavaConstant) LIRKind(org.graalvm.compiler.core.common.LIRKind) ConstantValue(org.graalvm.compiler.lir.ConstantValue)

Example 25 with Variable

use of org.graalvm.compiler.lir.Variable in project graal by oracle.

the class AArch64ArithmeticLIRGenerator method emitFloatConvert.

@Override
public Value emitFloatConvert(FloatConvert op, Value inputVal) {
    PlatformKind resultPlatformKind = getFloatConvertResultKind(op);
    LIRKind resultLirKind = LIRKind.combine(inputVal).changeType(resultPlatformKind);
    Variable result = getLIRGen().newVariable(resultLirKind);
    getLIRGen().append(new AArch64FloatConvertOp(op, result, getLIRGen().asAllocatable(inputVal)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) PlatformKind(jdk.vm.ci.meta.PlatformKind) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Aggregations

Variable (org.graalvm.compiler.lir.Variable)113 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)27 LIRKind (org.graalvm.compiler.core.common.LIRKind)19 RegisterValue (jdk.vm.ci.code.RegisterValue)11 Value (jdk.vm.ci.meta.Value)11 Register (jdk.vm.ci.code.Register)10 AMD64Unary (org.graalvm.compiler.lir.amd64.AMD64Unary)9 AMD64Binary (org.graalvm.compiler.lir.amd64.AMD64Binary)8 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)8 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)7 AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)7 SPARCKind (jdk.vm.ci.sparc.SPARCKind)6 ConstantValue (org.graalvm.compiler.lir.ConstantValue)6 JavaConstant (jdk.vm.ci.meta.JavaConstant)5 PlatformKind (jdk.vm.ci.meta.PlatformKind)5 LIRFrameState (org.graalvm.compiler.lir.LIRFrameState)5 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)5 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)5 AMD64MathIntrinsicUnaryOp (org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicUnaryOp)5 AMD64Move (org.graalvm.compiler.lir.amd64.AMD64Move)5