simonmar    2005/04/11 01:52:29 PDT

  Modified files:
    ghc/compiler/codeGen CgUtils.hs 
  Log:
  When generating a switch for:
  
    case e of
      0 -> A
      1 -> B
  
  instead of generating
  
    if (e < 1) then goto A
    B
  
  generate
  
    if (e >= 1) then goto B
    A
  
  because this helps the NCG to generate better code.  In particular, if
  e is a comparison, then we don't need to reverse the sense of the
  comparison to eliminate the comparse against 1 (the NCG does try to
  reverse the comparison, but floating-point comparisons can't be
  reversed).
  
  Revision  Changes    Path
  1.16      +13 -5     fptools/ghc/compiler/codeGen/CgUtils.hs
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to