Re: Using POPCNT and other advanced bit manipulation instructions

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Using POPCNT and other advanced bit manipulation instructions
Дата
Msg-id CAKJS1f-PFVfb+hDvOWC-8=SigOEuutoQCVNSvVdNyokCo1wYAA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Using POPCNT and other advanced bit manipulation instructions  (Jose Luis Tallon <jltallon@adv-solutions.net>)
Список pgsql-hackers
On Thu, 20 Dec 2018 at 23:59, Jose Luis Tallon
<jltallon@adv-solutions.net> wrote:
> IMVHO: Please do not disregard potential optimization by the compiler
> around those calls.. o_0  That might explain the reduced performance
> improvement observed.

It was a speedup that I measured. Did you see something else?

> > What I'm really looking for by posting now are reasons why we can't do
> > this. I'm also interested in getting some testing done on older
> > machines, particularly machines with processors that are from before
> > 2007, both AMD and Intel.
>
> I can offer a 2005-vintage Opteron 2216 rev3 (bought late 2007) to test
> on. Feel free to toss me some test code.
>
> cpuinfo flags:    fpu de tsc msr pae mce cx8 apic mca cmov pat clflush
> mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow
> rep_good nopl extd_apicid eagerfpu pni cx16 hypervisor lahf_lm
> cmp_legacy 3dnowprefetch vmmcall
>
> >   2007-2008 seems to be around the time both
> > AMD and Intel added support for POPCNT and LZCNT, going by [4].

It would be really good if you could git clone a copy of master and
patch it with the patch from earlier in the thread and see if you
encounter any issues running make check-world.

I'm a bit uncertain if passing -mpopcnt to a recent gcc would result
in the popcnt instruction being compiled in if the machine doing the
compiling had no support for that.

Likely it would be simple to test that with:

echo "int main(char **argv, int argc) { return
__builtin_popcount(argc); }" > popcnt.c && gcc popcnt.c -S -mpopcnt &&
cat popcnt.s | grep pop

I see a "popcntl" in there on my machine.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Allow auto_explain to log to NOTICE
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: don't create storage when unnecessary