gnu/gcc/d5044b85d3bd3ed0b8ddae3ea186eef747b1ef2d match.pd: factor MSB OR-cascade out of clz_table_index
Factor the 5- and 6-stage MSB OR-cascade -- which sets every bit from 0
to the input's MSB -- into two helper match patterns msb_or_cascade_32
and msb_or_cascade_64, and rewrite the 32-bit and 64-bit clz_table_index
patterns as one-liners over them. The helpers retain the
integral/unsigned/precision and shift-constant checks, so this is a
no-functional-change refactor.
It prepares a follow-up that recognises a CLZ idiom isolating the MSB
before the DeBruijn multiply, which reuses msb_or_cascade_64 directly.
gcc/ChangeLog:
* match.pd (msb_or_cascade_32, msb_or_cascade_64): New match
helpers.
(clz_table_index): Rewrite the 32-bit and 64-bit forms to use
the cascade helpers.
1 file changed