[GHC] #9251: ghc does not expose branchless max/min operations as primops

GHC ghc-devs at haskell.org
Thu Oct 4 18:06:17 UTC 2018


#9251: ghc does not expose branchless max/min operations as primops
-------------------------------------+-------------------------------------
        Reporter:  carter            |                Owner:  osa1
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.2
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #9246             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ulysses4ever):

 Ben, I'm interested in this. For osa1's work: I don't see a patch.
 [https://lpaste.net/134455 His link above] has a tiny example program
 using something called `min##` which is not defined there.

 Is there a clear strategy on how to attack this ticket? Let's say,
 starting with the most conservative step: provide primop version of
 integer `min` / `max` which, for x86, is implemented in assembly (`CMOV`
 or SSE4's `PMINSD` / `PMAXSD`).

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


More information about the ghc-tickets mailing list