# HG changeset patch # User Stefan Anzinger # Date 1409353530 25200 # Node ID 5c1bc769563e3b8914e5bfbb2c4f46aad41920c7 # Parent 1013a84447463b9e9c16accb66405bc7bb89098f# Parent 5d16da2ca0c869e237d88b1f7bb8008e1ba305b7 Merge diff -r 5d16da2ca0c8 -r 5c1bc769563e 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 Fri Aug 29 15:21:39 2014 -0700 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Fri Aug 29 16:05:30 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()); @@ -756,10 +755,10 @@ Variable result = newVariable(LIRKind.derive(a, b)); switch (a.getKind().getStackKind()) { case Int: - append(new Op2Stack(IXOR, result, a, loadNonConst(b))); + append(new Op2Stack(IXOR, result, load(a), loadNonConst(b))); break; case Long: - append(new Op2Stack(LXOR, result, a, loadNonConst(b))); + append(new Op2Stack(LXOR, result, load(a), loadNonConst(b))); break; default: throw GraalInternalError.shouldNotReachHere(); diff -r 5d16da2ca0c8 -r 5c1bc769563e graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Fri Aug 29 15:21:39 2014 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Fri Aug 29 16:05:30 2014 -0700 @@ -738,7 +738,7 @@ new Sra(asIntReg(dst), 16, asIntReg(dst)).emit(masm); break; case I2F: - if (src.getPlatformKind() == Kind.Int) { + if (src.getPlatformKind() == Kind.Int || src.getPlatformKind() == Kind.Char || src.getPlatformKind() == Kind.Short || src.getPlatformKind() == Kind.Byte) { new Movwtos(asIntReg(src), asFloatReg(dst)).emit(masm); new Fitos(asFloatReg(dst), asFloatReg(dst)).emit(masm); } else if (src.getPlatformKind() == Kind.Float) { diff -r 5d16da2ca0c8 -r 5c1bc769563e 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 Fri Aug 29 15:21:39 2014 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Fri Aug 29 16:05:30 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: