Re: Optimize Arm64 crc32c implementation in Postgresql

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andres Freund <andres(at)anarazel(dot)de>, Yuqi Gu <Yuqi(dot)Gu(at)arm(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize Arm64 crc32c implementation in Postgresql
Date: 2018-05-02 21:47:38
Message-ID: CAEepm=0V6o6J+C2S3=Ev42SQUri-bnYvs9r+y1dBsaBenrripA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 3, 2018 at 2:30 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Do you really need the pg_crc32c_armv8_choose_dummy global variable?
> That seems pretty ugly. If you're concerned about the compiler
> optimizing away the call to the crc function, you could write it like
>
> result = (pg_comp_crc32c_armv8(0, 0, 0) == expected-value);
>
> which'd provide a bit of extra checking that the code's not broken,
> too.

True. Of course I needed an interesting length too...

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Use-a-portable-way-to-detect-ARMv8-CRC32-hardware-v2.patch application/octet-stream 5.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-05-02 21:58:01 Re: Is a modern build system acceptable for older platforms
Previous Message Hartmut Holzgraefe 2018-05-02 21:43:50 Re: Is a modern build system acceptable for older platforms