diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-01-09 16:52:16 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-01-09 16:52:16 +0000 |
commit | 3af022f3ae6ff3adceb2318cf50549d954e8bbe7 (patch) | |
tree | 27fd84fdac7f45faa5917281df0a6092226398a0 /compiler/prelude/PrelRules.lhs | |
parent | 343548da7274cd15aaeabe72c6b37bce78e9af9c (diff) | |
download | haskell-3af022f3ae6ff3adceb2318cf50549d954e8bbe7.tar.gz |
Fix some incorrect narrowing rules (#7361)
e.g. narrow8Int# subsumes narrow16Int#, not the other way around.
Diffstat (limited to 'compiler/prelude/PrelRules.lhs')
-rw-r--r-- | compiler/prelude/PrelRules.lhs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index b58eb0a47e..b21d546ef7 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -142,28 +142,28 @@ primOpRules nm Int2WordOp = mkPrimOpRule nm 1 [ liftLitDynFlags int2WordLit , inversePrimOp Word2IntOp ] primOpRules nm Narrow8IntOp = mkPrimOpRule nm 1 [ liftLit narrow8IntLit , subsumedByPrimOp Narrow8IntOp - , subsumedByPrimOp Narrow16IntOp - , subsumedByPrimOp Narrow32IntOp ] + , Narrow8IntOp `subsumesPrimOp` Narrow16IntOp + , Narrow8IntOp `subsumesPrimOp` Narrow32IntOp ] primOpRules nm Narrow16IntOp = mkPrimOpRule nm 1 [ liftLit narrow16IntLit - , Narrow16IntOp `subsumesPrimOp` Narrow8IntOp + , subsumedByPrimOp Narrow8IntOp , subsumedByPrimOp Narrow16IntOp - , subsumedByPrimOp Narrow32IntOp ] + , Narrow16IntOp `subsumesPrimOp` Narrow32IntOp ] primOpRules nm Narrow32IntOp = mkPrimOpRule nm 1 [ liftLit narrow32IntLit - , Narrow32IntOp `subsumesPrimOp` Narrow8IntOp - , Narrow32IntOp `subsumesPrimOp` Narrow16IntOp + , subsumedByPrimOp Narrow8IntOp + , subsumedByPrimOp Narrow16IntOp , subsumedByPrimOp Narrow32IntOp , removeOp32 ] primOpRules nm Narrow8WordOp = mkPrimOpRule nm 1 [ liftLit narrow8WordLit , subsumedByPrimOp Narrow8WordOp - , subsumedByPrimOp Narrow16WordOp - , subsumedByPrimOp Narrow32WordOp ] + , Narrow8WordOp `subsumesPrimOp` Narrow16WordOp + , Narrow8WordOp `subsumesPrimOp` Narrow32WordOp ] primOpRules nm Narrow16WordOp = mkPrimOpRule nm 1 [ liftLit narrow16WordLit - , Narrow16WordOp `subsumesPrimOp` Narrow8WordOp + , subsumedByPrimOp Narrow8WordOp , subsumedByPrimOp Narrow16WordOp - , subsumedByPrimOp Narrow32WordOp ] + , Narrow16WordOp `subsumesPrimOp` Narrow32WordOp ] primOpRules nm Narrow32WordOp = mkPrimOpRule nm 1 [ liftLit narrow32WordLit - , Narrow32WordOp `subsumesPrimOp` Narrow8WordOp - , Narrow32WordOp `subsumesPrimOp` Narrow16WordOp + , subsumedByPrimOp Narrow8WordOp + , subsumedByPrimOp Narrow16WordOp , subsumedByPrimOp Narrow32WordOp , removeOp32 ] primOpRules nm OrdOp = mkPrimOpRule nm 1 [ liftLit char2IntLit |