Re: [PATCH-1v2, rs6000] Implement optab_isinf for SFDF and IEEE128

2024-05-22 Thread Peter Bergner
On 5/19/24 10:28 PM, HAO CHEN GUI wrote: > +(define_expand "isinf2" > + [(use (match_operand:SI 0 "gpc_reg_operand")) > + (use (match_operand:SFDF 1 "gpc_reg_operand"))] > + "TARGET_HARD_FLOAT && TARGET_P9_VECTOR" > +{ > + emit_insn (gen_xststdcp (operands[0], operands[1], GEN_INT (0x30))); >

Re: [PATCH] rs6000: Don't pass -many to the assembler [PR112868]

2024-05-22 Thread Peter Bergner
On 5/21/24 8:27 AM, jeevitha wrote: > The following patch has been bootstrapped and regtested with default > configuration > [--enable-checking=yes] and with --enable-checking=release on > powerpc64le-linux. > > This patch removes passing the -many assembler option for release builds. Now, >

Re: [PATCH] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-05-03 Thread Peter Bergner
On 4/12/24 3:36 PM, Peter Bergner wrote: > Testing was clean on both LE and BE, so I pushed the changes. > I'll let things bake on trunk for a bit before pushing the backports. The backports all tested clean, so I pushed them. Fixed everywhere. Thanks everyone! Peter

[gcc r11-11413] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-05-02 Thread Peter Bergner via Gcc-cvs
https://gcc.gnu.org/g:f8f02fd0bfeeb733a044a120b394eeac48de318a commit r11-11413-gf8f02fd0bfeeb733a044a120b394eeac48de318a Author: Peter Bergner Date: Thu May 2 18:07:05 2024 -0500 rs6000: Add OPTION_MASK_POWER8 [PR101865] The bug in PR101865 is the _ARCH_PWR8 predefine macro

[gcc r11-11412] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-05-02 Thread Peter Bergner via Gcc-cvs
https://gcc.gnu.org/g:26d48b6d3e2d07583f25f0769d0c005864760aee commit r11-11412-g26d48b6d3e2d07583f25f0769d0c005864760aee Author: Peter Bergner Date: Tue Apr 9 15:24:39 2024 -0500 rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865] This is a cleanup

[gcc r12-10409] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-05-02 Thread Peter Bergner via Gcc-cvs
for explicit options. 2024-04-12 Will Schmidt Peter Bergner gcc/ PR target/101865 * config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Use TARGET_POWER8. * config/rs6000/rs6000-c.cc

[gcc r12-10408] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-05-02 Thread Peter Bergner via Gcc-cvs
https://gcc.gnu.org/g:135402288a1b1b082d2e71ff2ee5c63b7dafed9f commit r12-10408-g135402288a1b1b082d2e71ff2ee5c63b7dafed9f Author: Peter Bergner Date: Tue Apr 9 15:24:39 2024 -0500 rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865] This is a cleanup

[gcc r13-8673] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-05-01 Thread Peter Bergner via Gcc-cvs
for explicit options. 2024-04-12 Will Schmidt Peter Bergner gcc/ PR target/101865 * config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Use TARGET_POWER8. * config/rs6000/rs6000-c.cc

[gcc r13-8672] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-05-01 Thread Peter Bergner via Gcc-cvs
https://gcc.gnu.org/g:d42105742841e73ca867b6da0c5ca6ad4d86fed6 commit r13-8672-gd42105742841e73ca867b6da0c5ca6ad4d86fed6 Author: Peter Bergner Date: Tue Apr 9 15:24:39 2024 -0500 rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865] This is a cleanup

Re: [PATCH] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-04-12 Thread Peter Bergner
On 4/11/24 11:23 PM, Peter Bergner wrote: > I'll make the changes above, modulo leaving the option name unchanged until > we hear from Segher on that and report back on the LE and BE testing. I made all of the requested changes and went with -mpower8-internal since Segher wa

[gcc r14-9949] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-04-12 Thread Peter Bergner via Gcc-cvs
for explicit options. 2024-04-12 Will Schmidt Peter Bergner gcc/ PR target/101865 * config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Use TARGET_POWER8. * config/rs6000/rs6000-c.cc

Re: [PATCH] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-04-11 Thread Peter Bergner
On 4/11/24 10:31 PM, Kewen.Lin wrote: >> The passed bootstrap and regtest on powerpc64le-linux. Ok for trunk? > > Thanks for fixing this. I guess it should go well on powerpc64-linux too, > but since it's very late stage4 now, could you also test this on BE machine? Will do, after making the

[PATCH] rs6000: Add OPTION_MASK_POWER8 [PR101865]

2024-04-11 Thread Peter Bergner
for backports after some burn-in time on trunk? Peter 2024-04-11 Will Schmidt Peter Bergner gcc/ PR target/101865 * config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Use TARGET_POWER8. * config/rs6000/rs6000-c.cc

Re: [PATCH] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-09 Thread Peter Bergner
On 4/9/24 3:19 PM, Peter Bergner wrote: > Ok, current trunk ignores -mno-direct-move and warns on -mdirect-move, so to > keep the same behavior for GCC 14 (before removing in stage1), we want just: > > mdirect-move > -Target Undocumented Mask(DIRECT_MOVE) Var(rs6000_isa_fla

[gcc r14-9884] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-09 Thread Peter Bergner via Gcc-cvs
https://gcc.gnu.org/g:7924e352523b37155ed9d76dc426701de9d11a22 commit r14-9884-g7924e352523b37155ed9d76dc426701de9d11a22 Author: Peter Bergner Date: Tue Apr 9 15:24:39 2024 -0500 rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865] This is a cleanup

Re: [PATCH] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-09 Thread Peter Bergner
On 4/9/24 12:37 AM, Kewen.Lin wrote: > Since removing it completely is a stage1 thing, I prefer to keep mdirect-move > and -mno-direct-move handlings as before, WarnRemoved and Ignore separately. Ok, current trunk ignores -mno-direct-move and warns on -mdirect-move, so to keep the same behavior

Re: [PATCH] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-08 Thread Peter Bergner
On 4/8/24 9:37 PM, Kewen.Lin wrote: > on 2024/4/8 21:21, Peter Bergner wrote: > I prefer to remove it completely, that is: > >> -mdirect-move >> -Target Undocumented Mask(DIRECT_MOVE) Var(rs6000_isa_flags) WarnRemoved > > The reason why you still kept it is to keep a

Re: [PATCH] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-08 Thread Peter Bergner
On 4/8/24 3:55 AM, Kewen.Lin wrote: > on 2024/4/6 06:28, Peter Bergner wrote: >> +mno-direct-move >> +Target Undocumented WarnRemoved >> + >> mdirect-move >> -Target Undocumented Mask(DIRECT_MOVE) Var(rs6000_isa_flags) WarnRemoved >> +Target Undocume

Re: [PATCH, rs6000] Split TARGET_POWER8 from TARGET_DIRECT_MOVE [PR101865] (2/2)

2024-04-07 Thread Peter Bergner
I'm picking up Will's patches for this bug. As an FYI, this is the bug where _ARCH_PWR8 is conditional on TARGET_DIRECT_MOVE which can be disabled with -mno-vsx which is bad. I already posted the cleanup patch that the updated patch for this bug will rely on, that removed the

[PATCH] rs6000: Replace OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR [PR101865]

2024-04-05 Thread Peter Bergner
This is a cleanup patch in preparation to fixing the real bug in PR101865. TARGET_DIRECT_MOVE is redundant with TARGET_P8_VECTOR, so alias it to that. Also replace all usages of OPTION_MASK_DIRECT_MOVE with OPTION_MASK_P8_VECTOR and delete the now dead mask. This passed bootstrap and retesting on

Re: [PATCH v3] tree-profile: Disable indirect call profiling for IFUNC resolvers

2024-04-03 Thread Peter Bergner
On 4/3/24 10:45 AM, Andrew Pinski wrote: > On Wed, Apr 3, 2024 at 8:32 AM Peter Bergner wrote: > I think you misunderstood the patch/situtation. Most ifunc resolves > don't use TLS at all; what is happening here is that the profiler > (-fprofile-generate) is adding TLS usage to the if

Re: [PATCH v3] tree-profile: Disable indirect call profiling for IFUNC resolvers

2024-04-03 Thread Peter Bergner
On 4/3/24 7:40 AM, H.J. Lu wrote: > We can't profile indirect calls to IFUNC resolvers nor their callees as > it requires TLS which hasn't been set up yet when the dynamic linker is > resolving IFUNC symbols. > > Add an IFUNC resolver caller marker to cgraph_node and set it if the > function is

Re: [PATCH v2] rs6000: Stackoverflow in optimized code on PPC [PR100799]

2024-03-23 Thread Peter Bergner
On 3/23/24 4:33 AM, Ajit Agarwal wrote: >>> - else if (align_words < GP_ARG_NUM_REG) >>> + else if (align_words < GP_ARG_NUM_REG >>> + || (cum->hidden_string_length >>> + && cum->actual_parm_length <= GP_ARG_NUM_REG)) >> { >> if (TARGET_32BIT &&

Re: [PATCH v2] rs6000: Stackoverflow in optimized code on PPC [PR100799]

2024-03-22 Thread Peter Bergner
On 3/22/24 5:15 AM, Ajit Agarwal wrote: > When using FlexiBLAS with OpenBLAS we noticed corruption of > the parameters passed to OpenBLAS functions. FlexiBLAS > basically provides a BLAS interface where each function > is a stub that forwards the arguments to a real BLAS lib, > like OpenBLAS. > >

Re: [PATCH] rs6000: Fix issue in specifying PTImode as an attribute [PR106895]

2024-03-18 Thread Peter Bergner
On 3/18/24 9:36 AM, Segher Boessenkool wrote: > Hi! > > On Fri, Feb 23, 2024 at 03:04:13PM +0530, jeevitha wrote: >> PTImode attribute assists in generating even/odd register pairs on 128 bits. > > It is a mode, not an attribute. Attributes are on declarations, while > modes are on a much more

Re: [PATCH V3] rs6000: Don't ICE when compiling the __builtin_vsx_splat_2di built-in [PR113950]

2024-03-15 Thread Peter Bergner
On 3/6/24 3:27 AM, Kewen.Lin wrote: > on 2024/3/4 02:55, jeevitha wrote: >> The following patch has been bootstrapped and regtested on powerpc64le-linux. >> >> When we expand the __builtin_vsx_splat_2di function, we were

Re: Stepping up as maintainer for ia64

2024-03-08 Thread Peter Bergner via Gcc
On 3/8/24 5:28 PM, Jonathan Wakely wrote: > On Fri, 8 Mar 2024 at 22:35, Frank Scheiner via Gcc wrote: >> >> On 08.03.24 23:00, Peter Bergner wrote: >>> On 3/8/24 7:16 AM, Richard Biener via Gcc wrote: >>>> I CCed Jeff who is on the commitee to forward the mai

Re: [PATCH] fix PowerPC < 7 w/ Altivec not to default to power7

2024-03-08 Thread Peter Bergner via Gcc
On 3/8/24 5:30 AM, Jonathan Wakely via Gcc wrote: > Patches should be sent to the gcc-patches list instead of this one, > and should be against trunk not an old gcc-11 RC. See > https://gcc.gnu.org/contribute.html#patches for more details - thanks! And you need to CC the rs6000/powerpc port

Re: Stepping up as maintainer for ia64

2024-03-08 Thread Peter Bergner via Gcc
On 3/8/24 7:16 AM, Richard Biener via Gcc wrote: > I CCed Jeff who is on the commitee to forward the maintainer proposal > though I guess this will not go forward as a first step. Instead > you are probably expected to show activity on the port, for example > post the patch series to make ia64

Re: [PATCH V2] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950]

2024-02-28 Thread Peter Bergner
On 2/28/24 8:31 AM, Segher Boessenkool wrote: > On Tue, Feb 27, 2024 at 04:50:02PM -0600, Peter Bergner wrote: >> So it seems you're not NAKing the use of splat_input_operand, but >> just that it needs more explanation in the git log entry, correct? > > I NAK the patch. _O

Re: [PATCH V2] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950]

2024-02-27 Thread Peter Bergner
On 2/27/24 6:40 AM, Segher Boessenkool wrote: > On Tue, Feb 27, 2024 at 02:02:38AM +0530, jeevitha wrote: >> There is no immediate value splatting instruction in Power. Currently, those >> values need to be stored in a register or memory. To address this issue, I >> have updated the predicate for

Re: [PATCH] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950]

2024-02-26 Thread Peter Bergner
On 2/26/24 7:55 PM, Kewen.Lin wrote: > on 2024/2/26 23:07, Peter Bergner wrote: >> so I think we should use both Jeevitha's predicate change and >> your operands[1] change. > > Since either the original predicate change or operands[1] change > can fix this issue, I thin

Re: [PATCH] rs6000: Don't allow immediate value in the vsx_splat pattern [PR113950]

2024-02-26 Thread Peter Bergner
On 2/26/24 4:49 AM, Kewen.Lin wrote: > on 2024/2/26 14:18, jeevitha wrote: >> Hi All, >> diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md >> index 6111cc90eb7..e5688ff972a 100644 >> --- a/gcc/config/rs6000/vsx.md >> +++ b/gcc/config/rs6000/vsx.md >> @@ -4660,7 +4660,7 @@ >>

Re: [PATCH] rs6000: Neuter option -mpower{8,9}-vector [PR109987]

2024-02-20 Thread Peter Bergner
On 2/20/24 3:27 AM, Kewen.Lin wrote: > on 2024/2/20 02:45, Segher Boessenkool wrote: >> On Tue, Jan 16, 2024 at 10:50:01AM +0800, Kewen.Lin wrote: >>> it consists of some aspects: >>> - effective target powerpc_p{8,9}vector_ok are removed >>> and replaced with powerpc_vsx_ok. >> >> So all

Re: [PATCH] rs6000: Update instruction counts due to combine changes [PR112103]

2024-02-20 Thread Peter Bergner
On 2/20/24 3:29 AM, Kewen.Lin wrote: > on 2024/2/20 06:35, Peter Bergner wrote: >> rs6000: Update instruction counts due to combine changes [PR112103] >> >> The PR91865 combine fix changed instruction counts slightly for rlwinm-0.c. >> Adjust expected ins

[PATCH] rs6000: Update instruction counts due to combine changes [PR112103]

2024-02-19 Thread Peter Bergner
rs6000: Update instruction counts due to combine changes [PR112103] The PR91865 combine fix changed instruction counts slightly for rlwinm-0.c. Adjust expected instruction counts accordingly. This passed on both powerpc64le-linux and powerpc64-linux running the testsuite in both 32-bit and

Re: [PATCH, V2] PR target/112886, Add %S to print_operand for vector pair support.

2024-01-24 Thread Peter Bergner
On 1/24/24 12:04 AM, Kewen.Lin wrote: > on 2024/1/24 11:11, Peter Bergner wrote: >> But not with this. The -mdejagnu-cpu=power10 option already enables -mvsx. >> If the user explcitly forces -mno-vsx via RUNTESTFLAGS, then let them. >> The options set in RUNTESTFLAGS c

Re: [PATCH, V2] PR target/112886, Add %S to print_operand for vector pair support.

2024-01-23 Thread Peter Bergner
On 1/23/24 8:30 PM, Kewen.Lin wrote: >> -output_operand_lossage ("invalid %%x value"); >> +output_operand_lossage ("invalid %%%c value", (code == 'S' ? 'S' : >> 'x')); > > Nit: Seems simpler with > > output_operand_lossage ("invalid %%%c value", (char) code); Agreed, good catch.

Re: [PATCH, V2] PR target/112886, Add %S to print_operand for vector pair support.

2024-01-19 Thread Peter Bergner
On 1/11/24 11:29 AM, Michael Meissner wrote: > This is version 2 of the patch. The only difference is I made the test case > simpler to read. [snip] > gcc/ > > PR target/112886 > * config/rs6000/rs6000.cc (print_operand): Add %S output modifier. > * doc/md.texi (Modifiers):

Re: [PATCH] PR target/112886, Add %S to print_operand for vector pair support

2024-01-09 Thread Peter Bergner
On 1/5/24 4:18 PM, Michael Meissner wrote: > @@ -14504,13 +14504,17 @@ print_operand (FILE *file, rtx x, int code) > print_operand (file, x, 0); >return; > > +case 'S': > case 'x': > - /* X is a FPR or Altivec register used in a VSX context. */ > + /* X is a FPR

Re: [PATCH V2] rs6000: Change GPR2 to volatile & non-fixed register for function that does not use TOC [PR110320]

2023-12-14 Thread Peter Bergner
On 12/14/23 9:57 PM, Peter Bergner wrote: > On 7/16/23 10:40 PM, P Jeevitha via Gcc-patches wrote: >> + /* For non PC-relative code, GPR2 is unavailable for register allocation. >> */ >> + if (FIXED_R2 && !rs6000_pcrel_p ()) >> +fixed_regs[2] = 1; [sn

Re: [PATCH V2] rs6000: Change GPR2 to volatile & non-fixed register for function that does not use TOC [PR110320]

2023-12-14 Thread Peter Bergner
On 7/16/23 10:40 PM, P Jeevitha via Gcc-patches wrote: > Normally, GPR2 is the TOC pointer and is defined as a fixed and non-volatile > register. However, it can be used as volatile for PCREL addressing. Therefore, > modified r2 to be non-fixed in FIXED_REGISTERS and set it to fixed if it is >

Re: [PATCH] rs6000: Disassemble opaque modes using subregs to allow optimizations [PR109116]

2023-12-13 Thread Peter Bergner
On 11/24/23 3:28 AM, Kewen.Lin wrote: >> + int regoff = INTVAL (operands[2]) * GET_MODE_SIZE (V16QImode); > > Is it intentional to keep GET_MODE_SIZE (V16QImode) instead of 16? > I think if one day NUM_POLY_INT_COEFFS isn't 1 on rs6000 any more, > we have to add one explicit .to_constant ()

Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)

2023-12-13 Thread Peter Bergner
On 12/13/23 2:05 AM, Jakub Jelinek wrote: > On Wed, Dec 13, 2023 at 08:51:16AM +0100, Richard Biener wrote: >> On Tue, 12 Dec 2023, Peter Bergner wrote: >> >>> On 12/12/23 8:36 PM, Jason Merrill wrote: >>>> This test is failing for me below C++17, I think y

Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)

2023-12-12 Thread Peter Bergner
On 12/12/23 8:36 PM, Jason Merrill wrote: > This test is failing for me below C++17, I think you need > > // { dg-do compile { target c++17 } } > or > // { dg-require-effective-target c++17 } Sorry about that. Should we do the above or should we just add -std=c++17 to dg-options? ...or do we

Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)

2023-12-12 Thread Peter Bergner
On 12/12/23 1:26 PM, Richard Biener wrote: >> Am 12.12.2023 um 19:51 schrieb Peter Bergner : >> >> On 12/12/23 12:45 PM, Peter Bergner wrote: >>> +/* PR target/112822 */ >> >> Oops, this should be: >> >> /* PR tree-optimization/112822 */ >>

Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)

2023-12-12 Thread Peter Bergner
On 12/12/23 12:45 PM, Peter Bergner wrote: > +/* PR target/112822 */ Oops, this should be: /* PR tree-optimization/112822 */ It's fixed on my end. Peter

Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822)

2023-12-12 Thread Peter Bergner
On 12/12/23 10:50 AM, Martin Jambor wrote: > The testcase has reasonable size but it is specific to ppc64le and its > altivec vectors. My plan is to ask the bug reporter to massage it into > a target specific testcase in bugzilla. Alternatively I can try to > craft a testcase from scratch but

[PATCH] rs6000: Disassemble opaque modes using subregs to allow optimizations [PR109116]

2023-11-15 Thread Peter Bergner
PR109116 exposes an issue where using unspecs to access each vector component of an opaque mode variable leads to unneeded register copies, because our rtl optimizers cannot handle unspecs. Instead, use subregs to access each vector component of the opaque mode variable, which our optimizers know

Re: [PATCH V3 0/7] ira/lra: Support subreg coalesce

2023-11-14 Thread Peter Bergner
On 11/14/23 9:12 PM, Lehua Ding wrote: > I've applied for machine permissions on the compile farm, can you give > me the way to compile and run tests on PPC64BE machine? I'll take a look > at it too, thanks a lot. That's an old system, with too old system libgmp, etc. Let me attempt a build

[PATCH] rs6000: Only enable PCREL on supported ABIs [PR111045]

2023-11-14 Thread Peter Bergner
PCREL data accesses are only officially supported on ELFv2. We currently incorrectly enable PCREL on all Power10 compiles in which prefix instructions are also enabled. Rework the option override code so we only enable PCREL for those ABIs that actually support it. Jeevitha has confirmed this

Re: [PATCH V3 0/7] ira/lra: Support subreg coalesce

2023-11-14 Thread Peter Bergner
On 11/13/23 11:37 PM, Lehua Ding wrote: > On 2023/11/14 3:37, Vladimir Makarov wrote: >> Also besides testing major targets I'd recommend testing at least one big >> endian target (I'd recommend ppc64be. gcc110.fsfrance.org could be used >> for this). Plenty RA issues occur because BE targets are

Re: [PATCH V3 0/7] ira/lra: Support subreg coalesce

