use correct word size for shiftRightLogical and removeOp32
authorLuite Stegeman <stegeman@gmail.com>
Wed, 19 Nov 2014 23:00:49 +0000 (17:00 -0600)
committerAustin Seipp <austin@well-typed.com>
Wed, 19 Nov 2014 23:03:06 +0000 (17:03 -0600)
commit4dd87c5e3ebd0569fdd19695f3e9c82102404a4f
treeba72c5a75fc1ce74cdc7f2adca2efe562785026d
parent33c029faef3b5e486def8f3a7c888dfa9f3d8cca
use correct word size for shiftRightLogical and removeOp32

Summary:
shiftRightLogical used a host sized Word for the intermediate value,
which would produce the wrong result when cross compiling to a target
with a different word size than the host.

removeOp32 used the preprocessor to bake in word size assumptions,
rather than getting the target word size from DynFlags

Test Plan: validate

Reviewers: hvr, rwbarton, carter, austin

Reviewed By: austin

Subscribers: thomie, carter

Differential Revision: https://phabricator.haskell.org/D502

GHC Trac Issues: #9736
compiler/prelude/PrelRules.lhs