From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 5694039AF1A3; Wed, 3 Feb 2021 15:50:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5694039AF1A3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-7070] libstdc++: Support -mlong-double-64 on PPC X-Act-Checkin: gcc X-Git-Author: Matthias Kretz X-Git-Refname: refs/heads/master X-Git-Oldrev: 4f22942841edabbdda8a15b172a5c143da7bdafe X-Git-Newrev: db256f9bef8c376e9d88e8f32ce94a03b6d105ee Message-Id: <20210203155018.5694039AF1A3@sourceware.org> Date: Wed, 3 Feb 2021 15:50:18 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 15:50:18 -0000 https://gcc.gnu.org/g:db256f9bef8c376e9d88e8f32ce94a03b6d105ee commit r11-7070-gdb256f9bef8c376e9d88e8f32ce94a03b6d105ee Author: Matthias Kretz Date: Wed Feb 3 15:49:29 2021 +0000 libstdc++: Support -mlong-double-64 on PPC libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Let __intrinsic_type be valid if sizeof(long double) == sizeof(double) and use a __vector double as member type. Diff: --- libstdc++-v3/include/experimental/bits/simd.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h index c379721c7be..477af86fd5e 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -2285,7 +2285,9 @@ template struct __intrinsic_type<_Tp, _Bytes, enable_if_t<__is_vectorizable_v<_Tp> && _Bytes <= 16>> { - static_assert(!is_same_v<_Tp, long double>, + static constexpr bool _S_is_ldouble = is_same_v<_Tp, long double>; + // allow _Tp == long double with -mlong-double-64 + static_assert(!(_S_is_ldouble && sizeof(long double) > sizeof(double)), "no __intrinsic_type support for long double on PPC"); #ifndef __VSX__ static_assert(!is_same_v<_Tp, double>, @@ -2297,8 +2299,11 @@ template "no __intrinsic_type support for integers larger than 4 Bytes " "on PPC w/o POWER8 vectors"); #endif - using type = typename __intrinsic_type_impl, _Tp, __int_for_sizeof_t<_Tp>>>::type; + using type = + typename __intrinsic_type_impl< + conditional_t, + conditional_t<_S_is_ldouble, double, _Tp>, + __int_for_sizeof_t<_Tp>>>::type; }; #endif // __ALTIVEC__