Re: [RFC] GNU Vector Extension -- Packed Boolean Vectors

2023-10-05 Thread Matthias Kretz
- let me know. -Matthias -- ────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──

[PATCH 00/16] stdx::simd fixes and testsuite improvements

2021-01-27 Thread Matthias Kretz
As promised on IRC ... Matthias Kretz (15): Support skip, only, expensive, and xfail markers Fix NEON intrinsic types usage Support -mlong-double-64 on PPC Fix simd_mask on POWER w/o POWER8 Fix several check-simd interaction issues Fix DRIVEROPTS and TESTFLAGS processing Fix

[PATCH 01/16] Support skip, only, expensive, and xfail markers

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Implement skip, only, expensive, and xfail markers. They can select on type, ABI tag subset number, target-triplet, and compiler flags. * testsuite/experimental/simd

[PATCH 02/16] Fix NEON intrinsic types usage

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz Intrinsics types for NEON differ from gnu::vector_size types now. This requires explicit specializations for __intrinsic_type and a new __is_intrinsic_type trait. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__is_intrinsic_type): New internal

[PATCH 03/16] Support -mlong-double-64 on PPC

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz 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. --- libstdc++-v3/include/experimental/bits/simd.h | 11 --- 1 file changed, 8

[PATCH 06/16] Fix DRIVEROPTS and TESTFLAGS processing

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/generate_makefile.sh: Use different variables internally than documented for user overrides. This makes internal append/prepend work as intended. --- .../testsuite/experimental/simd

[PATCH 04/16] Fix simd_mask on POWER w/o POWER8

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Remove unnecessary static assertion. Allow sizeof(8) integer __intrinsic_type to enable the necessary mask type. --- libstdc++-v3/include/experimental/bits/simd.h | 6 -- 1 file changed

[PATCH 05/16] Fix several check-simd interaction issues

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh (verify_test): Print test output on run xfail. Do not repeat lines from the log that were already printed on stdout. (test_selector): Make the compiler flags pattern usable as a

[PATCH 07/16] Fix incorrect display of old test summaries

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/Makefile.am: Ensure .simd.summary is empty before collecting a new summary. * testsuite/Makefile.in: Regenerate. --- libstdc++-v3/testsuite/Makefile.am | 1 + libstdc++-v3/testsuite/Makefile.in | 1 + 2 files

[PATCH 08/16] Immediate feedback with -v

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Remove executable on SIGINT. Process compiler and test executable output: In verbose mode print messages immediately, limited to 1000 lines and breaking long lines to below

[PATCH 09/16] Fix mask reduction of simd_mask on POWER7

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz POWER7 does not support __vector long long reductions, making the generic _S_popcount implementation ill-formed. Specializing _S_popcount for PPC allows optimization and avoids the issue. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Add

[PATCH 10/16] Skip testing hypot3 for long double on PPC

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz std::hypot(a, b, c) is imprecise and makes this test fail even though the failure is unrelated to simd. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/hypot3_fma.cc: Add skip: markup for long double on powerpc64*. --- libstdc++-v3/testsuite

[PATCH 11/16] Abort test after 1000 lines of output

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz Handle overly large output by aborting the log and thus the test. This is a similar condition to a timeout. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: When handling the pipe to log (and on verbose to stdout) count the lines. If it

[PATCH 12/16] Support timeout and timeout-factor options

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/driver.sh: Abstract reading test options into read_src_option function. Read skip, only, expensive, and xfail via read_src_option. Add timeout and timeout-factor options and adjust timeout

[PATCH 13/16] Improve test codegen for interpreting assembly

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz In many failure cases it is helpful to inspect the instructions leading up to the test failure. After this change the location is easier to find and the branch after failure is easier to find. libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/bits/verify.h

[PATCH 14/16] Implement hmin and hmax

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz From 9.7.4 in Parallelism TS 2. For some reason I overlooked these two functions. Implement them via call to _S_reduce. libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Add __detail::_Minimum and __detail::_Maximum to use them as _BinaryOperation

[PATCH 15/16] Work around test failures using -mno-tree-vrp

2021-01-27 Thread Matthias Kretz
From: Matthias Kretz This is necessary to avoid failures resulting from PR98834. libstdc++-v3/ChangeLog: * testsuite/Makefile.am: Warn about the workaround. Add -fno-tree-vrp to CXXFLAGS passed to the check_simd script. Improve initial user feedback from make check-simd

[PATCH 16/16] Improve "find_first/last_set" for NEON

2021-01-27 Thread Matthias Kretz
_asint, __zero)[0]; +#endif } else __assert_unreachable<_Tp>(); -- ────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research

Re: [PATCH 14/16] Implement hmin and hmax

2021-02-01 Thread Matthias Kretz
On Mittwoch, 27. Januar 2021 21:42:50 CET Matthias Kretz wrote: > --- a/libstdc++-v3/include/experimental/bits/simd.h > +++ b/libstdc++-v3/include/experimental/bits/simd.h > @@ -204,6 +204,27 @@ template > template >using _SizeConstant = integral_constant; > >

Re: [PATCH] libstdc++: Don't use reserved identifiers in simd headers

2021-02-01 Thread Matthias Kretz
rest of libstdc++ doesn't have it, the simd headers probably shouldn't have it either. Best, Matthias -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy

Re: [PATCH 4/4] libstdc++: More efficient last day of month.

2021-02-23 Thread Matthias Kretz
ggle the last bit. -- ────── 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 ──

[PATCH] libstdc++: Fix for non-constexpr math_errhandling

2022-01-19 Thread Matthias Kretz
Follow-up to my last patch. This one is a more thorough fix. Tested on x86_64- linux. OK for trunk? 8< Use SFINAE magic to support: "It is unspecified whether math_errhandling is a macro or an identifier with external linkage." [C Standard] Signed-off-by: Matthias Kretz

Re: [PATCH] libstdc++: Fix for non-constexpr math_errhandling

2022-01-19 Thread Matthias Kretz
On Wednesday, 19 January 2022 13:07:26 CET Jonathan Wakely wrote: > On Wed, 19 Jan 2022 at 08:10, Matthias Kretz wrote: > > Follow-up to my last patch. This one is a more thorough fix. Tested on > > x86_64- > > linux. OK for trunk? > > > > 8< > >

Re: [PATCH] libstdc++: Fix for non-constexpr math_errhandling

2022-01-19 Thread Matthias Kretz
On Wednesday, 19 January 2022 16:21:15 CET Jonathan Wakely wrote: > On Wed, 19 Jan 2022, 12:45 Matthias Kretz, wrote: > > On Wednesday, 19 January 2022 13:07:26 CET Jonathan Wakely wrote: > > > So is it a macro or not? > > > > I agree the quote I used is u

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-17 Thread Matthias Kretz
On Wednesday, 17 November 2021 19:25:46 CET Jason Merrill wrote: > On 11/17/21 04:04, Matthias Kretz wrote: > > On Wednesday, 17 November 2021 07:09:18 CET Jason Merrill wrote: > >>> - if (CHECKING_P) > >>> -SET_NON_DEFAULT_TEMPLATE_

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-19 Thread Matthias Kretz
On Thursday, 18 November 2021 20:24:36 CET Jason Merrill wrote: > On 11/17/21 17:51, Matthias Kretz wrote: > > Right, I had already added a `gcc_assert (!TMPL_ARGS_HAVE_MULTIPLE_LEVELS > > (args))` to my new set_non_default_template_args_count function and found > > c

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-19 Thread Matthias Kretz
On Friday, 19 November 2021 10:53:27 CET Matthias Kretz wrote: > > >> Ah, you're trying to omit defaulted parms from the ? I'm not > > >> sure > > >> that's necessary, leaving them out of the [with ...] list should be > > >> suff

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-19 Thread Matthias Kretz
On Friday, 19 November 2021 23:26:57 CET Jason Merrill wrote: > On 11/19/21 04:53, Matthias Kretz wrote: > > My motivation for printing a function template specialization differently > > is: > > > > 1. It's a different function definition that's being c

