On 31/08/18 16:27, Sam Tebbs wrote:
On 08/31/2018 11:59 AM, Kyrill Tkachov wrote: > > On 30/08/18 16:53, Sam Tebbs wrote: >> >> >> On 08/28/2018 11:53 PM, James Greenhalgh wrote: >> > Hm, I'm not very sure about the naming here; "left consecutive" >> isn't a >> > common phrase to denote the mask you're looking for (exact_log2 >> (-i) != -1 >> > if I'm reading right), and is misleading 0x0000ffff is 'left >> consecutive' >> > too, just with zeroes rather than ones. >> > >> I think you're right about it not being the best naming. Do you have any >> suggestions for a better name? > > Naming things is hard... :( > > How about aarch64_hi_bits_all_ones_p ? > > Kyrill That sounds good! Although I'm confused about what the 'p' means.
It stands for "predicate" meaning a boolean function with no side-effects. It's the preferred way to name these kinds of functions in GCC (though I can't seem to find the documentation mandate for it). IIRC it's a remnant from the LISP days. You'll find a lot of *_p functions in GCC. Kyrill