Fredrik Fornwall
9 years ago
4 changed files with 86 additions and 5 deletions
@ -0,0 +1,30 @@ |
|||
From |
|||
https://github.com/erikd/ghc-llvm-next/blob/llvm-3.8/patches/01-bitcast.patch |
|||
|
|||
diff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs ./compiler/llvmGen/Llvm/PpLlvm.hs
|
|||
--- ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs 2016-05-16 13:08:53.000000000 -0400
|
|||
+++ ./compiler/llvmGen/Llvm/PpLlvm.hs 2016-06-23 16:59:36.113778783 -0400
|
|||
@@ -73,7 +73,7 @@
|
|||
Nothing -> empty |
|||
|
|||
rhs = case dat of |
|||
- Just stat -> ppr stat
|
|||
+ Just stat -> pprSpecialStatic stat
|
|||
Nothing -> ppr (pLower $ getVarType var) |
|||
|
|||
-- Position of linkage is different for aliases. |
|||
diff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs ./compiler/llvmGen/Llvm/Types.hs
|
|||
--- ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs 2016-05-16 13:08:53.000000000 -0400
|
|||
+++ ./compiler/llvmGen/Llvm/Types.hs 2016-06-23 17:00:14.569166114 -0400
|
|||
@@ -175,6 +175,11 @@
|
|||
ppr (LMSub s1 s2) |
|||
= pprStaticArith s1 s2 (sLit "sub") (sLit "fsub") "LMSub" |
|||
|
|||
+pprSpecialStatic :: LlvmStatic -> SDoc
|
|||
+pprSpecialStatic (LMBitc v t) =
|
|||
+ ppr (pLower t) <> text ", bitcast (" <> ppr v <> text " to " <> ppr t <> char ')'
|
|||
+pprSpecialStatic stat = ppr stat
|
|||
+
|
|||
pprStaticArith :: LlvmStatic -> LlvmStatic -> LitString -> LitString -> String -> SDoc |
|||
pprStaticArith s1 s2 int_op float_op op_name = |
|||
let ty1 = getStatType s1 |
@ -0,0 +1,32 @@ |
|||
diff -u -r ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs ./compiler/llvmGen/LlvmCodeGen/Ppr.hs
|
|||
--- ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs 2016-05-16 13:08:53.000000000 -0400
|
|||
+++ ./compiler/llvmGen/LlvmCodeGen/Ppr.hs 2016-06-23 17:54:27.073877144 -0400
|
|||
@@ -44,12 +44,18 @@
|
|||
Platform { platformArch = ArchX86, platformOS = OSLinux } -> |
|||
text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32\"" |
|||
$+$ text "target triple = \"i386-pc-linux-gnu\"" |
|||
+ Platform { platformArch = ArchX86, platformOS = OSAndroid } ->
|
|||
+ text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32\""
|
|||
+ $+$ text "target triple = \"i386-pc-linux-android\""
|
|||
Platform { platformArch = ArchX86_64, platformOS = OSDarwin } -> |
|||
text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\"" |
|||
$+$ text "target triple = \"x86_64-apple-darwin10.0.0\"" |
|||
Platform { platformArch = ArchX86_64, platformOS = OSLinux } -> |
|||
text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\"" |
|||
$+$ text "target triple = \"x86_64-linux-gnu\"" |
|||
+ Platform { platformArch = ArchX86_64, platformOS = OSAndroid } ->
|
|||
+ text "target datalayout = \"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64\""
|
|||
+ $+$ text "target triple = \"x86_64-linux-android\""
|
|||
Platform { platformArch = ArchARM {}, platformOS = OSLinux } -> |
|||
text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\"" |
|||
$+$ text "target triple = \"armv6-unknown-linux-gnueabihf\"" |
|||
@@ -71,6 +77,9 @@
|
|||
Platform { platformArch = ArchARM64, platformOS = OSLinux } -> |
|||
text "target datalayout = \"e-m:e-i64:64-i128:128-n32:64-S128\"" |
|||
$+$ text "target triple = \"aarch64-unknown-linux-gnu\"" |
|||
+ Platform { platformArch = ArchARM64, platformOS = OSAndroid } ->
|
|||
+ text "target datalayout = \"e-m:e-i64:64-i128:128-n32:64-S128\""
|
|||
+ $+$ text "target triple = \"aarch64-unknown-linux-android\""
|
|||
_ -> |
|||
if platformIsCrossCompiling platform |
|||
then panic "LlvmCodeGen.Ppr: Cross compiling without valid target info." |
@ -0,0 +1,12 @@ |
|||
diff -u -r ../ghc-8.0.1/configure ./configure
|
|||
--- ../ghc-8.0.1/configure 2016-05-17 12:36:51.000000000 -0400
|
|||
+++ ./configure 2016-06-23 16:46:28.690875698 -0400
|
|||
@@ -7126,7 +7126,7 @@
|
|||
# tools we are looking for. In the past, GHC supported a number of |
|||
# versions of LLVM simultaneously, but that stopped working around |
|||
# 3.5/3.6 release of LLVM. |
|||
-LlvmVersion=3.7
|
|||
+LlvmVersion=3.8
|
|||
|
|||
sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/') |
|||
|
Loading…
Reference in new issue