libstdc++: Use more precise __RECIPROCAL_MATH__ macro

Message ID 5914330.taCxCBeP46@minbar
State Committed
Commit fac64bf456cf56f0c6309d21286b7eaf170f668e
Headers
Series libstdc++: Use more precise __RECIPROCAL_MATH__ macro |

Commit Message

Matthias Kretz March 21, 2023, 5:05 p.m. UTC
  Tested on x86_64-pc-linux-gnu.

--------- 8< -----------

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	* include/experimental/bits/simd_x86.h
	(_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0
	with __RECIPROCAL_MATH__.
---
 libstdc++-v3/include/experimental/bits/simd_x86.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
 stdₓ::simd
──────────────────────────────────────────────────────────────────────────
  

Comments

Jonathan Wakely March 21, 2023, 5:11 p.m. UTC | #1
On Tue, 21 Mar 2023 at 17:05, Matthias Kretz via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:

> Tested on x86_64-pc-linux-gnu.
>
> --------- 8< -----------
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>
> libstdc++-v3/ChangeLog:
>
>         * include/experimental/bits/simd_x86.h
>         (_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0
>         with __RECIPROCAL_MATH__.



OK
  

Patch

diff --git a/libstdc++-v3/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h
index 28ba344c2b2..2a3e74d9119 100644
--- a/libstdc++-v3/include/experimental/bits/simd_x86.h
+++ b/libstdc++-v3/include/experimental/bits/simd_x86.h
@@ -1469,7 +1469,7 @@  _CsrGuard()
 		[&__xf, &__yf](auto __i) _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA
 		  -> _SimdWrapper<_Float, __n_intermediate>
 		{
-#if __GCC_IEC_559 == 0
+#if __RECIPROCAL_MATH__
 		  // If -freciprocal-math is active, using the `/` operator is
 		  // incorrect because it may be translated to an imprecise
 		  // multiplication with reciprocal. We need to use inline