commit abd1d924f4a5886ce21b878a5e481d99c78ea705
parent e7de60c5463a77a6ad7df95b294835e6692b8ade
Author: Henri Sivonen <hsivonen@hsivonen.fi>
Date: Thu, 30 Oct 2025 11:05:12 +0000
Bug 1997283 - Make htmlaccelEnabled() match unavailability of SIMD code with GCC 10 and 11. r=sergesanspaille
GCC 12 or newer is required for __builtin_shuffle.
Differential Revision: https://phabricator.services.mozilla.com/D270650
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/parser/htmlaccel/htmlaccelEnabled.h b/parser/htmlaccel/htmlaccelEnabled.h
@@ -16,7 +16,11 @@ namespace mozilla::htmlaccel {
///
/// Keep this in sync with `HTML_ACCEL_FLAGS` in `toolchain.configure`.
inline bool htmlaccelEnabled() {
-#if defined(__aarch64__) && defined(__LITTLE_ENDIAN__)
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 12
+ // __GNUC__ is stuck at 4 in clang, so we need to check __clang__ above.
+ // GCC 12 or newer is required for __builtin_shuffle.
+ return false;
+#elif defined(__aarch64__) && defined(__LITTLE_ENDIAN__)
return true;
#elif defined(__x86_64__)
return mozilla::supports_bmi() && mozilla::supports_avx();