--- old/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java 2014-08-05 11:42:38.328906066 -0500 +++ new/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java 2014-08-05 11:42:38.164906067 -0500 @@ -324,7 +324,11 @@ } public static String mapAddress(HSAILAddress addr) { - return "[$d" + addr.getBase().encoding() + " + " + addr.getDisplacement() + "]"; + if (addr.getBase().encoding() < 0) { + return "[0x" + Long.toHexString(addr.getDisplacement()) + "]"; + } else { + return "[$d" + addr.getBase().encoding() + " + " + addr.getDisplacement() + "]"; + } } private static String doubleToString(double dval) { --- old/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/GraalKernelTester.java 2014-08-05 11:42:38.824906059 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test.infra/src/com/oracle/graal/compiler/hsail/test/infra/GraalKernelTester.java 2014-08-05 11:42:38.672906060 -0500 @@ -131,6 +131,13 @@ } /** + * Determines if we are running CQE tests (via a -D flag) + */ + public boolean runningCQETests() { + return Boolean.getBoolean("com.amd.CQE"); + } + + /** * Determines if the JVM supports the required typeProfileWidth. */ public boolean typeProfileWidthAtLeast(int val) { --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleCosTest.java 2014-08-05 11:42:39.356906052 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleCosTest.java 2014-08-05 11:42:39.200906054 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleNextAfterTest.java 2014-08-05 11:42:39.880906045 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleNextAfterTest.java 2014-08-05 11:42:39.716906047 -0500 @@ -39,6 +39,11 @@ }); } + @Override + protected boolean supportsRequiredCapabilities() { + return (runningOnSimulator() || runningCQETests()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleNextUpTest.java 2014-08-05 11:42:40.408906036 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleNextUpTest.java 2014-08-05 11:42:40.244906040 -0500 @@ -38,6 +38,11 @@ }); } + @Override + protected boolean supportsRequiredCapabilities() { + return (runningOnSimulator() || runningCQETests()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleSinTest.java 2014-08-05 11:42:40.904906031 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleSinTest.java 2014-08-05 11:42:40.740906033 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleTanTest.java 2014-08-05 11:42:41.416906024 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/DoubleTanTest.java 2014-08-05 11:42:41.256906026 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatCosTest.java 2014-08-05 11:42:41.932906017 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatCosTest.java 2014-08-05 11:42:41.768906019 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatNextAfterTest.java 2014-08-05 11:42:42.448906008 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatNextAfterTest.java 2014-08-05 11:42:42.284906012 -0500 @@ -39,6 +39,11 @@ }); } + @Override + protected boolean supportsRequiredCapabilities() { + return (runningOnSimulator() || runningCQETests()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatNextUpTest.java 2014-08-05 11:42:42.964906001 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatNextUpTest.java 2014-08-05 11:42:42.804906005 -0500 @@ -38,6 +38,11 @@ }); } + @Override + protected boolean supportsRequiredCapabilities() { + return (runningOnSimulator() || runningCQETests()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatSinTest.java 2014-08-05 11:42:43.472905994 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatSinTest.java 2014-08-05 11:42:43.312905998 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatTanTest.java 2014-08-05 11:42:43.984905987 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/FloatTanTest.java 2014-08-05 11:42:43.832905990 -0500 @@ -38,6 +38,12 @@ }); } + // internally allocates a Rempiostruct, escape analysis not catching it + @Override + protected boolean supportsRequiredCapabilities() { + return (canHandleObjectAllocation()); + } + @Test public void testUsingLambdaMethod() { testGeneratedHsailUsingLambdaMethod(); --- old/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/StringBuilderTest.java 2014-08-05 11:42:44.512905980 -0500 +++ new/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/StringBuilderTest.java 2014-08-05 11:42:44.348905982 -0500 @@ -47,7 +47,7 @@ @Override protected boolean supportsRequiredCapabilities() { - return (canHandleObjectAllocation()); + return (canHandleObjectAllocation() && (runningOnSimulator() || runningCQETests())); } @Test --- old/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java 2014-08-05 11:42:45.052905974 -0500 +++ new/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java 2014-08-05 11:42:44.876905975 -0500 @@ -686,7 +686,9 @@ String iterationObjArgReg = HSAIL.mapRegister(cc.getArgument(nonConstantParamCount - 1)); /* * iterationObjArgReg will be the highest $d register in use (it is the last parameter) - * so tempReg can be the next higher $d register + * so tempReg can be the next higher $d register. As of 1.0 spec, we cannot use + * ld_global_u32 $dxx, [addr]; so we need a temporary $s register. We can use + * workItemReg+1; */ String tmpReg = "$d" + (asRegister(cc.getArgument(nonConstantParamCount - 1)).encoding() + 1); // Convert gid to long. @@ -699,9 +701,13 @@ asm.emitString("add_u64 " + tmpReg + ", " + tmpReg + ", " + iterationObjArgReg + "; // Add to array ref ptr"); // Load the object into the parameter reg. if (useCompressedOops) { + int workItemRegEncoding = asRegister(cc.getArgument(nonConstantParamCount)).encoding(); + String tmpReg32 = "$s" + Integer.toString(workItemRegEncoding + 1); - // Load u32 into the d 64 reg since it will become an object address - asm.emitString("ld_global_u32 " + tmpReg + ", " + "[" + tmpReg + "]" + "; // Load compressed ptr from array"); + // Load u32 into the temporary $s reg since it will become an object address + + asm.emitString("ld_global_u32 " + tmpReg32 + ", " + "[" + tmpReg + "]" + "; // Load compressed ptr from array"); + asm.emitString("cvt_u64_u32 " + tmpReg + ", " + tmpReg32 + "; // cvt to 64 bits"); long narrowOopBase = config.narrowOopBase; long narrowOopShift = config.narrowOopShift;