From 0294162f21ad8ad5e1a7d7f62a88e6525181e834 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 3 Nov 2024 22:50:18 +0100 Subject: [PATCH 1/2] Allow to specify -DSSE2NEON_SUPPRESS_WARNINGS to avoid the #warning about optimization issues This warning breaks builds of applications using -Werror. --- sse2neon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sse2neon.h b/sse2neon.h index 10a1196e..a480c067 100644 --- a/sse2neon.h +++ b/sse2neon.h @@ -110,7 +110,7 @@ #warning "GCC versions earlier than 10 are not supported." #endif -#ifdef __OPTIMIZE__ +#if defined(__OPTIMIZE__) && !defined(SSE2NEON_SUPPRESS_WARNINGS) #warning \ "Report any potential compiler optimization issues when using SSE2NEON. See the 'Optimization' section at https://github.com/DLTcollab/sse2neon." #endif From 09e4a8aef54aede0f67743408f3638303c04264a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 4 Nov 2024 02:07:57 +0100 Subject: [PATCH 2/2] README.md: document SSE2NEON_SUPPRESS_WARNINGS --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6455cdfe..1bf5fd36 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Considering the balance between correctness and performance, `sse2neon` recogniz * `SSE2NEON_PRECISE_DIV`: Enable precise implementation of `_mm_rcp_ps` and `_mm_div_ps` by additional Netwon-Raphson iteration for accuracy. * `SSE2NEON_PRECISE_SQRT`: Enable precise implementation of `_mm_sqrt_ps` and `_mm_rsqrt_ps` by additional Netwon-Raphson iteration for accuracy. * `SSE2NEON_PRECISE_DP`: Enable precise implementation of `_mm_dp_pd`. When the conditional bit is not set, the corresponding multiplication would not be executed. +* `SSE2NEON_SUPPRESS_WARNINGS`: Set this macro to disable the warning which is emitted by default when optimizations are enabled. The above are turned off by default, and you should define the corresponding macro(s) as `1` before including `sse2neon.h` if you need the precise implementations.