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

From Tom Lane
Subject Re: Optimize Arm64 crc32c implementation in Postgresql
Date
Msg-id 17188.1525271439@sss.pgh.pa.us
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  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> 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?

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.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BufFileSize() doesn't work on a "shared" BufFiles
Next
From: Tom Lane
Date:
Subject: Re: power() function in Windows: "value out of range: underflow"