2023-11-14 Thread Peter Bergner
On 11/12/23 6:08 AM, Lehua Ding wrote: > V3 Changes: > 1. fix three ICE. > 2. rebase I tested this on powerpc64le-linux and powerpc64-linux. The LE build bootstrapped fine and it looks like only one testsuite FAIL which I have to look into why it's FAILing. The BE build did bootstrap, but

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-11-14 Thread Peter Bergner
On 11/13/23 8:33 PM, Kewen.Lin wrote: >> if (PCREL_SUPPORTED_BY_OS) > >> + else >> +{ >> + if (TARGET_PCREL >> + && (rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) >> +error ("use of %qs is invalid for this target", "-mpcrel"); >>rs6000_isa_flags &=

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-11-10 Thread Peter Bergner
On 8/25/23 6:20 AM, Kewen.Lin wrote: > btw, I was also expecting that we don't implicitly set > OPTION_MASK_PCREL any more for Power10, that is to remove > OPTION_MASK_PCREL from OTHER_POWER10_MASKS. So my patch removes the flag from the default power10 flags, like you want. However, it doesn't

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-11-10 Thread Peter Bergner
On 8/27/23 9:06 PM, Kewen.Lin wrote: > Assuming we only have ELFv2_ABI_CHECK in PCREL_SUPPORTED_BY_OS, we > can have either TARGET_PCREL or !TARGET_PCREL after the checking. > For the latter, it's fine and don't need any checks. For the former, > if it's implicit, for !TARGET_PREFIXED we will

[PATCH] rs6000: Update instruction counts to match vec_* calls [PR111228]

2023-08-30 Thread Peter Bergner via Gcc-patches
Commit r14-3258-ge7a36e4715c716 increased the amount of folding we perform, leading to better code. Update the expected instruction counts to match the the number of associated vec_* built-in calls. Tested on powerpc64le-linux with no regressions. Ok for mainline? Peter gcc/testsuite/

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-08-25 Thread Peter Bergner via Gcc-patches
On 8/25/23 6:20 AM, Kewen.Lin wrote: > Assuming the current PCREL_SUPPORTED_BY_OS unchanged, when > PCREL_SUPPORTED_BY_OS is true, all its required conditions are > satisfied, it should be safe. while PCREL_SUPPORTED_BY_OS is > false, it means the given subtarget doesn't support it, or one > or

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-08-24 Thread Peter Bergner via Gcc-patches
On 8/24/23 12:56 AM, Kewen.Lin wrote: > By looking into the uses of function rs6000_pcrel_p, I think we can > just replace it with TARGET_PCREL. Previously we don't require PCREL > unset for any unsupported target/OS, so we need rs6000_pcrel_p() to > ensure it's really supported in those use

Re: [PATCH] rs6000: Fix issue in specifying PTImode as an attribute [PR106895]

2023-08-24 Thread Peter Bergner via Gcc-patches
On 8/24/23 12:35 PM, Michael Meissner wrote: > On Thu, Jul 20, 2023 at 10:05:28AM +0530, jeevitha wrote: >> gcc/ >> PR target/110411 >> * config/rs6000/rs6000.h (enum rs6000_builtin_type_index): Add fields >> to hold PTImode type. >> * config/rs6000/rs6000-builtin.cc

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-08-23 Thread Peter Bergner via Gcc-patches
On 8/21/23 8:51 PM, Kewen.Lin wrote: >> The following patch has been bootstrapped and regtested on powerpc64-linux. > > I think we should test this on powerpc64le-linux P8 or P9 (no P10) as well. That's a good idea! > I think this should be moved to be with the hunk on PCREL: > > /* If the

Re: [PING][PATCH] ira: update allocated_hardreg_p[] in improve_allocation() [PR110254]

2023-08-18 Thread Peter Bergner via Gcc-patches
On 8/2/23 8:23 AM, Vladimir Makarov wrote: >>> gcc/ >>> PR rtl-optimization/PR110254 >>> * ira-color.cc (improve_allocation): Update array > > I guess you missed the next line in the changelog.  I suspect it should be > "Update array allocated_hard_reg_p." > > Please, fix it before

Re: [PATCH ver 2] rs6000, add overloaded DFP quantize support

2023-08-16 Thread Peter Bergner via Gcc-patches
On 8/16/23 7:19 PM, Carl Love wrote: > +(define_insn "dfp_dquan_" > + [(set (match_operand:DDTD 0 "gpc_reg_operand" "=d") > +(unspec:DDTD [(match_operand:DDTD 1 "gpc_reg_operand" "d") > + (match_operand:DDTD 2 "gpc_reg_operand" "d") > +

Re: [PATCH V2] rs6000: Don't allow AltiVec address in movoo & movxo pattern [PR110411]

2023-08-06 Thread Peter Bergner via Gcc-patches
On 7/19/23 11:46 AM, jeevitha via Gcc-patches wrote: > gcc/ > PR target/110411 > * config/rs6000/mma.md (define_insn_and_split movoo): Disallow > AltiVec address in movoo and movxo pattern. No need to mention movxo here, since the next change covers movxo. And maybe better as

Re: [PATCH] rs6000: Remove redundant initialization [PR106907]

2023-07-10 Thread Peter Bergner via Gcc-patches
On 6/29/23 4:31 AM, Kewen.Lin via Gcc-patches wrote: > This is okay for trunk (no backports needed btw), this fix can even be > taken as obvious, thanks! > >> >> 2023-06-07 Jeevitha Palanisamy >> >> gcc/ >> PR target/106907 > > One curious question is that this PR106907 seemed not to

Re: [PATCH, OBVIOUS] rs6000: Remove redundant MEM_P predicate usage

2023-07-10 Thread Peter Bergner via Gcc-patches
On 7/10/23 11:47 AM, Peter Bergner wrote: > While helping someone on the team debug an issue, I noticed some redundant > tests in a couple of our predicates which can be removed. I'm going to > commit the following as obvious once bootstrap and regtesting come back > clean

Re: [PATCH ver3] rs6000, Add return value to __builtin_set_fpscr_rn

2023-07-10 Thread Peter Bergner via Gcc-patches
On 7/10/23 2:18 PM, Carl Love wrote: > + /* Get the current FPSCR fields, bits 29:31 (DRN) and bits 56:63 (VE, OE, > UE, > + ZE, XE, NI, RN) from the FPSCR and return them. */ The 'Z' above should line up directly under the 'G' in Get. > - /* Insert new RN mode into FSCPR. */ > -

[PATCH, OBVIOUS] rs6000: Remove redundant MEM_P predicate usage

2023-07-10 Thread Peter Bergner via Gcc-patches
While helping someone on the team debug an issue, I noticed some redundant tests in a couple of our predicates which can be removed. I'm going to commit the following as obvious once bootstrap and regtesting come back clean. Peter rs6000: Remove redundant MEM_P predicate usage The

Re: [PATCH] rs6000: Don't ICE when generating vector pair load/store insns [PR110411]

2023-07-07 Thread Peter Bergner via Gcc-patches
On 7/6/23 6:28 PM, Segher Boessenkool wrote: > On Thu, Jul 06, 2023 at 02:48:19PM -0500, Peter Bergner wrote: >> On 7/6/23 12:33 PM, Segher Boessenkool wrote: >>> On Wed, Jul 05, 2023 at 05:21:18PM +0530, P Jeevitha wrote: >>>> --- a/gcc/config/rs6000/rs6000.cc >&

Re: [PATCH ver 2] rs6000, __builtin_set_fpscr_rn add retrun value

2023-07-07 Thread Peter Bergner via Gcc-patches
On 7/7/23 12:08 AM, Kewen.Lin wrote: > on 2023/7/7 07:00, Peter Bergner wrote: >> On 7/6/23 5:54 PM, Peter Bergner wrote: >>> On 6/30/23 7:58 PM, Carl Love via Gcc-patches wrote: >>>> +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_2.c >>>&

Re: [PATCH ver 2] rs6000, __builtin_set_fpscr_rn add retrun value

2023-07-06 Thread Peter Bergner via Gcc-patches
On 7/6/23 5:54 PM, Peter Bergner wrote: > On 6/30/23 7:58 PM, Carl Love via Gcc-patches wrote: >> +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_2.c >> @@ -0,0 +1,153 @@ >> +/* { dg-do run { target { powerpc*-*-* } } } */ > > powerpc*-*-* is the default

Re: [PATCH ver 2] rs6000, __builtin_set_fpscr_rn add retrun value

2023-07-06 Thread Peter Bergner via Gcc-patches
On 6/30/23 7:58 PM, Carl Love via Gcc-patches wrote: > rs6000, __builtin_set_fpscr_rn add retrun value s/retrun/return/ Maybe better written as: rs6000: Add return value to __builtin_set_fpscr_rn > Change the return value from void to double. The return value consists of > the FPSCR fields

Re: [PATCH] rs6000: Don't ICE when generating vector pair load/store insns [PR110411]

2023-07-06 Thread Peter Bergner via Gcc-patches
On 7/6/23 12:33 PM, Segher Boessenkool wrote: > On Wed, Jul 05, 2023 at 05:21:18PM +0530, P Jeevitha wrote: >> --- a/gcc/config/rs6000/rs6000.cc >> +++ b/gcc/config/rs6000/rs6000.cc >> @@ -9894,6 +9894,8 @@ rs6000_legitimate_address_p (machine_mode mode, rtx x, >> bool reg_ok_strict) >> >>

Re: [PATCH] rs6000: Change GPR2 to volatile & non-fixed register for function that does not use TOC [PR110320]

2023-07-06 Thread Peter Bergner via Gcc-patches
On 6/28/23 3:07 AM, Kewen.Lin wrote: > I think the reason why we need to check common_deferred_options is at this > time > we can't distinguish the fixed_regs[2] is from the initialization or command > line > user explicit specification. But could we just update the FIXED_REGISTERS > without >

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/30/23 6:50 PM, Carl Love wrote: > With a little help from Peter and Julian Wang. Objdump decodes some of > the xxlor instructions as xxmr instsructions. The xxmr is a new > mnemonic which will be out in the next ISA. But objdump already > produces it. So if you add the counts for grep

Re: [PATCH] rs6000: Update the vsx-vector-6.* tests.

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/30/23 5:20 PM, Carl Love wrote: > So, we have the issue that looking at the assembly gives different > instruction counts then what > >dg-final { scan-assembler-times {\mxxlor\M} } > > comes up with??? I recommend not even counting xxlor at all, since the majority of them come from

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-30 Thread Peter Bergner via Gcc-patches
On 6/22/23 10:30 PM, Ian Lance Taylor wrote: > On Thu, Jun 22, 2023, 4: 47 PM Peter Bergner > wrote: On 6/22/23 6: 37 PM, Peter Bergner via Gcc-patches wrote: > On 6/16/23 > >> On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches > >> mailto:gcc-

Re: [PATCH] rs6000, __builtin_set_fpscr_rn add retrun value

2023-06-29 Thread Peter Bergner via Gcc-patches
On 6/29/23 4:13 AM, Kewen.Lin wrote: > on 2023/6/19 23:57, Carl Love wrote: >> The following patch changes the return type of the >> __builtin_set_fpscr_rn builtin from void to double. The return value >> is the current value of the various FPSCR fields DRN, VE, OE, UE, ZE, >> XE, NI, RN bit

Re: [PATCH v5] tree-ssa-sink: Improve code sinking pass

2023-06-22 Thread Peter Bergner via Gcc-patches
On 6/1/23 11:54 PM, Ajit Agarwal via Gcc-patches wrote: > > > On 01/06/23 2:06 pm, Bernhard Reutner-Fischer wrote: >> On 1 June 2023 09:20:08 CEST, Ajit Agarwal wrote: >>> Hello All: >>> >>> This patch improves code sinking pass to sink statements before call to >>> reduce >>> register

Re: [PATCH 2/2] rust: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-22 Thread Peter Bergner via Gcc-rust
On 6/21/23 11:20 AM, Paul E Murphy via Gcc-patches wrote: > > > On 6/19/23 3:39 AM, Thomas Schwinge wrote: >> Hi Paul! >> >> On 2023-06-16T11:00:02-0500, "Paul E. Murphy via Gcc-patches" >> wrote: >>> This was noticed when fixing the gccgo usage of the macro, the >>> rust usage is very

Re: [PATCH 2/2] rust: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-22 Thread Peter Bergner via Gcc-patches
On 6/21/23 11:20 AM, Paul E Murphy via Gcc-patches wrote: > > > On 6/19/23 3:39 AM, Thomas Schwinge wrote: >> Hi Paul! >> >> On 2023-06-16T11:00:02-0500, "Paul E. Murphy via Gcc-patches" >> wrote: >>> This was noticed when fixing the gccgo usage of the macro, the >>> rust usage is very

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-22 Thread Peter Bergner via Gcc-patches
On 6/22/23 6:37 PM, Peter Bergner via Gcc-patches wrote: > On 6/16/23 12:01 PM, Ian Lance Taylor via Gcc-patches wrote: >> On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches >> wrote: >>> >>> TARGET_AIX is defined to a non-zero value on linux and ma

Re: [PATCH 1/2] go: update usage of TARGET_AIX to TARGET_AIX_OS

2023-06-22 Thread Peter Bergner via Gcc-patches
On 6/16/23 12:01 PM, Ian Lance Taylor via Gcc-patches wrote: > On Fri, Jun 16, 2023 at 9:00 AM Paul E. Murphy via Gcc-patches > wrote: >> >> TARGET_AIX is defined to a non-zero value on linux and maybe other >> powerpc64le targets. This leads to unexpected behavior such as >> dropping the

Re: [PATCH] rs6000: Change bitwise xor to inequality operator [PR106907]

2023-06-15 Thread Peter Bergner via Gcc-patches
On 6/12/23 6:18 AM, P Jeevitha wrote: > Bitwise xor performed on bool > is similar to checking inequality. So changed to inequality > operator (!=) instead of bitwise xor (^). [snip' > - if (swapped ^ !BYTES_BIG_ENDIAN [snip] > + if (swapped != !BYTES_BIG_ENDIAN I know Andreas

Re: [PATCH v4] tree-ssa-sink: Improve code sinking pass

2023-05-31 Thread Peter Bergner via Gcc-patches
This is not a review of the patch itself, but... On 5/31/23 2:01 AM, Ajit Agarwal wrote: > tree-ssa-sink: Improve code sinking pass > > Code Sinking sinks the blocks after call.This increases register pressure > for callee-saved registers. Improves code sinking before call in the use > blocks or

Re: [PATCH] rs6000: Fix __builtin_vec_xst_trunc definition

2023-05-31 Thread Peter Bergner via Gcc-patches
On 5/22/23 4:04 AM, Kewen.Lin wrote: > on 2023/5/11 02:06, Carl Love via Gcc-patches wrote: >> @@ -3161,12 +3161,15 @@ >>void __builtin_altivec_tr_stxvrbx (vsq, signed long, signed char *); >> TR_STXVRBX vsx_stxvrbx {stvec} >> >> - void __builtin_altivec_tr_stxvrhx (vsq, signed long,

Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions

2023-05-24 Thread Peter Bergner via Gcc-patches
On 5/24/23 10:20 AM, Carl Love wrote: > Extending the builtin to pre Power 9 is straight forward and I agree > would make good sense to do. > > I am a bit concerned on how to extend __builtin_set_fpscr_rn to add the > new functionality. Peter suggests overloading the builtin to either > return

Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions

2023-05-23 Thread Peter Bergner via Gcc-patches
On 5/23/23 12:24 AM, Kewen.Lin wrote: > on 2023/5/23 01:31, Carl Love wrote: >> The builtins were requested for use in GLibC. As of version 2.31 they >> were added as inline asm. They requested a builtin so the asm could be >> removed. > > So IMHO we also want the similar support for mffscrn,

Re: [PATCH] rs6000: Fix __builtin_vec_xst_trunc definition

2023-05-18 Thread Peter Bergner via Gcc-patches
On 5/10/23 1:06 PM, Carl Love wrote: > - void __builtin_altivec_tr_stxvrhx (vsq, signed long, signed int *); > + void __builtin_altivec_tr_stxvrhx (vsq, signed long, signed short *); > TR_STXVRHX vsx_stxvrhx {stvec} > > - void __builtin_altivec_tr_stxvrwx (vsq, signed long, signed short

Re: [PATCH] rs6000: Update powerpc test fold-vec-extract-int.p8.c

2023-05-18 Thread Peter Bergner via Gcc-patches
On 5/18/23 6:16 AM, Ajit Agarwal via Gcc-patches wrote: > -/* { dg-final { scan-assembler-times {\mrldicl\M} 7 { target { le } } } } */ > +/* { dg-final { scan-assembler-times {\mrldicl\M} 5 { target { le } } } } */ > /* { dg-final { scan-assembler-times {\mrldicl\M} 4 { target { lp64 && be } >

Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-13 Thread Peter Bergner via Gcc-patches
On 5/10/23 2:34 AM, Andreas Schwab wrote: > On Mai 09 2023, Peter Bergner via Gcc-patches wrote: >> I'm sorry to be dense, but can you point to the specific line? In my >> $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is: >> >> RPATH_ENVVAR = LD_LIBRARY_

Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-09 Thread Peter Bergner via Gcc-patches
On 5/9/23 3:50 PM, Andreas Schwab wrote: > On Mai 09 2023, Peter Bergner via Gcc-patches wrote: > >> It's almost as if the top level build machinery >> adds a LD_LIBRARY_PATH=... > > See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if > gcc-b

Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-09 Thread Peter Bergner via Gcc-patches
On 5/5/23 4:42 PM, Jakub Jelinek wrote: > On Thu, May 04, 2023 at 02:29:34PM -0500, Peter Bergner wrote: >> Merged from upstream libffi commit: 464b4b66e3cf3b5489e730c1466ee1bf825560e0 >> >> 2023-05-03 Dan Horák >> >> libffi/ >> PR libffi/109

Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-05 Thread Peter Bergner via Gcc-patches
On 5/4/23 2:29 PM, Peter Bergner wrote: > I'd like to pull in Dan's upstream libffi commit into trunk to fix a > wrong code bug/testsuite failure on powerpc64le-linux with long double > defaulting to ieee128. This passed bootstrap and regtesting with no > regressions. Ok for trunk? &

[PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]

2023-05-04 Thread Peter Bergner via Gcc-patches
I'd like to pull in Dan's upstream libffi commit into trunk to fix a wrong code bug/testsuite failure on powerpc64le-linux with long double defaulting to ieee128. This passed bootstrap and regtesting with no regressions. Ok for trunk? This bug is also on the GCC 12 and GCC 11 release branches.

Re: [PATCH v4 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces.

2023-05-02 Thread Peter Bergner via Gcc-patches
On 4/28/23 6:49 PM, Hans-Peter Nilsson wrote: > On Fri, 28 Apr 2023, Jeff Law wrote: >> So while what Ajit has done is a step forward, at some point the actual >> details of the ABI need to be described in a way that can be checked and >> consumed by REE. > > IIRC I also commented and suggested a

Re: [PATCH v3 1/4] ree: Default ree pass for O2 and above for rs6000 target.

2023-04-24 Thread Peter Bergner via Gcc-patches
On 4/24/23 10:28 AM, Jakub Jelinek wrote: > On Mon, Apr 24, 2023 at 10:23:06AM -0500, Peter Bergner wrote: >> On 4/19/23 3:00 PM, Segher Boessenkool wrote: >>> On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote: >>>>* common/config/rs6000/

Re: [PATCH v3 1/4] ree: Default ree pass for O2 and above for rs6000 target.

2023-04-24 Thread Peter Bergner via Gcc-patches
On 4/19/23 3:00 PM, Segher Boessenkool wrote: > On Wed, Apr 19, 2023 at 11:23:07PM +0530, Ajit Agarwal wrote: >> * common/config/rs6000/rs6000-common.cc: Add REE pass as a >> default rs6000 target pass for O2 and above. > > Why only for -O2? Only when optimising at all makes sense,

Re: [PATCH] rtl-optimization: ppc backend generates unnecessary signed extension.

2023-03-24 Thread Peter Bergner via Gcc-patches
On 3/23/23 6:12 PM, Jeff Law via Gcc-patches wrote: Is there a reason why REE cannot see that our (reg:QI 4) is a param register and thus due to our ABI, already correctly sign/zero extended? >>> >>> I don't think REE has ever considered exploiting ABI constraints. Handling >>>

Re: [PATCH] rtl-optimization: ppc backend generates unnecessary signed extension.

2023-03-23 Thread Peter Bergner via Gcc-patches
On 3/23/23 11:32 AM, Jeff Law via Gcc-patches wrote: > On 3/23/23 10:29, Peter Bergner wrote: >> I'm sorry that I don't know how REE works. Why can't it optimize this? >> I see in the REE dump: >> >> (insn 20 18 22 3 (set (reg:DI 4 4) >>

  1   2   3   4   5   6   7   8   9   10   >