Fix push/pop emit methods for ARM assembler.
These two methods introduce multiple instructions. Between each
instruction a newline must be inserted, and a call to startNextInt().
This CL makes sure both cases are met.
BUG=None
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1441023002 .
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 7363617..5507b63 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -1117,9 +1117,9 @@
for (const Operand *Op : Dests) {
if (isScalarIntegerType(Op->getType()))
continue;
- startNextInst(Func);
if (NeedNewline) {
Str << "\n";
+ startNextInst(Func);
NeedNewline = false;
}
Str << "\t"
@@ -1227,6 +1227,11 @@
Operand *Op = getSrc(i - 1);
if (isScalarIntegerType(Op->getType()))
continue;
+ if (NeedNewline) {
+ Str << "\n";
+ startNextInst(Func);
+ NeedNewline = false;
+ }
Str << "\t"
<< "vpush"
<< "\t{";
@@ -1235,9 +1240,9 @@
NeedNewline = true;
}
if (IntegerCount != 0) {
- startNextInst(Func);
if (NeedNewline) {
Str << "\n";
+ startNextInst(Func);
NeedNewline = false;
}
Str << "\t"
diff --git a/tests_lit/assembler/arm32/mul.ll b/tests_lit/assembler/arm32/mul.ll
index ad55ef0..23791cf 100644
--- a/tests_lit/assembler/arm32/mul.ll
+++ b/tests_lit/assembler/arm32/mul.ll
@@ -49,9 +49,10 @@
; ASM-NEXT: mul r3, r0, r3
; ASM-NEXT: mla r1, r2, r1, r3
; ASM-NEXT: umull r0, r2, r0, r2
-; ASM: add r2, r2, r1
+; ASM-NEXT: # r2 = def.pseudo r0
+; ASM-NEXT: add r2, r2, r1
; ASM-NEXT: mov r1, r2
-; ASM: bx lr
+; ASM-NEXT: bx lr
; DIS-LABEL:00000010 <MulTwoI64Regs>: