[PATCH] optabs: Implement double-word ctz and ffs expansion

2023-06-07 Thread Jakub Jelinek via Gcc-patches
Hi! We have expand_doubleword_clz for a couple of years, where we emit double-word CLZ as if (high_word == 0) return CLZ (low_word) + word_size; else return CLZ (high_word); We can do something similar for CTZ and FFS IMHO, just with the 2 words swapped. So if (low_word == 0) return CTZ (high_wor

Re: [PATCH] optabs: Implement double-word ctz and ffs expansion

2023-06-07 Thread Richard Biener via Gcc-patches
> Am 07.06.2023 um 18:59 schrieb Jakub Jelinek via Gcc-patches > : > > Hi! > > We have expand_doubleword_clz for a couple of years, where we emit > double-word CLZ as if (high_word == 0) return CLZ (low_word) + word_size; > else return CLZ (high_word); > We can do something similar for CTZ a