use rotate macro in more places

Поиск
Список
Период
Сортировка
От John Naylor
Тема use rotate macro in more places
Дата
Msg-id CAFBsxsH7c1LC0CGZ0ADCBXLHU5-=KNXx-r7tHYPAW51b2HK4Qw@mail.gmail.com
обсуждение исходный текст
Ответы Re: use rotate macro in more places  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: use rotate macro in more places  (Yugo NAGATA <nagata@sraoss.co.jp>)
Список pgsql-hackers
We've accumulated a few bit-twiddling hacks to get the compiler to
emit a rotate instruction. Since we have a macro for that, let's use
it, as in the attached. I thought the new call sites would look better
with a "left" version, so I added a new macro for that. That's not
necessary, however.

Some comments now look a bit too obvious to keep around, but maybe
they should be replaced with a "why", instead of a "what":

                        /* rotate hashkey left 1 bit at each step */
-                       hashkey = (hashkey << 1) | ((hashkey &
0x80000000) ? 1 : 0);
+                       hashkey = pg_rotate_left32(hashkey, 1);


-- 
John Naylor
EDB: http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Design of pg_stat_subscription_workers vs pgstats
Следующее
От: Zhihong Yu
Дата:
Сообщение: doc: join state for merge join