From: Matthias Kretz <m.kretz@gsi.de>
To: <gcc-patches@gcc.gnu.org>, <libstdc++@gcc.gnu.org>
Subject: [PATCH 03/16] Support -mlong-double-64 on PPC
Date: Wed, 27 Jan 2021 21:42:00 +0100 [thread overview]
Message-ID: <7614121.znU0eCzeS4@excalibur> (raw)
In-Reply-To: <4667217.5jz8CO7rxU@excalibur>
From: Matthias Kretz <kretz@kde.org>
libstdc++-v3/ChangeLog:
* include/experimental/bits/simd.h: Let __intrinsic_type<long
double, N> be valid if sizeof(long double) == sizeof(double) and
use a __vector double as member type.
---
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 d56176210df..64cf8d32328 100644
--- a/libstdc++-v3/include/experimental/bits/simd.h
+++ b/libstdc++-v3/include/experimental/bits/simd.h
@@ -2285,7 +2285,9 @@ template <typename _Tp, size_t _Bytes>
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 <typename _Tp, size_t _Bytes>
"no __intrinsic_type support for integers larger than 4 Bytes "
"on PPC w/o POWER8 vectors");
#endif
- using type = typename __intrinsic_type_impl<conditional_t<
- is_floating_point_v<_Tp>, _Tp, __int_for_sizeof_t<_Tp>>>::type;
+ using type =
+ typename __intrinsic_type_impl<
+ conditional_t<is_floating_point_v<_Tp>,
+ conditional_t<_S_is_ldouble, double, _Tp>,
+ __int_for_sizeof_t<_Tp>>>::type;
};
#endif // __ALTIVEC__
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://mattkretz.github.io
GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
std::experimental::simd https://github.com/VcDevel/std-simd
──────────────────────────────────────────────────────────────────────────
next prev parent reply other threads:[~2021-01-27 20:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 20:36 [PATCH 00/16] stdx::simd fixes and testsuite improvements Matthias Kretz
2021-01-27 20:41 ` [PATCH 02/16] Fix NEON intrinsic types usage Matthias Kretz
2021-01-27 20:42 ` Matthias Kretz [this message]
2021-01-27 20:42 ` [PATCH 04/16] Fix simd_mask<double> on POWER w/o POWER8 Matthias Kretz
2021-01-27 20:42 ` [PATCH 05/16] Fix several check-simd interaction issues Matthias Kretz
2021-01-27 20:42 ` [PATCH 06/16] Fix DRIVEROPTS and TESTFLAGS processing Matthias Kretz
2021-01-27 20:42 ` [PATCH 07/16] Fix incorrect display of old test summaries Matthias Kretz
2021-01-27 20:42 ` [PATCH 08/16] Immediate feedback with -v Matthias Kretz
2021-01-27 20:42 ` [PATCH 09/16] Fix mask reduction of simd_mask<double> on POWER7 Matthias Kretz
2021-01-27 20:42 ` [PATCH 10/16] Skip testing hypot3 for long double on PPC Matthias Kretz
2021-01-27 20:42 ` [PATCH 11/16] Abort test after 1000 lines of output Matthias Kretz
2021-01-27 20:42 ` [PATCH 12/16] Support timeout and timeout-factor options Matthias Kretz
2021-01-27 20:42 ` [PATCH 13/16] Improve test codegen for interpreting assembly Matthias Kretz
2021-02-02 15:02 ` Jonathan Wakely
2021-01-27 20:42 ` [PATCH 14/16] Implement hmin and hmax Matthias Kretz
2021-02-01 10:23 ` Matthias Kretz
2021-01-27 20:42 ` [PATCH 15/16] Work around test failures using -mno-tree-vrp Matthias Kretz
2021-01-27 20:42 ` [PATCH 16/16] Improve "find_first/last_set" for NEON Matthias Kretz
2021-02-03 15:52 ` [PATCH 00/16] stdx::simd fixes and testsuite improvements Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7614121.znU0eCzeS4@excalibur \
--to=m.kretz@gsi.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).