Search in sources :

Example 1 with Rem

use of org.graalvm.compiler.lir.sparc.SPARCArithmetic.RemOp.Rem in project graal by oracle.

the class SPARCArithmeticLIRGenerator method emitURem.

@Override
public Value emitURem(Value a, Value b, LIRFrameState state) {
    Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch1 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Variable scratch2 = getLIRGen().newVariable(LIRKind.combine(a, b));
    Rem opcode;
    switch(((SPARCKind) a.getPlatformKind())) {
        case WORD:
            opcode = Rem.IUREM;
            break;
        case XWORD:
            opcode = Rem.LUREM;
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    getLIRGen().append(new RemOp(opcode, result, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b), scratch1, scratch2, state));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) RemOp(org.graalvm.compiler.lir.sparc.SPARCArithmetic.RemOp) Rem(org.graalvm.compiler.lir.sparc.SPARCArithmetic.RemOp.Rem)

Aggregations

Variable (org.graalvm.compiler.lir.Variable)1 RemOp (org.graalvm.compiler.lir.sparc.SPARCArithmetic.RemOp)1 Rem (org.graalvm.compiler.lir.sparc.SPARCArithmetic.RemOp.Rem)1