Re: use CLZ instruction in AllocSetFreeIndex()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: use CLZ instruction in AllocSetFreeIndex()
Дата
Msg-id 8398.1577464998@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: use CLZ instruction in AllocSetFreeIndex()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Dec-27, Tom Lane wrote:
>> ... Perhaps what we really ought to be working on is
>> finding MSVC equivalents for __builtin_clz and friends.

> Apparently clz() can be written using _BitScanReverse(), per
> https://stackoverflow.com/a/20468180
> https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64?view=vs-2015

Yeah, I found that too.  It looks promising, but we need to look into
* portability to different MSVC versions? (I guess the buildfarm would
  tell us)
* performance, does it actually generate comparable code?
* intrinsics for the other bit instructions we use?

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: use CLZ instruction in AllocSetFreeIndex()
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: [PATCH v1] pg_ls_tmpdir to show directories