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;
}