summaryrefslogtreecommitdiff
path: root/compiler/optimizing/parallel_move_resolver.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-04-15 11:56:51 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-04-15 12:53:42 +0100
commit9021825d1e73998b99c81e89c73796f6f2845471 (patch)
tree13e1038931cbb8bf8b8d0f4e3f51553ba1bfa983 /compiler/optimizing/parallel_move_resolver.h
parent858d28ca2e73a785977f53141e775a7d4841b89d (diff)
Type MoveOperands.
The ParallelMoveResolver implementation needs to know if a move is for 64bits or not, to handle swaps correctly. Bug found, and test case courtesy of Serguei I. Katkov. Change-Id: I9a0917a1cfed398c07e57ad6251aea8c9b0b8506
Diffstat (limited to 'compiler/optimizing/parallel_move_resolver.h')
-rw-r--r--compiler/optimizing/parallel_move_resolver.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/compiler/optimizing/parallel_move_resolver.h b/compiler/optimizing/parallel_move_resolver.h
index 173cffc71e..36ce575609 100644
--- a/compiler/optimizing/parallel_move_resolver.h
+++ b/compiler/optimizing/parallel_move_resolver.h
@@ -92,12 +92,18 @@ class ParallelMoveResolver : public ValueObject {
// other moves to satisfy dependencies).
//
// Return whether another move in the dependency cycle needs to swap. This
- // is to handle pair swaps, where we want the pair to swap first to avoid
- // building pairs that are unexpected by the code generator. For example, if
- // we were to swap R1 with R2, we would need to update all locations using
- // R2 to R1. So a (R2,R3) pair register could become (R1,R3). We could make
- // the code generator understand such pairs, but it's easier and cleaner to
- // just not create such pairs and exchange pairs in priority.
+ // is to handle 64bits swaps:
+ // 1) In the case of register pairs, where we want the pair to swap first to avoid
+ // building pairs that are unexpected by the code generator. For example, if
+ // we were to swap R1 with R2, we would need to update all locations using
+ // R2 to R1. So a (R2,R3) pair register could become (R1,R3). We could make
+ // the code generator understand such pairs, but it's easier and cleaner to
+ // just not create such pairs and exchange pairs in priority.
+ // 2) Even when the architecture does not have pairs, we must handle 64bits swaps
+ // first. Consider the case: (R0->R1) (R1->S) (S->R0), where 'S' is a single
+ // stack slot. If we end up swapping S and R0, S will only contain the low bits
+ // of R0. If R0->R1 is for a 64bits instruction, R1 will therefore not contain
+ // the right value.
MoveOperands* PerformMove(size_t index);
DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolver);