Commit 5e2dabea authored by mrchebas@gmail.com's avatar mrchebas@gmail.com

prettifying Cmm a bit: convert (x + (-N)) to (x - N)

parent 709599a8
...@@ -292,6 +292,8 @@ infixMachOp1 (MO_U_Lt _) = Just (char '<') ...@@ -292,6 +292,8 @@ infixMachOp1 (MO_U_Lt _) = Just (char '<')
infixMachOp1 _ = Nothing infixMachOp1 _ = Nothing
-- %left '-' '+' -- %left '-' '+'
pprExpr7 (CmmMachOp (MO_Add rep1) [x, CmmLit (CmmInt i rep2)]) | i < 0
= pprExpr7 (CmmMachOp (MO_Sub rep1) [x, CmmLit (CmmInt (negate i) rep2)])
pprExpr7 (CmmMachOp op [x,y]) | Just doc <- infixMachOp7 op pprExpr7 (CmmMachOp op [x,y]) | Just doc <- infixMachOp7 op
= pprExpr7 x <+> doc <+> pprExpr8 y = pprExpr7 x <+> doc <+> pprExpr8 y
pprExpr7 e = pprExpr8 e pprExpr7 e = pprExpr8 e
......
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