summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmPrim.hs
diff options
context:
space:
mode:
authorMichal Terepeta <michal.terepeta@gmail.com>2015-07-20 15:43:31 +0200
committerBen Gamari <ben@smart-cactus.org>2015-07-20 16:43:34 +0200
commit82ffc80df573512f788524c4616db3c08fc9f125 (patch)
treebf35684068e0376bb30013d22288a81966427965 /compiler/codeGen/StgCmmPrim.hs
parent029367e5894d4ac3ea3845f39f2cc1b5a6a9fac1 (diff)
downloadhaskell-82ffc80df573512f788524c4616db3c08fc9f125.tar.gz
LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp
This adds support MO_U_Mul2 to the LLVM backend by simply using 'mul' instruction but operating at twice the bit width (e.g., for 64 bit words we will generate mul that operates on 128 bits and then extract the two 64 bit values for the result of the CallishMachOp). Test Plan: validate Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1068 GHC Trac Issues: #9430
Diffstat (limited to 'compiler/codeGen/StgCmmPrim.hs')
-rw-r--r--compiler/codeGen/StgCmmPrim.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index 563f6dcc4a..243e2a32ac 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -823,7 +823,8 @@ callishPrimOpSupported dflags op
|| llvm -> Left (MO_SubIntC (wordWidth dflags))
| otherwise -> Right genericIntSubCOp
- WordMul2Op | ncg && x86ish -> Left (MO_U_Mul2 (wordWidth dflags))
+ WordMul2Op | ncg && x86ish
+ || llvm -> Left (MO_U_Mul2 (wordWidth dflags))
| otherwise -> Right genericWordMul2Op
_ -> pprPanic "emitPrimOp: can't translate PrimOp " (ppr op)