From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id 68F43385828E; Thu, 16 Feb 2023 21:04:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68F43385828E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676581465; bh=gYrl2ekIT8B084C29zUbH20vLVsCuUbgkXMeU5aQuhs=; h=From:To:Subject:Date:From; b=MRH3Cz72tGDY9fmGvoJ31dJKtcG0M37f7kZirm1wXf9FRPiW7ywO9VJ4YMIEOrI3w vZXIZUtQgrmUkLMQVZUW6wcz2grDAQy/IWl9jmBc5KaAkMvaKT7Tz1vMCLyblwwwbh KepxuzRzwCMwfqYgXpQy2hOh9HD824vORzz30nak= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Matthias Kretz To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-9184] libstdc++: Fix incorrect function call in -ffast-math optimization X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/releases/gcc-12 X-Git-Oldrev: 16162ac2250943af3fa710496f066bf2af35ca9f X-Git-Newrev: c70a6414d74431a9370c6806ea04882185774fe9 Message-Id: <20230216210425.68F43385828E@sourceware.org> Date: Thu, 16 Feb 2023 21:04:25 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c70a6414d74431a9370c6806ea04882185774fe9 commit r12-9184-gc70a6414d74431a9370c6806ea04882185774fe9 Author: Matthias Kretz Date: Fri Feb 3 17:47:05 2023 +0100 libstdc++: Fix incorrect function call in -ffast-math optimization Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_math.h (__hypot): Bitcasting between scalars requires the __bit_cast helper function instead of simd_bit_cast. (cherry picked from commit a5de17d9120dde7e6598a05ea4d1556c2783c69b) Diff: --- libstdc++-v3/include/experimental/bits/simd_math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd_math.h b/libstdc++-v3/include/experimental/bits/simd_math.h index 5fe44adceb5..b008139c11c 100644 --- a/libstdc++-v3/include/experimental/bits/simd_math.h +++ b/libstdc++-v3/include/experimental/bits/simd_math.h @@ -1010,7 +1010,7 @@ template using _IV = rebind_simd_t<_Ip, _V>; const auto __as_int = simd_bit_cast<_IV>(__hi_exp); const _V __scale - = simd_bit_cast<_V>(2 * simd_bit_cast<_Ip>(_Tp(1)) - __as_int); + = simd_bit_cast<_V>(2 * __bit_cast<_Ip>(_Tp(1)) - __as_int); #else const _V __scale = (__hi_exp ^ __inf) * _Tp(.5); #endif @@ -1180,7 +1180,7 @@ _GLIBCXX_SIMD_CVTING2(hypot) using _IV = rebind_simd_t<_Ip, _V>; const auto __as_int = simd_bit_cast<_IV>(__hi_exp); const _V __scale - = simd_bit_cast<_V>(2 * simd_bit_cast<_Ip>(_Tp(1)) - __as_int); + = simd_bit_cast<_V>(2 * __bit_cast<_Ip>(_Tp(1)) - __as_int); #else const _V __scale = (__hi_exp ^ __inf) * _Tp(.5); #endif