From f9c5c120f65165711425cee8af392abb6556fdc6 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Sun, 9 Jan 2022 16:07:13 +0100 Subject: [PATCH] AK/SIMD: Suppress psabi warnings and add explanatory comment --- AK/SIMDExtras.h | 12 +++++++----- AK/SIMDMath.h | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/AK/SIMDExtras.h b/AK/SIMDExtras.h index 4b4a406116..88ec07d942 100644 --- a/AK/SIMDExtras.h +++ b/AK/SIMDExtras.h @@ -8,10 +8,12 @@ #include -// Returning a vector on i686 target generates warning "psabi". -// This prevents the CI, treating this as an error, from running to completion. +// Functions returning vectors or accepting vector arguments have different calling conventions +// depending on whether the target architecture supports SSE or not. GCC generates warning "psabi" +// when compiling for non-SSE architectures. We disable this warning because these functions +// are static and should never be visible from outside the translation unit that includes this header. #pragma GCC diagnostic push -#pragma GCC diagnostic warning "-Wpsabi" +#pragma GCC diagnostic ignored "-Wpsabi" namespace AK::SIMD { @@ -141,6 +143,6 @@ ALWAYS_INLINE static void store4_masked(VectorType v, UnderlyingType* a, Underly *d = v[3]; } -#pragma GCC diagnostic pop - } + +#pragma GCC diagnostic pop diff --git a/AK/SIMDMath.h b/AK/SIMDMath.h index 60bc8c6e80..a8726963eb 100644 --- a/AK/SIMDMath.h +++ b/AK/SIMDMath.h @@ -9,10 +9,12 @@ #include #include -// Returning a vector on i686 target generates warning "psabi". -// This prevents the CI, treating this as an error, from running to completion. +// Functions returning vectors or accepting vector arguments have different calling conventions +// depending on whether the target architecture supports SSE or not. GCC generates warning "psabi" +// when compiling for non-SSE architectures. We disable this warning because these functions +// are static and should never be visible from outside the translation unit that includes this header. #pragma GCC diagnostic push -#pragma GCC diagnostic warning "-Wpsabi" +#pragma GCC diagnostic ignored "-Wpsabi" namespace AK::SIMD { @@ -57,6 +59,6 @@ ALWAYS_INLINE static f32x4 exp(f32x4 v) }; } -#pragma GCC diagnostic pop - } + +#pragma GCC diagnostic pop