[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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] 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: 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: 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: 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: 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] 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

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

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 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 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 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] 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

[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 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 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 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 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 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 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 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 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 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 01/15] frv: 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/frv/frv.md (*abssi2_internal, *minmax_

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

2021-11-11 Thread Kewen Lin via Gcc-patches
gcc.gnu.org/pipermail/gcc-patches/2021-June/571647.html [2] https://gcc.gnu.org/pipermail/gcc-patches/2021-June/572120.html BR, Kewen - Kewen Lin (15): frv: Fix non-robust split condition in define_insn_and_split m32c: Fix non-robust split condition in define_insn_and_split rx:

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

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix one non-robust split condition, to make it applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/rx/rx.md (cstoresf4): Fix split condition. --- gcc/config/rx/rx.md | 2 +- 1 fil

[PATCH 02/15] m32c: 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/m32c/cond.md (stzx_reversed_, movhicc_

[PATCH 04/15] s390: 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/s390/s390.md (*cstorecc_z13): Fix spli

[PATCH 05/15] v850: 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/v850/v850.md (cbranchsf4, cbranchdf4,

[PATCH 07/15] xtensa: 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/xtensa/xtensa.md (movdi_internal, movd

[PATCH 06/15] visium: 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/visium/visium.md (*add3_insn, *addsi3_

[PATCH 08/15] alpha: 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/alpha/alpha.md (*movtf_internal, *movt

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

2021-11-11 Thread Kewen Lin via Gcc-patches
This patch is to fix one non-robust split condition, to make it applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/arm/arm.md (*minmax_arithsi_non_canon): Fix split condition. --- gcc/config/arm/

[PATCH 10/15] bfin: 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/bfin/bfin.md (movdi_insn, movdf_insn):

[PATCH 13/15] ia64: 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/ia64/vect.md (*vec_extractv2sf_0_le, *

[PATCH 12/15] i386: 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/i386/i386.md (*add3_doubleword, *addv4

[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

[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 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

[RFC/PATCH 00/11] Fix up some unexpected empty split conditions

2021-06-01 Thread Kewen Lin via Gcc-patches
ot intentional to be kept as blank. Any comments are highly appreciated. BR, Kewen [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566970.html Kewen Lin (11): gen: Emit error msg for empty split condition arc: Update unexpected empty split condition arm: Update unexpected empty sp

[PATCH 01/11] gen: Emit error msg for empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
As Segher suggested, this patch is to emit the error message if the split condition of define_insn_and_split is empty while the insn condition isn't. gcc/ChangeLog: * gensupport.c (process_rtx): Emit error message for empty split condition in define_insn_and_split while the insn

[PATCH 02/11] arc: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/arc/arc.md (*bbit_di): Fix empty split condition. --- gcc/config/arc/arc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 7a52551eef5..a03840c4c36 100644 --- a/gcc/config/arc/arc.md +++ b/gcc

[PATCH 07/11] m68k: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/m68k/m68k.md (*zero_extend_inc, *zero_extend_dec, *zero_extendsidi2): Fix empty split condition. --- gcc/config/m68k/m68k.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 59

[PATCH 06/11] i386: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/i386/i386.md (*load_tp_x32_zext, *add_tp_x32_zext, *tls_dynamic_gnu2_combine_32): Fix empty split condition. * config/i386/sse.md (*_pmovmskb_lt, *_pmovmskb_zext_lt, *sse2_pmovmskb_ext_lt, *_pblendvb_lt): Likewise. --- gcc/config/i38

[PATCH 03/11] arm: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/arm/vfp.md (no_literal_pool_df_immediate, no_literal_pool_sf_immediate): Fix empty split condition. --- gcc/config/arm/vfp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index f97af92

[PATCH 05/11] h8300: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/h8300/combiner.md (*andsi3_lshiftrt_n_sb): Fix empty split condition. --- gcc/config/h8300/combiner.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/h8300/combiner.md b/gcc/config/h8300/combiner.md index 20e19da0419..e31bd50

[PATCH 08/11] mips: Update unexpected empty split condition

2021-06-01 Thread Kewen Lin via Gcc-patches
gcc/ChangeLog: * config/mips/mips.md (, bswapsi2, bswapdi2): Fix empty split condition. --- gcc/config/mips/mips.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index eef3cfd50a8..455b9b802f6 100644 ---

  1   2   >