diff options
author | Tom Lane | 2024-11-25 17:50:17 +0000 |
---|---|---|
committer | Tom Lane | 2024-11-25 17:50:17 +0000 |
commit | 5980f1884fc911af120c98ad440b9546ed9012c5 (patch) | |
tree | 2fcc8c90e4f4e3ab9bd52c05ad8888e7c092e9d7 /configure.ac | |
parent | 4570b22666dd4c45a4c355f7d156d949c0247e2d (diff) |
Update configure probes for CFLAGS needed for ARM CRC instructions.
On ARM platforms where the baseline CPU target lacks CRC instructions,
we need to supply a -march flag to persuade the compiler to compile
such instructions. It turns out that our existing choice of
"-march=armv8-a+crc" has not worked for some time, because recent gcc
will interpret that as selecting software floating point, and then
will spit up if the platform requires hard-float ABI, as most do
nowadays. The end result was to silently fall back to software CRC,
which isn't very desirable since in practice almost all currently
produced ARM chips do have hardware CRC.
We can fix this by using "-march=armv8-a+crc+simd" to enable the
correct ABI choice. (This has no impact on the code actually
generated, since neither of the files we compile with this flag
does any floating-point stuff, let alone SIMD.) Keep the test for
"-march=armv8-a+crc" since that's required for soft-float ABI,
but try that second since most platforms we're likely to build on
use hard-float.
Since this isn't working as-intended on the last several years'
worth of gcc releases, back-patch to all supported branches.
Discussion: https://postgr.es/m/4496616.iHFcN1HehY@portable-bastien
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index c7d01168814..4f56bb5062e 100644 --- a/configure.ac +++ b/configure.ac @@ -2088,11 +2088,15 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ # Check for ARMv8 CRC Extension intrinsics to do CRC calculations. # # First check if __crc32c* intrinsics can be used with the default compiler -# flags. If not, check if adding -march=armv8-a+crc flag helps. +# flags. If not, check if adding "-march=armv8-a+crc+simd" flag helps. +# On systems using soft-float ABI, "-march=armv8-a+crc" is required instead. # CFLAGS_CRC is set if the extra flag is required. PGAC_ARMV8_CRC32C_INTRINSICS([]) if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then - PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc]) + PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc+simd]) + if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then + PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc]) + fi fi # Check for LoongArch CRC intrinsics to do CRC calculations. |