use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCArithmeticLIRGenerator method emitUShr.
@Override
public Variable emitUShr(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.Srl;
break;
case XWORD:
op = Op3s.Srlx;
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 emitMathSqrt.
@Override
public Value emitMathSqrt(Value inputValue) {
Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue));
SPARCKind kind = (SPARCKind) inputValue.getPlatformKind();
Opfs opf;
switch(kind) {
case SINGLE:
opf = Opfs.Fsqrts;
break;
case DOUBLE:
opf = Opfs.Fsqrtd;
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 SPARCLIRGenerator method emitIntegerTestBranch.
@Override
public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
emitIntegerTest(left, right);
append(new BranchOp(ConditionFlag.Equal, trueDestination, falseDestination, (SPARCKind) left.getPlatformKind(), trueDestinationProbability));
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCNodeMatchRules method emitZeroExtendMemory.
private ComplexMatchResult emitZeroExtendMemory(Access access, int fromBits, int toBits) {
assert fromBits <= toBits && toBits <= 64;
SPARCKind toKind = null;
SPARCKind fromKind = null;
if (fromBits == toBits) {
return null;
}
toKind = toBits > 32 ? XWORD : WORD;
switch(fromBits) {
case 8:
fromKind = BYTE;
break;
case 16:
fromKind = HWORD;
break;
case 32:
fromKind = WORD;
break;
default:
throw GraalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
}
SPARCKind localFromKind = fromKind;
SPARCKind localToKind = toKind;
return builder -> {
// Loads are always zero extending load
return getLIRGeneratorTool().emitZeroExtendLoad(LIRKind.value(localFromKind), LIRKind.value(localToKind), operand(access.getAddress()), getState(access));
};
}
use of jdk.vm.ci.sparc.SPARCKind in project graal by oracle.
the class SPARCNodeMatchRules method emitSignExtendMemory.
private ComplexMatchResult emitSignExtendMemory(Access access, int fromBits, int toBits) {
assert fromBits <= toBits && toBits <= 64;
SPARCKind toKind = null;
SPARCKind fromKind = null;
if (fromBits == toBits) {
return null;
}
toKind = toBits > 32 ? XWORD : WORD;
switch(fromBits) {
case 8:
fromKind = BYTE;
break;
case 16:
fromKind = HWORD;
break;
case 32:
fromKind = WORD;
break;
default:
throw GraalError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
}
SPARCKind localFromKind = fromKind;
SPARCKind localToKind = toKind;
return builder -> {
return getLIRGeneratorTool().emitSignExtendLoad(LIRKind.value(localFromKind), LIRKind.value(localToKind), operand(access.getAddress()), getState(access));
};
}
Aggregations