Re: Optimize Arm64 crc32c implementation in Postgresql - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Optimize Arm64 crc32c implementation in Postgresql
Date
Msg-id CAEepm=0wF0_E++FYm38vtynbuyOamQ-1KjucV9r43MbHHaBsHA@mail.gmail.com
Whole thread Raw
In response to Re: Optimize Arm64 crc32c implementation in Postgresql  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: Optimize Arm64 crc32c implementation in Postgresql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Apr 5, 2018 at 12:00 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> ... trying to figure out how to detect the instruction portably using SIGILL ...

Ahh, OpenSSL's armcap.c shows how to do this.  You need to
siglongjmp() out of there.  Here's a patch that does it that way.
Isn't this better?

I tested this on a Linux ARM system that has the instruction, and I
put a kill(getpid(), SIGILL) in there to test the negative case
because I don't have access to an ARM system without the instruction.
I don't have a FreeBSD/ARM system to test on either but I checked that
the flow control technique works fine on FreeBSD on another
architecture when it hits an instruction it doesn't support.

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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: FPW stats?
Next
From: Dmitry Dolgov
Date:
Subject: Re: FPW stats?