From 2fc7101e3c2bdae65104becd8fd091d85d5ab60f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 19 Dec 2013 02:21:16 +0000 Subject: Add stack alignment information for Sparc. This matches the data in clang which was added by Jakob Stoklund Olesen in r179596. Thanks for erikjv on irc for pointing me to the relevant documents: http://sparc.com/standards/64.psabi.1.35.ps.Z page 25: Every stack frame must be 16-byte aligned. http://sparc.com/standards/psABI3rd.pdf page 3-10: Although the architecture requires only word alignment, software convention and the operating system require every stack frame to be doubleword aligned. I tried to add a test, but it looks like sparc doesn't implement dynamic stack realignment. This will be tested in clang shortly. llvm-svn: 197646 --- llvm/lib/Target/Sparc/SparcTargetMachine.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target/Sparc/SparcTargetMachine.cpp') diff --git a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp b/llvm/lib/Target/Sparc/SparcTargetMachine.cpp index 172bb66b7c8..ac26765aecf 100644 --- a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/llvm/lib/Target/Sparc/SparcTargetMachine.cpp @@ -41,6 +41,11 @@ static std::string computeDataLayout(const SparcSubtarget &ST) { else Ret += "-f128:64-n32"; + if (ST.is64Bit()) + Ret += "-S128"; + else + Ret += "-S64"; + return Ret; } -- cgit v1.2.3