Search in sources :

Example 91 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitReinterpret.

@Override
public Value emitReinterpret(LIRKind to, Value inputVal) {
    ValueKind<?> from = inputVal.getValueKind();
    if (to.equals(from)) {
        return inputVal;
    }
    Variable result = getLIRGen().newVariable(to);
    getLIRGen().append(new AArch64ReinterpretOp(result, getLIRGen().asAllocatable(inputVal)));
    return result;
}
Also used : AArch64ReinterpretOp(org.graalvm.compiler.lir.aarch64.AArch64ReinterpretOp) Variable(org.graalvm.compiler.lir.Variable)

Example 92 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitCountTrailingZeros.

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

Example 93 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitUnary.

private Variable emitUnary(AArch64ArithmeticOp op, Value inputVal) {
    AllocatableValue input = getLIRGen().asAllocatable(inputVal);
    Variable result = getLIRGen().newVariable(LIRKind.combine(input));
    getLIRGen().append(new AArch64ArithmeticOp.UnaryOp(op, result, input));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64ArithmeticOp(org.graalvm.compiler.lir.aarch64.AArch64ArithmeticOp) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 94 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitExtendMemory.

public Value emitExtendMemory(boolean isSigned, AArch64Kind memoryKind, int resultBits, AArch64AddressValue address, LIRFrameState state) {
    // Issue a zero extending load of the proper bit size and set the result to
    // the proper kind.
    Variable result = getLIRGen().newVariable(LIRKind.value(resultBits == 32 ? AArch64Kind.DWORD : AArch64Kind.QWORD));
    int targetSize = resultBits <= 32 ? 32 : 64;
    switch(memoryKind) {
        case BYTE:
        case WORD:
        case DWORD:
        case QWORD:
            getLIRGen().append(new AArch64Unary.MemoryOp(isSigned, targetSize, memoryKind.getSizeInBytes() * 8, result, address, state));
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64Unary(org.graalvm.compiler.lir.aarch64.AArch64Unary)

Example 95 with Variable

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

the class AArch64LIRGenerator method emitLogicCompareAndSwap.

@Override
public Variable emitLogicCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
    Variable prevValue = newVariable(expectedValue.getValueKind());
    Variable scratch = newVariable(LIRKind.value(AArch64Kind.DWORD));
    append(new CompareAndSwapOp(prevValue, loadReg(expectedValue), loadReg(newValue), asAllocatable(address), scratch));
    assert trueValue.getValueKind().equals(falseValue.getValueKind());
    Variable result = newVariable(trueValue.getValueKind());
    append(new CondMoveOp(result, ConditionFlag.EQ, asAllocatable(trueValue), asAllocatable(falseValue)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) CompareAndSwapOp(org.graalvm.compiler.lir.aarch64.AArch64Move.CompareAndSwapOp) CondMoveOp(org.graalvm.compiler.lir.aarch64.AArch64ControlFlow.CondMoveOp)

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