Re: [PATCH] testsuite: Fix up various powerpc tests after -std=gnu23 by default switch [PR117663]

2024-11-24 Thread Kewen Lin
Hi Jakub, 在 2024/11/22 16:18, Jakub Jelinek 写道: > Hi! > > These tests use the K&R function style definitions or pass arguments > to () functions. > It seemed easiest to just use -std=gnu17 for all of those. Thanks for fixing! I slightly prefer passing -Wno-old-style-definition instead as the te

Re: [PATCH] rs6000: Add PowerPC inline asm redzone clobber support

2024-11-24 Thread Kewen Lin
Hi Jakub, Thanks for doing this! 在 2024/11/7 20:16, Jakub Jelinek 写道: > Hi! > > The following patch on top of the > https://gcc.gnu.org/pipermail/gcc-patches/2024-November/667949.html > patch adds rs6000 part of the support (the only other target I'm aware of > which clearly has red zone as well

Re: [PATCH ver2 4/4] rs6000, Add tests and documentation for vector, conversions between integer and float

2024-11-24 Thread Kewen Lin
Hi Carl, 在 2024/10/1 23:28, Carl Love 写道: > > GCC maintainers: > > Version 2, added the argument changes for the__builtin_vsx_uns_double[e | o | > h | l ]_v4si built-ins. Added support to the vector {un,}signed int to vector > float builtins so they are supported using Altivec instructions if

Re: [PATCH ver2 3/4] rs6000, Remove redundant built-in __builtin_vsx_xvcvuxwdp

2024-11-24 Thread Kewen Lin
Hi Carl, 在 2024/10/1 23:27, Carl Love 写道: > > > GCC maintainers: > > Version 2: Fixed the wording in the changelog per the feedback. With this > change the patch was approved by Kewen. > > The patch removed the built-in __builtin_vsx_xvcvuxwdp as it is covered by > the overloaded vec_doubleo

Re: [PATCH ver2 2/4] rs6000, remove built-ins __builtin_vsx_vperm_8hi and, __builtin_vsx_vperm_8hi_uns

2024-11-24 Thread Kewen Lin
Hi Carl, 在 2024/10/1 23:27, Carl Love 写道: > > GCC maintainers: > > version 2, added the reference to the patch where the removal of the > built-ins was missed.  Note, patch was approved by Kewen with this change. > > The following patch removes two redundant built-ins __builtin_vsx_vperm_8hi

Re: [PATCH ver2 1/4] rs6000, add testcases to the overloaded vec_perm built-in

2024-11-24 Thread Kewen Lin
Hi Carl, 在 2024/10/1 23:27, Carl Love 写道: > > > GCC maintainers: > > Version 2, fixed the changelog, updated the wording in the documentation and > updated the argument types in the vsx-builtin-3.c test file. > > The following patch adds missing test cases for the overloaded vec_perm > built

Re: [PATCH] rs6000, fix test builtins-1-p10-runnable.c

2024-11-24 Thread Kewen Lin
Hi Carl, 在 2024/10/3 23:11, Carl Love 写道: > GCC maintainers: > > The builtins-1-10-runnable.c has the debugging inadvertently enabled.  The > test uses #ifdef to enable/disable the debugging. Unfortunately, the #define > DEBUG was set to 0 to disable debugging and enable the call to abort in ca

[PATCH] rs6000: Use standard name {add,sub}v1ti3 for altivec_v{add,sub}uqm

2024-11-15 Thread Kewen Lin
Hi, This patch is to adjust define_insn altivec_v{add,sub}uqm with standard names, as the associated test case shows, w/o this patch, it ends up with scalar {add,subf}c/{add,subf}e, the standard names help to exploit v{add,sub}uqm. Bootstrapped and regtested on ppc64-linux P8/P9 and ppc64le-linux

[PATCH] rs6000: Adjust FLOAT128 signbit2 expander for P8 LE [PR114567]

2024-11-15 Thread Kewen Lin
Hi, As the associated test case shows, signbit generated assembly is sub-optimal for _Float128 argument from memory on P8 LE. On P8 LE, p8swap pass puts an explicit AND -16 on the memory, which causes mode_dependent_address_p considers it's invalid to change its mode and combine fails to make use

[PATCH] rs6000: Remove entry for V1TImode from VI_unit

2024-11-15 Thread Kewen Lin
Hi, When making a patch to adjust VECTOR_P8_VECTOR rs6000_vector enum, I noticed that V1TImode's mode attribute in VI_unit VECTOR_UNIT_ALTIVEC_P (V1TImode) is never true, since VECTOR_UNIT_ALTIVEC_P checks if vector_unit[V1TImode] is equal to VECTOR_ALTIVEC, but vector_unit[V1TImode] can only be V

[PATCH] rs6000: Add veqv support to *eqv3_internal1

2024-11-15 Thread Kewen Lin
Hi, When making patch to replace TARGET_P8_VECTOR, I noticed for *eqv3_internal1 unlike the other logical operations, we only exploited the vsx version. I think it is an oversight, this patch is to consider veqv as well. Bootstrapped and regtested on ppc64-linux P8/P9 and ppc64le-linux P9/P10 tw

[PATCH] rs6000: Simplify some conditions or code related to TARGET_DIRECT_MOVE

2024-11-15 Thread Kewen Lin
Hi, When I was making a patch to rework TARGET_P8_VECTOR, I noticed that there are some redundant checks and dead code related to TARGET_DIRECT_MOVE, so I made this patch as one separated preparatory patch, it consists of: - Check either TARGET_DIRECT_MOVE or TARGET_P8_VECTOR only according

[PATCH] rs6000: Remove ISA_3_0_MASKS_IEEE and check P9_VECTOR instead

2024-11-15 Thread Kewen Lin
Hi, When working to get rid of mask bit OPTION_MASK_P8_VECTOR, I noticed that the check on ISA_3_0_MASKS_IEEE is actually to check TARGET_P9_VECTOR, since we check all three mask bits together and p9 vector guarantees p8 vector and vsx should be enabled. So this patch is to adjust this first as p

[PATCH 04/52] go: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 52/52] bfin: Rename macros {FLOAT,DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This patch is to remove LONG_DOUBLE_TYPE_SIZE and rename macros {FLOAT,DOUBLE}_TYPE_SIZE with prefix BFIN_ as some macro defines want to use them, keeping them can have better code readability. gcc/ChangeLog: * config/bfin/bfin.h (FLOAT_TYPE_SIZE): Rename to ... (BFIN_FLOAT_TYPE_S

[PATCH 44/52] s390: New hook implementation s390_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in s390 port, and add new port specific hook implementation s390_c_mode_for_floating_type. gcc/ChangeLog: * config/s390/s390.cc (s390_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): New m

[PATCH 49/52] mips: New hook implementation mips_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation mips_c_mode_for_floating_type, remove macros FLOAT_TYPE_SIZE and DOUBLE_TYPE_SIZE, rename LONG_DOUBLE_TYPE_SIZE to MIPS_LONG_DOUBLE_TYPE_SIZE since we poison LONG_DOUBLE_TYPE_SIZE but some subtarget wants to redefine it and some macro defines nee

[PATCH 47/52] loongarch: New hook implementation loongarch_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation loongarch_c_mode_for_floating_type, remove macro defines for FLOAT_TYPE_SIZE and DOUBLE_TYPE_SIZE, and rename LONG_DOUBLE_TYPE_SIZE to LA_LONG_DOUBLE_TYPE_SIZE as we poison LONG_DOUBLE_TYPE_SIZE but some macros need LONG_DOUBLE_TYPE_SIZE. gcc/Ch

[PATCH 48/52] m68k: New hook implementation m68k_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation m68k_c_mode_for_floating_type, remove macro LONG_DOUBLE_TYPE_SIZE and add new macro LONG_DOUBLE_TYPE_MODE which some subtarget can redefine. gcc/ChangeLog: * config/m68k/m68k.cc (m68k_c_mode_for_floating_type): New function. (TA

[PATCH 45/52] sh: New hook implementation sh_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macro LONG_DOUBLE_TYPE_SIZE define in sh port, and add new port specific hook implementation sh_c_mode_for_floating_type. gcc/ChangeLog: * config/sh/sh.cc (sh_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. * config/

[PATCH 36/52] aarch64: New hook implementation aarch64_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in aarch64 port, and add new port specific hook implementation aarch64_c_mode_for_floating_type. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_c_mode_for_floating_type): New function. (TARGET_C_MODE_FO

[PATCH 38/52] avr: New hook implementation avr_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in avr port, and add new port specific hook implementation avr_c_mode_for_floating_type. gcc/ChangeLog: * config/avr/avr.cc (avr_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): Ne

[PATCH 50/52] pa: New hook implementation pa_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation pa_c_mode_for_floating_type, as we remove defines in defaults.h for {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE, this also defines them in pa.h but with PA_ prefix since we poison {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE. gcc/ChangeLog: * config/pa/pa.cc

[PATCH 40/52] ia64: New hook implementation ia64_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in ia64 port, and add new port specific hook implementation ia64_c_mode_for_floating_type. gcc/ChangeLog: * config/ia64/ia64.cc (ia64_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE

[PATCH 30/52] pdp11: Remove macro LONG_DOUBLE_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macro LONG_DOUBLE_TYPE_SIZE define in pdp11 port. gcc/ChangeLog: * config/pdp11/pdp11.h (LONG_DOUBLE_TYPE_SIZE): Remove. --- gcc/config/pdp11/pdp11.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h inde

[PATCH 37/52] alpha: New hook implementation alpha_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in alpha port, and add new port specific hook implementation alpha_c_mode_for_floating_type. gcc/ChangeLog: * config/alpha/alpha.cc (alpha_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING

[PATCH 46/52] h8300: New hook implementation h8300_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation h8300_c_mode_for_floating_type, remove useless macro defines for {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE and add new macro DOUBLE_TYPE_MODE which some subtarget can redefine. gcc/ChangeLog: * config/h8300/h8300.cc (h8300_c_mode_for_floating_ty

[PATCH 39/52] i386: New hook implementation ix86_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in i386 port, and add new port specific hook implementation ix86_c_mode_for_floating_type. gcc/ChangeLog: * config/i386/i386.cc (ix86_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE

[PATCH 34/52] xtensa: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in xtensa port. gcc/ChangeLog: * config/xtensa/xtensa.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/xtensa/xtensa.h | 3 --- 1 file changed, 3

[PATCH 43/52] rx: New hook implementation rx_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in rx port, and add new port specific hook implementation rx_c_mode_for_floating_type. gcc/ChangeLog: * config/rx/rx.cc (rx_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro.

[PATCH 51/52] sparc: New hook implementation sparc_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to add new port specific hook implementation sparc_c_mode_for_floating_type, remove macros {FLOAT,DOUBLE}_TYPE_SIZE defines and rename LONG_DOUBLE_TYPE_SIZE to SPARC_LONG_DOUBLE_TYPE_SIZE as we poison LONG_DOUBLE_TYPE_SIZE and some subtargets still want to re-define it. gcc/ChangeLog:

[PATCH 28/52] nvptx: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in nvptx port. gcc/ChangeLog: * config/nvptx/nvptx.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/nvptx/nvptx.h | 3 --- 1 file changed, 3 delet

[PATCH 32/52] stormy16: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in stormy16 port. gcc/ChangeLog: * config/stormy16/stormy16.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/stormy16/stormy16.h | 6 -- 1 fil

[PATCH 23/52] mmix: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in mmix port. gcc/ChangeLog: * config/mmix/mmix.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/mmix/mmix.h | 4 1 file changed, 4 deletions

[PATCH 31/52] pru: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in pru port. gcc/ChangeLog: * config/pru/pru.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/pru/pru.h | 3 --- 1 file changed, 3 deletions(-) d

[PATCH 22/52] microblaze: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in microblaze port. gcc/ChangeLog: * config/microblaze/microblaze.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/microblaze/microblaze.h | 3 ---

[PATCH 42/52] rl78: New hook implementation rl78_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in rl78 port, and add new port specific hook implementation rl78_c_mode_for_floating_type. gcc/ChangeLog: * config/rl78/rl78.cc (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. (rl78_c_mode_for_floating_type): New func

[PATCH 27/52] nios2: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in nios2 port. gcc/ChangeLog: * config/nios2/nios2.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/nios2/nios2.h | 3 --- 1 file changed, 3 delet

[PATCH 33/52] visium: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in visium port. gcc/ChangeLog: * config/visium/visium.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/visium/visium.h | 29 ++

[PATCH 17/52] gcn: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in gcn port. gcc/ChangeLog: * config/gcn/gcn.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/gcn/gcn.h | 3 --- 1 file changed, 3 deletions(-) d

[PATCH 20/52] m32c: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in m32c port. gcc/ChangeLog: * config/m32c/m32c.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/m32c/m32c.h | 4 1 file changed, 4 deletions

[PATCH 41/52] riscv: New hook implementation riscv_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in riscv port, and add new port specific hook implementation riscv_c_mode_for_floating_type. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_c_mode_for_floating_type): New function. (TARGET_C_MODE_FOR_FLOATING_TYPE):

[PATCH 26/52] nds32: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in nds32 port. gcc/ChangeLog: * config/nds32/nds32.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/nds32/nds32.h | 4 1 file changed, 4 dele

[PATCH 16/52] ft32: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in ft32 port. gcc/ChangeLog: * config/ft32/ft32.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/ft32/ft32.h | 4 1 file changed, 4 deletions

[PATCH 21/52] m32r: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in m32r port. gcc/ChangeLog: * config/m32r/m32r.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/m32r/m32r.h | 3 --- 1 file changed, 3 deletions(

[PATCH 11/52] arc: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in arc port. gcc/ChangeLog: * config/arc/arc.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/arc/arc.h | 3 --- 1 file changed, 3 deletions(-) d

[PATCH 35/52] rs6000: New hook implementation rs6000_c_mode_for_floating_type

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in rs6000 port, and add new port specific hook implementation rs6000_c_mode_for_floating_type. gcc/ChangeLog: * config/rs6000/rs6000.cc (TARGET_C_MODE_FOR_FLOATING_TYPE): New macro. (rs6000_c_mode_for_floating_type)

[PATCH 19/52] lm32: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in lm32 port. gcc/ChangeLog: * config/lm32/lm32.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/lm32/lm32.h | 4 1 file changed, 4 deletions

[PATCH 14/52] fr30: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in fr30 port. gcc/ChangeLog: * config/fr30/fr30.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/fr30/fr30.h | 3 --- 1 file changed, 3 deletions(

[PATCH 12/52] bpf: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in bpf port. gcc/ChangeLog: * config/bpf/bpf.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/bpf/bpf.h | 3 --- 1 file changed, 3 deletions(-) d

[PATCH 18/52] iq2000: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in iq2000 port. gcc/ChangeLog: * config/iq2000/iq2000.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/iq2000/iq2000.h | 3 --- 1 file changed, 3

[PATCH 29/52] or1k: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in or1k port. gcc/ChangeLog: * config/or1k/or1k.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/or1k/or1k.h | 3 --- 1 file changed, 3 deletions(

[PATCH 09/52] Replace {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE with new hook mode_for_floating_type

2024-06-02 Thread Kewen Lin
Currently how we determine which mode will be used for a floating point type is that for a given type precision (size) call mode_for_size to get the first mode which has this size in the specified class. On Powerpc, we have three modes (TF/KF/IF) having the same mode precision 128 (see[1]), so the

[PATCH 15/52] frv: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in frv port. gcc/ChangeLog: * config/frv/frv.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/frv/frv.h | 3 --- 1 file changed, 3 deletions(-) d

[PATCH 08/52] vms: Replace use of LONG_DOUBLE_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 03/52] fortran: Replace uses of {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 24/52] moxie: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in moxie port. gcc/ChangeLog: * config/moxie/moxie.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/moxie/moxie.h | 4 1 file changed, 4 dele

[PATCH 10/52] jit: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. Unlike the other FEs, for the uses in recordin

[PATCH 06/52] m2: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 05/52] rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 02/52] d: Replace use of LONG_DOUBLE_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 25/52] msp430: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in msp430 port. gcc/ChangeLog: * config/msp430/msp430.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/msp430/msp430.h | 4 1 file changed, 4

[PATCH 13/52] epiphany: Remove macros {FLOAT, DOUBLE, LONG_DOUBLE}_TYPE_SIZE

2024-06-02 Thread Kewen Lin
This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in epiphany port. gcc/ChangeLog: * config/epiphany/epiphany.h (FLOAT_TYPE_SIZE): Remove. (DOUBLE_TYPE_SIZE): Likewise. (LONG_DOUBLE_TYPE_SIZE): Likewise. --- gcc/config/epiphany/epiphany.h | 3 --- 1 file c

[PATCH 07/52] darwin: Replace use of LONG_DOUBLE_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 00/52] Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook

2024-06-02 Thread Kewen Lin
RFC/PATCH, this is bootstrapped & regtested on powerpc64{,le}-linux-gnu with all langs on, cross cc1 built well for affected ports at least one available triple. Kewen Lin (52): ada: Replace use of LONG_DOUBLE_TYPE_SIZE d: Replace use of LONG_DOUBLE_TYPE_SIZE fortran: Replace uses of

[PATCH 01/52] ada: Replace use of LONG_DOUBLE_TYPE_SIZE

2024-06-02 Thread Kewen Lin
Joseph pointed out "floating types should have their mode, not a poorly defined precision value" in the discussion[1], as he and Richi suggested, the existing macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a hook mode_for_floating_type. To be prepared for that, this patch is to repl

[PATCH 10/10] vect: Consider vec_perm costing for VMAT_CONTIGUOUS_REVERSE

2023-09-13 Thread Kewen Lin via Gcc-patches
For VMAT_CONTIGUOUS_REVERSE, the transform code in function vectorizable_store generates a VEC_PERM_EXPR stmt before storing, but it's never considered in costing. This patch is to make it consider vec_perm in costing, it adjusts the order of transform code a bit to make it easy to early return fo

[PATCH 09/10] vect: Get rid of vect_model_store_cost

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch is to eventually get rid of vect_model_store_cost, it adjusts the costing for the remaining memory access types VMAT_CONTIGUOUS{, _DOWN, _REVERSE} by moving costing close to the transform code. Note that in vect_model_store_cost, there is one special handling for vectorizing a store int

[PATCH 03/10] vect: Adjust vectorizable_store costing on VMAT_GATHER_SCATTER

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_GATHER_SCATTER in function vectorizable_store (all three cases), then we won't depend on vect_model_load_store for its costing any more. This patch shouldn't have any functional changes. gcc/ChangeLog: * tree-vect-stmts.cc (vect_model_store_co

[PATCH 07/10] vect: Adjust vectorizable_store costing on VMAT_CONTIGUOUS_PERMUTE

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS_PERMUTE in function vectorizable_store. We don't call function vect_model_store_cost for it any more. It's the case of interleaving stores, so it skips all stmts excepting for first_stmt_info, consider the whole group when costing first_stmt

[PATCH/RFC 08/10] aarch64: Don't use CEIL for vector_store in aarch64_stp_sequence_cost

2023-09-13 Thread Kewen Lin via Gcc-patches
This costing adjustment patch series exposes one issue in aarch64 specific costing adjustment for STP sequence. It causes the below test cases to fail: - gcc/testsuite/gcc.target/aarch64/ldp_stp_15.c - gcc/testsuite/gcc.target/aarch64/ldp_stp_16.c - gcc/testsuite/gcc.target/aarch64/ldp_stp_

[PATCH 01/10] vect: Ensure vect store is supported for some VMAT_ELEMENTWISE case

2023-09-13 Thread Kewen Lin via Gcc-patches
When making/testing patches to move costing next to the transform code for vectorizable_store, some ICEs got exposed when I further refined the costing handlings on VMAT_ELEMENTWISE. The apparent cause is triggering the assertion in rs6000 specific function for costing rs6000_builtin_vectorization

[PATCH 05/10] vect: Adjust vectorizable_store costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP in function vectorizable_store. We don't call function vect_model_store_cost for them any more. Like what we improved for PR82255 on load side, this change helps us to get rid of unnecessary vec_to_scalar costing for so

[PATCH 06/10] vect: Adjust vectorizable_store costing on VMAT_LOAD_STORE_LANES

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_LOAD_STORE_LANES in function vectorizable_store. We don't call function vect_model_store_cost for it any more. It's the case of interleaving stores, so it skips all stmts excepting for first_stmt_info, consider the whole group when costing first_stmt_i

[PATCH 04/10] vect: Simplify costing on vectorizable_scan_store

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch is to simplify the costing on the case vectorizable_scan_store without calling function vect_model_store_cost any more. I considered if moving the costing into function vectorizable_scan_store is a good idea, for doing that, we have to pass several variables down which are only used for

[PATCH 00/10] vect: Move costing next to the transform for vect store

2023-09-13 Thread Kewen Lin via Gcc-patches
cost model, I also verified the whole patch series was neutral for SPEC2017 int/fp on Power9 at O2, O3 and Ofast separately. [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621460.html Kewen Lin (10): vect: Ensure vect store is supported for some VMAT_ELEMENTWISE case vect: Move

[PATCH 02/10] vect: Move vect_model_store_cost next to the transform in vectorizable_store

2023-09-13 Thread Kewen Lin via Gcc-patches
This patch is an initial patch to move costing next to the transform, it still adopts vect_model_store_cost for costing but moves and duplicates it down according to the handlings of different vect_memory_access_types or some special handling need, hope it can make the subsequent patches easy to re

[PATCH 0/9] vect: Move costing next to the transform for vect load

2023-06-12 Thread Kewen Lin via Gcc-patches
rified the whole patch series was neutral for SPEC2017 int/fp on Power9 at O2, O3 and Ofast separately. [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563624.html Kewen Lin (9): vect: Move vect_model_load_cost next to the transform in vectorizable_load vect: Adjust vectorizable_lo

[PATCH 7/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_REVERSE

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS_REVERSE in function vectorizable_load. We don't call function vect_model_load_cost for it any more. This change makes us not miscount some required vector permutation as the associated test case shows. gcc/ChangeLog: * tree-vect-st

[PATCH 5/9] vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_GATHER_SCATTER in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It's mainly for gather loads with IFN or emulated gather loads, it follows the handlings in function vect_model_load_cost. This patch shouldn't

[PATCH 4/9] vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP

2023-06-12 Thread Kewen Lin via Gcc-patches
ew test. 2023-06-13 Bill Schmidt Kewen Lin --- .../vect/costmodel/ppc/costmodel-pr82255.c| 31 gcc/tree-vect-stmts.cc| 170 +++--- 2 files changed, 134 insertions(+), 67 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/cos

[PATCH 8/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_PERMUTE

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS_PERMUTE in function vectorizable_load. We don't call function vect_model_load_cost for it any more. As the affected test case gcc.target/i386/pr70021.c shows, the previous costing can under-cost the total generated vector loads as for VMAT_C

[PATCH 9/9] vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_CONTIGUOUS in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It removes function vect_model_load_cost which becomes useless and unreachable now. gcc/ChangeLog: * tree-vect-stmts.cc (vect_model_load_co

[PATCH 2/9] vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER && gs_info.decl

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adds one extra argument cost_vec to function vect_build_gather_load_calls, so that we can do costing next to the tranform in vect_build_gather_load_calls. For now, the implementation just follows the handlings in vect_model_load_cost, it isn't so good, so placing one FIXME for any furthe

[PATCH 3/9] vect: Adjust vectorizable_load costing on VMAT_INVARIANT

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_INVARIANT in function vectorizable_load. We don't call function vect_model_load_cost for it any more. To make the costing on VMAT_INVARIANT better, this patch is to query hoist_defs_of_uses for hoisting decision, and add costs for different "where" bas

[PATCH 6/9] vect: Adjust vectorizable_load costing on VMAT_LOAD_STORE_LANES

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch adjusts the cost handling on VMAT_LOAD_STORE_LANES in function vectorizable_load. We don't call function vect_model_load_cost for it any more. It follows what we do in the function vect_model_load_cost, and shouldn't have any functional changes. gcc/ChangeLog: * tree-vect-stm

[PATCH 1/9] vect: Move vect_model_load_cost next to the transform in vectorizable_load

2023-06-12 Thread Kewen Lin via Gcc-patches
This patch is an initial patch to move costing next to the transform, it still adopts vect_model_load_cost for costing but moves and duplicates it down according to the handlings of different vect_memory_access_types, hope it can make the subsequent patches easy to review. This patch should not ha

[PATCH 8/9] rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p4

2022-11-24 Thread Kewen Lin via Gcc-patches
The current handlings in rs6000_emit_vector_compare is a bit complicated to me, especially after we emit vector float comparison insn with the given code directly. So it's better to refactor the handlings of vector integer comparison here. This is part 4, it's to rework the handlings on GE/GEU/LE

[PATCH 5/9] rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p1

2022-11-24 Thread Kewen Lin via Gcc-patches
The current handlings in rs6000_emit_vector_compare is a bit complicated to me, especially after we emit vector float comparison insn with the given code directly. So it's better to refactor the handlings of vector integer comparison here. This is part 1, it's to remove the helper function rs6000

[PATCH 4/9] rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p4

2022-11-24 Thread Kewen Lin via Gcc-patches
All kinds of vector float comparison operators have been supported in a rtl comparison pattern as vector.md, we can just emit an rtx comparison insn with the given comparison operator in function rs6000_emit_vector_compare instead of checking and handling the reverse condition cases. This is part

[PATCH 2/9] rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p2

2022-11-24 Thread Kewen Lin via Gcc-patches
All kinds of vector float comparison operators have been supported in a rtl comparison pattern as vector.md, we can just emit an rtx comparison insn with the given comparison operator in function rs6000_emit_vector_compare instead of checking and handling the reverse condition cases. This is part

[PATCH 7/9] rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p3

2022-11-24 Thread Kewen Lin via Gcc-patches
The current handlings in rs6000_emit_vector_compare is a bit complicated to me, especially after we emit vector float comparison insn with the given code directly. So it's better to refactor the handlings of vector integer comparison here. This is part 3, it's to refactor the handlings on NE. Thi

[PATCH 1/9] rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p1

2022-11-24 Thread Kewen Lin via Gcc-patches
All kinds of vector float comparison operators have been supported in a rtl comparison pattern as vector.md, we can just emit an rtx comparison insn with the given comparison operator in function rs6000_emit_vector_compare instead of checking and handling the reverse condition cases. This is part

[PATCH 9/9] rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p5

2022-11-24 Thread Kewen Lin via Gcc-patches
The current handlings in rs6000_emit_vector_compare is a bit complicated to me, especially after we emit vector float comparison insn with the given code directly. So it's better to refactor the handlings of vector integer comparison here. This is part 5, it's to refactor all the handlings of vec

[PATCH 6/9] rs6000: Rework vector integer comparison in rs6000_emit_vector_compare - p2

2022-11-24 Thread Kewen Lin via Gcc-patches
The current handlings in rs6000_emit_vector_compare is a bit complicated to me, especially after we emit vector float comparison insn with the given code directly. So it's better to refactor the handlings of vector integer comparison here. This is part 2, it's to refactor the handlings on LT and

[PATCH 3/9] rs6000: Rework vector float comparison in rs6000_emit_vector_compare - p3

2022-11-24 Thread Kewen Lin via Gcc-patches
All kinds of vector float comparison operators have been supported in a rtl comparison pattern as vector.md, we can just emit an rtx comparison insn with the given comparison operator in function rs6000_emit_vector_compare instead of checking and handling the reverse condition cases. This is part

[PATCH 0/9] rs6000: Rework rs6000_emit_vector_compare

2022-11-24 Thread Kewen Lin via Gcc-patches
22-November/606375.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606376.html [3] https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606504.html [4] https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606506.html Kewen Lin (9): rs6000: Rework vector float comparison i

[PATCH 11/15] csky: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/csky/csky.md (*cskyv2_adddi3, *ck801_a

[PATCH 15/15] sh: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/sh/sh.md (call_pcrel, call_value_pcrel

[PATCH 14/15] mips: Fix non-robust split condition in define_insn_and_split

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/mips/mips.md (*udivmod4, udivmod4_mips

  1   2   >