Search in sources :

Example 16 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitMathTan.

@Override
public Value emitMathTan(Value input) {
    LIRGenerator gen = getLIRGen();
    Variable result = maths.emitTan(gen, input);
    if (result == null) {
        result = gen.newVariable(LIRKind.combine(input));
        AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
        gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), TAN, result, gen.asAllocatable(input), stackSlot));
    }
    return result;
}
Also used : AMD64MathIntrinsicUnaryOp(org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicUnaryOp) Variable(org.graalvm.compiler.lir.Variable) ArithmeticLIRGenerator(org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator) LIRGenerator(org.graalvm.compiler.lir.gen.LIRGenerator) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 17 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitConvertOp.

private AllocatableValue emitConvertOp(LIRKind kind, AMD64RMOp op, OperandSize size, Value input) {
    Variable result = getLIRGen().newVariable(kind);
    getLIRGen().append(new AMD64Unary.RMOp(op, size, result, getLIRGen().asAllocatable(input)));
    return result;
}
Also used : AMD64Unary(org.graalvm.compiler.lir.amd64.AMD64Unary) Variable(org.graalvm.compiler.lir.Variable)

Example 18 with Variable

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

the class AMD64LIRGenerator method emitArrayEquals.

@Override
public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length) {
    Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
    append(new AMD64ArrayEqualsOp(this, kind, result, array1, array2, asAllocatable(length)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64ArrayEqualsOp(org.graalvm.compiler.lir.amd64.AMD64ArrayEqualsOp)

Example 19 with Variable

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

the class AMD64LIRGenerator method emitLogicCompareAndSwap.

@Override
public Variable emitLogicCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
    ValueKind<?> kind = newValue.getValueKind();
    assert kind.equals(expectedValue.getValueKind());
    AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
    AMD64AddressValue addressValue = asAddressValue(address);
    RegisterValue raxRes = AMD64.rax.asValue(kind);
    emitMove(raxRes, expectedValue);
    append(new CompareAndSwapOp(memKind, raxRes, addressValue, raxRes, asAllocatable(newValue)));
    assert trueValue.getValueKind().equals(falseValue.getValueKind());
    Variable result = newVariable(trueValue.getValueKind());
    append(new CondMoveOp(result, Condition.EQ, asAllocatable(trueValue), falseValue));
    return result;
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) Variable(org.graalvm.compiler.lir.Variable) CompareAndSwapOp(org.graalvm.compiler.lir.amd64.AMD64Move.CompareAndSwapOp) CondMoveOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.CondMoveOp) FloatCondMoveOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.FloatCondMoveOp)

Example 20 with Variable

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

the class AMD64LIRGenerator method emitAtomicReadAndAdd.

@Override
public Value emitAtomicReadAndAdd(Value address, Value delta) {
    ValueKind<?> kind = delta.getValueKind();
    Variable result = newVariable(kind);
    AMD64AddressValue addressValue = asAddressValue(address);
    append(new AMD64Move.AtomicReadAndAddOp((AMD64Kind) kind.getPlatformKind(), result, addressValue, asAllocatable(delta)));
    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)

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