From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7857) id 1422538493D1; Thu, 16 Feb 2023 14:59:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1422538493D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676559557; bh=RYS+gYYMpvb+EjBw/lBn6aN6fUHxXXHRfdaF7+VYQLM=; h=From:To:Subject:Date:From; b=OBHjT55YqOIyvxvF1mJ3aD95SuzmjgbtcliFH3bWezXYBtWJUrz8dGkLBZ3fLTkBb 9ND0BACgftHevN8H37yKbfLlH/59pmZGu7a6+6HF6C45yRbseuw0m8WoeuhIcCN3ln P5OJ3O+ZruLKXZJGER9T/NUXCDyIp6tdwVffplmI= 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 r13-6095] libstdc++: Fix incorrect function call in -ffast-math optimization X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/master X-Git-Oldrev: 1fd3836463c65f695831ef04c7dbda1e7a1794ba X-Git-Newrev: a5de17d9120dde7e6598a05ea4d1556c2783c69b Message-Id: <20230216145917.1422538493D1@sourceware.org> Date: Thu, 16 Feb 2023 14:59:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:a5de17d9120dde7e6598a05ea4d1556c2783c69b commit r13-6095-ga5de17d9120dde7e6598a05ea4d1556c2783c69b 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. 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 c20315e4e30..c91f05fceb3 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 @@ -1181,7 +1181,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