On Fri, Dec 27, 2019 at 9:16 PM David Fetter <david@fetter.org> wrote:
> On Fri, Dec 27, 2019 at 07:02:02PM -0500, John Naylor wrote:
> > The lookup table case is less clear. Removing the shift results in
> > assembly that looks more like the C code and is slower for me. The
> > standard lookup table code uses some magic constants and does its own
> > constant folding by shifting 11 (8 + 3). In the absence of testing on
> > platforms that will actually exercise this path, it seems the
> > open-coded path should keep the shift for now. Thoughts?
>
> It's probably worth doing the things you've found unambiguous gains
> for as a patch, putting it on the next commitfest, and seeing what the
> commitfest.cputube.org machinery has to say about it.
Done in the attached.
> Maybe it'd be worth trying out a patch that enables CLZ for Windows,
> but that seems like a separate issue.
Agreed.
--
John Naylor https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services