Commit ccbb6d16 by Sagar Thakur Committed by Jim Stichnoth

[Subzero][MIPS] Fix test nacl-other-intrinsics.ll

The test nacl-other-intrinsics.ll fails with an assertion failure: assert(SpillAreaAlignmentBytes <= MIPS32_STACK_ALIGNMENT_BYTES). This assertion triggers because MIPS32_STACK_ALIGNMENT_BYTES is 8 and SpillAreaAlignmentBytes is 16. The minimum required alignment of stack for MIPS32 is 8 bytes according to the ABI document. Since 16 is aligned to 8, we can safely keep the stack aligned to 16 bytes to fix the test. R=stichnot@chromium.org Review URL: https://codereview.chromium.org/2339683003 . Patch from Sagar Thakur <sagar.thakur@imgtec.com>.
parent d57ed5fa
...@@ -84,7 +84,7 @@ const char *getRegClassName(RegClass C) { ...@@ -84,7 +84,7 @@ const char *getRegClassName(RegClass C) {
} }
// Stack alignment // Stack alignment
constexpr uint32_t MIPS32_STACK_ALIGNMENT_BYTES = 8; constexpr uint32_t MIPS32_STACK_ALIGNMENT_BYTES = 16;
// Value is in bytes. Return Value adjusted to the next highest multiple of the // Value is in bytes. Return Value adjusted to the next highest multiple of the
// stack alignment required for the given type. // stack alignment required for the given type.
......
...@@ -65,7 +65,7 @@ entry: ...@@ -65,7 +65,7 @@ entry:
; ARM32: bl {{.*}} R_{{.*}} f1 ; ARM32: bl {{.*}} R_{{.*}} f1
; MIPS32-LABEL: fixed_416_align_16 ; MIPS32-LABEL: fixed_416_align_16
; MIPS32-OPT2: addiu sp,sp,-440 ; MIPS32-OPT2: addiu sp,sp,-448
; MIPS32-OPT2: addiu a0,sp,16 ; MIPS32-OPT2: addiu a0,sp,16
; MIPS32-OPTM1: addiu sp,sp,-448 ; MIPS32-OPTM1: addiu sp,sp,-448
; MIPS32-OPTM1: addiu [[REG:.*]],sp,16 ; MIPS32-OPTM1: addiu [[REG:.*]],sp,16
...@@ -96,7 +96,7 @@ entry: ...@@ -96,7 +96,7 @@ entry:
; ARM32: bl {{.*}} R_{{.*}} f1 ; ARM32: bl {{.*}} R_{{.*}} f1
; MIPS32-LABEL: fixed_416_align_32 ; MIPS32-LABEL: fixed_416_align_32
; MIPS32-OPT2: addiu sp,sp,-440 ; MIPS32-OPT2: addiu sp,sp,-448
; MIPS32-OPT2: addiu a0,sp,16 ; MIPS32-OPT2: addiu a0,sp,16
; MIPS32-OPTM1: addiu sp,sp,-448 ; MIPS32-OPTM1: addiu sp,sp,-448
; MIPS32-OPTM1: addiu [[REG:.*]],sp,16 ; MIPS32-OPTM1: addiu [[REG:.*]],sp,16
...@@ -130,7 +130,7 @@ entry: ...@@ -130,7 +130,7 @@ entry:
; ARM32: bl {{.*}} R_{{.*}} f1 ; ARM32: bl {{.*}} R_{{.*}} f1
; MIPS32-LABEL: fixed_351_align_16 ; MIPS32-LABEL: fixed_351_align_16
; MIPS32-OPT2: addiu sp,sp,-376 ; MIPS32-OPT2: addiu sp,sp,-384
; MIPS32-OPT2: addiu a0,sp,16 ; MIPS32-OPT2: addiu a0,sp,16
; MIPS32-OPTM1: addiu sp,sp,-384 ; MIPS32-OPTM1: addiu sp,sp,-384
; MIPS32-OPTM1: addiu [[REG:.*]],sp,16 ; MIPS32-OPTM1: addiu [[REG:.*]],sp,16
...@@ -161,7 +161,7 @@ entry: ...@@ -161,7 +161,7 @@ entry:
; ARM32: bl {{.*}} R_{{.*}} f1 ; ARM32: bl {{.*}} R_{{.*}} f1
; MIPS32-LABEL: fixed_351_align_32 ; MIPS32-LABEL: fixed_351_align_32
; MIPS32-OPT2: addiu sp,sp,-376 ; MIPS32-OPT2: addiu sp,sp,-384
; MIPS32-OPT2: addiu a0,sp,16 ; MIPS32-OPT2: addiu a0,sp,16
; MIPS32-OPTM1: addiu sp,sp,-384 ; MIPS32-OPTM1: addiu sp,sp,-384
; MIPS32-OPTM1: addiu [[REG:.*]],sp,16 ; MIPS32-OPTM1: addiu [[REG:.*]],sp,16
...@@ -197,8 +197,8 @@ entry: ...@@ -197,8 +197,8 @@ entry:
; ARM32: bl {{.*}} R_{{.*}} f2 ; ARM32: bl {{.*}} R_{{.*}} f2
; MIPS32-LABEL: variable_n_align_16 ; MIPS32-LABEL: variable_n_align_16
; MIPS32: addiu [[REG:.*]],{{.*}},7 ; MIPS32: addiu [[REG:.*]],{{.*}},15
; MIPS32: li [[REG1:.*]],-8 ; MIPS32: li [[REG1:.*]],-16
; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]] ; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]]
; MIPS32: subu [[REG3:.*]],sp,[[REG2:.*]] ; MIPS32: subu [[REG3:.*]],sp,[[REG2:.*]]
; MIPS32: li [[REG4:.*]],-16 ; MIPS32: li [[REG4:.*]],-16
...@@ -242,8 +242,8 @@ entry: ...@@ -242,8 +242,8 @@ entry:
; ARM32: pop {fp, lr} ; ARM32: pop {fp, lr}
; MIPS32-LABEL: variable_n_align_32 ; MIPS32-LABEL: variable_n_align_32
; MIPS32: addiu [[REG:.*]],{{.*}},7 ; MIPS32: addiu [[REG:.*]],{{.*}},15
; MIPS32: li [[REG1:.*]],-8 ; MIPS32: li [[REG1:.*]],-16
; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]] ; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]]
; MIPS32: subu [[REG3:.*]],sp,[[REG2]] ; MIPS32: subu [[REG3:.*]],sp,[[REG2]]
; MIPS32: li [[REG4:.*]],-32 ; MIPS32: li [[REG4:.*]],-32
...@@ -271,8 +271,8 @@ entry: ...@@ -271,8 +271,8 @@ entry:
; ARM32: sub sp, sp, r0 ; ARM32: sub sp, sp, r0
; MIPS32-LABEL: align0 ; MIPS32-LABEL: align0
; MIPS32: addiu [[REG:.*]],{{.*}},7 ; MIPS32: addiu [[REG:.*]],{{.*}},15
; MIPS32: li [[REG1:.*]],-8 ; MIPS32: li [[REG1:.*]],-16
; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]] ; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]]
; MIPS32: subu {{.*}},sp,[[REG2]] ; MIPS32: subu {{.*}},sp,[[REG2]]
; MIPS32: addiu sp,sp,-16 ; MIPS32: addiu sp,sp,-16
...@@ -309,8 +309,8 @@ entry: ...@@ -309,8 +309,8 @@ entry:
; ARM32: sub sp, sp, r0 ; ARM32: sub sp, sp, r0
; MIPS32-LABEL: align1MB ; MIPS32-LABEL: align1MB
; MIPS32: addiu [[REG:.*]],{{.*}},7 ; MIPS32: addiu [[REG:.*]],{{.*}},15
; MIPS32: li [[REG1:.*]],-8 ; MIPS32: li [[REG1:.*]],-16
; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]] ; MIPS32: and [[REG2:.*]],[[REG]],[[REG1]]
; MIPS32: subu [[REG3:.*]],sp,[[REG2]] ; MIPS32: subu [[REG3:.*]],sp,[[REG2]]
; MIPS32: lui [[REG4:.*]],0xfff0 ; MIPS32: lui [[REG4:.*]],0xfff0
...@@ -344,8 +344,8 @@ entry: ...@@ -344,8 +344,8 @@ entry:
; ARM32: sub sp, sp, r0 ; ARM32: sub sp, sp, r0
; MIPS32-LABEL: align512MB ; MIPS32-LABEL: align512MB
; MIPS32: addiu [[REG:.*]],{{.*}},7 ; MIPS32: addiu [[REG:.*]],{{.*}},15
; MIPS32: li [[REG2:.*]],-8 ; MIPS32: li [[REG2:.*]],-16
; MIPS32: and [[REG3:.*]],[[REG]],[[REG2]] ; MIPS32: and [[REG3:.*]],[[REG]],[[REG2]]
; MIPS32: subu [[REG4:.*]],sp,[[REG3]] ; MIPS32: subu [[REG4:.*]],sp,[[REG3]]
; MIPS32: lui [[REG5:.*]],0xe000 ; MIPS32: lui [[REG5:.*]],0xe000
......
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