Re: Detection of hadware feature => please do not use signal
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnaka@iki.fi>, Bastien Roucariès <rouca@debian.org>, pgsql-bugs@lists.postgresql.org
Date: 2024-11-10T09:19:54Z
Lists: pgsql-bugs
On Fri, Nov 8, 2024 at 4:28 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
> One small improvement in this area that I'm working on (and about to commit
> for the AVX-512 stuff) is using __attribute__((target(...))) instead of
> special -march options for specific files [0].
(Catching up with that stuff). Neat.
I tried sprinkling __attribute__((target_clones("default,lse"))) in
front of some functions like LWLockAquire() just to see if this
multifunction stuff worked enough yet on ARM. FreeBSD 15/clang 18:
yes, I got LSE CAS-based lwlocks with loader-time feature detection!
Debian 12/gcc 12: no, it fails with "error: target does not support
function version dispatcher". I think maybe gcc 14 will do it (from
quick look at release notes)? I realise that's yet a different issue
than the <arm_acle.h> visibility thing you mentioned for the CRC32
builtins. Anyway, it's apparently still too soon to help on all
systems with this specific topic as you already said, so the explicit
auxv check still looks like the only reasonable way for now.
Commits
-
Update configure probes for CFLAGS needed for ARM CRC instructions.
- e266a0ed67d2 17.3 landed
- 851c6ff18fd3 15.11 landed
- 5980f1884fc9 18.0 landed
- 32057a0f791e 13.19 landed
- 2fc0199a5015 14.16 landed
- 1f4aadec41b8 16.7 landed
-
Support runtime CRC feature probing on NetBSD/ARM using sysctl().
- 4570b22666dd 18.0 landed
-
Use auxv to check for CRC32 instructions on ARM.
- aac831cafa6f 18.0 landed
-
Improve our method for probing the availability of ARM CRC instructions.
- 1c72ec6f4989 11.0 cited