Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > On Tue, 2021-05-04 at 13:13 +0200, Matthias Kretz wrote: > > This attribute overrides the diagnostics output string for the entity > > it > > appertains to. The motivation is to improve QoI for library TS >

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
On Tuesday, 4 May 2021 16:23:23 CEST Matthias Kretz wrote: > On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > > Does the patch interact correctly with the %H and %I codes that try to > > show the differences between two template types? > > I don't know. I&

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
flags); pp_cxx_tree_identifier (pp, TYPE_IDENTIFIER (t)); This is important for my diagnose_as patch because otherwise the output is: 'const string' {aka 'const std::string'} which is confusing and unnecessarily verbose. Patch below. From: Matthias Kretz dump_type on &#

Re: [PATCH v2] libstdc++: add ARM SVE support to std::experimental::simd

2024-03-08 Thread Matthias Kretz
Hi, I applied and did extended testing on x86_64 (no regressions) and aarch64 using qemu testing SVE 256, 512, and 1024. Looks good! While going through the applied patch I noticed a few style issues that I simply turned into a patch (attached). A few comments inline. Sorry for not seeing thes

[PATCH] libstdc++: Fix call signature of builtins from masked ++/--

2024-03-27 Thread Matthias Kretz
le changed, 9 insertions(+), 3 deletions(-) -- ────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.d

Re: [PATCH v2] libstdc++: add ARM SVE support to std::experimental::simd

2024-03-27 Thread Matthias Kretz
of the spec and implementation is to gather experience. Best, Matthias -- ────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmh

Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2024-03-27 Thread Matthias Kretz
d SIMD registers). > In Neoverse V1 (SVE256) they are the same physical register as well. > I believe the same is true for A64FX. That's good to know. 👍 > FWIW, GCC has already started using SVE in this way. E.g. SVE provides > a wider range of immediate constants for logi

[PATCH] libstdc++: Add masked ++/-- implementation for sizeof < 16

2024-03-27 Thread Matthias Kretz
And one more to fix follow-up / remaining failures. Tested on x86_64-linux- gnu. OK for trunk and 13? 8< -- This resolves further failures (-Wreturn-type warnings) and test failures for where-* tests targeting AVX-512. Signed-off-by: Matthias Kretz libstdc++

Re: [PATCH v2] libstdc++: add ARM SVE support to std::experimental::simd

2024-03-27 Thread Matthias Kretz
tached. -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ── commit 9ac3119fec81fb64d11dee8f853145f937389366

Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2024-03-28 Thread Matthias Kretz
On Mittwoch, 27. März 2024 14:34:52 CET Richard Sandiford wrote: > Matthias Kretz writes: > > The big issue here is that, IIUC, a user (and the simd library) cannot do > > the right thing at the moment. There simply isn't enough context > > information available whe

Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2024-01-17 Thread Matthias Kretz
BITS being set here > and being meanful in any way. I'd love to. In the same way I'd love to *not depend* on __AVX__, __AVX512F__ etc. - Matthias -- ────── Dr. Matthias Kretz

Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2024-01-17 Thread Matthias Kretz
128) don't do that and might incur a significant latency when going from a NEON register to an SVE register and back (which each requires a store-load, IIUC). So are you thinking of implementing everything via SVE? That would break ABI, no? - Matthias -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──

Re: [PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2024-01-18 Thread Matthias Kretz
On Thursday, 18 January 2024 08:40:48 CET Andrew Pinski wrote: > On Wed, Jan 17, 2024 at 11:28 PM Matthias Kretz wrote: > > template > > struct Point > > { > > T x, y, z; > > > > T distance_to_origin() { > > return sqrt(x * x + y * y +

Re: libstdc++: Speed up push_back

2023-11-23 Thread Matthias Kretz
z): #include auto f() { std::vector x; x.reserve(10); for (int i = 0; i < 10; ++i) x.push_back(0); return x; } auto g() { return std::vector(10, 0); } -- ────── Dr. Matthias Kretz http

Re: [PATCH] [libstdc++] [testsuite] defer to check_vect_support* [PR115454]

2024-06-26 Thread Matthias Kretz
ective-target c++17 } > // { dg-additional-options "-march=x86-64-v4" { target avx512f_runtime } } > // { dg-require-cmath "" } -- ──┬ Dr. Matthias Kretz │ SDE — Software Development for Experiments Senior Software Engineer,

Re: [r15-429 Regression] FAIL: experimental/simd/pr109261_constexpr_simd.cc -msse2 -O2 -Wno-psabi (test for excess errors) on Linux/x86_64

2024-05-14 Thread Matthias Kretz
Matthias On Montag, 13. Mai 2024 18:55:13 MESZ haochen. jiang wrote: > On Linux/x86_64, > > fb1649f8b4ad5043dd0e65e4e3a643a0ced018a9 is the first bad commit > commit fb1649f8b4ad5043dd0e65e4e3a643a0ced018a9 > Author: Matthias Kretz > Date: Mon May 6 12:13:55 2024 +

Re: [r15-429 Regression] FAIL: experimental/simd/pr109261_constexpr_simd.cc -msse2 -O2 -Wno-psabi (test for excess errors) on Linux/x86_64

2024-05-14 Thread Matthias Kretz
ext says: > could not convert '__vector(2) wchar_t' to '_SimdWrapper' And _SimdWrapper has an implicit constructor taking one __vector(2) wchar_t argument. So I potentially need all of the context to make sense of it. - Matthias -- ──

Re: [r15-429 Regression] FAIL: experimental/simd/pr109261_constexpr_simd.cc -msse2 -O2 -Wno-psabi (test for excess errors) on Linux/x86_64

2024-05-15 Thread Matthias Kretz
e issue if I can't get this to fail. I've tested x86_64 multilib with -m32 and even -mx32 locally and cannot find any issue. 😟 - Matthias -- ────── Dr. Matthias Kretz https://mattkretz.git

Re: [r15-429 Regression] FAIL: experimental/simd/pr109261_constexpr_simd.cc -msse2 -O2 -Wno-psabi (test for excess errors) on Linux/x86_64

2024-05-15 Thread Matthias Kretz
On Mittwoch, 15. Mai 2024 09:06:57 MESZ Matthias Kretz wrote: > On Mittwoch, 15. Mai 2024 04:20:51 MESZ Jiang, Haochen wrote: > > I am little concerned about the file size, but let me give a try if you > > can > > see the attachment. > > [...] > But now that I es

[PATCH] libstdc++: Avoid MMX return types from __builtin_shufflevector

2024-05-15 Thread Matthias Kretz
ves a regression on i686 that was introduced with r15-429-gfb1649f8b4ad50. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/114958 * include/experimental/bits/simd.h (__as_vector): Don't use vector_size(8) on __i386__. (__vec_shuffle): Neve

Re: [PATCH] libstdc++: Avoid MMX return types from __builtin_shufflevector

2024-05-27 Thread Matthias Kretz
ping On Wednesday, 15 May 2024 21:49:56 GMT+2 Matthias Kretz wrote: > Tested on aarch64-linux-gnu, arm-linux-gnueabihf, powerpc64le-linux-gnu, > x86_64-linux-gnu (-m64, -m32, -mx32), and arm-linux-gnueabi > > OK for trunk? And when backporting, should I squash it with the

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Matthias Kretz
ifdef __clang__ > >+ #ifdef _GLIBCXX_CLANG > > I'd like to hear from Matthias to know he's OK with the simd changes. Yes, LGTM. There's no maintained upstream copy of simd anymore. And all occurrences in the simd code are asking for the actual Clang compiler

[PATCH] libstdc++: Fix simd conversion for -fno-signed-char for Clang

2024-06-03 Thread Matthias Kretz
rsion from vector types with compatible integral type. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/115308 * include/experimental/bits/simd.h (__int_for_sizeof): Remove special cases for __clang__. (_SimdWrapper): Change constructor ove

[PATCH] libstdc++: Fix find_last_set(simd_mask) to ignore padding bits

2024-06-17 Thread Matthias Kretz
-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/115454 * include/experimental/bits/simd_x86.h (_S_not_equal_to): Use neq comparison instead of bitwise negation after eq. (_S_find_last_set): Clear unused high bits before computing bit_wi

Re: [PATCH] libstdc++: Fix find_last_set(simd_mask) to ignore padding bits

2024-06-20 Thread Matthias Kretz
Ping. I fear that time to make GCC 11.5 is running out. -Matthias On Tuesday, 18 June 2024 08:22:13 GMT+2 Matthias Kretz wrote: > Tested on x86_64-linux-gnu (also -m32 and -mx32), aarch64-linux-gnu, and > arm- linux-gnueabi(hf). > > OK for trunk and backports? OK, to go for GCC 1

[PATCH] libstdc++: Fix test on x86_64 and non-simd targets

2024-06-21 Thread Matthias Kretz
* Running a test compiled with AVX512 instructions requires avx512f_runtime not just avx512f. * The 'reduce2' test violated an invariant of fixed_size_simd_mask and thus failed on all targets without 16-Byte vector builtins enabled (in bits/simd.h). Signed-off-by: Matthias Kretz li

[PATCH] libstdc++: Avoid ill-formed types on ARM

2024-04-17 Thread Matthias Kretz
Tested on arm-linux-gnueabihf, powerpc64le-linux-gnu, and aarch64-linux-gnu. OK for trunk and backports? - 8< -- This resolves failing tests in check-simd. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/114

[PATCH] libstdc++: Add include guard to simd-internal header

2024-04-17 Thread Matthias Kretz
This never showed up as an issue because it's an internal header and implicitly guarded by bits/simd.h. OK for trunk? Any reason to backport? - 8< -- Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimen

[PATCH] libstdc++: Silence irrelevant warnings in

2024-04-22 Thread Matthias Kretz
g a dependency on a template parameter) Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Ignore -Wnarrowing for arm_neon.h. (__int_for_sizeof): Replace tautological compare with checking for invalid template parameter va

[PATCH] libstdc++: Fix conversion of simd to vector builtin

2024-04-22 Thread Matthias Kretz
Tested on x86_64-linux-gnu, powerpc64le-linux-gnu, aarch64-linux-gnu, arm- linux-gnueabihf OK for trunk and backports? - 8< - Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/114803 * incl

[PATCH] libstdc++: Use __builtin_shufflevector for simd split and concat

2024-05-07 Thread Matthias Kretz
Tested on x86_64-linux-gnu and aarch64-linux-gnu and with Clang 18 on x86_64- linux-gnu. OK for trunk and backport(s)? -- 8< Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/114958 * include/experimental/b

[PATCH] Avoid illegal argument to verbose in dg-test callback

2020-04-16 Thread Matthias Kretz
From: Matthias Kretz If extra_tool_flags starts with a dash, an error like 'ERROR: verbose: illegal argument: -march=native -O2 -std=c++17' is printed. This is easily fixed by inserting a double dash before the variable. * testsuite/lib/libstdc++.exp: Avoid illegal a

[PATCH] Enable simple invocation of runtest in testsuite

2020-04-23 Thread Matthias Kretz
I noticed this inconvenience while learning dejagnu. From: Matthias Kretz * testsuite/Makefile.am: Remove dup target_triplet and set tool, allowing runtest to work without arguments. --- libstdc++-v3/testsuite/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[RFC] Clarify -ffinite-math-only documentation

2020-04-27 Thread Matthias Kretz
. This option is not turned on by any @option{-O} option since it can result in incorrect output for programs that depend on -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz

[PATCH] Let numeric_limits::is_iec559 reflect -ffast-math

2020-04-27 Thread Matthias Kretz
From: Matthias Kretz PR libstdc++/84949 * include/std/limits: Let is_iec559 reflect whether __GCC_IEC_559 says float and double support IEEE 754-2008. * testsuite/18_support/numeric_limits/is_iec559.cc: Test IEC559 mandated behavior if is_iec559 is true

Re: [RFC] Clarify -ffinite-math-only documentation

2020-04-27 Thread Matthias Kretz
On Montag, 27. April 2020 21:39:17 CEST Richard Sandiford wrote: > "Dr. Matthias Kretz" writes: > > On Montag, 27. April 2020 18:59:08 CEST Richard Sandiford wrote: > >> Richard Biener via Gcc-patches writes: > >> > On Mon, Apr 27, 2020 at 6

Re: [RFC] Clarify -ffinite-math-only documentation

2020-04-28 Thread Matthias Kretz
On Dienstag, 28. April 2020 09:21:38 CEST Richard Biener wrote: > On Mon, Apr 27, 2020 at 11:26 PM Matthias Kretz wrote: > > On Montag, 27. April 2020 21:39:17 CEST Richard Sandiford wrote: > > > "Dr. Matthias Kretz" writes: > > > > On Montag, 27. April 20

[PATCH] Fix parser to recognize operator?:

2019-10-11 Thread Matthias Kretz
This is a minor bugfix for improved error reporting. Overloading ?: is just as disallowed as it is without this change. 2019-10-11 Matthias Kretz * gcc/cp/parser.c (cp_parser_operator): Parse operator?: as an attempt to overload the conditional operator. Then

Re: [PATCH] Fix parser to recognize operator?:

2019-10-14 Thread Matthias Kretz
On Freitag, 11. Oktober 2019 16:17:09 CEST Marek Polacek wrote: > On Fri, Oct 11, 2019 at 04:06:43PM +0200, Matthias Kretz wrote: > > This is a minor bugfix for improved error reporting. Overloading ?: is > > just as disallowed as it is without this change. > > Thanks. Can y

Re: [PATCH] Fix parser to recognize operator?:

2019-10-14 Thread Matthias Kretz
This time with testcase. Is the subdir for the test ok? gcc/ChangeLog: 2019-10-11 Matthias Kretz * gcc/cp/parser.c (cp_parser_operator): Parse operator?: as an attempt to overload the conditional operator. Then grok_op_properties can print its useful "

[PATCH] std::experimental::simd

2019-10-14 Thread Matthias Kretz
specific conversion optimizations. -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtzzentrum für Schwerionenforschung https://gsi.de SIMD easy and portable

Re: [PATCH] Let numeric_limits::is_iec559 reflect -ffast-math

2020-05-22 Thread Matthias Kretz
On Donnerstag, 21. Mai 2020 17:46:01 CEST Marc Glisse wrote: > On Thu, 21 May 2020, Jonathan Wakely wrote: > > On 27/04/20 17:09 +0200, Matthias Kretz wrote: > >> From: Matthias Kretz > >> > >>PR libstdc++/84949 > >>* incl

Re: [PATCH] Let numeric_limits::is_iec559 reflect -ffast-math

2020-05-25 Thread Matthias Kretz
On Freitag, 22. Mai 2020 18:39:42 CEST Jonathan Wakely wrote: > On 22/05/20 09:49 +0200, Matthias Kretz wrote: > >On Donnerstag, 21. Mai 2020 17:46:01 CEST Marc Glisse wrote: > >> On Thu, 21 May 2020, Jonathan Wakely wrote: > >> > On 27/04/20 17:09 +0200, Matt

Re: [PATCH] Add simd testsuite

2020-12-18 Thread Matthias Kretz
On Donnerstag, 17. Dezember 2020 14:10:51 CET Jonathan Wakely wrote: > On 16/12/20 12:58 +0100, Matthias Kretz wrote: > >+ $srcdir/testsuite/experimental/simd/generate_makefile.sh \ > >+--destination="$testdir/$subdir" $CXX $INCLUDES $CXXFLAGS -static > > Is th

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-15 Thread Matthias Kretz
On Tuesday, 15 June 2021 17:51:20 CEST Jason Merrill wrote: > On 6/11/21 6:01 AM, Matthias Kretz wrote: > > For reference I'll attach my stdx::simd diagnose_as patch. > > > > We could also talk about extending the feature to provide more information > > about

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Matthias Kretz
to adjust the grammar rules, that'd help. :) Best, Matthias -- ────── 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 ──

Re: [committed] libstdc++: Improve std::lock algorithm

2021-06-22 Thread Matthias Kretz
_L2& __l2, _L3&... __l3) > { > - while (true) > -{ > - using __try_locker = __try_lock_impl<0, sizeof...(_L3) != 0>; > - unique_lock<_L1> __first(__l1); > - int __idx; > - auto __locks = std::ti

Re: [PATCH v2] libstdc++: Improve std::lock algorithm

2021-06-22 Thread Matthias Kretz
if (!__locks[__idx].try_lock()) > + { > + for (int __k = __j; __k != 0; --__k) > + __locks[(__first + __k - 1) % _Np].unlock(); > + __first = __idx; > + break; > +

Re: [PATCH v2] libstdc++: Improve std::lock algorithm

2021-06-22 Thread Matthias Kretz
On Dienstag, 22. Juni 2021 17:20:41 CEST Jonathan Wakely wrote: > On Tue, 22 Jun 2021 at 14:21, Matthias Kretz wrote: > > This does a try_lock on all lockabes even if any of them fails. I think > > that's > > not only more expensive but also non-conforming. I think you

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Matthias Kretz
atching template params? -Matthias -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de std::experimental::simd

Re: [PATCH 04/11 v3] libstdc++: Make use of __builtin_bit_cast

2021-06-24 Thread Matthias Kretz
For -ffast-math there was a missing using namespace __proposed left. The attached patch resolves the issue. From: Matthias Kretz The __bit_cast function was a hack to achieve what __builtin_bit_cast can do, therefore use __builtin_bit_cast if possible. However, __builtin_bit_cast cannot be

[PATCH] c-family: Add more predefined macros for math flags

2021-06-30 Thread Matthias Kretz
-math, -fassociative-math, and -frounding-math report their state via corresponding pre-defined macros. Signed-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * gcc.dg/associative-math-1.c: New test. * gcc.dg/associative-math-2.c: New test. * gcc.dg/no-signed-zeros-1.c: New

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-01 Thread Matthias Kretz
On Tuesday, 22 June 2021 22:12:42 CEST Jason Merrill wrote: > On 6/22/21 4:01 PM, Matthias Kretz wrote: > > On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: > >> For alias templates, you probably want the attribute only on the > >> templated class, not on the

[PATCH] c++: don't ICE on NAMESPACE_DECL inside FUNCTION_DECL

2021-12-15 Thread Matthias Kretz
NAMESPACE_DECL and therefore must be handled first in the assertion. Signed-off-by: Matthias Kretz gcc/cp/ChangeLog: * module.cc (trees_out::get_merge_kind): NAMESPACE_DECLs also cannot have a DECL_TEMPLATE_INFO. --- gcc/cp/module.cc | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH] libstdc++: Don't fail if math_errhandling is not defined

2022-01-17 Thread Matthias Kretz
Tested on x86_64-linux and powerpc64le-linux. This fixes the powerpc64le-linux failure Jonathan reported. OK for trunk? Older glibc does not define math_errhandling with -ffast-math, in which case floating-point exceptions are not used. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog

[PATCH] fix type typo in avx512fintrin.h

2018-01-23 Thread Matthias Kretz
I just hit a compile error on AVX512 code. The fix is trivial enough that I didn't bother writing a PR and just fixed it. Acceptable? I hope this doesn't require the paperwork, though my employer is willing to do it anyway. :-) Cheers, Matthias 2018-01-23 Matt

Re: [PATCH] x86: Update VFIXUPIMM* Intrinsics to align with the latest Intel SDM

2019-01-10 Thread Matthias Kretz
On Donnerstag, 10. Januar 2019 11:39:56 CET Jakub Jelinek wrote: > On Thu, Jan 10, 2019 at 10:46:14AM +0100, Dr. Matthias Kretz wrote: > > _mm_fixupimm_ps(_mm_getexp_ps(x), x, _mm_set1_epi32(0x00550433), 0x00); > > I guess you could use > _mm_mask_fixupimm_ps(_mm_g

Re: [PATCH] x86: Update VFIXUPIMM* Intrinsics to align with the latest Intel SDM

2019-01-10 Thread Matthias Kretz
On Donnerstag, 10. Januar 2019 14:27:40 CET Matthias Kretz wrote: > On Donnerstag, 10. Januar 2019 11:39:56 CET Jakub Jelinek wrote: > > On Thu, Jan 10, 2019 at 10:46:14AM +0100, Dr. Matthias Kretz wrote: > > > _mm_fixupimm_ps(_mm_getexp_ps(x), x, _mm_set1_epi32(0x00550433),

Re: [PATCH] Fix parser to recognize operator?:

2019-10-24 Thread Dr. Matthias Kretz
ping On Montag, 14. Oktober 2019 12:27:11 CEST Matthias Kretz wrote: > This time with testcase. Is the subdir for the test ok? > > gcc/ChangeLog: > > 2019-10-11 Matthias Kretz > > * gcc/cp/parser.c (cp_parser_operator): Parse operator?: as an >

Re: [PATCH] std::experimental::simd

2020-01-07 Thread Dr. Matthias Kretz
On Dienstag, 7. Januar 2020 12:16:57 CET Andrew Pinski wrote: > On Tue, Jan 7, 2020 at 3:01 AM Matthias Kretz wrote: > > Is there any chance left we can get this done for 10.1? If not, can we > > please get it ready for 10.2 ASAP? > > > > Cheers, > > >

Re: [PATCH] c++: Add missing scope in typedef diagnostic [PR100763]

2021-05-27 Thread Dr. Matthias Kretz
On Thursday, 27 May 2021 17:18:58 CEST Jason Merrill wrote: > On 5/26/21 5:27 PM, Matthias Kretz wrote: > > From: Matthias Kretz > > > > dump_type on 'const std::string' should not print 'const string' unless > > TFF_UNQUALIFIED_NAME is requested. &

Re: [RFC] Clarify -ffinite-math-only documentation

2020-04-27 Thread Dr. Matthias Kretz
On Montag, 27. April 2020 18:59:08 CEST Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > On Mon, Apr 27, 2020 at 6:09 PM Matthias Kretz wrote: > >> Hi, > >> > >> This documentation change clarifies the effect of -ffinite-math-only. > &

Re: [PATCH] x86: Update VFIXUPIMM* Intrinsics to align with the latest Intel SDM

2019-01-10 Thread Dr. Matthias Kretz
*gcc.target/i386/avx512vl-vfixupimmps-1.c: Ditto. > *gcc.target/i386/sse-13.c: Ditto. > *gcc.target/i386/sse-14.c: Ditto. > *gcc.target/i386/sse-22.c: Ditto. > *gcc.target/i386/sse-23.c: Ditto. > *gcc.target/i386/testimm-10.c: Ditto. >

[committed] libstdc++: Resolve -Wsign-compare issue

2023-05-26 Thread Matthias Kretz via Gcc-patches
pushed to master, will backport later tested on x86_64-pc-linux-gnu and powerpc64le-linux-gnu --- 8< Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_ppc.h (_S_bit_shift_left): Negative __y is UB, so prefer sig

[PATCH] libstdc++: Fix test assumptions on long and long double

2023-05-26 Thread Matthias Kretz via Gcc-patches
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 libstdc++-v3/ChangeLog: * testsu

[PATCH] libstdc++: Simplify calculation of expected value in simd test

2023-05-26 Thread Matthias Kretz via Gcc-patches
OK for master and all backports (after 11.4 is done)? tested on powerpc64le-linux-gnu --- 8< This avoids a failure on PR109964. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/integer_operators.cc: Comp

[PATCH] libstdc++: Correct NTTP and simd_mask ctor call

2023-05-26 Thread Matthias Kretz via Gcc-patches
OK for master and all backports (after 11.4 is done)? tested on powerpc64le-linux-gnu and x86_64-pc-linux-gnu --- 8< Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/109822 * include/experimental/bits/simd.h (to_native): Use int N

[committed] libstdc++: Fix condition for supported SIMD types on ARMv8

2023-06-01 Thread Matthias Kretz via Gcc-patches
pushed to trunk, will backport tested on arm-linux-gnueabihf -- 8< -- Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/110050 * include/experimental/bits/simd.h (__vectorized_sizeof): With __have_neon_a32 only single-precision fl

Re: [PATCH] doc: clarify semantics of vector bitwise shifts

2023-06-02 Thread Matthias Kretz via Gcc-patches
version of int. > Revised patch below. This can be considered a breaking change. Does it need a mention in the release notes? - Matthias -- ────── Dr. Matthias Kretz https://mattkretz.github.io

Re: [PATCH] libstdc++: Correct NTTP and simd_mask ctor call

2023-06-02 Thread Matthias Kretz via Gcc-patches
Hello Alexandre, On Friday, 2 June 2023 10:32:40 CEST Alexandre Oliva wrote: > On May 26, 2023, Matthias Kretz via Libstdc++ wrote: > > OK for master and all backports (after 11.4 is done)? > > tested on powerpc64le-linux-gnu and x86_64-pc-linux-gnu > > > > *

Re: [PATCH] doc: clarify semantics of vector bitwise shifts

2023-06-02 Thread Matthias Kretz via Gcc-patches
e implementation of the shift operator depends on the current behavior, even if it is target-dependent. For PPC the simd implementation adds extra code to avoid the "UB". With nailing down shifts > sizeof(T) as UB this extra code now needs to be added for all targets. - M

Re: [PATCH] doc: clarify semantics of vector bitwise shifts

2023-06-02 Thread Matthias Kretz via Gcc-patches
ht just be that some codes have become dependent on the existing (under-specified) behavior. 🤷 - Matthias -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ──

Re: [PATCH] libstdc++: Correct NTTP and simd_mask ctor call

2023-06-02 Thread Matthias Kretz via Gcc-patches
++, but also that even those that are present are not visible in > namespace ::std::, where the macros reasonably expect to find them. Is > this known? Should I file a PR about it? I had/have no idea. Is rtems6 using the "freestanding" subset of C++? In which case simd shouldn&#x

[committed] libstdc++: Protect against macros

2023-06-06 Thread Matthias Kretz via Gcc-patches
pushed to trunk, will backport later tested on x86_64-pc-linux-gnu --- >8 Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__bit_cast): Use __gnu__::__vector_size__ instead of gnu::vector_size. --- libstdc++-v3/incl

[PATCH] libstdc++: Replace use of incorrect non-temporal store

2023-06-06 Thread Matthias Kretz via Gcc-patches
current ABI tag's _SimdImpl. This also reduces the number of possible template instantiations. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/110054 * include/experimental/bits/simd_builtin.h (_S_masked_store): Call into deduced ABI'

[PATCH] libstdc++: Avoid vector casts while still avoiding PR90424

2023-06-06 Thread Matthias Kretz via Gcc-patches
ned-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/109822 * include/experimental/bits/simd_builtin.h (_S_store): Rewrite to avoid casts to other vector types. Implement store as succession of power-of-2 sized memcpy to avoid PR90424. --- .../incl

[PATCH] libstdc++: Rewrite or avoid casts to 64-bit element types

2023-06-06 Thread Matthias Kretz via Gcc-patches
SX POWER targets. Replace __extract_part implementation (which was the only user of __shift_elements_right) by relying on __builtin_shufflevector (not available in GCC 11). This removes another cast to 64-bit element type, which breaks on non-VSX POWER. Signed-off-by: Matthias Kretz libstdc++-v3/C

[PATCH 0/7] Work on PR108030 and several simd bugfixes and testsuite improvements

2023-02-15 Thread Matthias Kretz via Gcc-patches
implemented the use of PCH to speed up the test suite. Matthias Kretz (7): libstdc++: Ensure __builtin_constant_p isn't lost on the way libstdc++: Annotate most lambdas with always_inline libstdc++: Document timeout and timeout-factor of simd tests libstdc++: Use a PCH to speed up check

[PATCH 1/7] libstdc++: Ensure __builtin_constant_p isn't lost on the way

2023-02-15 Thread Matthias Kretz via Gcc-patches
The more expensive code path should only be taken if it can be optimized away. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (_SimdWrapper::_M_is_constprop_none_of) (_SimdWrapper::_M_is_constprop_all_of): Return false unless

[PATCH 3/7] libstdc++: Document timeout and timeout-factor of simd tests

2023-02-15 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/README.md: Document the timeout and timeout-factor directives. Minor typo fixed. --- libstdc++-v3/testsuite/experimental/simd/README.md | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH 7/7] libstdc++: Fix incorrect function call in -ffast-math optimization

2023-02-15 Thread Matthias Kretz via Gcc-patches
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. --- libstdc++-v3/include/experimental/bits/simd_math.h | 4 ++-- 1

[PATCH 2/7] libstdc++: Annotate most lambdas with always_inline

2023-02-15 Thread Matthias Kretz via Gcc-patches
All of the annotated lambdas are simply a necessary means for implementing these functions and should never result in an actual function call. Many of these lambdas would go away if C++ had better language support for packs. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR

[PATCH 5/7] libstdc++: printf format string fix in testsuite

2023-02-15 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/bits/verify.h (verify::verify): Use %zx for size_t in format string. --- libstdc++-v3/testsuite/experimental/simd/tests/bits/verify.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 4/7] libstdc++: Use a PCH to speed up check-simd

2023-02-15 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/generate_makefile.sh: Generate and pre-compile pch.h, which includes all headers that do not depend on command-line macros. * testsuite/experimental/simd/tests/bits/conversions.h

[PATCH 6/7] libstdc++: Fix incorrect __builtin_is_constant_evaluated calls

2023-02-15 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_not_equal_to, _SimdImplX86::_S_less) (_SimdImplX86::_S_less_equal): Do not call __builtin_is_constant_evaluated in constexpr-if. --- .../include

[committed] libstdc++: Fix uses of non-reserved names in simd header

2023-02-20 Thread Matthias Kretz via Gcc-patches
Tested x86_64-pc-linux. Pushed to trunk. -- >8 -- Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__extract_part, split): Use reserved name for template parameter. --- libstdc++-v3/include/experimental/bits/simd.h |

[PATCH 8/8] libstdc++: Test that integral simd reductions are precise

2023-02-23 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/reductions.cc: Introduce max_distance as the type-dependent max error. --- libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 4/8] libstdc++: Add missing constexpr on simd shift implementation

2023-02-23 Thread Matthias Kretz via Gcc-patches
Resolves -Wtautological-compare warnings about `if (__builtin_is_constant_evaluated())` in the implementations of these functions. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_S_bit_shift_left) (_S_bit_shift_right): Declare

