Commit f2674646 by Karl Schimpf

Fix line spacing for push instructions in ARM assembly.

Removes blank line after push instructions. BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1439683002 .
parent daf096cd
...@@ -1214,6 +1214,7 @@ void InstARM32Push::emit(const Cfg *Func) const { ...@@ -1214,6 +1214,7 @@ void InstARM32Push::emit(const Cfg *Func) const {
} }
} }
Ostream &Str = Func->getContext()->getStrEmit(); Ostream &Str = Func->getContext()->getStrEmit();
bool NeedNewline = false;
for (SizeT i = getSrcSize(); i > 0; --i) { for (SizeT i = getSrcSize(); i > 0; --i) {
Operand *Op = getSrc(i - 1); Operand *Op = getSrc(i - 1);
if (isScalarIntegerType(Op->getType())) if (isScalarIntegerType(Op->getType()))
...@@ -1222,10 +1223,15 @@ void InstARM32Push::emit(const Cfg *Func) const { ...@@ -1222,10 +1223,15 @@ void InstARM32Push::emit(const Cfg *Func) const {
<< "vpush" << "vpush"
<< "\t{"; << "\t{";
Op->emit(Func); Op->emit(Func);
Str << "}\n"; Str << "}";
NeedNewline = true;
} }
if (IntegerCount != 0) { if (IntegerCount != 0) {
startNextInst(Func); startNextInst(Func);
if (NeedNewline) {
Str << "\n";
NeedNewline = false;
}
Str << "\t" Str << "\t"
<< "push" << "push"
<< "\t{"; << "\t{";
...@@ -1239,8 +1245,10 @@ void InstARM32Push::emit(const Cfg *Func) const { ...@@ -1239,8 +1245,10 @@ void InstARM32Push::emit(const Cfg *Func) const {
PrintComma = true; PrintComma = true;
} }
} }
Str << "}\n"; Str << "}";
NeedNewline = true;
} }
assert(NeedNewline); // caller will add the newline
} }
void InstARM32Push::emitIAS(const Cfg *Func) const { void InstARM32Push::emitIAS(const Cfg *Func) const {
......
...@@ -27,17 +27,17 @@ define internal i32 @AllocBigAlign() { ...@@ -27,17 +27,17 @@ define internal i32 @AllocBigAlign() {
} }
; ASM-LABEL:AllocBigAlign: ; ASM-LABEL:AllocBigAlign:
; ASM:.LAllocBigAlign$__0: ; ASM-NEXT:.LAllocBigAlign$__0:
; ASM: push {fp} ; ASM-NEXT: push {fp}
; ASM: mov fp, sp ; ASM-NEXT: mov fp, sp
; ASM: sub sp, sp, #12 ; ASM-NEXT: sub sp, sp, #12
; ASM: bic sp, sp, #31 ; ASM-NEXT: bic sp, sp, #31
; ASM: sub sp, sp, #32 ; ASM-NEXT: sub sp, sp, #32
; ASM: mov r0, sp ; ASM-NEXT: mov r0, sp
; ASM: mov sp, fp ; ASM-NEXT: mov sp, fp
; ASM: pop {fp} ; ASM-NEXT: pop {fp}
; ASM: # fp = def.pseudo ; ASM-NEXT: # fp = def.pseudo
; ASM: bx lr ; ASM-NEXT: bx lr
; DIS-LABEL:00000000 <AllocBigAlign>: ; DIS-LABEL:00000000 <AllocBigAlign>:
; DIS-NEXT: 0: e52db004 ; DIS-NEXT: 0: e52db004
......
...@@ -31,11 +31,12 @@ define internal void @SinglePushPop() { ...@@ -31,11 +31,12 @@ define internal void @SinglePushPop() {
; ASM-LABEL:SinglePushPop: ; ASM-LABEL:SinglePushPop:
; ASM-NEXT:.LSinglePushPop$__0: ; ASM-NEXT:.LSinglePushPop$__0:
; ASM-NEXT: push {lr} ; ASM-NEXT: push {lr}
; ASM: sub sp, sp, #12 ; ASM-NEXT: sub sp, sp, #12
; ASM-NEXT: bl DoSomething ; ASM-NEXT: bl DoSomething
; ASM: add sp, sp, #12 ; ASM-NEXT: add sp, sp, #12
; ASM-NEXT: pop {lr} ; ASM-NEXT: pop {lr}
; ASM: bx lr ; ASM-NEXT: # lr = def.pseudo
; ASM-NEXT: bx lr
; DIS-LABEL:00000000 <SinglePushPop>: ; DIS-LABEL:00000000 <SinglePushPop>:
; DIS-NEXT: 0: e52de004 ; DIS-NEXT: 0: e52de004
...@@ -86,15 +87,18 @@ define internal i32 @MultPushPop(i32 %v1, i32 %v2) { ...@@ -86,15 +87,18 @@ define internal i32 @MultPushPop(i32 %v1, i32 %v2) {
; ASM-LABEL:MultPushPop: ; ASM-LABEL:MultPushPop:
; ASM-NEXT:.LMultPushPop$__0: ; ASM-NEXT:.LMultPushPop$__0:
; ASM-NEXT: push {r4, r5, lr} ; ASM-NEXT: push {r4, r5, lr}
; ASM: sub sp, sp, #4 ; ASM-NEXT: sub sp, sp, #4
; ASM-NEXT: mov r4, r0 ; ASM-NEXT: mov r4, r0
; ASM-NEXT: mov r5, r1 ; ASM-NEXT: mov r5, r1
; ASM-NEXT: bl DoSomething ; ASM-NEXT: bl DoSomething
; ASM: add r4, r4, r5 ; ASM-NEXT: add r4, r4, r5
; ASM-NEXT: mov r0, r4 ; ASM-NEXT: mov r0, r4
; ASM-NEXT: add sp, sp, #4 ; ASM-NEXT: add sp, sp, #4
; ASM-NEXT: pop {r4, r5, lr} ; ASM-NEXT: pop {r4, r5, lr}
; ASM: bx lr ; ASM-NEXT: # r4 = def.pseudo
; ASM-NEXT: # r5 = def.pseudo
; ASM-NEXT: # lr = def.pseudo
; ASM-NEXT: bx lr
; DIS-LABEL:00000020 <MultPushPop>: ; DIS-LABEL:00000020 <MultPushPop>:
; DIS-NEXT: 20: e92d4030 ; DIS-NEXT: 20: e92d4030
......
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