Support MO_U_QuotRem2 in LLVM backend
authorMichal Terepeta <michal.terepeta@gmail.com>
Mon, 3 Aug 2015 06:41:13 +0000 (08:41 +0200)
committerBen Gamari <ben@smart-cactus.org>
Mon, 3 Aug 2015 06:41:32 +0000 (08:41 +0200)
commit92f5385d8b2be50848a2496199a481f299f4b53a
treee335893d9ff65b3df9f34dd5191b7a785eeeabfb
parent37227d3400549c2a6844dfb8c34c0738edc69ecc
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
compiler/codeGen/StgCmmPrim.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
testsuite/tests/primops/should_run/T9430.hs