Search in sources :

Example 86 with Variable

use of org.graalvm.compiler.lir.Variable 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)

Example 87 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitMathPow.

@Override
public Value emitMathPow(Value input1, Value input2) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(input1));
    getLIRGen().append(new AMD64MathIntrinsicBinaryOp(getAMD64LIRGen(), POW, result, getLIRGen().asAllocatable(input1), getLIRGen().asAllocatable(input2)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64MathIntrinsicBinaryOp(org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicBinaryOp)

Example 88 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitConvertOp.

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

Example 89 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitBitScanForward.

@Override
public Variable emitBitScanForward(Value value) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
    getLIRGen().append(new AMD64Unary.RMOp(BSF, QWORD, result, getLIRGen().asAllocatable(value)));
    return result;
}
Also used : AMD64Unary(org.graalvm.compiler.lir.amd64.AMD64Unary) Variable(org.graalvm.compiler.lir.Variable)

Example 90 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitLoad.

@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
    AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address);
    Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
    getLIRGen().append(new LoadOp((AArch64Kind) kind.getPlatformKind(), result, loadAddress, state));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LoadOp(org.graalvm.compiler.lir.aarch64.AArch64Move.LoadOp)

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