Re: [PATCH v3 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-09 Thread Ken Matsui via Gcc-patches
On Fri, Jun 9, 2023 at 10:54 AM Patrick Palka wrote: > > On Sun, 2 Apr 2023, Ken Matsui via Gcc-patches wrote: > > > This patch gets std::is_function to dispatch to new built-in trait > > __is_function. > > For std::is_function and other predicate-like type traits, I t

[PATCH v4 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-10 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

[PATCH v4 1/6] c++: implement __is_reference built-in trait

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v4 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v4 3/6] c++: implement __is_function built-in trait

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v4 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v4 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v4 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-10 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. Signed-off-by: Ken Matsui --- li

Re: [PATCH v4 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
Yes, I have fixed them on my side and am waiting for the test results! Thank you! On Mon, Jun 12, 2023 at 11:09 AM François Dumont wrote: > Same remark for all your alike patches. > > On 11/06/2023 04:43, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_reference to dispatch to new bu

[PATCH v5 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

[PATCH v5 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v5 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v5 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v5 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v5 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v5 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (__is_object): Define this

[PATCH v6 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

[PATCH v6 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v6 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v6 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v6 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v6 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (is_object_v): Likewise. S

[PATCH v6 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v7 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function * __is_void std::is_object was depending on them with disjunction and negation. __not_<__

[PATCH v7 1/6] c++: implement __is_reference built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v7 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v7 3/6] c++: implement __is_function built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v7 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_tr

[PATCH v7 5/6] c++, libstdc++: implement __is_void built-in trait

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_void. Since the new built-in name is __is_void, to avoid unintentional macro replacement, this patch also involves the removal of the existing __is_void in helper_functions.h and cpp_type_traits.h and renaming __is_void to is_void in the test fil

[PATCH v7 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function, __is_reference, and __is_void. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function, __is_reference, and __is_void. (is_object_v): Likewise. S

Re: [PATCH v5 6/6] libstdc++: make std::is_object dispatch to new built-in traits

2023-06-13 Thread Ken Matsui via Gcc-patches
On Tue, Jun 13, 2023 at 10:10 PM François Dumont wrote: > > > On 13/06/2023 00:22, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_object to dispatch to new built-in traits, > > __is_function, __is_reference, and __is_void. > > > > libstdc++-v3/ChangeLog: > > * include/std/type_t

Re: [PATCH v7 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-15 Thread Ken Matsui via Gcc-patches
Hi, For those curious about the performance improvements of this patch, I conducted a benchmark that instantiates 256k specializations of is_object_v based on Patrick's code. You can find the benchmark code at this link: https://github.com/ken-matsui/gcc-benches/blob/main/is_object_benchmark.cc

[PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-06-15 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __remove_poin

[PATCH 2/2] libstdc++: use new built-in trait __remove_pointer

2023-06-15 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __remove_pointer. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 8 +++- 1 file changed, 7 insertions(+),

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar

2023-07-12 Thread Ken Matsui via Gcc-patches
On Wed, Jul 12, 2023 at 2:50 AM Jonathan Wakely wrote: > > On Sat, 8 Jul 2023 at 05:47, Ken Matsui via Libstdc++ > wrote: > > > > This patch gets std::is_scalar to dispatch to new built-in trait > > __is_scalar. > > > > libstdc++-v3/ChangeLog: > > > > * include/std/type_traits (is_scalar)

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar

2023-07-12 Thread Ken Matsui via Gcc-patches
On Wed, Jul 12, 2023 at 11:56 AM Xi Ruoyao wrote: > > On Wed, 2023-07-12 at 11:32 -0700, Ken Matsui via Gcc-patches wrote: > > > conditional on the front-end change being committed first of course > > > > Does this mean we want to commit this [2/2] patch before commit

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar

2023-07-12 Thread Ken Matsui via Gcc-patches
On Wed, Jul 12, 2023 at 12:23 PM Jonathan Wakely wrote: > > > > On Wed, 12 Jul 2023, 19:33 Ken Matsui via Libstdc++, > wrote: >> >> On Wed, Jul 12, 2023 at 2:50 AM Jonathan Wakely wrote: >> > >> > On Sat, 8 Jul 2023 at 05:47, Ken Matsui via Libstdc++ >> > wrote: >> > > >> > > This patch gets s

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely wrote: > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ > wrote: > > > > Hi, > > > > Here is the benchmark result for is_pointer: > > > > https://github.com/ken-matsui/gcc-benches/blob/main/is_pointer.md#sun-jul--9-103948-pm-pdt-2023 > > >

[PATCH v3 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

Re: [PATCH v3 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
Hi, Here is the updated benchmark result for is_pointer: https://github.com/ken-matsui/gcc-benches/blob/main/is_pointer.md#wed-jul-12-055654-pm-pdt-2023 Time: -2.79488% Peak Memory Usage: -2.39379% Total Memory Usage: -3.39559% Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 6:12 PM Ken Matsui

[PATCH v3 2/2] libstdc++: Use new built-in trait __is_pointer

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Likewise. (is_pointer_v): Likewise. Optimize its implementat

Re: [PATCH v3 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
Also, here is the Kanban board for our GSoC project, which might be useful for you to manage non-reviewed patches. https://github.com/users/ken-matsui/projects/1/views/1 On Wed, Jul 12, 2023 at 6:13 PM Ken Matsui wrote: > > Hi, > > Here is the updated benchmark result for is_pointer: > > https:/

Re: [PATCH 1/2] c++, libstdc++: implement __is_signed built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
On Wed, Jul 12, 2023 at 3:20 AM Jonathan Wakely wrote: > > On Sun, 9 Jul 2023 at 09:50, Ken Matsui via Libstdc++ > wrote: > > > > This patch implements built-in trait for std::is_signed. > > > > gcc/cp/ChangeLog: > > > > * cp-trait.def: Define __is_signed. > > * constraint.cc (dia

[PATCH v2 1/2] c++, libstdc++: Implement __is_signed built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_signed. gcc/cp/ChangeLog: * cp-trait.def: Define __is_signed. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_SIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/C

[PATCH v2 2/2] libstdc++: Use new built-in trait __is_signed

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_signed. libstdc++-v3/ChangeLog: * include/std/type_traits (is_signed): Use __is_signed built-in trait. (is_signed_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 15 ++- 1 file

[PATCH v10 0/5] c++, libstdc++: Make std::is_object dispatch to new built-in traits

2023-07-12 Thread Ken Matsui via Gcc-patches
Hi, This patch series gets std::is_object to dispatch to built-in traits and implements the following built-in traits, on which std::object depends. * __is_reference * __is_function std::is_object was depending on them with disjunction and negation. __not_<__or_, is_reference<_T

[PATCH v10 2/5] libstdc++: Use new built-in trait __is_reference for std::is_reference

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_reference to dispatch to new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/ty

[PATCH v10 1/5] c++: Implement __is_reference built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v10 3/5] c++: Implement __is_function built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v10 4/5] libstdc++: Use new built-in trait __is_function for std::is_function

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Optimize its implementation. Signed-off-by: Ken Matsui --- lib

Re: [PATCH v10 3/5] c++: Implement __is_function built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
Hi, Here is the benchmark result for is_function: https://github.com/ken-matsui/gcc-benches/blob/main/is_function.md#wed-jul-12-072510-pm-pdt-2023 Time: -21.3748% Peak Memory Usage: -10.962% Total Memory Usage: -12.8384% Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 7:40 PM Ken Matsui wrote:

[PATCH v10 5/5] libstdc++: Make std::is_object dispatch to new built-in traits

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch gets std::is_object to dispatch to new built-in traits, __is_function and __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use new built-in traits, __is_function and __is_reference. (is_object_v): Likewise. Signed-off-by: Ken Matsui

Re: [PATCH v10 2/5] libstdc++: Use new built-in trait __is_reference for std::is_reference

2023-07-12 Thread Ken Matsui via Gcc-patches
Hi, Here is the benchmark result for is_reference: https://github.com/ken-matsui/gcc-benches/blob/main/is_reference.md#wed-jul-12-074702-pm-pdt-2023 Time: -8.15593% Peak Memory Usage: -4.48408% Total Memory Usage: -8.03783% Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 7:39 PM Ken Matsui wrot

[PATCH v4 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

[PATCH v4 2/2] libstdc++: Use new built-in trait __is_pointer

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Likewise. Optimize its implementation. (is_pointer_v

[PATCH v5 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

[PATCH v5 2/2] libstdc++: Use new built-in trait __is_pointer

2023-07-12 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Likewise. Optimize its implementation. (is_pointer_v

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-13 Thread Ken Matsui via Gcc-patches
On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely wrote: > > On Wed, 12 Jul 2023 at 21:42, Ken Matsui wrote: > > > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely wrote: > > > > > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ > > > wrote: > > > > > > > > Hi, > > > > > > > > Here is t

[PATCH v6 1/2] c++, libstdc++: Implement __is_pointer built-in trait

2023-07-13 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

[PATCH v6 2/2] libstdc++: Use new built-in trait __is_pointer

2023-07-13 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Likewise. Optimize its implementation. (is_pointer_v

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-14 Thread Ken Matsui via Gcc-patches
On Fri, Jul 14, 2023 at 3:49 AM Jonathan Wakely wrote: > > On Fri, 14 Jul 2023 at 11:48, Jonathan Wakely wrote: > > > > On Thu, 13 Jul 2023 at 21:04, Ken Matsui wrote: > > > > > > On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely > > > wrote: > > > > > > > > On Wed, 12 Jul 2023 at 21:42, Ken Mat

[PATCH] libstdc++: Use __bool_constant entirely

2023-07-14 Thread Ken Matsui via Gcc-patches
This patch uses __bool_constant entirely instead of integral_constant in the type_traits header, specifically for true_type, false_type, and bool_constant. libstdc++-v3/ChangeLog: * include/std/type_traits (true_type): Use __bool_constant instead. (false_type): Likewise.

[PATCH v2 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-14 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc

[PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-07-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_arithmetic): Use __is_arithmetic built-in trait. (is_arithmetic_v): Likewise. Signed-off-by: Ken

[PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the ori

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-14 Thread Ken Matsui via Gcc-patches
Hi, Here are the benchmarks for this change: * is_fundamental https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental.md#fri-jul-14-091146-pm-pdt-2023 Time: -37.1619% Peak Memory Usage: -29.4294% Total Memory Usage: -29.4783% * is_fundamental_v https://github.com/ken-matsui/gcc-ben

Re: [PATCH v2 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-16 Thread Ken Matsui via Gcc-patches
On Sun, Jul 16, 2023 at 5:28 AM François Dumont wrote: > > > On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_arithmetic. > > > > gcc/cp/ChangeLog: > > > > * cp-trait.def: Define __is_arithmetic. > > * constraint.cc (diagnose_tra

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-07-16 Thread Ken Matsui via Gcc-patches
On Sun, Jul 16, 2023 at 5:32 AM François Dumont wrote: > > > On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: > > This patch optimizes the performance of the is_arithmetic trait by > > dispatching to the new __is_arithmetic built-in trait. > > > > libstdc++-v3/ChangeLog: > > > > * includ

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-16 Thread Ken Matsui via Gcc-patches
On Sun, Jul 16, 2023 at 5:41 AM François Dumont wrote: > > > On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: > > This patch optimizes the performance of the is_fundamental trait by > > dispatching to the new __is_arithmetic built-in trait. > > > > libstdc++-v3/ChangeLog: > > > > * inclu

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-17 Thread Ken Matsui via Gcc-patches
Hi, I took a benchmark for this. https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 template struct is_fundamental : public std::bool_constant<__is_arithmetic(_Tp) || std::is_void<_Tp>::value

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-17 Thread Ken Matsui via Gcc-patches
I will eventually work on disjunction to somehow optimize, but in the meantime, this might be a better implementation. Of course, my benchmark could be wrong. On Mon, Jul 17, 2023 at 11:24 PM Ken Matsui wrote: > > Hi, > > I took a benchmark for this. > > https://github.com/ken-matsui/gcc-benches/

[PATCH v3 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-17 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc

[PATCH v3 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-07-17 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_arithmetic): Use __is_arithmetic built-in trait. (is_arithmetic_v): Likewise. Signed-off-by: Ken

[PATCH v3 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-17 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the ori

[PATCH v4 1/4] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc

[PATCH v4 2/4] libstdc++: Optimize is_arithmetic trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_arithmetic): Use __is_arithmetic built-in trait. (is_arithmetic_v): Likewise. Signed-off-by: Ken

[PATCH v4 3/4] libstdc++: Optimize is_fundamental trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the ori

[PATCH v4 4/4] libstdc++: Optimize is_compound trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_compound trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_compound): Use __is_arithmetic built-in trait. (is_compound_v): Use is_fundamental_v instead. Sign

[PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a flag to toggle built-in traits in the type_traits header. Through this macro function and _GLIBCXX_NO_BUILTIN_TRAITS macro, we can switch the use of built-in traits without needing to modify the source code. libstdc++-v3/Change

[PATCH 0/8] Tweak predicate macros in tree

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch series tweaks predicate macros in tree.h to make the code more readable. TYPE_REF_P is moved to tree.h and used for INDIRECT_TYPE_P and TYPE_REF_IS_LVALUE. TYPE_PTR_P is also moved to tree.h and used for INDIRECT_TYPE_P. POINTER_TYPE_P in tree.h is replaced with INDIRECT_TYPE_P since it

[PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves TYPE_REF_P from cp/cp-tree.h to tree.h to simplify the same code as it and to declare TYPE_REF_IS_LVALUE that determines if a type is a C++ lvalue reference. gcc/cp/ChangeLog: * cp-tree.h (TYPE_REF_P): Remove. gcc/ChangeLog: * tree.h (TYPE_REF_P): Define. Signe

[PATCH 2/8] gcc: Use TYPE_REF_P

2023-07-18 Thread Ken Matsui via Gcc-patches
gcc/ada/ChangeLog: * gcc-interface/trans.cc (return_slot_opt_for_pure_call_p): Use TYPE_REF_P. * gcc-interface/utils2.cc (build_unary_op): Likewise. gcc/ChangeLog: * alias.cc (get_alias_set): Use TYPE_REF_P. * config/gcn/gcn-tree.cc (gcn_goacc_get_worker_red_decl

[PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves TYPE_PTR_P from cp/cp-tree.h to tree.h to unify POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P in cp/cp-tree.h, which are equivalent. gcc/cp/ChangeLog: * cp-tree.h (TYPE_PTR_P): Remove. gcc/ChangeLog: * tree.h (TYPE_PTR_P): Define. Signed-off-by: Ken Matsui ---

[PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves INDIRECT_TYPE_P from cp/cp-tree.h to tree.h to unify POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P, which are equivalent. gcc/cp/ChangeLog: * cp-tree.h (INDIRECT_TYPE_P): Remove. gcc/ChangeLog: * tree.h (INDIRECT_TYPE_P): Define. Signed-off-by: Ken Matsui --- g

[PATCH 6/8] tree: Remove POINTER_TYPE_P

2023-07-18 Thread Ken Matsui via Gcc-patches
Since POINTER_TYPE_P was completely replaced by INDIRECT_TYPE_P, it can be deleted. gcc/ChangeLog: * tree.h (POINTER_TYPE_P): Remove. Signed-off-by: Ken Matsui --- gcc/tree.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/gcc/tree.h b/gcc/tree.h index d548dce63f7..347e676e73

[PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch defines TYPE_REF_IS_LVALUE to determine if a type is a C++ lvalue reference. gcc/ChangeLog: * tree.h (TYPE_REF_IS_LVALUE): Define. Signed-off-by: Ken Matsui --- gcc/tree.h | 4 1 file changed, 4 insertions(+) diff --git a/gcc/tree.h b/gcc/tree.h index 347e676e737..0b2c

[PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE

2023-07-18 Thread Ken Matsui via Gcc-patches
gcc/cp/ChangeLog: * decl.cc (copy_fn_p): Use TYPE_REF_IS_LVALUE. * init.cc (maybe_warn_list_ctor): Likewise. * method.cc (early_check_defaulted_comparison): Likewise. * pt.cc (maybe_adjust_types_for_deduction): Likewise. (invalid_nontype_parm_type_p): Likewi

Re: [PATCH 0/8] Tweak predicate macros in tree

2023-07-19 Thread Ken Matsui via Gcc-patches
On Wed, Jul 19, 2023 at 12:08 AM Richard Biener wrote: > > On Wed, Jul 19, 2023 at 1:34 AM Ken Matsui via Gcc-patches > wrote: > > > > This patch series tweaks predicate macros in tree.h to make the code more > > readable. TYPE_REF_P is moved to tree.h and u

Re: [PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-19 Thread Ken Matsui via Gcc-patches
On Wed, Jul 19, 2023 at 11:48 AM Patrick Palka wrote: > > On Tue, 18 Jul 2023, Ken Matsui via Libstdc++ wrote: > > > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a > > flag to toggle built-in traits in the type_traits header. Through this > > macro function and _GLIBCXX_NO_

[PATCH v2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-19 Thread Ken Matsui via Gcc-patches
This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT macro, which will be used as a flag to toggle the use of built-in traits in the type_traits header through _GLIBCXX_NO_BUILTIN_TRAITS macro, without needing to modify the source code. libstdc++-v3/ChangeLog: * include/bits/c++config (_GLIBCXX_

[PATCH v3 1/2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-27 Thread Ken Matsui via Gcc-patches
This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT macro, which will be used as a flag to toggle the use of built-in traits in the type_traits header through _GLIBCXX_NO_BUILTIN_TRAITS macro, without needing to modify the source code. libstdc++-v3/ChangeLog: * include/bits/c++config (_GLIBCXX_

[PATCH v3 2/2] libstdc++: Use _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-27 Thread Ken Matsui via Gcc-patches
This patch uses _GLIBCXX_HAS_BUILTIN_TRAIT macro instead of __has_builtin in the type_traits header. This macro supports to toggle the use of built-in traits in the type_traits header through _GLIBCXX_NO_BUILTIN_TRAITS macro, without needing to modify the source code. libstdc++-v3/ChangeLog:

Re: [PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-06-17 Thread Ken Matsui via Gcc-patches
Hi, I conducted a benchmark for remove_pointer as well as is_object. Just like the is_object benchmark, here is the benchmark code: https://github.com/ken-matsui/gcc-benches/blob/main/remove_pointer_benchmark.cc On my computer, using the gcc HEAD of this patch for a release build, the patch with

Re: [PATCH v7 0/6] c++, libstdc++: get std::is_object to dispatch to new built-in traits

2023-06-20 Thread Ken Matsui via Gcc-patches
Just a quick update, the benchmark code link has been updated and can now be accessed at https://github.com/ken-matsui/gcc-benches/blob/main/is_object.cc. I have also created a report file which can be found at https://github.com/ken-matsui/gcc-benches/blob/main/is_object.md. On Thu, Jun 15, 2023

Re: [PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-06-20 Thread Ken Matsui via Gcc-patches
Just a quick update, the benchmark code link has been updated and can now be accessed at https://github.com/ken-matsui/gcc-benches/blob/main/remove_pointer.cc. I have also created a report file which can be found at https://github.com/ken-matsui/gcc-benches/blob/main/remove_pointer.md. On Sat, Jun

Re: [PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-06-24 Thread Ken Matsui via Gcc-patches
On Tue, Jun 20, 2023 at 8:22 AM Patrick Palka wrote: > > On Sat, 17 Jun 2023, Ken Matsui via Gcc-patches wrote: > > > Hi, > > > > I conducted a benchmark for remove_pointer as well as is_object. Just > > like the is_object benchmark, here is the benchmark cod

[PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-06-24 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __remove_poin

[PATCH 2/2] libstdc++: use new built-in trait __remove_pointer

2023-06-24 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __remove_pointer. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 8 +++- 1 file changed, 7 insertions(+),

[PATCH 1/2] c++: implement __is_const built-in trait

2023-06-24 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * cp-trait.def: Define __is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/Chan

[PATCH 2/2] libstdc++: use new built-in trait __is_const

2023-06-24 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_const. libstdc++-v3/ChangeLog: * include/std/type_traits (is_const): Use __is_const built-in trait. (is_const_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 14 ++ 1 file chang

  1   2   3   4   5   >