Search in sources :

Example 26 with Variable

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

the class AArch64ArithmeticLIRGenerator method emitCountLeadingZeros.

@Override
public Value emitCountLeadingZeros(Value value) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD));
    getLIRGen().append(new AArch64BitManipulationOp(CLZ, result, getLIRGen().asAllocatable(value)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64BitManipulationOp(org.graalvm.compiler.lir.aarch64.AArch64BitManipulationOp)

Example 27 with Variable

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

the class AArch64LIRGenerator method emitByteSwap.

@Override
public Variable emitByteSwap(Value input) {
    Variable result = newVariable(LIRKind.combine(input));
    append(new AArch64ByteSwapOp(result, input));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) AArch64ByteSwapOp(org.graalvm.compiler.lir.aarch64.AArch64ByteSwapOp)

Example 28 with Variable

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

the class AArch64LIRGenerator method emitIntegerTestMove.

/**
 * Moves trueValue into result if (left & right) == 0, else falseValue.
 *
 * @param left Integer kind. Non null.
 * @param right Integer kind. Non null.
 * @param trueValue Integer kind. Non null.
 * @param falseValue Integer kind. Non null.
 * @return virtual register containing trueValue if (left & right) == 0, else falseValue.
 */
@Override
public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {
    assert ((AArch64Kind) left.getPlatformKind()).isInteger() && ((AArch64Kind) right.getPlatformKind()).isInteger();
    assert ((AArch64Kind) trueValue.getPlatformKind()).isInteger() && ((AArch64Kind) falseValue.getPlatformKind()).isInteger();
    ((AArch64ArithmeticLIRGenerator) getArithmetic()).emitBinary(left.getValueKind(), AArch64ArithmeticOp.ANDS, true, left, right);
    Variable result = newVariable(trueValue.getValueKind());
    append(new CondMoveOp(result, ConditionFlag.EQ, load(trueValue), load(falseValue)));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) CondMoveOp(org.graalvm.compiler.lir.aarch64.AArch64ControlFlow.CondMoveOp)

Example 29 with Variable

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

the class AArch64LIRGenerator method emitArrayEquals.

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

Example 30 with Variable

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

the class AArch64LIRGenerator method emitValueCompareAndSwap.

@Override
public Variable emitValueCompareAndSwap(Value address, Value expectedValue, Value newValue) {
    Variable result = newVariable(newValue.getValueKind());
    Variable scratch = newVariable(LIRKind.value(AArch64Kind.WORD));
    append(new CompareAndSwapOp(result, loadNonCompareConst(expectedValue), loadReg(newValue), asAllocatable(address), scratch));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) CompareAndSwapOp(org.graalvm.compiler.lir.aarch64.AArch64Move.CompareAndSwapOp)

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