summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToC.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-07-07 18:47:25 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-15 23:29:09 -0400
commit41d6cfc4d36ba93d82f16f9a83ea69f4e02c3810 (patch)
tree067308ecd598d42523238a96ac400a40edbe9f28 /compiler/GHC/CmmToC.hs
parentde98a0ce8f184c9653477ee41602f999c7a381e1 (diff)
downloadhaskell-41d6cfc4d36ba93d82f16f9a83ea69f4e02c3810.tar.gz
Add Word64#/Int64# primops
Word64#/Int64# are only used on 32-bit architectures. Before this patch, operations on these types were directly using the FFI. Now we use real primops that are then lowered into ccalls. The advantage of doing this is that we can now perform constant folding on Word64#/Int64# (#19024). Most of this work was done by John Ericson in !3658. However this patch doesn't go as far as e.g. changing Word64 to always be using Word64#. Noticeable performance improvements T9203(normal) run/alloc 89870808.0 66662456.0 -25.8% GOOD haddock.Cabal(normal) run/alloc 14215777340.8 12780374172.0 -10.1% GOOD haddock.base(normal) run/alloc 15420020877.6 13643834480.0 -11.5% GOOD Metric Decrease: T9203 haddock.Cabal haddock.base
Diffstat (limited to 'compiler/GHC/CmmToC.hs')
-rw-r--r--compiler/GHC/CmmToC.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index 4e828e29f4..8349393f0d 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -861,6 +861,35 @@ pprCallishMachOp_for_C mop
(MO_Prefetch_Data _ ) -> unsupported
--- we could support prefetch via "__builtin_prefetch"
--- Not adding it for now
+ MO_I64_ToI -> unsupported
+ MO_I64_FromI -> unsupported
+ MO_W64_ToW -> unsupported
+ MO_W64_FromW -> unsupported
+ MO_x64_Neg -> unsupported
+ MO_x64_Add -> unsupported
+ MO_x64_Sub -> unsupported
+ MO_x64_Mul -> unsupported
+ MO_I64_Quot -> unsupported
+ MO_I64_Rem -> unsupported
+ MO_W64_Quot -> unsupported
+ MO_W64_Rem -> unsupported
+ MO_x64_And -> unsupported
+ MO_x64_Or -> unsupported
+ MO_x64_Xor -> unsupported
+ MO_x64_Not -> unsupported
+ MO_x64_Shl -> unsupported
+ MO_I64_Shr -> unsupported
+ MO_W64_Shr -> unsupported
+ MO_x64_Eq -> unsupported
+ MO_x64_Ne -> unsupported
+ MO_I64_Ge -> unsupported
+ MO_I64_Gt -> unsupported
+ MO_I64_Le -> unsupported
+ MO_I64_Lt -> unsupported
+ MO_W64_Ge -> unsupported
+ MO_W64_Gt -> unsupported
+ MO_W64_Le -> unsupported
+ MO_W64_Lt -> unsupported
where unsupported = panic ("pprCallishMachOp_for_C: " ++ show mop
++ " not supported!")