Index: src/compiler/move-optimizer.cc |
diff --git a/src/compiler/move-optimizer.cc b/src/compiler/move-optimizer.cc |
index 4753d15979a99fcb0f39e59db9ab3f6a1d979938..0c1132e6af6a572309ff9cddb79fbd8e42dc1f0f 100644 |
--- a/src/compiler/move-optimizer.cc |
+++ b/src/compiler/move-optimizer.cc |
@@ -32,26 +32,41 @@ bool Blocks(const OperandSet& set, const InstructionOperand& operand) { |
// Only FP registers on archs with non-simple aliasing need extra checks. |
if (!operand.IsFPRegister() || kSimpleFPAliasing) return false; |
+ // Check operand against operands of other FP types for interference. |
const LocationOperand& loc = LocationOperand::cast(operand); |
MachineRepresentation rep = loc.representation(); |
- MachineRepresentation other_fp_rep = rep == MachineRepresentation::kFloat64 |
- ? MachineRepresentation::kFloat32 |
- : MachineRepresentation::kFloat64; |
+ MachineRepresentation other_rep1, other_rep2; |
+ switch (rep) { |
+ case MachineRepresentation::kFloat32: |
+ other_rep1 = MachineRepresentation::kFloat64; |
+ other_rep2 = MachineRepresentation::kSimd128; |
+ break; |
+ case MachineRepresentation::kFloat64: |
+ other_rep1 = MachineRepresentation::kFloat32; |
+ other_rep2 = MachineRepresentation::kSimd128; |
+ break; |
+ case MachineRepresentation::kSimd128: |
+ other_rep1 = MachineRepresentation::kFloat32; |
+ other_rep2 = MachineRepresentation::kFloat64; |
+ break; |
+ default: |
+ UNREACHABLE(); |
+ break; |
+ } |
const RegisterConfiguration* config = RegisterConfiguration::Turbofan(); |
- if (config->fp_aliasing_kind() != RegisterConfiguration::COMBINE) { |
- // Overlap aliasing case. |
- return set.find(LocationOperand(loc.kind(), loc.location_kind(), |
- other_fp_rep, loc.register_code())) != |
- set.end(); |
- } |
- // Combine aliasing case. |
- int alias_base_index = -1; |
- int aliases = config->GetAliases(rep, loc.register_code(), other_fp_rep, |
- &alias_base_index); |
+ int base = -1; |
+ int aliases = config->GetAliases(rep, loc.register_code(), other_rep1, &base); |
+ DCHECK(aliases > 0 || (aliases == 0 && base == -1)); |
+ while (aliases--) { |
+ if (set.find(LocationOperand(loc.kind(), loc.location_kind(), other_rep1, |
+ base + aliases)) != set.end()) |
+ return true; |
+ } |
+ aliases = config->GetAliases(rep, loc.register_code(), other_rep2, &base); |
+ DCHECK(aliases > 0 || (aliases == 0 && base == -1)); |
while (aliases--) { |
- int aliased_reg = alias_base_index + aliases; |
- if (set.find(LocationOperand(loc.kind(), loc.location_kind(), other_fp_rep, |
- aliased_reg)) != set.end()) |
+ if (set.find(LocationOperand(loc.kind(), loc.location_kind(), other_rep2, |
+ base + aliases)) != set.end()) |
return true; |
} |
return false; |