
Hi, I found these: https://github.com/ghc/ghc/blob/5f3c5384df59717ca8013c5df8d1f65692867825/inc... They go only 0-14, so there's some long chains of branches and stuff in hot paths that could be cleaned up into single &-masked branches by changing these into a set of flags. And then I saw these: https://github.com/ghc/ghc/blob/master/libraries/base/GHC/Conc/Sync.lhs#L483 Where does 16 and 17 come from -- I couldn't find them in the header files anywhere? Kyle

On 19/07/2014 06:00, Kyle Van Berendonck wrote:
I found these: https://github.com/ghc/ghc/blob/5f3c5384df59717ca8013c5df8d1f65692867825/inc...
They go only 0-14, so there's some long chains of branches and stuff in hot paths that could be cleaned up into single &-masked branches by changing these into a set of flags.
GHC will generate a table jump for a large dense case, if that's what you're worried about. Cheers, Simon

Hi Simon,
I have been inspecting what gcc generates and found that in all the
functions I checked which used the thread status in a switch, none of them
generated jump tables, rather, long chains of cmp's.
I predict this is because there are overlapping cases (or even a
fall-through in one I saw, which looked accidental...).
On Tue, Jul 22, 2014 at 5:32 AM, Simon Marlow
On 19/07/2014 06:00, Kyle Van Berendonck wrote:
I found these: https://github.com/ghc/ghc/blob/5f3c5384df59717ca8013c5df8d1f6 5692867825/includes/rts/Constants.h#L194
They go only 0-14, so there's some long chains of branches and stuff in hot paths that could be cleaned up into single &-masked branches by changing these into a set of flags.
GHC will generate a table jump for a large dense case, if that's what you're worried about.
Cheers, Simon
participants (2)
-
Kyle Van Berendonck
-
Simon Marlow