[PATCH v13 14/40] c++: Implement __is_member_pointer built-in trait

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

[PATCH v13 35/40] c++: Implement __is_unsigned built-in trait

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

[PATCH v13 29/40] c++, libstdc++: Implement __is_pointer built-in trait

2023-09-14 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 v13 27/40] c++: Implement __remove_pointer built-in trait

2023-09-14 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 v1] LoongArch: Check whether binutils supports the relax function. If supported, explicit relocs are turned off by default.

2023-09-14 Thread Lulu Cheng
gcc/ChangeLog: * config.in: Regenerate. * config/loongarch/genopts/loongarch.opt.in: Add compilation option mrelax. And set the initial value of explicit-relocs according to the detection status. * config/loongarch/gnu-user.h: When compiling with -mno-relax,

[PATCH v13 15/40] libstdc++: Optimize is_member_pointer trait performance

2023-09-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_member_pointer trait by dispatching to the new __is_member_pointer built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_member_pointer): Use __is_member_pointer built-in trait. (is_member_pointer_v): Likewise.

[PATCH v13 32/40] libstdc++: Optimize is_arithmetic trait performance

2023-09-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

Re: [pushed][PATCH] LoongArch: Reimplement multilib build option handling.

2023-09-14 Thread chenglulu
Pushed to r14-4009. 在 2023/9/13 下午5:52, Yang Yujie 写道: Library build options from --with-multilib-list used to be processed with *self_spec, which missed the driver's initial canonicalization. This caused limitations on CFLAGS override and the use of driver-only options like -m[no]-lsx. The pr

[PATCH v13 11/40] libstdc++: Optimize is_bounded_array trait performance

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

[PATCH v13 34/40] libstdc++: Optimize is_compound trait performance

2023-09-14 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): Do not use __not_. (is_compound_v): Use is_fundamental_v instead. Signed-off-by: Ken Matsui --

[PATCH v13 02/40] c++: Implement __is_const built-in trait

2023-09-14 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 v13 26/40] libstdc++: Optimize is_object trait performance

2023-09-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_object trait by dispatching to the new __is_function and __is_reference built-in traits. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use __is_function and __is_reference built-in traits. (is_object_v): Likewi

[PATCH v13 20/40] c++: Implement __is_member_object_pointer built-in trait

2023-09-14 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_member_object_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_member_object_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_MEMBER_OBJECT_POINTER. * semantics.cc (trait_expr_value): Likewise.

[PATCH v13 39/40] c++, libstdc++: Implement __is_scalar built-in trait

2023-09-14 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_scalar. The existent __is_scalar codes were replaced with __is_scalar_type to avoid unintentional macro replacement by the new built-in. gcc/cp/ChangeLog: * cp-trait.def: Define __is_scalar. * constraint.cc (diagnose_trait_expr): Ha

[PATCH v13 38/40] libstdc++: Optimize is_signed trait performance

2023-09-14 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_signed trait by dispatching to the new __is_signed built-in trait. 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/i

[PATCH v1] LoongArch: Add floating point conditional move support.

2023-09-14 Thread Lulu Cheng
gcc/ChangeLog: * config/loongarch/loongarch-protos.h (loongarch_expand_conditional_move): Modify the return value type of a function. * config/loongarch/loongarch.cc (loongarch_expand_conditional_move): Added floating point conditional transfer implementat

Re: [PATCH] LoongArch: gcc: Modify gas uleb128 support test.

2023-09-14 Thread mengqinggang
Thank you very much, we will send a new patch use this. 在 2023/9/14 下午8:09, Xi Ruoyao 写道: On Thu, 2023-09-14 at 19:54 +0800, chenglulu wrote: Sorry, it's my problem. We will modify it as soon as possible. Try this: diff --git a/gcc/configure.ac b/gcc/configure.ac index cb4be11facd..10027a4aa

[PATCH v2] Modify gas uleb128 support test

2023-09-14 Thread mengqinggang
Some assemblers (GNU as for LoongArch) generates relocations for leb128 symbol arithmetic for relaxation, we need to disable relaxation probing leb128 support then. gcc/ChangeLog: * configure: Regenerate. * configure.ac: Checking assembler for -mno-relax support. Disable relaxation wh

[PATCH] RISC-V: Refactor expand_reduction and cleanup enum reduction_type

2023-09-14 Thread Lehua Ding
This patch refactors expand_reduction, remove the reduction_type argument and add insn_flags argument to determine the passing of the operands. ops has also been modified to restrict it to only two cases and to remove operand that are not in use. gcc/ChangeLog: * config/riscv/autovec-opt.

[PATCH] LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP.

2023-09-14 Thread Lulu Cheng
There are two reasons for removing this macro definition: 1. The default in the assembler is to use the nop instruction for filling. 2. For assembly directives: .align [abs-expr[, abs-expr[, abs-expr]]] The third expression it is the maximum number of bytes that should be skipped by this alig

Re: [PATCH] tree optimization/111407--SSA corruption due to widening_mul opt

2023-09-14 Thread Richard Biener via Gcc-patches
On Thu, Sep 14, 2023 at 3:25 PM Qing Zhao via Gcc-patches wrote: > > on conflict across an abnormal edge > > This is a bug in tree-ssa-math-opts.cc, when applying the widening mul > optimization, the compiler needs to check whether the operand is in a > ABNORMAL PHI, if YES, we should avoid the tr

Re: [PATCH] MATCH: Fix `(1 >> X) != 0` pattern for vector types

2023-09-14 Thread Richard Biener via Gcc-patches
On Thu, Sep 14, 2023 at 7:49 PM Andrew Pinski via Gcc-patches wrote: > > I had missed that integer_onep can match vector types with uniform constant > of `1`. > This means the shifter could be an scalar type and then doing a comparison > against `0` > would be an invalid transformation. > This f

Re: [PATCH] MATCH: Improve zero_one_valued_p for cases without range information

2023-09-14 Thread Richard Biener via Gcc-patches
On Fri, Sep 15, 2023 at 3:09 AM Andrew Pinski via Gcc-patches wrote: > > I noticed we sometimes lose range information in forwprop due to a few > match and simplify patterns optimizing away casts. So the easier way > to these cases is to add a match for zero_one_valued_p wich mathes > a cast from

Re: [PATCH] use local range for one more pattern in match.pd

2023-09-14 Thread Richard Biener via Gcc-patches
On Fri, 15 Sep 2023, Jiufu Guo wrote: > Hi, > > For "get_global_range_query" SSA_NAME_RANGE_INFO can be queried. > For "get_range_query", it could get more context-aware range info. > And look at the implementation of "get_range_query", it returns > global range if no local fun info. > > ATTRIB

<    1   2   3