Opened 5 years ago

Last modified 4 years ago

#9659 new feature request

Offer branchless conditional (CMOV) primop

Reported by: dfeuer Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by dfeuer)

I'd like to see something similar to C's ?:, like

ifI#, boolI# :: Int# -> Int# -> Int# -> Int#

We could then write things like

ifI# (x <# y) 12# (x +# 17#)
boolI# potato cannon (y ># 2)

When the value of the test is difficult to predict, this would be better than the usual branching if or case.

Change History (2)

comment:1 Changed 5 years ago by dfeuer

Description: modified (diff)

comment:2 Changed 4 years ago by thomie

Type of failure: None/UnknownRuntime performance bug
Note: See TracTickets for help on using tickets.