Mercurial > hg > truffle
changeset 16660:07c9a8824b62
[SPARC] Test op applies to bool, char, byte and short types as well.
author | Stefan Anzinger <stefan.anzinger@gmail.com> |
---|---|
date | Wed, 30 Jul 2014 08:51:04 -0700 |
parents | b377d9e85bc6 |
children | f1fba319d4e3 |
files | graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java |
diffstat | 1 files changed, 10 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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(); } }