Commit 799ba673 by Karl Schimpf

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 .
parent bb0bacfd
...@@ -1117,9 +1117,9 @@ void InstARM32Pop::emit(const Cfg *Func) const { ...@@ -1117,9 +1117,9 @@ void InstARM32Pop::emit(const Cfg *Func) const {
for (const Operand *Op : Dests) { for (const Operand *Op : Dests) {
if (isScalarIntegerType(Op->getType())) if (isScalarIntegerType(Op->getType()))
continue; continue;
startNextInst(Func);
if (NeedNewline) { if (NeedNewline) {
Str << "\n"; Str << "\n";
startNextInst(Func);
NeedNewline = false; NeedNewline = false;
} }
Str << "\t" Str << "\t"
...@@ -1227,6 +1227,11 @@ void InstARM32Push::emit(const Cfg *Func) const { ...@@ -1227,6 +1227,11 @@ void InstARM32Push::emit(const Cfg *Func) const {
Operand *Op = getSrc(i - 1); Operand *Op = getSrc(i - 1);
if (isScalarIntegerType(Op->getType())) if (isScalarIntegerType(Op->getType()))
continue; continue;
if (NeedNewline) {
Str << "\n";
startNextInst(Func);
NeedNewline = false;
}
Str << "\t" Str << "\t"
<< "vpush" << "vpush"
<< "\t{"; << "\t{";
...@@ -1235,9 +1240,9 @@ void InstARM32Push::emit(const Cfg *Func) const { ...@@ -1235,9 +1240,9 @@ void InstARM32Push::emit(const Cfg *Func) const {
NeedNewline = true; NeedNewline = true;
} }
if (IntegerCount != 0) { if (IntegerCount != 0) {
startNextInst(Func);
if (NeedNewline) { if (NeedNewline) {
Str << "\n"; Str << "\n";
startNextInst(Func);
NeedNewline = false; NeedNewline = false;
} }
Str << "\t" Str << "\t"
......
...@@ -49,9 +49,10 @@ define internal i64 @MulTwoI64Regs(i64 %a, i64 %b) { ...@@ -49,9 +49,10 @@ define internal i64 @MulTwoI64Regs(i64 %a, i64 %b) {
; ASM-NEXT: mul r3, r0, r3 ; ASM-NEXT: mul r3, r0, r3
; ASM-NEXT: mla r1, r2, r1, r3 ; ASM-NEXT: mla r1, r2, r1, r3
; ASM-NEXT: umull r0, r2, r0, r2 ; 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-NEXT: mov r1, r2
; ASM: bx lr ; ASM-NEXT: bx lr
; DIS-LABEL:00000010 <MulTwoI64Regs>: ; DIS-LABEL:00000010 <MulTwoI64Regs>:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment