diff options
author | Vladimir Marko <vmarko@google.com> | 2014-02-28 17:36:39 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-02-28 17:46:22 +0000 |
commit | dbb8c49d540edd2a39076093163c7218f03aa502 (patch) | |
tree | 6dc923e8d79f1c436d1144eb909be5aed8525d07 /compiler/dex/quick/arm/utility_arm.cc | |
parent | 1b22ddf2efe48ae1cbcdc34468037eca6072fe5c (diff) | |
download | android_art-dbb8c49d540edd2a39076093163c7218f03aa502.tar.gz android_art-dbb8c49d540edd2a39076093163c7218f03aa502.tar.bz2 android_art-dbb8c49d540edd2a39076093163c7218f03aa502.zip |
Remove non-existent ARM insn kThumb2SubsRRI12.
For kOpSub/kOpAdd, prefer modified immediate encodings
because they set flags.
Change-Id: I41dcd2d43ba1e62120c99eaf9106edc61c41e157
Diffstat (limited to 'compiler/dex/quick/arm/utility_arm.cc')
-rw-r--r-- | compiler/dex/quick/arm/utility_arm.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/dex/quick/arm/utility_arm.cc b/compiler/dex/quick/arm/utility_arm.cc index 9d3968bff2..c2cfb4dbc1 100644 --- a/compiler/dex/quick/arm/utility_arm.cc +++ b/compiler/dex/quick/arm/utility_arm.cc @@ -499,12 +499,6 @@ LIR* ArmMir2Lir::OpRegRegImm(OpKind op, int r_dest, int r_src1, int value) { else opcode = (neg) ? kThumbAddRRI3 : kThumbSubRRI3; return NewLIR3(opcode, r_dest, r_src1, abs_value); - } else if ((abs_value & 0x3ff) == abs_value) { - if (op == kOpAdd) - opcode = (neg) ? kThumb2SubRRI12 : kThumb2AddRRI12; - else - opcode = (neg) ? kThumb2AddRRI12 : kThumb2SubRRI12; - return NewLIR3(opcode, r_dest, r_src1, abs_value); } if (mod_imm < 0) { mod_imm = ModifiedImmediate(-value); @@ -512,6 +506,15 @@ LIR* ArmMir2Lir::OpRegRegImm(OpKind op, int r_dest, int r_src1, int value) { op = (op == kOpAdd) ? kOpSub : kOpAdd; } } + if (mod_imm < 0 && (abs_value & 0x3ff) == abs_value) { + // This is deliberately used only if modified immediate encoding is inadequate since + // we sometimes actually use the flags for small values but not necessarily low regs. + if (op == kOpAdd) + opcode = (neg) ? kThumb2SubRRI12 : kThumb2AddRRI12; + else + opcode = (neg) ? kThumb2AddRRI12 : kThumb2SubRRI12; + return NewLIR3(opcode, r_dest, r_src1, abs_value); + } if (op == kOpSub) { opcode = kThumb2SubRRI8M; alt_opcode = kThumb2SubRRR; |