summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2014-08-29 23:09:47 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-08-29 23:09:48 +0000
commit59a004328f42c32026a79b59e8eae0f3bf85b59b (patch)
treec66c482eead93169f75431cdc57d8631bd3986b9 /compiler
parent5383613c5deab8d92dcfb85c1b034594394c7cca (diff)
parente5beb18ca08962ed271f4c1f703e0c52bc8805f3 (diff)
Merge "ART: Address issues with kIntrinsicMinMaxDouble for x86"
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/dex/quick/x86/fp_x86.cc19
-rw-r--r--compiler/dex/quick/x86/utility_x86.cc2
2 files changed, 20 insertions, 1 deletions
diff --git a/compiler/dex/quick/x86/fp_x86.cc b/compiler/dex/quick/x86/fp_x86.cc
index 2920fb6507..21d1a5cec2 100755
--- a/compiler/dex/quick/x86/fp_x86.cc
+++ b/compiler/dex/quick/x86/fp_x86.cc
@@ -730,6 +730,25 @@ bool X86Mir2Lir::GenInlinedMinMaxFP(CallInfo* info, bool is_min, bool is_double)
// Handle NaN.
branch_nan->target = NewLIR0(kPseudoTargetLabel);
LoadConstantWide(rl_result.reg, INT64_C(0x7ff8000000000000));
+
+ // The base_of_code_ compiler temp is non-null when it is reserved
+ // for being able to do data accesses relative to method start.
+ if (base_of_code_ != nullptr) {
+ // Loading from the constant pool may have used base of code register.
+ // However, the code here generates logic in diamond shape and not all
+ // paths load base of code register. Therefore, we ensure it is clobbered so
+ // that the temp caching system does not believe it is live at merge point.
+ RegLocation rl_method = mir_graph_->GetRegLocation(base_of_code_->s_reg_low);
+ if (rl_method.wide) {
+ rl_method = UpdateLocWide(rl_method);
+ } else {
+ rl_method = UpdateLoc(rl_method);
+ }
+ if (rl_method.location == kLocPhysReg) {
+ Clobber(rl_method.reg);
+ }
+ }
+
LIR* branch_exit_nan = NewLIR1(kX86Jmp8, 0);
// Handle Min/Max. Copy greater/lesser value from src2.
branch_cond1->target = NewLIR0(kPseudoTargetLabel);
diff --git a/compiler/dex/quick/x86/utility_x86.cc b/compiler/dex/quick/x86/utility_x86.cc
index 022fd80663..4f65a0f5af 100644
--- a/compiler/dex/quick/x86/utility_x86.cc
+++ b/compiler/dex/quick/x86/utility_x86.cc
@@ -592,7 +592,6 @@ LIR* X86Mir2Lir::LoadConstantWide(RegStorage r_dest, int64_t value) {
kDouble, kNotVolatile);
res->target = data_target;
res->flags.fixup = kFixupLoad;
- Clobber(rl_method.reg);
store_method_addr_used_ = true;
} else {
if (r_dest.IsPair()) {
@@ -1025,6 +1024,7 @@ void X86Mir2Lir::AnalyzeMIR(int opcode, BasicBlock * bb, MIR *mir) {
store_method_addr_ = true;
break;
case Instruction::INVOKE_STATIC:
+ case Instruction::INVOKE_STATIC_RANGE:
AnalyzeInvokeStatic(opcode, bb, mir);
break;
default: