Search in sources :

Example 16 with AMD64AddressValue

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

the class AMD64ArithmeticLIRGenerator method emitBinaryMemory.

public Value emitBinaryMemory(AMD64RMOp op, OperandSize size, AllocatableValue a, AMD64AddressValue location, LIRFrameState state) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(a));
    getLIRGen().append(new AMD64Binary.MemoryTwoOp(op, size, result, a, location, state));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64Binary(org.graalvm.compiler.lir.amd64.AMD64Binary)

Example 17 with AMD64AddressValue

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

the class AMD64ArithmeticLIRGenerator method emitConvertMemoryOp.

protected Value emitConvertMemoryOp(PlatformKind kind, AMD64RMOp op, OperandSize size, AMD64AddressValue address, LIRFrameState state) {
    Variable result = getLIRGen().newVariable(LIRKind.value(kind));
    getLIRGen().append(new AMD64Unary.MemoryOp(op, size, result, address, state));
    return result;
}
Also used : AMD64Unary(org.graalvm.compiler.lir.amd64.AMD64Unary) Variable(org.graalvm.compiler.lir.Variable)

Example 18 with AMD64AddressValue

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

the class AMD64LIRGenerator method emitCompareRegMemoryOp.

private boolean emitCompareRegMemoryOp(OperandSize size, AllocatableValue a, AMD64AddressValue b, LIRFrameState state) {
    AMD64RMOp op = CMP.getRMOpcode(size);
    append(new AMD64BinaryConsumer.MemoryRMOp(op, size, a, b, state));
    return false;
}
Also used : AMD64RMOp(org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp) AMD64BinaryConsumer(org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer)

Example 19 with AMD64AddressValue

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

the class AMD64LIRGenerator method emitCompareAndSwapBranch.

public void emitCompareAndSwapBranch(ValueKind<?> kind, AMD64AddressValue address, Value expectedValue, Value newValue, Condition condition, LabelRef trueLabel, LabelRef falseLabel, double trueLabelProbability) {
    assert kind.equals(expectedValue.getValueKind());
    assert kind.equals(newValue.getValueKind());
    assert condition == Condition.EQ || condition == Condition.NE;
    AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
    RegisterValue raxValue = AMD64.rax.asValue(kind);
    emitMove(raxValue, expectedValue);
    append(new CompareAndSwapOp(memKind, raxValue, address, raxValue, asAllocatable(newValue)));
    append(new BranchOp(condition, trueLabel, falseLabel, trueLabelProbability));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) BranchOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.BranchOp) FloatBranchOp(org.graalvm.compiler.lir.amd64.AMD64ControlFlow.FloatBranchOp) CompareAndSwapOp(org.graalvm.compiler.lir.amd64.AMD64Move.CompareAndSwapOp)

Example 20 with AMD64AddressValue

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

the class AMD64LIRGenerator method emitValueCompareAndSwap.

@Override
public Value emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
    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)));
    Variable result = newVariable(kind);
    emitMove(result, raxRes);
    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)

Aggregations

AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)15 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)10 Variable (org.graalvm.compiler.lir.Variable)9 LIRKind (org.graalvm.compiler.core.common.LIRKind)6 RegisterValue (jdk.vm.ci.code.RegisterValue)5 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)5 JavaConstant (jdk.vm.ci.meta.JavaConstant)4 Value (jdk.vm.ci.meta.Value)4 NodeLIRBuilder (org.graalvm.compiler.core.gen.NodeLIRBuilder)4 ComplexMatchResult (org.graalvm.compiler.core.match.ComplexMatchResult)4 AMD64BinaryConsumer (org.graalvm.compiler.lir.amd64.AMD64BinaryConsumer)4 BranchOp (org.graalvm.compiler.lir.amd64.AMD64ControlFlow.BranchOp)4 AMD64MIOp (org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MIOp)3 AMD64RMOp (org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp)3 OperandSize (org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize)3 CanonicalCondition (org.graalvm.compiler.core.common.calc.CanonicalCondition)3 Condition (org.graalvm.compiler.core.common.calc.Condition)3 AMD64Move (org.graalvm.compiler.lir.amd64.AMD64Move)3 AMD64 (jdk.vm.ci.amd64.AMD64)2 CPUFeature (jdk.vm.ci.amd64.AMD64.CPUFeature)2