diff options
| author | 2016-02-03 10:13:41 +0000 | |
|---|---|---|
| committer | 2016-02-03 10:13:41 +0000 | |
| commit | 7770a3e080db3fb26e0754dc5afd05eb73aae2a7 (patch) | |
| tree | e7eb4be8e179b684550c0a77dd2a194a1b809693 /compiler/optimizing | |
| parent | b72923dd4d6e1636163047c960395ed9879e31fc (diff) | |
Assume fp operations can also take a constant on x86.
Because irreducible loops disable the constant pool optimization
on x86, we need to handle cases where a fp operation gets one.
Change-Id: I43387f31aa2589d02112953baa62fd0994d0a6d7
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 18d70daf47..da054baa1c 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -2688,6 +2688,8 @@ void LocationsBuilderX86::VisitAdd(HAdd* add) {        locations->SetInAt(0, Location::RequiresFpuRegister());        if (add->InputAt(1)->IsX86LoadFromConstantTable()) {          DCHECK(add->InputAt(1)->IsEmittedAtUseSite()); +      } else if (add->InputAt(1)->IsConstant()) { +        locations->SetInAt(1, Location::RequiresFpuRegister());        } else {          locations->SetInAt(1, Location::Any());        } @@ -2804,6 +2806,8 @@ void LocationsBuilderX86::VisitSub(HSub* sub) {        locations->SetInAt(0, Location::RequiresFpuRegister());        if (sub->InputAt(1)->IsX86LoadFromConstantTable()) {          DCHECK(sub->InputAt(1)->IsEmittedAtUseSite()); +      } else if (sub->InputAt(1)->IsConstant()) { +        locations->SetInAt(1, Location::RequiresFpuRegister());        } else {          locations->SetInAt(1, Location::Any());        } @@ -2918,6 +2922,8 @@ void LocationsBuilderX86::VisitMul(HMul* mul) {        locations->SetInAt(0, Location::RequiresFpuRegister());        if (mul->InputAt(1)->IsX86LoadFromConstantTable()) {          DCHECK(mul->InputAt(1)->IsEmittedAtUseSite()); +      } else if (mul->InputAt(1)->IsConstant()) { +        locations->SetInAt(1, Location::RequiresFpuRegister());        } else {          locations->SetInAt(1, Location::Any());        } @@ -3415,6 +3421,8 @@ void LocationsBuilderX86::VisitDiv(HDiv* div) {        locations->SetInAt(0, Location::RequiresFpuRegister());        if (div->InputAt(1)->IsX86LoadFromConstantTable()) {          DCHECK(div->InputAt(1)->IsEmittedAtUseSite()); +      } else if (div->InputAt(1)->IsConstant()) { +        locations->SetInAt(1, Location::RequiresFpuRegister());        } else {          locations->SetInAt(1, Location::Any());        }  |