Commit 94dbd655 authored by ian@well-typed.com's avatar ian@well-typed.com

Pass Platform down to halfWordMask

parent 26ebd1b7
......@@ -171,10 +171,11 @@ halfWordWidth _
| wORD_SIZE == 8 = W32
| otherwise = panic "MachOp.halfWordRep: Unknown word size"
halfWordMask :: Integer
halfWordMask | wORD_SIZE == 4 = 0xFFFF
| wORD_SIZE == 8 = 0xFFFFFFFF
| otherwise = panic "MachOp.halfWordMask: Unknown word size"
halfWordMask :: Platform -> Integer
halfWordMask _
| wORD_SIZE == 4 = 0xFFFF
| wORD_SIZE == 8 = 0xFFFFFFFF
| otherwise = panic "MachOp.halfWordMask: Unknown word size"
-- cIntRep is the Width for a C-language 'int'
cIntWidth, cLongWidth :: Width
......
......@@ -568,7 +568,7 @@ emitPrimOp [res_h, res_l] WordAdd2Op [arg_x, arg_y] _
or x y = CmmMachOp (MO_Or wordWidth) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth platform)))
wordWidth)
hwm = CmmLit (CmmInt halfWordMask wordWidth)
hwm = CmmLit (CmmInt (halfWordMask platform) wordWidth)
stmt = CmmCall (CmmPrim (MO_Add2 wordWidth) (Just genericImpl))
[CmmHinted res_h NoHint,
CmmHinted res_l NoHint]
......@@ -614,7 +614,7 @@ emitPrimOp [res_h, res_l] WordMul2Op [arg_x, arg_y] _
or x y = CmmMachOp (MO_Or wordWidth) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth platform)))
wordWidth)
hwm = CmmLit (CmmInt halfWordMask wordWidth)
hwm = CmmLit (CmmInt (halfWordMask platform) wordWidth)
stmt = CmmCall (CmmPrim (MO_U_Mul2 wordWidth) (Just genericImpl))
[CmmHinted res_h NoHint,
CmmHinted res_l NoHint]
......
......@@ -641,7 +641,7 @@ genericWordAdd2Op [res_h, res_l] [arg_x, arg_y]
or x y = CmmMachOp (MO_Or wordWidth) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth platform)))
wordWidth)
hwm = CmmLit (CmmInt halfWordMask wordWidth)
hwm = CmmLit (CmmInt (halfWordMask platform) wordWidth)
emit $ catAGraphs
[mkAssign (CmmLocal r1)
(add (bottomHalf arg_x) (bottomHalf arg_y)),
......@@ -675,7 +675,7 @@ genericWordMul2Op [res_h, res_l] [arg_x, arg_y]
or x y = CmmMachOp (MO_Or wordWidth) [x, y]
hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth platform)))
wordWidth)
hwm = CmmLit (CmmInt halfWordMask wordWidth)
hwm = CmmLit (CmmInt (halfWordMask platform) wordWidth)
emit $ catAGraphs
[mkAssign xlyl
(mul (bottomHalf arg_x) (bottomHalf arg_y)),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment