[GHC] #9661: Branchless ==# is compiled to branchy code

GHC ghc-devs at haskell.org
Fri Oct 3 20:04:19 UTC 2014


#9661: Branchless ==# is compiled to branchy code
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.9
            Resolution:              |         Keywords:
      Operating System:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Runtime     |       Blocked By:
  performance bug                    |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 I hope that works. As a side note, we consider redefining `not` as `not x
 = dataToTag# (x /=# 1#)`, which should work better for branchless stuff
 and I ''think'' should work exactly the same for branchy stuff. That'll be
 one less thing I need to add to a branchless `Bool` module. I already need
 `complementBL x = tagToEnum# (dataToTag# `xorI#` 1#)` to play as nicely as
 possible with `&&!` and `||!`, I think; I'd rather not have to add `notBL`
 if that can replace `not` without any negative consequences.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9661#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list