Allow X86 QBE to be extended
Enhancements and updates to allow X86Mir2LIR Backend to be subclassed
for experimentation. Add virtual in a whole bunch of places, and make
some other changes to get this to work.
Change-Id: I0980a19bc5d5725f91660f98c95f1f51c17ee9b6
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
diff --git a/compiler/dex/quick/x86/utility_x86.cc b/compiler/dex/quick/x86/utility_x86.cc
index e9592a6..fed31c1 100644
--- a/compiler/dex/quick/x86/utility_x86.cc
+++ b/compiler/dex/quick/x86/utility_x86.cc
@@ -161,6 +161,22 @@
case kOpMul:
opcode = byte_imm ? kX86Imul32RRI8 : kX86Imul32RRI;
return NewLIR3(opcode, r_dest_src1.GetReg(), r_dest_src1.GetReg(), value);
+ case kOp2Byte:
+ opcode = kX86Mov32RI;
+ value = static_cast<int8_t>(value);
+ break;
+ case kOp2Short:
+ opcode = kX86Mov32RI;
+ value = static_cast<int16_t>(value);
+ break;
+ case kOp2Char:
+ opcode = kX86Mov32RI;
+ value = static_cast<uint16_t>(value);
+ break;
+ case kOpNeg:
+ opcode = kX86Mov32RI;
+ value = -value;
+ break;
default:
LOG(FATAL) << "Bad case in OpRegImm " << op;
}
@@ -523,7 +539,7 @@
int32_t val_hi = High32Bits(value);
int32_t low_reg_val = r_dest.IsPair() ? r_dest.GetLowReg() : r_dest.GetReg();
LIR *res;
- bool is_fp = RegStorage::IsFloat(low_reg_val);
+ bool is_fp = r_dest.IsFloat();
// TODO: clean this up once we fully recognize 64-bit storage containers.
if (is_fp) {
if (value == 0) {