# HG changeset patch # User Doug Simon # Date 1389264341 -3600 # Node ID 29db3f666f8da2ae5f0dd81dc0a134019bd26d48 # Parent 1302b727b5cdb785f61cf15dda187fae78a4c95f fixed compare instruction emitting in HSAILAssembler Contributed-by: Tom Deneau diff -r 1302b727b5cd -r 29db3f666f8d graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java --- a/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java Thu Jan 09 08:30:58 2014 +0100 +++ b/graal/com.oracle.graal.asm.hsail/src/com/oracle/graal/asm/hsail/HSAILAssembler.java Thu Jan 09 11:45:41 2014 +0100 @@ -273,7 +273,9 @@ */ public void emitCompare(Value src0, Value src1, String condition, boolean unordered, boolean isUnsignedCompare) { // Formulate the prefix of the instruction. - String prefix = "cmp_" + condition + (unordered ? "u" : "") + "_b1_" + (isUnsignedCompare ? getArgTypeForceUnsigned(src1) : getArgType(src1)); + // if unordered is true, it should be ignored unless the src type is f32 or f64 + String unorderedPrefix = (getArgType(src1).startsWith("f") && unordered ? "u" : ""); + String prefix = "cmp_" + condition + unorderedPrefix + "_b1_" + (isUnsignedCompare ? getArgTypeForceUnsigned(src1) : getArgType(src1)); // Generate a comment for debugging purposes String comment = (isConstant(src1) && (src1.getKind() == Kind.Object) && (asConstant(src1).asObject() == null) ? " // null test " : ""); // Emit the instruction.