# HG changeset patch # User Stefan Anzinger # Date 1406735464 25200 # Node ID 07c9a8824b625a3fb0e34627c71c7a5b3527305a # Parent b377d9e85bc624b18841d771bf53120ad2027b94 [SPARC] Test op applies to bool, char, byte and short types as well. diff -r b377d9e85bc6 -r 07c9a8824b62 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Wed Jul 30 08:50:26 2014 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Wed Jul 30 08:51:04 2014 -0700 @@ -37,7 +37,7 @@ public class SPARCTestOp extends SPARCLIRInstruction { @Use({REG}) protected Value x; - @Use({REG, STACK, CONST}) protected Value y; + @Use({REG, CONST}) protected Value y; public SPARCTestOp(Value x, Value y) { this.x = x; @@ -48,6 +48,10 @@ public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { if (isRegister(y)) { switch (x.getKind()) { + case Short: + case Byte: + case Char: + case Boolean: case Int: new Andcc(asIntReg(x), asIntReg(y), g0).emit(masm); break; @@ -59,6 +63,10 @@ } } else if (isConstant(y)) { switch (x.getKind()) { + case Short: + case Byte: + case Char: + case Boolean: case Int: new Andcc(asIntReg(x), crb.asIntConst(y), g0).emit(masm); break; @@ -69,18 +77,7 @@ throw GraalInternalError.shouldNotReachHere(); } } else { - switch (x.getKind()) { - case Int: - new Ldsw((SPARCAddress) crb.asIntAddr(y), asIntReg(y)).emit(masm); - new Andcc(asIntReg(x), asIntReg(y), g0).emit(masm); - break; - case Long: - new Ldx((SPARCAddress) crb.asLongAddr(y), asLongReg(y)).emit(masm); - new Andcc(asLongReg(x), asLongReg(y), g0).emit(masm); - break; - default: - throw GraalInternalError.shouldNotReachHere(); - } + throw GraalInternalError.shouldNotReachHere(); } }