# HG changeset patch # User Stefan Anzinger # Date 1409279092 25200 # Node ID e91533b86166c48e516987c98d6efd0f3b1c6fca # Parent e4cfc9ea2bd343c86a92f68ec4058f8114f0cc47 [SPARC] Fix dacapo sunflow test (Unordered branching is now implemented right) diff -r e4cfc9ea2bd3 -r e91533b86166 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu Aug 28 17:49:37 2014 -0700 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Thu Aug 28 19:24:52 2014 -0700 @@ -224,7 +224,6 @@ double trueDestinationProbability) { boolean mirrored = emitCompare(cmpKind, left, right); Condition finalCondition = mirrored ? cond.mirror() : cond; - boolean finalUnorderedIsTrue = mirrored ? !unorderedIsTrue : unorderedIsTrue; Kind kind = left.getKind().getStackKind(); switch (kind) { @@ -235,7 +234,7 @@ break; case Float: case Double: - append(new BranchOp(finalCondition, trueDestination, falseDestination, kind, finalUnorderedIsTrue)); + append(new BranchOp(finalCondition, trueDestination, falseDestination, kind, unorderedIsTrue)); break; default: throw GraalInternalError.shouldNotReachHere("" + left.getKind()); diff -r e4cfc9ea2bd3 -r e91533b86166 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Thu Aug 28 17:49:37 2014 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Thu Aug 28 19:24:52 2014 -0700 @@ -139,28 +139,44 @@ } private static void emitFloatCompare(SPARCMacroAssembler masm, Label target, Condition actualCondition, boolean branchOnUnordered) { - if (branchOnUnordered) { - // new Fbu(false, target).emit(masm); - // new Nop().emit(masm); - } switch (actualCondition) { case EQ: - new Fbe(false, target).emit(masm); + if (branchOnUnordered) { + new Fbue(false, target).emit(masm); + } else { + new Fbe(false, target).emit(masm); + } break; case NE: - new Fbne(false, target).emit(masm); + new Fbne(false, target).emit(masm); // Is also unordered break; case LT: - new Fbl(false, target).emit(masm); + if (branchOnUnordered) { + new Fbul(false, target).emit(masm); + } else { + new Fbl(false, target).emit(masm); + } break; case LE: - new Fble(false, target).emit(masm); + if (branchOnUnordered) { + new Fbule(false, target).emit(masm); + } else { + new Fble(false, target).emit(masm); + } break; case GT: - new Fbg(false, target).emit(masm); + if (branchOnUnordered) { + new Fbug(false, target).emit(masm); + } else { + new Fbg(false, target).emit(masm); + } break; case GE: - new Fbge(false, target).emit(masm); + if (branchOnUnordered) { + new Fbuge(false, target).emit(masm); + } else { + new Fbge(false, target).emit(masm); + } break; case AE: case AT: