* [PATCH] libstdc++: Fix test assumptions on long and long double
@ 2023-05-26 11:02 Matthias Kretz
2023-05-26 15:44 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Kretz @ 2023-05-26 11:02 UTC (permalink / raw)
To: gcc-patches, libstdc++
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
OK for master and all backports (after 11.4 is done)
tested on powerpc64le-linux-gnu (with 64-bit long double)
----------- 8< ------------
Expect that long might not fit into the long double mantissa bits.
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/operator_cvt.cc: Make long
double <-> (u)long conversion tests conditional on sizeof(long
double) and sizeof(long).
---
.../experimental/simd/tests/operator_cvt.cc | 30 +++++++++++++++----
1 file changed, 24 insertions(+), 6 deletions(-)
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://mattkretz.github.io
GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
stdₓ::simd
──────────────────────────────────────────────────────────────────────────
[-- Attachment #2: 0002-libstdc-Fix-test-assumptions-on-long-and-long-double.patch --]
[-- Type: text/x-patch, Size: 3210 bytes --]
diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc
index c1acfdf10e0..9b6cb38ff82 100644
--- a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc
+++ b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc
@@ -219,8 +219,6 @@ namespace simd_abi
binary_op_return_type<vldouble, short>();
binary_op_return_type<vldouble, ushort>();
binary_op_return_type<vldouble, uint>();
- binary_op_return_type<vldouble, long>();
- binary_op_return_type<vldouble, ulong>();
binary_op_return_type<vldouble, float>();
binary_op_return_type<vldouble, double>();
@@ -230,8 +228,6 @@ namespace simd_abi
binary_op_return_type<vf64<long double>, ushort>();
binary_op_return_type<vf64<long double>, int>();
binary_op_return_type<vf64<long double>, uint>();
- binary_op_return_type<vf64<long double>, long>();
- binary_op_return_type<vf64<long double>, ulong>();
binary_op_return_type<vf64<long double>, float>();
binary_op_return_type<vf64<long double>, double>();
binary_op_return_type<vf64<long double>, vf64<long double>>();
@@ -244,8 +240,6 @@ namespace simd_abi
binary_op_return_type<simd<long double, A>, ushort>();
binary_op_return_type<simd<long double, A>, int>();
binary_op_return_type<simd<long double, A>, uint>();
- binary_op_return_type<simd<long double, A>, long>();
- binary_op_return_type<simd<long double, A>, ulong>();
binary_op_return_type<simd<long double, A>, float>();
binary_op_return_type<simd<long double, A>, double>();
@@ -257,6 +251,24 @@ namespace simd_abi
VERIFY((is_substitution_failure<vf64<ldouble>, ullong>));
VERIFY((is_substitution_failure<simd<ldouble, A>, llong>));
VERIFY((is_substitution_failure<simd<ldouble, A>, ullong>));
+ if constexpr (sizeof(long) == sizeof(llong))
+ {
+ VERIFY((is_substitution_failure<vldouble, long>));
+ VERIFY((is_substitution_failure<vldouble, ulong>));
+ VERIFY((is_substitution_failure<vf64<ldouble>, long>));
+ VERIFY((is_substitution_failure<vf64<ldouble>, ulong>));
+ VERIFY((is_substitution_failure<simd<ldouble, A>, long>));
+ VERIFY((is_substitution_failure<simd<ldouble, A>, ulong>));
+ }
+ else
+ {
+ binary_op_return_type<vldouble, long>();
+ binary_op_return_type<vldouble, ulong>();
+ binary_op_return_type<vf64<long double>, long>();
+ binary_op_return_type<vf64<long double>, ulong>();
+ binary_op_return_type<simd<long double, A>, long>();
+ binary_op_return_type<simd<long double, A>, ulong>();
+ }
}
else
{
@@ -266,6 +278,12 @@ namespace simd_abi
binary_op_return_type<vf64<long double>, ullong>();
binary_op_return_type<simd<long double, A>, llong>();
binary_op_return_type<simd<long double, A>, ullong>();
+ binary_op_return_type<vldouble, long>();
+ binary_op_return_type<vldouble, ulong>();
+ binary_op_return_type<vf64<long double>, long>();
+ binary_op_return_type<vf64<long double>, ulong>();
+ binary_op_return_type<simd<long double, A>, long>();
+ binary_op_return_type<simd<long double, A>, ulong>();
}
VERIFY((is_substitution_failure<vf64<long double>, vldouble>));
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libstdc++: Fix test assumptions on long and long double
2023-05-26 11:02 [PATCH] libstdc++: Fix test assumptions on long and long double Matthias Kretz
@ 2023-05-26 15:44 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-05-26 15:44 UTC (permalink / raw)
To: Matthias Kretz; +Cc: gcc-patches, libstdc++
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
On Fri, 26 May 2023 at 12:03, Matthias Kretz via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:
> OK for master and all backports (after 11.4 is done)
>
OK
>
> tested on powerpc64le-linux-gnu (with 64-bit long double)
>
> ----------- 8< ------------
>
> Expect that long might not fit into the long double mantissa bits.
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>
> libstdc++-v3/ChangeLog:
>
> * testsuite/experimental/simd/tests/operator_cvt.cc: Make long
> double <-> (u)long conversion tests conditional on sizeof(long
> double) and sizeof(long).
> ---
> .../experimental/simd/tests/operator_cvt.cc | 30 +++++++++++++++----
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
>
> --
> ──────────────────────────────────────────────────────────────────────────
> Dr. Matthias Kretz https://mattkretz.github.io
> GSI Helmholtz Centre for Heavy Ion Research https://gsi.de
> stdₓ::simd
> ──────────────────────────────────────────────────────────────────────────
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-26 15:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26 11:02 [PATCH] libstdc++: Fix test assumptions on long and long double Matthias Kretz
2023-05-26 15:44 ` Jonathan Wakely
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).