Skip to content
  • Simon Marlow's avatar
    [project @ 2005-04-11 08:52:29 by simonmar] · 5ba806d8
    Simon Marlow authored
    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).
    5ba806d8