Re: Optimize Arm64 crc32c implementation in Postgresql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
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 14:30:39
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)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,

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-02 14:42:27 Re: power() function in Windows: "value out of range: underflow"
Previous Message Heikki Linnakangas 2018-05-02 14:24:45 Re: BufFileSize() doesn't work on a "shared" BufFiles