summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorMichal Terepeta <michal.terepeta@gmail.com>2015-08-03 08:41:13 +0200
committerBen Gamari <ben@smart-cactus.org>2015-08-03 08:41:32 +0200
commit92f5385d8b2be50848a2496199a481f299f4b53a (patch)
treee335893d9ff65b3df9f34dd5191b7a785eeeabfb /compiler/codeGen
parent37227d3400549c2a6844dfb8c34c0738edc69ecc (diff)
downloadhaskell-92f5385d8b2be50848a2496199a481f299f4b53a.tar.gz
Support MO_U_QuotRem2 in LLVM backend
This adds support for MO_U_QuotRem2 in LLVM backend. Similarly to MO_U_Mul2 we use the standard LLVM instructions (in this case 'udiv' and 'urem') but do the computation on double the word width (e.g., for 64-bit we will do them on 128 registers). Test Plan: validate Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1100 GHC Trac Issues: #9430
Diffstat (limited to 'compiler/codeGen')
-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 243e2a32ac..d201eaf20b 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -808,7 +808,8 @@ callishPrimOpSupported dflags op
WordQuotRemOp | ncg && x86ish -> Left (MO_U_QuotRem (wordWidth dflags))
| otherwise -> Right (genericWordQuotRemOp dflags)
- WordQuotRem2Op | ncg && x86ish -> Left (MO_U_QuotRem2 (wordWidth dflags))
+ WordQuotRem2Op | (ncg && x86ish)
+ || llvm -> Left (MO_U_QuotRem2 (wordWidth dflags))
| otherwise -> Right (genericWordQuotRem2Op dflags)
WordAdd2Op | (ncg && x86ish)