use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitLogicCompareAndSwap.
@Override
public Variable emitLogicCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
ValueKind<?> kind = newValue.getValueKind();
assert kind.equals(expectedValue.getValueKind());
SPARCKind memKind = (SPARCKind) kind.getPlatformKind();
Variable result = newVariable(newValue.getValueKind());
append(new CompareAndSwapOp(result, asAllocatable(address), asAllocatable(expectedValue), asAllocatable(newValue)));
return emitConditionalMove(memKind, expectedValue, result, Condition.EQ, true, trueValue, falseValue);
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitMathAbs.
@Override
public Value emitMathAbs(Value inputValue) {
Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
Opfs opf;
switch(kind) {
case SINGLE:
opf = Opfs.Fabss;
break;
case DOUBLE:
opf = Opfs.Fabsd;
break;
default:
throw GraalError.shouldNotReachHere("Input kind: " + kind);
}
getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result));
return result;
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitShr.
@Override
public Variable emitShr(Value a, Value b) {
SPARCKind aKind = (SPARCKind) a.getPlatformKind();
LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
Op3s op;
switch(aKind) {
case WORD:
op = Op3s.Sra;
break;
case XWORD:
op = Op3s.Srax;
break;
default:
throw GraalError.shouldNotReachHere();
}
return emitBinary(resultKind, op, a, b);
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitRem.
@Override
public Value emitRem(Value a, Value b, LIRFrameState state) {
Variable result = getLIRGen().newVariable(LIRKind.combine(a, b));
// Intermediate values
Variable q1;
Variable q2;
switch((SPARCKind) a.getPlatformKind()) {
case WORD:
// Sign extend a and b
Value as = emitSignExtend(a);
Value bs = emitSignExtend(b);
q1 = emitBinary(as.getValueKind(), Sdivx, as, bs, state);
q2 = emitBinary(as.getValueKind(), Mulx, q1, bs);
result = emitSub(as, q2, false);
break;
case XWORD:
q1 = emitBinary(result.getValueKind(), Sdivx, a, b, state);
q2 = emitBinary(result.getValueKind(), Mulx, q1, b);
result = emitSub(a, q2, false);
break;
case SINGLE:
ForeignCallLinkage fremCall = getLIRGen().getForeignCalls().lookupForeignCall(ARITHMETIC_FREM);
result = getLIRGen().emitForeignCall(fremCall, state, a, b);
break;
case DOUBLE:
ForeignCallLinkage dremCall = getLIRGen().getForeignCalls().lookupForeignCall(ARITHMETIC_DREM);
result = getLIRGen().emitForeignCall(dremCall, state, a, b);
break;
default:
throw GraalError.shouldNotReachHere("missing: " + a.getPlatformKind());
}
return result;
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitShl.
@Override
public Variable emitShl(Value a, Value b) {
SPARCKind aKind = (SPARCKind) a.getPlatformKind();
LIRKind resultKind = LIRKind.combine(a, b).changeType(aKind);
Op3s op;
switch(aKind) {
case WORD:
op = Op3s.Sll;
break;
case XWORD:
op = Op3s.Sllx;
break;
default:
throw GraalError.shouldNotReachHere(String.format("Unsupported kind %s", aKind));
}
return emitBinary(resultKind, op, a, b);
}
Aggregations