summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-07-19 04:06:33 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-08 02:57:55 -0400
commitbeef61351b240967b49169d27a9a19565cf3c4af (patch)
tree7ef77954391b2babe2772144a5e37cc8d8b4231d /compiler/GHC/StgToCmm
parent6ea9b3ee4454b87ecc017d89f131a80f57ef65aa (diff)
downloadhaskell-beef61351b240967b49169d27a9a19565cf3c4af.tar.gz
Let LLVM and C handle > native size arithmetic
NCG needs to call slow FFI functions where we "borrow" the C compiler's implementation, but there is no reason why we need to do that for LLVM, or the unregisterized backend where everything is via C anyways!
Diffstat (limited to 'compiler/GHC/StgToCmm')
-rw-r--r--compiler/GHC/StgToCmm/Prim.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs
index ab1ac89576..dff86341b1 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -1707,6 +1707,8 @@ emitPrimOp dflags primop = case primop of
-> PrimopCmmEmit
opTranslate64 args mkMop callish =
case platformWordSize platform of
+ -- LLVM and C `can handle larger than native size arithmetic natively.
+ _ | not ncg -> opTranslate args $ mkMop W64
PW4 -> opCallish args callish
PW8 -> opTranslate args $ mkMop W64