Search in sources :

Example 1 with LIRGenerator

use of org.graalvm.compiler.lir.gen.LIRGenerator 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 2 with LIRGenerator

use of org.graalvm.compiler.lir.gen.LIRGenerator 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 3 with LIRGenerator

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

the class AMD64ArithmeticLIRGenerator method emitMathSin.

@Override
public Value emitMathSin(Value input) {
    LIRGenerator gen = getLIRGen();
    Variable result = maths.emitSin(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(), SIN, 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 4 with LIRGenerator

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

the class AMD64ArithmeticLIRGenerator method emitMathLog.

@Override
public Value emitMathLog(Value input, boolean base10) {
    LIRGenerator gen = getLIRGen();
    Variable result = maths.emitLog(gen, input, base10);
    if (result == null) {
        result = gen.newVariable(LIRKind.combine(input));
        AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
        gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), base10 ? LOG10 : LOG, 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)

Aggregations

AllocatableValue (jdk.vm.ci.meta.AllocatableValue)4 Variable (org.graalvm.compiler.lir.Variable)4 AMD64MathIntrinsicUnaryOp (org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicUnaryOp)4 ArithmeticLIRGenerator (org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator)4 LIRGenerator (org.graalvm.compiler.lir.gen.LIRGenerator)4