Search in sources :

Example 11 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitLoad.

@Override
public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
    AMD64AddressValue loadAddress = getAMD64LIRGen().asAddressValue(address);
    Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(kind));
    switch((AMD64Kind) kind.getPlatformKind()) {
        case BYTE:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
            break;
        case WORD:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
            break;
        case DWORD:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
            break;
        case QWORD:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOV, QWORD, result, loadAddress, state));
            break;
        case SINGLE:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOVSS, SS, result, loadAddress, state));
            break;
        case DOUBLE:
            getLIRGen().append(new AMD64Unary.MemoryOp(MOVSD, SD, result, loadAddress, state));
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    return result;
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) AMD64Unary(org.graalvm.compiler.lir.amd64.AMD64Unary) AMD64Kind(jdk.vm.ci.amd64.AMD64Kind) Variable(org.graalvm.compiler.lir.Variable)

Example 12 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitBinaryConst.

private Variable emitBinaryConst(LIRKind resultKind, AMD64RRMOp op, OperandSize size, AllocatableValue a, JavaConstant b) {
    Variable result = getLIRGen().newVariable(resultKind);
    getLIRGen().append(new AMD64Binary.DataThreeOp(op, size, result, a, b));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64Binary(org.graalvm.compiler.lir.amd64.AMD64Binary)

Example 13 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitBinaryConst.

private Variable emitBinaryConst(LIRKind resultKind, AMD64RMOp op, OperandSize size, AllocatableValue a, JavaConstant b) {
    Variable result = getLIRGen().newVariable(resultKind);
    getLIRGen().append(new AMD64Binary.DataTwoOp(op, size, result, a, b));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AMD64Binary(org.graalvm.compiler.lir.amd64.AMD64Binary)

Example 14 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitMathCos.

@Override
public Value emitMathCos(Value input) {
    LIRGenerator gen = getLIRGen();
    Variable result = maths.emitCos(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(), COS, 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 15 with Variable

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

the class AMD64ArithmeticLIRGenerator method emitBinaryMemory.

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

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