diff graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java @ 16315:b955d649fca8

Fixing BC_i2f, BC_i2c, BC_fadd Implementing instructions in assembler Movwtos and Fitos
author Stefan Anzinger <stefan.anzinger@gmail.com>
date Mon, 02 Jun 2014 20:40:57 +0200
parents 151fe6b1e511
children a4bd33d52985
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Sat May 31 00:30:26 2014 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Mon Jun 02 20:40:57 2014 +0200
@@ -850,7 +850,14 @@
             assert inputVal.getKind() == Kind.Int;
             Variable result = newVariable(Kind.Int);
             int mask = (int) IntegerStamp.defaultMask(fromBits);
-            append(new BinaryRegConst(SPARCArithmetic.IAND, result, asAllocatable(inputVal), Constant.forInt(mask)));
+            Constant constant = Constant.forInt(mask);
+            if (canInlineConstant(constant)) {
+                append(new BinaryRegConst(SPARCArithmetic.IAND, result, asAllocatable(inputVal), constant));
+            } else {
+                Variable maskVar = newVariable(Kind.Int);
+                emitMove(maskVar, constant);
+                append(new BinaryRegReg(IAND, result, maskVar, (inputVal)));
+            }
             if (toBits > 32) {
                 Variable longResult = newVariable(Kind.Long);
                 emitMove(longResult, result);