byteSwap16/32: Narrow the result to 16/32 bits

Authored by rwbarton on Sep 7 2013, 8:07 PM.

Description

byteSwap16/32: Narrow the result to 16/32 bits

According to primops.txt.pp, the BSwap16Op and BSwap32Op primops
leave the higher bytes of their results undefined. We must clear
those higher bytes here before storing the result in a Word16/32.

Signed-off-by: Austin Seipp <austin@well-typed.com>

Details

Committed
austinSep 15 2013, 1:01 PM
Pushed
bgamariAug 25 2016, 1:39 PM
Parents
rGHCDIFFfa3440945f25: Add `Data` instance for `Data.Version`
Branches
Unknown
Tags
Unknown