[PATCH 6/8] libstdc++: Fix formatting

2023-02-23 Thread Matthias Kretz via Gcc-patches
Whitespace changes only. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Line breaks and indenting fixed to follow the libstdc++ standard. * include/experimental/bits/simd_builtin.h: Likewise. * include/experimental

[PATCH 7/8] libstdc++: Fix -Wsign-compare issue

2023-02-23 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_builtin.h (_S_set): Compare as int. The actual range of these indexes is very small. --- libstdc++-v3/include/experimental/bits/simd_builtin.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 2/8] libstdc++: Fix simd build failure on clang

2023-02-23 Thread Matthias Kretz via Gcc-patches
Clang does not support __attribute__ on lambdas. Therefore, only set _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA if __clang__ is not defined. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/108030 * include/experimental/bits/simd_detail.h

[PATCH 5/8] libstdc++: Always-inline most of non-cmath fixed_size implementation

2023-02-23 Thread Matthias Kretz via Gcc-patches
For simd, the inlining behavior should be similar to builtin types. (No operator on buitin types is ever translated into a function call.) Therefore, always_inline is the right choice (i.e. inline on -O0 as well). Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc

[PATCH 3/8] libstdc++: More efficient masked inc-/decrement implementation

2023-02-23 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/108856 * include/experimental/bits/simd_builtin.h (_SimdImplBuiltin::_S_masked_unary): More efficient implementation of masked inc-/decrement for integers and floats without AVX2

