use of org.graalvm.compiler.core.match.ComplexMatchResult 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 org.graalvm.compiler.core.match.ComplexMatchResult 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