comparison graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java @ 13227:1a66453f73db

renamed TargetMethodAssembler to CompilationResultBuilder
author Doug Simon <doug.simon@oracle.com>
date Tue, 03 Dec 2013 10:51:16 +0100
parents 7a8d6ba83a04
children 8db6e76cb658
comparison
equal deleted inserted replaced
13226:0b4d38339708 13227:1a66453f73db
47 this.x = x; 47 this.x = x;
48 this.y = y; 48 this.y = y;
49 } 49 }
50 50
51 @Override 51 @Override
52 public void emitCode(TargetMethodAssembler tasm, SPARCMacroAssembler masm) { 52 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
53 emit(tasm, masm, opcode, x, y); 53 emit(crb, masm, opcode, x, y);
54 } 54 }
55 55
56 @Override 56 @Override
57 protected void verify() { 57 protected void verify() {
58 super.verify(); 58 super.verify();
60 (name().startsWith("A") && x.getKind() == Kind.Object && y.getKind() == Kind.Object) || 60 (name().startsWith("A") && x.getKind() == Kind.Object && y.getKind() == Kind.Object) ||
61 (name().startsWith("F") && x.getKind() == Kind.Float && y.getKind() == Kind.Float) || (name().startsWith("D") && x.getKind() == Kind.Double && y.getKind() == Kind.Double); 61 (name().startsWith("F") && x.getKind() == Kind.Float && y.getKind() == Kind.Float) || (name().startsWith("D") && x.getKind() == Kind.Double && y.getKind() == Kind.Double);
62 } 62 }
63 } 63 }
64 64
65 public static void emit(TargetMethodAssembler tasm, SPARCMacroAssembler masm, SPARCCompare opcode, Value x, Value y) { 65 public static void emit(CompilationResultBuilder crb, SPARCMacroAssembler masm, SPARCCompare opcode, Value x, Value y) {
66 if (isRegister(y)) { 66 if (isRegister(y)) {
67 switch (opcode) { 67 switch (opcode) {
68 case ICMP: 68 case ICMP:
69 new Cmp(asIntReg(x), asIntReg(y)).emit(masm); 69 new Cmp(asIntReg(x), asIntReg(y)).emit(masm);
70 break; 70 break;
85 } 85 }
86 } else { 86 } else {
87 assert isConstant(y); 87 assert isConstant(y);
88 switch (opcode) { 88 switch (opcode) {
89 case ICMP: 89 case ICMP:
90 assert isSimm13(tasm.asIntConst(y)); 90 assert isSimm13(crb.asIntConst(y));
91 new Cmp(asIntReg(x), tasm.asIntConst(y)).emit(masm); 91 new Cmp(asIntReg(x), crb.asIntConst(y)).emit(masm);
92 break; 92 break;
93 case LCMP: 93 case LCMP:
94 assert isSimm13(tasm.asIntConst(y)); 94 assert isSimm13(crb.asIntConst(y));
95 new Cmp(asLongReg(x), tasm.asIntConst(y)).emit(masm); 95 new Cmp(asLongReg(x), crb.asIntConst(y)).emit(masm);
96 break; 96 break;
97 case ACMP: 97 case ACMP:
98 if (((Constant) y).isNull()) { 98 if (((Constant) y).isNull()) {
99 new Cmp(asObjectReg(x), 0).emit(masm); 99 new Cmp(asObjectReg(x), 0).emit(masm);
100 break; 100 break;
101 } else { 101 } else {
102 throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons"); 102 throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons");
103 } 103 }
104 case FCMP: 104 case FCMP:
105 // masm.ucomiss(asFloatReg(x), (AMD64Address) tasm.asFloatConstRef(y)); 105 // masm.ucomiss(asFloatReg(x), (AMD64Address) crb.asFloatConstRef(y));
106 // break; 106 // break;
107 case DCMP: 107 case DCMP:
108 // masm.ucomisd(asDoubleReg(x), (AMD64Address) tasm.asDoubleConstRef(y)); 108 // masm.ucomisd(asDoubleReg(x), (AMD64Address) crb.asDoubleConstRef(y));
109 // break; 109 // break;
110 default: 110 default:
111 throw GraalInternalError.shouldNotReachHere(); 111 throw GraalInternalError.shouldNotReachHere();
112 } 112 }
113 } 113 }