summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm
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/Cmm
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/Cmm')
-rw-r--r--compiler/GHC/Cmm/MachOp.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/compiler/GHC/Cmm/MachOp.hs b/compiler/GHC/Cmm/MachOp.hs
index b91263ce47..b5aa278ad7 100644
--- a/compiler/GHC/Cmm/MachOp.hs
+++ b/compiler/GHC/Cmm/MachOp.hs
@@ -586,6 +586,41 @@ data CallishMachOp
| MO_F32_Fabs
| MO_F32_Sqrt
+ -- 64-bit int/word ops for when they exceed the native word size
+ -- (i.e. on 32-bit architectures)
+ | MO_I64_ToI
+ | MO_I64_FromI
+ | MO_W64_ToW
+ | MO_W64_FromW
+
+ | MO_x64_Neg
+ | MO_x64_Add
+ | MO_x64_Sub
+ | MO_x64_Mul
+ | MO_I64_Quot
+ | MO_I64_Rem
+ | MO_W64_Quot
+ | MO_W64_Rem
+
+ | MO_x64_And
+ | MO_x64_Or
+ | MO_x64_Xor
+ | MO_x64_Not
+ | MO_x64_Shl
+ | MO_I64_Shr
+ | MO_W64_Shr
+
+ | MO_x64_Eq
+ | MO_x64_Ne
+ | MO_I64_Ge
+ | MO_I64_Gt
+ | MO_I64_Le
+ | MO_I64_Lt
+ | MO_W64_Ge
+ | MO_W64_Gt
+ | MO_W64_Le
+ | MO_W64_Lt
+
| MO_UF_Conv Width
| MO_S_Mul2 Width