[project @ 2005-04-11 08:52:29 by simonmar]
authorsimonmar <unknown>
Mon, 11 Apr 2005 08:52:29 +0000 (08:52 +0000)
committersimonmar <unknown>
Mon, 11 Apr 2005 08:52:29 +0000 (08:52 +0000)
commit5ba806d8ea2fb64c058f8a17fb7e5d4b9afa6515
tree504b2667be2d4add455383bde8120947d8294c27
parentd2ebcf24e738c858a9b999602795c25c32c82bcf
[project @ 2005-04-11 08:52:29 by simonmar]
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).
ghc/compiler/codeGen/CgUtils.hs