[PATCH 0/2] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-26 Thread Matthias Kretz
On Friday, 19 November 2021 23:26:57 CET Jason Merrill wrote: > On 11/19/21 04:53, Matthias Kretz wrote: > > On Thursday, 18 November 2021 20:24:36 CET Jason Merrill wrote: > >> On 11/17/21 17:51, Matthias Kretz wrote: > >>>>> __FUNCTION__ was 'fun&#

[PATCH 1/2] c++: Print function template parms when relevant

2021-11-26 Thread Matthias Kretz
igned-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/template-params-12n.C: Optionally, allow DW_AT_default_value. * g++.dg/diagnostic/default-template-args-1.C: New test. * g++.dg/diagnostic/default-template-args-2.C: New test. * g

[PATCH 2/2] c++: Print function template parms when relevant [part 2]

2021-11-26 Thread Matthias Kretz
Restore status-quo how function template specializations were diagnosed. Signed-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * g++.dg/diagnostic/default-template-args-1.C: Adjust for different presentation of function template specializations. * g++.dg/ext/pretty1

Re: [PATCH v2 1/2] c++: Print function template parms when relevant

2021-12-02 Thread Matthias Kretz
On Friday, 26 November 2021 16:23:43 CET Matthias Kretz wrote: > > Hmm, since it walks DECL_TEMPLATE_RESULT, I wouldn't expect it to find > > template parms that aren't in the function signature. > > You were right, walking TREE_TYPE (DECL_TEMPLATE_RESULT (t))

[PATCH] Fix hash_map::traverse overload

2021-12-06 Thread Matthias Kretz
While reading the hash_map code I noticed this inconsistency. Bootstrapped and regtested on x86_64. OK for trunk? The hash_map::traverse overload taking a non-const Value pointer breaks if the callback returns false. The other overload should behave the same. Signed-off-by: Matthias Kretz

Re: [PATCH] Fix hash_map::traverse overload

2021-12-07 Thread Matthias Kretz
On Tuesday, 7 December 2021 08:47:56 CET Richard Biener wrote: > On Tue, Dec 7, 2021 at 8:43 AM Richard Biener > wrote: > > > > > > > On Mon, Dec 6, 2021 at 11:47 AM Matthias Kretz wrote: > > > > > > > > > > > While reading the hash_m

Re: [PATCH] Fix hash_map::traverse overload

2021-12-07 Thread Matthias Kretz
On Tuesday, 7 December 2021 08:43:56 CET Richard Biener wrote: > On Mon, Dec 6, 2021 at 11:47 AM Matthias Kretz wrote: > > While reading the hash_map code I noticed this inconsistency. Bootstrapped > > and regtested on x86_64. OK for trunk? > > I've inspected two users

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

2019-11-06 Thread Matthias Kretz
ping2 On Montag, 14. Oktober 2019 12:27:11 CET 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-11-13 Thread Matthias Kretz
On Donnerstag, 12. November 2020 00:43:31 CET Jonathan Wakely wrote: > On 08/05/20 21:03 +0200, Matthias Kretz wrote: > >Here's my last update to the std::experimental::simd patch. It's currently > >based on the gcc-10 branch. > > > > > >+ > >

[PATCH v2] c-family: Add __builtin_assoc_barrier

2021-09-06 Thread Matthias Kretz
its operand instead. OK, that was easy. On Monday, 19 July 2021 14:34:12 CEST Richard Biener wrote: > On Mon, 19 Jul 2021, Matthias Kretz wrote: > > tested on x86_64-pc-linux-gnu with no new failures. OK for master? > > I think now that PAREN_EXPR can appear in C++ code you need

Re: [PATCH v2] c-family: Add __builtin_assoc_barrier

2021-09-06 Thread Matthias Kretz
We have (std::)fma (__builtin_fma) to explicitly request contraction. PAREN_EXPR seems like a good fit to inhibit contraction. -- ────── Dr. Matthias Kretz https://mattkretz.github.io GSI He

Re: [PATCH v2] c-family: Add __builtin_assoc_barrier

2021-09-06 Thread Matthias Kretz
On Monday, 6 September 2021 14:59:27 CEST Richard Biener wrote: > On Mon, 6 Sep 2021, Matthias Kretz wrote: > > On Monday, 6 September 2021 14:40:31 CEST Richard Biener wrote: > > > I'll note that currently a + PAREN_EXPR (b * c) is for example > > > also n

Re: [PATCH v2] c-family: Add __builtin_assoc_barrier

2021-09-08 Thread Matthias Kretz
───── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ── diff --git a/gc

Re: [PATCH v2] c-family: Add __builtin_assoc_barrier

2021-09-08 Thread Matthias Kretz
On Wednesday, 8 September 2021 15:44:28 CEST Jason Merrill wrote: > On 9/8/21 5:37 AM, Matthias Kretz wrote: > > On Tuesday, 7 September 2021 19:36:22 CEST Jason Merrill wrote: > >>> case PAREN_EXPR: > >>> - RETURN (finish_parenthesized_expr (RECUR (TREE_O

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

2020-01-07 Thread Matthias Kretz
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, Matthias On Montag, 14. Oktober 2019 14:12:12 CET Matthias Kretz wrote: > Let me try again to get this patch ready. It will need a few iterations... > This patch is w

[RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-08 Thread Matthias Kretz
kes diagnostic messages hard to understand. The general idea of this change is to print template parms wherever they would appear in the source code as well. Thus, the diagnostics code needs to know whether any template parameter was given explicitly. Signed-off-by: Matthias K

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-08 Thread Matthias Kretz
re, I used the sign of that integer. I was hoping to find a cleaner solution, though. -Matthias On Monday, 8 November 2021 17:40:44 CET Matthias Kretz wrote: > On Tuesday, 17 August 2021 20:31:54 CET Jason Merrill wrote: > > > 2. Given a DECL_TI_ARGS tree, can I query whethe

[PATCH v3] c-family: Add __builtin_assoc_barrier

2021-11-11 Thread Matthias Kretz
On Wednesday, 8 September 2021 15:49:27 CET Matthias Kretz wrote: > On Wednesday, 8 September 2021 15:44:28 CEST Jason Merrill wrote: > > On 9/8/21 5:37 AM, Matthias Kretz wrote: > > > On Tuesday, 7 September 2021 19:36:22 CEST Jason Merrill wrote: > > >>> case

[PATCH v5] c++: Add gnu::diagnose_as attribute

2021-11-14 Thread Matthias Kretz
wrote: > On 7/23/21 4:58 AM, Matthias Kretz wrote: > > gcc/cp/ChangeLog: > > PR c++/89370 > > * cp-tree.h: Add is_alias_template_p declaration. > > * decl2.c (is_alias_template_p): New function. Determines > > whether a giv

Re: [PATCH 11/11] libstdc++: Fix ODR issues with different -m flags

2021-11-15 Thread Matthias Kretz
ping. OK to push? On Tuesday, 8 June 2021 14:12:23 CET Matthias Kretz wrote: > From: Matthias Kretz > > Explicitly support use of the stdx::simd implementation in situations > where the user links TUs that were compiled with different -m flags. In > general, this is alway

[PATCH 0/2] Make use of the diagnose_as attribute to improve libstdc++ diagnostics

2021-11-15 Thread Matthias Kretz
After my two C++ patches for template diagnostics and the diagnose_as attribute are in, I'd like to make use of the attribute for std::*string and std::pmr::*string as well as for std::experimental::simd diagnostics. Matthias Kretz (2): libstdc++: Use diagnose_as attribute to improve s

[PATCH 1/2] libstdc++: Use diagnose_as attribute to improve string diagnostics

2021-11-15 Thread Matthias Kretz
This hides the basic_string template in all diagnostics, reducing the signal-to-noise ratio significantly. It also hides the std::__cxx11 namespace from users by presenting it as std. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: PR c++/89370 * include/bits/c++config

[PATCH 2/2] libstdc++: Use diagnose_as attribute to improve simd diagnostics

2021-11-15 Thread Matthias Kretz
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Diagnose 'std::experimental::parallelism_v2::simd_abi' as 'simd_abi'. On x86, diagnose _VecBuiltin<16>, _VecBuiltin<32>, and _Vec

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-16 Thread Matthias Kretz
On Tuesday, 16 November 2021 21:25:33 CET Jason Merrill wrote: > On 11/8/21 15:00, Matthias Kretz wrote: > > I forgot to mention why I tagged it [RFC]: I needed one more bit of > > information on the template args TREE_VEC to encode > > EXPLICIT_TEMPLATE_ARGS_P. Its TREE_CHAIN

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-16 Thread Matthias Kretz
On Tuesday, 16 November 2021 21:49:31 CET Jason Merrill wrote: > On 11/16/21 15:42, Matthias Kretz wrote: > > On Tuesday, 16 November 2021 21:25:33 CET Jason Merrill wrote: > >> On 11/8/21 15:00, Matthias Kretz wrote: > >>> I forgot to mention why I tagged it [

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-17 Thread Matthias Kretz
al different functions the same name. That seemed like a regression. So either the DWARF strings need to include the function arguments, or we need this condition to keep showing the template arguments independent of whether they were explicitly given or not. > > + 5. either > > +

[PATCH] c++: Output less irrelevant info for function template decl [PR100716]

2021-05-25 Thread Matthias Kretz
From: Matthias Kretz Ensure dump_template_decl for function templates never prints template parameters after the function name (it did with -fno-pretty-templates) and skip output of irrelevant & confusing "[with T = T]" in dump_substitution. gcc/cp/ChangeLog:

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

2021-05-26 Thread Matthias Kretz
From: Matthias Kretz dump_type on 'const std::string' should not print 'const string' unless TFF_UNQUALIFIED_NAME is requested. gcc/cp/ChangeLog: PR c++/100763 * error.c: Call dump_scope when printing a typedef. --- gcc/cp/error.c | 2 ++ 1 file c

Re: [PATCH] c++: Output less irrelevant info for function template decl [PR100716]

2021-05-26 Thread Matthias Kretz
New revision which can also be compiled with GCC 4.8. From: Matthias Kretz Ensure dump_template_decl for function templates never prints template parameters after the function name (it did with -fno-pretty-templates) and skip output of irrelevant & confusing "[with T = T]" in dum

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-26 Thread Matthias Kretz
ute can be applied to a template instantiation. But only before its instantiation. Example: template struct X {}; using [[gnu::diagnose_as("XX")]] XX = X; // OK template struct X; using [[gnu::diagnose_as("XY")]] XY = X; // not OK msgid "ignoring %qE attribute ap

Re: [PATCH] c++: Output less irrelevant info for function template decl [PR100716]

2021-05-27 Thread Matthias Kretz
On Thursday, 27 May 2021 17:07:40 CEST Jason Merrill wrote: > On 5/26/21 5:29 PM, Matthias Kretz wrote: > > New revision which can also be compiled with GCC 4.8. > > > > From: Matthias Kretz > > > > Ensure dump_template_decl for function templates never prints

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Matthias Kretz
On Thursday, 27 May 2021 19:39:48 CEST Jason Merrill wrote: > On 5/4/21 7:13 AM, Matthias Kretz wrote: > > From: Matthias Kretz > > > > This attribute overrides the diagnostics output string for the entity it > > appertains to. The motivation is to improve QoI for lib

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Matthias Kretz
On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: > On 5/27/21 2:54 PM, Matthias Kretz wrote: > > Also hiding all inline namespace by default might make some error messages > > harder to understand: > > > > namespace Vir { > >inline

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-28 Thread Matthias Kretz
On Friday, 28 May 2021 05:05:52 CEST Jason Merrill wrote: > On 5/27/21 6:07 PM, Matthias Kretz wrote: > > On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: > >> On 5/27/21 2:54 PM, Matthias Kretz wrote: > >>> namespace Vir { > >>> i

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-01 Thread Matthias Kretz
On Tuesday, 1 June 2021 21:12:18 CEST Jason Merrill wrote: > On 5/28/21 3:42 AM, Matthias Kretz wrote: > > On Friday, 28 May 2021 05:05:52 CEST Jason Merrill wrote: > >> I'd think you could get the same effect from a hypothetical > >> > >> namespace [[gn

[PATCH 0/3] Improve and document stdx::simd testsuite

2021-06-08 Thread Matthias Kretz
. Tested on x86_64-linux (and more). Matthias Kretz (3): libstdc++: Remove -fno-tree-vrp after PR98834 was resolved libstdc++: Improve output verbosity options and default libstdc++: Document simd testsuite libstdc++-v3/testsuite/Makefile.am| 3 +- libstdc++-v3/testsuite

[PATCH 1/3] libstdc++: Remove -fno-tree-vrp after PR98834 was resolved

2021-06-08 Thread Matthias Kretz
libstdc++-v3/ChangeLog: * testsuite/Makefile.am (check-simd): Remove -fno-tree-vrp flag and associated warning. * testsuite/Makefile.in: Regenerate. Signed-off-by: Matthias Kretz --- libstdc++-v3/testsuite/Makefile.am | 3 +-- libstdc++-v3/testsuite/Makefile.in | 3

[PATCH 2/3] libstdc++: Improve output verbosity options and default

2021-06-08 Thread Matthias Kretz
help target for changes to DRIVEROPTS. Signed-off-by: Matthias Kretz --- .../testsuite/experimental/simd/driver.sh | 137 +- .../experimental/simd/generate_makefile.sh| 33 +++-- 2 files changed, 121 insertions(+), 49 deletions

[PATCH 3/3] libstdc++: Document simd testsuite

2021-06-08 Thread Matthias Kretz
libstdc++-v3/ChangeLog: * testsuite/experimental/simd/README.md: New file. Signed-off-by: Matthias Kretz --- .../testsuite/experimental/simd/README.md | 257 ++ 1 file changed, 257 insertions(+) create mode 100644 libstdc++-v3/testsuite/experimental/simd

[PATCH 00/11] stdx::simd optimizations, corrections, and cleanups

2021-06-08 Thread Matthias Kretz
flags. Matthias Kretz (11): libstdc++: Improve copysign codegen libstdc++: Remove dead code libstdc++: Improve fixed_size codegen libstdc++: Make use of __builtin_bit_cast libstdc++: Remove incorrect fabs overload libstdc++: Minor simd_math cleanups libstdc++: Fix condition when

[PATCH 01/11] libstdc++: Improve copysign codegen

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz This also resolves a test failure on aarch64 with -ffast-math and fixed_size with large N. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h: Add missing operator~ overload for simd to __float_bitwise_operators

[PATCH 02/11] libstdc++: Remove dead code

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz This helper type became unused at some point. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_fixed_size.h (_AbisInSimdTuple): Removed. --- .../experimental/bits/simd_fixed_size.h | 49 --- 1

[PATCH 03/11] libstdc++: Improve fixed_size codegen

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Sometimes fixed_size objects will get unnecessarily copied on the stack. The simd implementation should never pass _SimdTuple by value to avoid requiring the optimizer to see through these copies. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include

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

2021-06-08 Thread Matthias Kretz
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 used to cast from/to fixed_size_simd, since it isn't trivially copyable (in the language sense — in prin

[PATCH 05/11] libstdc++: Remove incorrect fabs overload

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz fabs(int) returns double, this one didn't. This overload is not specified in the Parallelism TS 2. Also remove the comment about labs and llabs: it doesn't belong here. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experim

[PATCH 06/11] libstdc++: Minor simd_math cleanups

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_math.h: Undefine internal macros after use. (frexp): Move #if to a more sensible position and reformat preceding code. (logb): Call _SimdImpl

[PATCH 07/11] libstdc++: Fix condition when AVX512F ldexp implementation is used

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz This improves codegen of ldexp if AVX512VL is available. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_S_ldexp): The AVX512F implementation doesn't require a _VecBltnBtmsk ABI tag, it req

[PATCH 08/11] libstdc++: Avoid raising fp exceptions in trunc, floor, and ceil

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_S_trunc, _S_floor, _S_ceil): Set bit 8 (_MM_FROUND_NO_EXC) on AVX and SSE4.1 roundp[sd] calls. --- .../include/experimental/bits/simd_x86.h | 24

[PATCH 09/11] libstdc++: Ensure unrolled loops inline the lambda

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd.h (__execute_on_index_sequence, __execute_on_index_sequence_with_return, __call_with_n_evaluations, __call_with_subscripts): Add flatten attribute

[PATCH 10/11] libstdc++: Fix internal names: add missing underscores

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_math.h (_GLIBCXX_SIMD_MATH_CALL2_): Rename arg2_ to __arg2. (_GLIBCXX_SIMD_MATH_CALL3_): Rename arg2_ to __arg2 and arg3_ to __arg3. --- libstdc++-v3

[PATCH 11/11] libstdc++: Fix ODR issues with different -m flags

2021-06-08 Thread Matthias Kretz
From: Matthias Kretz Explicitly support use of the stdx::simd implementation in situations where the user links TUs that were compiled with different -m flags. In general, this is always a (quasi) ODR violation for inline functions because at least codegen may differ in important ways. However

Re: [PATCH 11/11] libstdc++: Fix ODR issues with different -m flags

2021-06-09 Thread Matthias Kretz
On Wednesday, 9 June 2021 14:22:00 CEST Richard Biener wrote: > On Tue, Jun 8, 2021 at 2:23 PM Matthias Kretz wrote: > > From: Matthias Kretz > > > > Explicitly support use of the stdx::simd implementation in situations > > where the user links TUs that were compiled

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-11 Thread Matthias Kretz
not valid identifiers > will just confuse users that don't know about them. > > If a user sees stdx::foo in a diagnostic and then tries to refer to > stdx::foo and gets an error, the diagnostic is not more helpful than one > that uses the fully qualified name. > > Jon

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

2021-06-11 Thread Matthias Kretz
While testing newer patches I found several missing conversions from __bit_cast to simd_bit_cast in this patch (i.e. where bit casting to / from fixed_size was sometimes required). Corrected patch attached. From: Matthias Kretz The __bit_cast function was a hack to achieve what

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-05 Thread Matthias Kretz
et to see the TEMPLATE_DECL of either #1, #2, or #3, only a TYPE_DECL whose TREE_TYPE is A0. I thus have no idea how to reject #2. -- ── 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 ──

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

2021-07-07 Thread Matthias Kretz
OK? (I want to use the macros in libstdc++.) On Wednesday, 30 June 2021 10:59:28 CEST Matthias Kretz wrote: > Library code, especially in headers, sometimes needs to know how the > compiler interprets / optimizes floating-point types and operations. > This information can be used for a

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-07 Thread Matthias Kretz
e attribute placements are allowed: namespace [[whatever] foo {} namespace bar [[whatever]] = foo; -- ── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion R

Re: [Questions] Is there any bit in gimple/rtl to indicate this IR support fast-math or not?

2021-07-13 Thread Matthias Kretz
question: https://godbolt.org/z/3cKq5hT1o -- ────── 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 ──

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

2021-07-14 Thread Matthias Kretz
OK? On Wednesday, 30 June 2021 10:59:28 CEST Matthias Kretz wrote: > Library code, especially in headers, sometimes needs to know how the > compiler interprets / optimizes floating-point types and operations. > This information can be used for additional optimizations or for &

[PATCH v3] c++: Add gnu::diagnose_as attribute

2021-07-15 Thread Matthias Kretz
the TYPE_DECL apparently doesn't have a template_info/decl at this point. From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for library TS implementations, where diagnostics have a very bad sign

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

2021-07-15 Thread Matthias Kretz
On Wednesday, 14 July 2021 14:42:01 CEST H.J. Lu wrote: > On Wed, Jul 14, 2021 at 12:32 AM Matthias Kretz wrote: > > OK? > > > > On Wednesday, 30 June 2021 10:59:28 CEST Matthias Kretz wrote: > > > Library code, especially in headers, sometimes needs to know how

[RFC] c-family: Add __builtin_noassoc

2021-07-16 Thread Matthias Kretz
ode. Like this? If you like it, I'll write the missing documentation and do real regression testing. --- New builtin to enable explicit use of PAREN_EXPR in C & C++ code. Signed-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * c-c++-common/builtin-noassoc-

Re: [RFC] c-family: Add __builtin_noassoc

2021-07-16 Thread Matthias Kretz
On Friday, 16 July 2021 11:31:29 CEST Richard Biener wrote: > On Fri, Jul 16, 2021 at 10:57 AM Matthias Kretz wrote: > > On Wednesday, 14 July 2021 10:14:55 CEST Richard Biener wrote: > > > I think implementing it similar to how we do __builtin_shufflevector > > > wou

Re: [PATCH] c++: implement C++17 hardware interference size

2021-07-16 Thread Matthias Kretz
128 is necessary, set the destructive hardware interference size to 64 for all of x86 except -mtune=sandybridge. -- ── 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: [PATCH] c++: implement C++17 hardware interference size

2021-07-16 Thread Matthias Kretz
ry disappointed if std::hardware_destructive_interference_size and std::hardware_constructive_interference_size turn into a glorified macro. -- ────── Dr. Matthias Kretz https://mattkretz.github.io G

Re: [PATCH] c++: implement C++17 hardware interference size

2021-07-16 Thread Matthias Kretz
On Friday, 16 July 2021 19:20:29 CEST Noah Goldstein wrote: > On Fri, Jul 16, 2021 at 11:12 AM Matthias Kretz wrote: > > I don't understand how this feature would lead to false sharing. But maybe > > I > > misunderstand the spatial prefetcher. The first access t

Re: [PATCH] c++: implement C++17 hardware interference size

2021-07-17 Thread Matthias Kretz
On Friday, 16 July 2021 21:58:36 CEST Jonathan Wakely wrote: > On Fri, 16 Jul 2021 at 20:26, Matthias Kretz wrote: > > On Friday, 16 July 2021 18:54:30 CEST Jonathan Wakely wrote: > > > On Fri, 16 Jul 2021 at 16:33, Jason Merrill wrote: > > > > Adjusting them b

Re: [PATCH] c++: implement C++17 hardware interference size

2021-07-17 Thread Matthias Kretz
On Saturday, 17 July 2021 15:32:42 CEST Jonathan Wakely wrote: > On Sat, 17 Jul 2021, 09:15 Matthias Kretz, wrote: > > If somebody writes a library with `keep_apart` in the public API/ABI then > > you're right. > > Yes, it's fine if those constants don&

[PATCH] c-family: Add __builtin_assoc_barrier

2021-07-19 Thread Matthias Kretz
tested on x86_64-pc-linux-gnu with no new failures. OK for master? New builtin to enable explicit use of PAREN_EXPR in C & C++ code. Signed-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * c-c++-common/builtin-assoc-barrier-1.c: New test. gcc/cp/ChangeLog: * cp-o

[PATCH v4] c++: Add gnu::diagnose_as attribute

2021-07-23 Thread Matthias Kretz
signal-to-noise ratio due to the long namespaces involved. With the attribute, it is possible to solve PR89370 and make std::__cxx11::basic_string<_CharT, _Traits, _Alloc> appear as std::string in diagnostic output without extra hacks to recognize the type in the C++ frontend. Signed-off-by

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

2021-07-27 Thread Matthias Kretz
OK? On Wednesday, 30 June 2021 10:59:28 CEST Matthias Kretz wrote: > Library code, especially in headers, sometimes needs to know how the > compiler interprets / optimizes floating-point types and operations. > This information can be used for additional optimizations or for &

[PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for library TS implementations, where diagnostics have a very bad signal-to-noise ratio due to the long namespaces involved. On Tuesday, 27 April 2021 11

  1   2   3   >