[PATCH 1/8] libstdc++: Simplify three helper functions into one

2023-02-23 Thread Matthias Kretz via Gcc-patches
Broadcast is a very common function. This should reduce compile-time effort. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR libstdc++/108030 * include/experimental/bits/simd.h (__vector_broadcast): Implement via __vector_broadcast_impl instead of

[PATCH 0/8] std::experimental::simd patchset

2023-02-23 Thread Matthias Kretz via Gcc-patches
Tested on x86_64-pc-linux. This patchset provides the final changes for PR108030 and resolves PR108856. The latter is a pure optimization and could wait for Stage 1 (I'm submitting the patch because simd is experimental/TS) Matthias Kretz (8): libstdc++: Simplify three helper functions

Re: [PATCH 4/8] libstdc++: Add missing constexpr on simd shift implementation

2023-02-23 Thread Matthias Kretz via Gcc-patches
On Thursday, 23 February 2023 12:07:11 CET Jonathan Wakely wrote: > On Thu, 23 Feb 2023 at 08:55, Matthias Kretz via Libstdc++ > > wrote: > > Resolves -Wtautological-compare warnings about `if > > (__builtin_is_constant_evaluated())` in the implementations of these &g

Re: [PATCH 6/8] libstdc++: Fix formatting

2023-02-24 Thread Matthias Kretz via Gcc-patches
d all other patches to trunk that came before this one. -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ──

[committed] libstdc++: Resolve -Wunused-variable warnings in stdx::simd and tests

2023-05-22 Thread Matthias Kretz via Gcc-patches
pushed to master, will backport later regtested on x86_64-linux Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_builtin.h (_S_fpclassify): Move __infn into #ifdef'ed block. * testsuite/experimental/simd/tests/fpclassi

[PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Matthias Kretz via Gcc-patches
expressions. Issues why constant_evaluated branches are necessary: * subscripting vector builtins is not allowed in constant expressions * if the implementation needs/uses memcpy * if the implementation would otherwise call SIMD intrinsics/builtins Signed-off-by: Matthias Kretz libstdc++-v3

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Matthias Kretz via Gcc-patches
xpr_simd.cc correct, or just > copy&paste? Right, copy&paste. Should I simply remove the complete header? - Matthias -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ──

<    1   2   3   >