Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFM7s-00CaGP-QH for pgsql-bugs@arkaria.postgresql.org; Sun, 24 Nov 2024 23:34:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tFM7r-00A8mb-FD for pgsql-bugs@arkaria.postgresql.org; Sun, 24 Nov 2024 23:34:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFM7r-00A8mT-6s for pgsql-bugs@lists.postgresql.org; Sun, 24 Nov 2024 23:34:47 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tFM7p-003fPR-8X for pgsql-bugs@lists.postgresql.org; Sun, 24 Nov 2024 23:34:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4AONYS1c1216861; Sun, 24 Nov 2024 18:34:28 -0500 From: Tom Lane To: Thomas Munro cc: Heikki Linnakangas , =?UTF-8?Q?Bastien_Roucari=C3=A8s?= , pgsql-bugs@lists.postgresql.org Subject: Re: Detection of hadware feature => please do not use signal In-reply-to: References: <4496616.iHFcN1HehY@portable-bastien> <1156374.1730396928@sss.pgh.pa.us> <7ec1c65c-1a28-49a7-af43-f77c260a3df6@iki.fi> <1292593.1730399134@sss.pgh.pa.us> <707008.1732325995@sss.pgh.pa.us> <736756.1732341046@sss.pgh.pa.us> <865773.1732399354@sss.pgh.pa.us> <885805.1732406935@sss.pgh.pa.us> <1074317.1732479406@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Mon, 25 Nov 2024 11:50:53 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1216859.1732491268.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 24 Nov 2024 18:34:28 -0500 Message-ID: <1216860.1732491268@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > On Mon, Nov 25, 2024 at 9:16=E2=80=AFAM Tom Lane wro= te: >> Anyway, experimentation shows that this gcc version gives the same >> "selected processor lacks an FPU" failure with "-march=3Darmv8-a+crc". >> It will not take "-march=3Darmv8-a+crc+fp", but it will take >> "-march=3Darmv8-a+crc -mfpu=3Dvfpv3"; the same holds for NetBSD 10.0's >> gcc 10.5.0. Possibly other -mfpu settings will work (I recall having >> had success yesterday with -mfpu=3Dneon on NetBSD), but I think this is >> a pretty generic setting: per the gcc docs it corresponds to typical >> armv7 hardware. > LGTM. > It might be slightly more logical to say vfpv4 if that also works, > since armv8 floats are based on vfpf4[1], but it hardly matters given > we're not actually using it... Yeah, with no FP operations in the files that get compiled with these flags, it probably doesn't matter. But gcc 10.5.0 seems happy with -mfpu=3Dvfpv4, so I'll use that. > [1] is also where you can read that > software implementation is still technically permitted in armv8 > aarch32 state (but not aarch64), even though A profile chips without > it are apparently like unicorns. Anyway, I can't find any evidence > that GCC knows that[2], or changed that deliberately any time > recently, or is out of sync with its own docs, or has local patches in > NetBSD's copy, so yeah, maybe it really is a bug. It's very confusing, especially given this: $ gcc -march=3Darmv8-a+crc+fp testarm32.c gcc: error: 'armv8-a' does not support feature 'fp' gcc: note: valid feature names are: crc simd crypto nocrypto nofp sb predr= es; did you mean 'nofp'? If they think that base armv8-a doesn't include FP, why is there a +nofp option? But whether it's a bug or somehow intentional, there's an awful lot of copies of gcc with this behavior, so we need to cope. I wonder whether "armv8-a" includes FP on aarch64 but not arm32, and we only did the original testing of f044d71e3 on aarch64. If so, it might've been like this all along and we didn't notice. > There was some > recent-ish churn affecting -mfpu and -march interactions[3], maybe > relevant, or not, it beats me. That looks like incorrect assembly code being emitted. Our problem here is much further upstream, ie what compiler flags are accepted. regards, tom lane