summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/Mips/MipsSubtarget.h4
-rw-r--r--llvm/test/CodeGen/Mips/stack-alignment.ll4
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MipsSubtarget.h b/llvm/lib/Target/Mips/MipsSubtarget.h
index cce3b8c4c8d..ef04c931138 100644
--- a/llvm/lib/Target/Mips/MipsSubtarget.h
+++ b/llvm/lib/Target/Mips/MipsSubtarget.h
@@ -295,7 +295,9 @@ public:
// really use them if in addition we are in mips16 mode
static bool useConstantIslands();
- unsigned stackAlignment() const { return hasMips64() ? 16 : 8; }
+ unsigned stackAlignment() const {
+ return isABI_N32() || isABI_N64() ? 16 : 8;
+ }
// Grab relocation model
Reloc::Model getRelocationModel() const;
diff --git a/llvm/test/CodeGen/Mips/stack-alignment.ll b/llvm/test/CodeGen/Mips/stack-alignment.ll
index b18f96695ff..619550fa75b 100644
--- a/llvm/test/CodeGen/Mips/stack-alignment.ll
+++ b/llvm/test/CodeGen/Mips/stack-alignment.ll
@@ -1,9 +1,11 @@
; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
; RUN: llc -march=mipsel -mattr=+fp64 < %s | FileCheck %s -check-prefix=32
+; RUN: llc -march=mips64el -mcpu=mips3 < %s | FileCheck %s -check-prefix=64
+; RUN: llc -march=mips64el -mcpu=mips4 < %s | FileCheck %s -check-prefix=64
; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
; 32: addiu $sp, $sp, -8
-; 64: addiu $sp, $sp, -16
+; 64: daddiu $sp, $sp, -16
define i32 @foo1() #0 {
entry:
OpenPOWER on IntegriCloud