summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2019-10-08 12:32:15 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-22 02:39:03 -0400
commitfd8b666acfee5524a2d7c8b845a3782f6a89bec7 (patch)
tree4ce0d732ef341bcffa721f6d25f2cf4dcd476fd8 /compiler/llvmGen
parentaa31ceaf7568802590f73a740ffbc8b800096342 (diff)
downloadhaskell-fd8b666acfee5524a2d7c8b845a3782f6a89bec7.tar.gz
Implement s390x LLVM backend.
This patch adds support for the s390x architecture for the LLVM code generator. The patch includes a register mapping of STG registers onto s390x machine registers which enables a registerised build.
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Data.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
index 70a04e6bc9..4c07f8ee8f 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
@@ -71,6 +71,7 @@ genLlvmData (sec, Statics lbl xs) = do
label <- strCLabel_llvm lbl
static <- mapM genData xs
lmsec <- llvmSection sec
+ platform <- getLlvmPlatform
let types = map getStatType static
strucTy = LMStruct types
@@ -79,7 +80,8 @@ genLlvmData (sec, Statics lbl xs) = do
struct = Just $ LMStaticStruc static tyAlias
link = linkage lbl
align = case sec of
- Section CString _ -> Just 1
+ Section CString _ -> if (platformArch platform == ArchS390X)
+ then Just 2 else Just 1
_ -> Nothing
const = if isSecConstant sec then Constant else Global
varDef = LMGlobalVar label tyAlias link lmsec align const