Re: [PATCH 1/2] rs6000: Support _mm_insert_epi{8,32,64}

2020-09-25 Thread Segher Boessenkool
Hi! On Fri, Sep 25, 2020 at 09:07:46AM -0500, Paul A. Clarke wrote: > On Thu, Sep 24, 2020 at 06:22:10PM -0500, Segher Boessenkool wrote: > > > + result [(__N & 0b)] = __D; > > > > Hrm, GCC supports binary constants like this since 2007, so okay. But I > &g

Re: [EXTERNAL] Re: [PATCH 2/2, rs6000] VSX load/store rightmost element operations

2020-09-25 Thread Segher Boessenkool
On Fri, Sep 25, 2020 at 10:41:05AM -0500, will schmidt wrote: > On Thu, 2020-09-24 at 19:40 -0500, Segher Boessenkool wrote: > > > +++ b/gcc/testsuite/gcc.target/powerpc/vsx-load-element-extend- > > > char.c > > > @@ -0,0 +1,168 @@ > > > +/* > > > +

Re: [PATCH 1/2, rs6000] int128 sign extention instructions (partial prereq)

2020-09-25 Thread Segher Boessenkool
], temp)); > > +DONE; > > + } > > + [(set_attr "type" "exts")]) > > Don't need "type" attr on define_expand since the type will come from the 2 > individual insns emitted. Yeah good point, those attrs do not even do anything on the expand as far as I can see (do *any* attrs, even?) Segher

Re: [PATCH, rs6000] correct an erroneous BTM value in the BU_P10_MISC define

2020-09-25 Thread Segher Boessenkool
On Fri, Sep 25, 2020 at 03:34:49PM -0500, will schmidt wrote: > On Fri, 2020-09-25 at 12:36 -0500, Segher Boessenkool wrote: > > No, it cannot. > > > > This is used for pdepd/pextd/cntlzdm/cnttzdm/cfuged, all of which do > > need 64-bit registers to do anything sane.

Re: [PATCH, rs6000] Add non-relative jump table support on Power Linux

2020-09-28 Thread Segher Boessenkool
, which will make your patch much easier to read. It looks like it will be fine, thanks :-) Segher

Re: [rs6000] Avoid useless masking of count operand for rotation

2020-09-29 Thread Segher Boessenkool
st_int 0)))] Why? This diverges the "dot" version from the non-dot for no reason. (We can do 32-bit rotates on 64-bit implementations just fine, and even the record ("dot") form works just fine; except for the setting of "smaller than" in CR0. And we can fix that even (by not using 0,31 but a wrapping mask, say, 1,0), but more readable generated code was more important so far.) I don't see a patch with splitters only? Huh. Did you attach the same patch twice? Since this won't be handled before combine (or what do I miss?), it is fine to do splitters only (splitters for combine). But the other approach is fine as well. Thanks, Segher

Re: [PATCH] aarch64: Add extend-as-extract-with-shift pattern [PR96998]

2020-09-29 Thread Segher Boessenkool
On Tue, Sep 29, 2020 at 11:36:12AM +0100, Alex Coplan wrote: > Is the combine change (a canonicalization fix, as described below) OK > for trunk in light of this info? Can you please resend it with correct info and a corresponding commit message? Segher

Re: [PATCH v2] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-29 Thread Segher Boessenkool
Hi Raoni, Some of this isn't an rs6000 patch, but the subject says it is, so it might well not draw the attention it needs. Adding some Cc:s. On Fri, Sep 04, 2020 at 12:52:30PM -0300, Raoni Fassina Firmino wrote: > There is one pending question raised by Segher, It is abou

[PATCH] rs6000: Use parameterized names for tablejump

2020-09-29 Thread Segher Boessenkool
We have too many tablejump patterns. Using parameterized names simplifies the code a bit. Tested on powerpc64-linux {-m32,-m64}. Committing. Segher 2020-09-29 Segher Boessenkool * config/rs6000/rs6000.md (tablejump): Simplify. (tablejumpsi): Merge this

Re: [PATCH v2] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-30 Thread Segher Boessenkool
On Wed, Sep 30, 2020 at 09:02:34AM +0200, Richard Biener wrote: > On Tue, 29 Sep 2020, Segher Boessenkool wrote: > > I don't see much about optabs in the docs either. Add some text to > > optabs.def itself then? > > All optabs are documented in doc/md.texi as 'in

Re: [RS6000] -mno-minimal-toc vs. power10 pcrelative

2020-09-30 Thread Segher Boessenkool
& OPTION_MASK_PCREL) == 0))) \ > + SET_CMODEL (CMODEL_SMALL); \ Please write this in a more readable way? With some "else" statements, perhaps. It is also fine to SET_CMODEL twice if that makes for simpler code. The rest looks fine, fwiw. Segher

Re: [RS6000] Adjust gcc asm for power10

2020-09-30 Thread Segher Boessenkool
S: Support __PCREL__ code. The patch does look fine. Okay for trunk (and backports if those are wanted; discuss with Bill I guess). Thanks! (But please explain the purpose of this, in the commit message if that makes sense.) Segher

Re: [RS6000] Adjust gcc asm for power10

2020-09-30 Thread Segher Boessenkool
Hi Alan, On Thu, Oct 01, 2020 at 08:49:44AM +0930, Alan Modra wrote: > On Wed, Sep 30, 2020 at 05:36:08PM -0500, Segher Boessenkool wrote: > > On Wed, Sep 30, 2020 at 05:06:57PM +0930, Alan Modra wrote: > > > Generate assembly that is .localentry 1 with @notoc calls to match. &g

Re: [RS6000] -mno-minimal-toc vs. power10 pcrelative

2020-10-01 Thread Segher Boessenkool
Hi! On Thu, Oct 01, 2020 at 10:57:48PM +0930, Alan Modra wrote: > On Wed, Sep 30, 2020 at 03:56:32PM -0500, Segher Boessenkool wrote: > > On Wed, Sep 30, 2020 at 05:01:45PM +0930, Alan Modra wrote: > > > * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Don't >

Re: [PATCH] Fix build of ppc64 target.

2020-10-01 Thread Segher Boessenkool
; > > Ready for master? This is okay for trunk, thanks! (It is trivial and obvious as well, so please just commit things like this without prior approval.) Segher > * config/rs6000/rs6000-call.c: Include value-range.h. > * config/rs6000/rs6000.c: Likewise.

Re: [PATCH v2] builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-01 Thread Segher Boessenkool
On Thu, Oct 01, 2020 at 08:08:01AM +0200, Richard Biener wrote: > On Wed, 30 Sep 2020, Segher Boessenkool wrote: > > > On Wed, Sep 30, 2020 at 09:02:34AM +0200, Richard Biener wrote: > > > On Tue, 29 Sep 2020, Segher Boessenkool wrote: > > > > I don't se

Re: [RS6000] -mno-minimal-toc vs. power10 pcrelative

2020-10-01 Thread Segher Boessenkool
can address them just as efficiently outside > the TOC. > > * config/rs6000/rs6000.c (rs6000_linux64_override_options): > Formatting. Correct setting of TARGET_NO_FP_IN_TOC and > TARGET_NO_SUM_IN_TOC. Okay for trunk. Thanks! Segher

Re: [RS6000] ICE in decompose, at rtl.h:2282

2020-10-01 Thread Segher Boessenkool
dress): Properly > sign extend high part of address constant. I would just say "use gen_int_mode" ;-) But this is fine, sure. Segher

Re: [PATCH] Fix build of ppc64 target.

2020-10-02 Thread Segher Boessenkool
me to time, but that isn't unique to Power ;-) There isn't a rule that we can just revert any patches that break bootstrap on primary targets (and I am not suggesting there should be), so breakage now and then is unavoidable. Maybe some CI thing can help make stage 1 a less bumpy road. Segher

Re: [rs6000] Avoid useless masking of count operand for rotation

2020-10-02 Thread Segher Boessenkool
> fine to do splitters only (splitters for combine). But the other > > approach is fine as well. > > Patch #2 uses define_and_split like the x86 back-end; moreover, we already > have define_and_split for the dot variants so maybe it's the best way to go? Please just use define_split, or just define_insn. define_split if you want this to be split during combine (how could that work here though?), or define_insn if you think other passes can generate this as well. define_insn_and_split is *both*, and that isn't useful here. Do you see dot patterns for this used ever, btw? Segher

Re: [PATCH] calls.c:can_implement_as_sibling_call_p REG_PARM_STACK_SPACE check

2020-10-02 Thread Segher Boessenkool
u can do \M or even just a space instead of that last \s, but this works fine.) The rs6000 parts are fine (with the message improved perhaps). Thanks! The rest looks fine to me as well, fwiw. Segher

Re: [patch] Rework CPP_BUILTINS_SPEC for powerpc-vxworks

2020-10-02 Thread Segher Boessenkool
not all ways are supported by all compilers! (Including older versions of the same compilers.) - /* C89 namespace violation! */ \ - builtin_define ("CPU_FAMILY=PPC"); \ + builtin_define ("CPU_FAMILY=PPC"); \ You removed the comment, but it is rather important still? Of course the "C89" part of it is dated, but it is true for all newer language standards just the same. Cheers, Segher

Re: [r11-3641 Regression] FAIL: gcc.dg/torture/pta-ptrarith-1.c -Os scan-tree-dump alias "ESCAPED = {[^\n}]* i f [^\n}]*}" on Linux/x86_64 (-m32 -march=cascadelake)

2020-10-03 Thread Segher Boessenkool
200 > > Track access ranges in ipa-modref > > caused [ ... ] This isn't a patch. Wrong mailing list? Segher

Re: [PATCH] calls.c:can_implement_as_sibling_call_p REG_PARM_STACK_SPACE check

2020-10-05 Thread Segher Boessenkool
Hi! On Sun, Oct 04, 2020 at 11:09:11PM +1030, Alan Modra wrote: > On Fri, Oct 02, 2020 at 01:50:24PM -0500, Segher Boessenkool wrote: > > > + /* If reg parm stack space increases, we cannot sibcall. */ > > > + if (REG_PARM_STACK_SPACE (decl ? decl : fntype) > > >

Re: [r11-3641 Regression] FAIL: gcc.dg/torture/pta-ptrarith-1.c -Os scan-tree-dump alias "ESCAPED = {[^\n}]* i f [^\n}]*}" on Linux/x86_64 (-m32 -march=cascadelake)

2020-10-05 Thread Segher Boessenkool
On Sun, Oct 04, 2020 at 09:51:23AM -0700, H.J. Lu wrote: > On Sat, Oct 3, 2020 at 5:57 PM Segher Boessenkool > wrote: > > On Sat, Oct 03, 2020 at 12:21:04PM -0700, sunil.k.pandey via Gcc-patches > > wrote: > > > On Linux/x86_64, > > > > > > c34db4b6

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-10-05 Thread Segher Boessenkool
& 0x1e00) != fe) FAIL; and then see if more than one bit is set: if (fe & (fe - 1)) FAIL; but also disallow zero: if (!fe) FAIL; Or, you can just put the bit number in the switch cases for the four bits. There are only four, after all. Thanks, Segher

Re: [PATCH] rs6000: Fix extraneous characters in the documentation

2020-10-07 Thread Segher Boessenkool
int4. Yeah, utf8 c2 a0, aka u+00a0. Replacing that with an actual space is of course okay (and trivial and obvious). Thanks! (Bonus points if you do all of doc/*.texi :-) ) Segher

Re: [PATCH, rs6000] rename BU_P10_MISC_2 define to BU_P10_POWERPC64_MISC_2

2020-10-07 Thread Segher Boessenkool
2): Rename > to BU_P10_POWERPC64_MISC_2. > (CFUGED,CNTLZDM,CNTTZDM,PDEPD,PEXTD): Call renamed macro. (space after comma?) Segher

Re: [PING][PATCH v2] combine: Don't turn (mult (extend x) 2^n) into extract [PR96998]

2020-10-08 Thread Segher Boessenkool
On Thu, Oct 08, 2020 at 11:21:26AM +0100, Alex Coplan wrote: > Ping. The kernel is still broken on AArch64. You *cannot* fix a correctness bug with a combine addition. So please fix the target bug first. I haven't had time to look at your patch yet, sorry. Segher

Re: [PING][PATCH v2] combine: Don't turn (mult (extend x) 2^n) into extract [PR96998]

2020-10-09 Thread Segher Boessenkool
On Fri, Oct 09, 2020 at 09:38:09AM +0100, Alex Coplan wrote: > Hi Segher, > > On 08/10/2020 15:20, Segher Boessenkool wrote: > > On Thu, Oct 08, 2020 at 11:21:26AM +0100, Alex Coplan wrote: > > > Ping. The kernel is still broken on AArch64. > > > > You *

Re: [PATCH, rs6000] Eliminate TARGET_CTZ, TARGET_FCTIDZ, FCTIWUZ defines

2022-09-20 Thread Segher Boessenkool
this. But thanks for trying! :-) (Don't let me dicsourage you btw, most is pretty straightforward). > * config/rs6000/rs6000.h (TARGET_CTZ): Replace with > TARGET_MODULO. Changelogs are indented with tabs, and this fits on one line. So, please make TARGET_P7 and such, and OPTION_MASKs for those in rs6000-cpus.def? Segher

Re: [PATCH, rs6000] Eliminate TARGET_CTZ, TARGET_FCTIDZ, FCTIWUZ defines

2022-09-20 Thread Segher Boessenkool
On Tue, Sep 20, 2022 at 05:01:53PM -0500, will schmidt wrote: > On Tue, 2022-09-20 at 16:14 -0500, Segher Boessenkool wrote: > > > TARGET_FCTIWUZ has a low number of uses, and can be directly > > > replaced with TARGET_POPCNTD. > > > > It is a p7 (ISA 2.06) insn.

Re: [PATCH v6, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]

2022-09-21 Thread Segher Boessenkool
ywhere. "fmin" and "fmax" seem to be good names :-) Segher

Re: [PATCH v6, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]

2022-09-22 Thread Segher Boessenkool
mantics, we can generate code for that with -ffast-math as well, since the code generated is optimal in either case; it's just the *generic* optimisations that fall behind. Segher

Re: [PATCH v6, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]

2022-09-22 Thread Segher Boessenkool
Hi! On Thu, Sep 22, 2022 at 10:28:23AM +0800, Kewen.Lin wrote: > on 2022/9/22 05:56, Segher Boessenkool wrote: > > On Fri, Jun 24, 2022 at 10:02:19AM +0800, HAO CHEN GUI wrote: > > In the other direction I am worried that the unspecs will degrade > > performance (relati

Re: [PATCH] rs6000: Fix condition of define_expand vec_shr_ [PR100645]

2022-09-22 Thread Segher Boessenkool
is no need for altivec_ok in any case, the -mcpu= guarantees it is satisfied. > +/* It's to verify no ICE here. */ "This used to ICE."? Please commit this now, looks good. Thanks! Segher

Re: [PATCH] rs6000: Fix the condition with frame_pointer_needed_indeed [PR96072]

2022-09-22 Thread Segher Boessenkool
Verify there is no ICE on 32 bit environment. */ /* This used to ICE with the SYSV ABI (PR96072). */ Please use -O2 if that works here. Okay for trunk. Thank you! Segher

Re: [PATCH] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]

2022-09-28 Thread Segher Boessenkool
s_arch_ tests if the compiler is asked to generate code for (which is reflected in the _ARCH_* preprocessor symbols, hence the name). Okay for trunk with the correct check_effective_target_* . Thanks! Segher

Re: PING^1 [PATCH] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]

2022-09-28 Thread Segher Boessenkool
target-specific (since we are the only one implementing it), so :-) I know it is borderline. Segher

Re: [PATCH v4] rs6000: Rework ELFv2 support for -fpatchable-function-entry* [PR99888]

2022-09-28 Thread Segher Boessenkool
er. > -The maximum value of @var{N} and @var{M} is 65535. > +The maximum value of @var{N} and @var{M} is 65535. On PowerPC with the > +ELFv2 ABI, for one function with dual entry points, the supported values > +for @var{M} are 0, 2, 6 and 14. "for a function" Okay for trunk with those trivial chnges. Thanks! Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Segher Boessenkool
mpowerpc64 -m32, this is determined by the way how we > >> handle option powerpc64 in rs6000_handle_option. > >> > >> Segher pointed out this difference should be taken as > >> a bug and we should ensure that option powerpc64 is > >> independent of -m

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Segher Boessenkool
On Wed, Sep 28, 2022 at 01:30:46PM +0800, Kewen.Lin wrote: > PR106680 shows that -m32 -mpowerpc64 is different from > -mpowerpc64 -m32, this is determined by the way how we > handle option powerpc64 in rs6000_handle_option. > > Segher pointed out this difference should be taken as

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
error, but a warning, and then we force > 64b on (taking > the user’s intention to be specified by the explicit ‘-m64’). And that is wrong. Any silent overriding of what the user says is bad. Not overriding it (and then later ICEing) is bad as well, so it should be an error here. And in generic code anyway. Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
introducing more special cases like this. > +#ifdef OS_MISSING_POWERPC64 > + else if (OS_MISSING_POWERPC64) > + /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which > +miss powerpc64 support, so disable it. */ > + rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; > +#endif All silent stuff is always bad. If things are done well, we will end up with *less* code than what we had before, not more! Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: > > On 28 Sep 2022, at 22:30, Segher Boessenkool > > wrote: > > That works on Linux as well. What still does not work is user-mode > > context switches in 32-bit processes (so setjmp and getcontext stuff). &g

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
in the past. Compare to -maltivec, which often is used with -mcpu=750 and stuff like that. We want to have less like this (much less), to reduce exponential special cases and exponential testing requirements to something manageable, but we also want to not break the world :-) Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
Hi! On Thu, Sep 29, 2022 at 07:25:44PM +0100, Iain Sandoe wrote: > > On 29 Sep 2022, at 18:04, Segher Boessenkool > > wrote: > > On Thu, Sep 29, 2022 at 09:16:33AM +0100, Iain Sandoe wrote: > >> Which means that we do not report an error, but a warning, and then we

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 07:33:14PM +0100, Iain Sandoe wrote: > > On 29 Sep 2022, at 18:18, Segher Boessenkool > > wrote: > > On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: > >>> On 28 Sep 2022, at 22:30, Segher Boessenkool > >>> wrote

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
pc*-*-freebsd*, but leave the others alone (and update this as needed > later)? Ah. This error should be generated by generic rs6000 code, not separately by separate targets. Dunno if you want to fold that into the current patch series. Segher

Re: [PATCH] Adjust the symbol for SECTION_LINK_ORDER linked_to section [PR99889]

2022-09-29 Thread Segher Boessenkool
ult_print_patchable_function_entry_1 (file, patch_area_size, record_p, > - flags); > + default_print_patchable_function_entry (file, patch_area_size, record_p); > } Please don't define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY at all, instead, and remove this whole function? The rs6000 changes are okay like that, thanks! Segher

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Segher Boessenkool
ind this documented anywhere. If this is not true, this part of the patch is incorrect. Segher

Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080]

2022-09-30 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 05:31:26PM +0200, Jakub Jelinek wrote: > On Fri, Sep 30, 2022 at 10:07:59AM -0500, Segher Boessenkool wrote: > > On Thu, Sep 29, 2022 at 12:01:43PM +0200, Jakub Jelinek via Gcc-patches > > wrote: > > > --- gcc/config/i386/i386.cc.jj2022-09-29

Re: [PATCH] Adjust the symbol for SECTION_LINK_ORDER linked_to section [PR99889]

2022-09-30 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 08:47:53PM +0800, Kewen.Lin wrote: > on 2022/9/30 04:31, Segher Boessenkool wrote: > > Please don't define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY at all, > > instead, and remove this whole function? > > This hook is still needed for "EL

Re: [patch] Fix thinko in powerpc default specs for -mabi

2022-10-03 Thread Segher Boessenkool
" }, \ >{"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \ So this patch will make a difference to people who use --with-abi= for one of the ABI variant things. But it does not seem correct. -mabi=optionA should not override the -mabi=optionB set in --with-abi=, where A and B are independent, nor should it override the base ABI. Please open a PR for the problem you want to solve here, so we do not lose track of it? Thanks, Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-03 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 08:15:37PM +0800, Kewen.Lin wrote: > on 2022/9/30 01:11, Segher Boessenkool wrote: > >> +#ifdef OS_MISSING_POWERPC64 > >> + else if (OS_MISSING_POWERPC64) > >> + /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which &g

[PATCH 0/3] rs6000: Get rid of wD

2022-10-05 Thread Segher Boessenkool
ortly. Segher Segher Boessenkool (3): rs6000: Remove "wD" from *vsx_extract__store rs6000: Rework vsx_extract_ rs6000: Remove the wD constraint gcc/config/rs6000/constraints.md | 6 --- gcc/config/rs6000/vsx.md | 85 +++-

[PATCH 2/3] rs6000: Rework vsx_extract_

2022-10-05 Thread Segher Boessenkool
is, cost 0, making it more likely RA will choose it. 2022-10-05 Segher Boessenkool * config/rs6000/vsx.md (vsx_extract_): Replace define_insn by a define_expand. Split the contents to... (*vsx_extract__0): ... this. Rewrite. (*vsx_extract__01: ... and this

[PATCH 1/3] rs6000: Remove "wD" from *vsx_extract__store

2022-10-05 Thread Segher Boessenkool
We can use "n" instead of "wD" if we simply test the value of the integer constant directly. 2022-10-05 Segher Boessenkool * config/rs6000/vsx.md (*vsx_extract__store): Use "n" instead of "wD" constraint. --- gcc/config/rs6000/vsx.md

[PATCH 3/3] rs6000: Remove the wD constraint

2022-10-05 Thread Segher Boessenkool
2022-10-05 Segher Boessenkool * config/rs6000/constraints.md (wD): Delete. * doc/md.texi (Machine Constraints): Adjust. --- gcc/config/rs6000/constraints.md | 6 -- gcc/doc/md.texi | 3 --- 2 files changed, 9 deletions(-) diff --git a/gcc/config/rs6000

Re: [PATCH, rs6000] Fix addg6s builtin with long long parameters. (PR100693)

2022-10-07 Thread Segher Boessenkool
al { scan-assembler-times {\maddg6s\M} 4 } } */ > +/* { dg-final { scan-assembler-not"bl __builtin" } } */ Some ABIs will use tailcalls here. You can prevent that in the testcase (add an asm(""); before the return statement), or you can scan for something less specific than the exact "bl"? > +unsigned long long test4_ull (unsigned long long *a, unsigned long long *b) > +{ > + return __builtin_addg6s(*a, *b); > +} This does not work with -m32, no? Segher

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-10 Thread Segher Boessenkool
On Mon, Oct 10, 2022 at 10:15:58AM +0800, Kewen.Lin wrote: > on 2022/10/4 05:15, Segher Boessenkool wrote: > > Right. If If mpowerpc64 is enabled while OS_MISSING_POWERPC64, warn for > > that; > > Currently if option powerpc64 is enabled explicitly while > OS_MISSING_

Re: [PATCH] Check if loading const from mem is faster

2022-03-02 Thread Segher Boessenkool
On Tue, Mar 01, 2022 at 10:28:57PM +0800, Jiufu Guo wrote: > Segher Boessenkool writes: > > No. insn_cost is only for correct, existing instructions, not for > > made-up nonsense. I created insn_cost precisely to get away from that > > aspect of rtx_cost (and some othe

Re: [PATCH, V2] Optimize signed DImode -> TImode on power10, PR target/104698

2022-03-02 Thread Segher Boessenkool
for memory at least!) > +/* { dg-final { scan-assembler-not {\mmfvsrd\M} } } */ > +/* { dg-final { scan-assembler-not {\mmfvsrld\M}} } */ > +/* { dg-final { scan-assembler-not {\mmtvsrdd\M}} } */ You could just do > +/* { dg-final { scan-assembler-not {\mm[ft]vsr}} } */ and even all future variants would be handled :-) Looks good, just those last details :-) Segher

Re: [PATCH] libgcc: allow building float128 libraries on FreeBSD

2022-03-03 Thread Segher Boessenkool
etween the two then. Copied code easily turns into a maintenance nightmare, after all. And then I just forgot, it fell off my to-do lists, sorry. The patch is okay for trunk, with a suitable changelog. Thanks! Do you want backports for this as well? Segher

[PATCH] rs6000: Improve .machine

2022-03-04 Thread Segher Boessenkool
}. Also manually tested with all -mcpu=, and the output of that passed through the GNU assembler. I plan to commit this later today. Segher 2022-03-04 Segher Boessenkool * config/rs6000/rs6000.c (rs6000_machine_from_flags): Restructure a bit. Handle most older CPUs. --- gcc

Re: [PATCH] rs6000: Fix up __SIZEOF_{FLOAT, IBM}128__ defines [PR99708]

2022-03-07 Thread Segher Boessenkool
easily added back, >but wasting GTY just in case... > 5) actually syncs __SIZEOF_FLOAT128__ with the __float128 macro being >defined in addition to __ieee128 being usable > > Now, in the PR Segher said he doesn't like 5), but I think it is better > to match the r

Re: [PATCH] rs6000: Improve .machine

2022-03-07 Thread Segher Boessenkool
ermail/libc-testresults/2022q1/009421.html Thanks for the report! This is now PR104829. Segher

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-07 Thread Segher Boessenkool
#x27; is an optional vector: if a closeparen follows, just store NULL for this element. */ (optional vectors are at the end of an RTX), and if you write [] you will hit fatal_with_file_and_line ("vector must have at least one element"); Segher

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
Hi! On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > On Mon, Mar 07, 2022 at 07:19:09PM -0600, Segher Boessenkool wrote: > > On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches > > wrote: > > > In r270550, Jakub fixed classify_insn to

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
On Tue, Mar 08, 2022 at 10:25:45AM -0500, Marek Polacek wrote: > On Tue, Mar 08, 2022 at 09:14:56AM -0600, Segher Boessenkool wrote: > > On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > > > ...I don't see that. In fact copy_rtx does the same t

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
On Tue, Mar 08, 2022 at 05:12:43PM +0100, Jakub Jelinek wrote: > On Tue, Mar 08, 2022 at 09:49:15AM -0600, Segher Boessenkool wrote: > > > But like I said above, even if we didn't copy these XVECLEN 0 rtvecs, > > > the crash would not go away. > > > > An rtve

Re: Ping: [PATCH] PR target/102059 Fix inline of target specific functions

2022-03-08 Thread Segher Boessenkool
t disable any effect from this flag, instead? It should just be implied by -mcpu=power8, and be impossible to be enabled otherwise (or disabled!) Segher

Re: [PATCH] rs6000, v2: Fix up __SIZEOF_{FLOAT, IBM}128__ defines [PR99708]

2022-03-09 Thread Segher Boessenkool
Hi! On Wed, Mar 09, 2022 at 02:27:19PM +0100, Jakub Jelinek wrote: > On Mon, Mar 07, 2022 at 03:37:18PM -0600, Segher Boessenkool wrote: > > > 2) adjusts the builtins code to use > > >ibm128_float_type_node ? ibm128_float_type_node : long_double_type_node > > >

Re: [PATCH] rs6000, v2: Fix up __SIZEOF_{FLOAT, IBM}128__ defines [PR99708]

2022-03-09 Thread Segher Boessenkool
On Wed, Mar 09, 2022 at 08:24:24PM +0100, Jakub Jelinek wrote: > On Wed, Mar 09, 2022 at 12:34:06PM -0600, Segher Boessenkool wrote: > > > rs6000_expand_builtin has (but at an incorrect spot) code to remap > > > __builtin_{,un}pack_ibm128 to __builtin_{,un}pack_longdouble

Re: [PATCH] rs6000, v3: Fix up __SIZEOF_{FLOAT, IBM}128__ defines [PR99708]

2022-03-09 Thread Segher Boessenkool
On Wed, Mar 09, 2022 at 10:10:07PM +0100, Jakub Jelinek wrote: > On Wed, Mar 09, 2022 at 02:57:20PM -0600, Segher Boessenkool wrote: > > But __ibm128 should *always* be supported, so this is a hypothetical > > problem. > > I bet that will require much more work. I think for

Re: [PATCH] rs6000: Improve .machine

2022-03-10 Thread Segher Boessenkool
Hi! On Thu, Mar 10, 2022 at 09:25:21AM +0100, Sebastian Huber wrote: > On 04/03/2022 17:51, Segher Boessenkool wrote: > >This adds more correct .machine for most older CPUs. It should be > >conservative in the sense that everything we handled before we handle at > >least as

Re: [PATCH] rs6000, v3: Fix up __SIZEOF_{FLOAT, IBM}128__ defines [PR99708]

2022-03-10 Thread Segher Boessenkool
Hi! On Thu, Mar 10, 2022 at 10:35:36AM +0100, Jakub Jelinek wrote: > On Wed, Mar 09, 2022 at 04:57:01PM -0600, Segher Boessenkool wrote: > > > > If you are fed up with all this, please commit what you have now (after > > > > testing of course ;-) ), and I'll pi

Re: [PATCH, V2] Eliminate power8 fusion options, use power8 tuning, PR target/102059

2022-03-10 Thread Segher Boessenkool
at implements Book III-E of ISA 2.07 (nothing in GCC, but no actual CPU either). Or Category: Embedded even maybe :-) It could be clearer perhaps, or just be removed completely; it might have been useful historically, but it isn't anymore really. Segher

Re: [RFC v2] RISCV: Combine Pass Clobber Ops

2022-03-11 Thread Segher Boessenkool
return 2; > + else if (GET_CODE(XEXP(src, 1)) == CONST_INT && > CMPRESD_OPERAND(INTVAL(XEXP(src, 1 > + return 2; REG_P, CONST_INT_P > +#define CMPRESD_OPERAND(VALUE) \ > + (VALUE < 32 && VALUE >= -32) IN_RANGE ((VALUE), -32, 31) Using a predicate might be better? Note you need parens around macro params, btw. > +/* True if VALUE is an unsigned 5-bit number. */ > +#define UNSIGNED_CMPRESD_OPERAND(VALUE) \ > + (VALUE < 64 && VALUE >= 0) IN_RANGE ((VALUE), 0, 63) Segher

Re: [PATCH] Fix DImode to TImode sign extend issue, PR target/104868

2022-03-11 Thread Segher Boessenkool
? If not, this is okay for trunk. Thanks! Segher

Re: [PATCH, V3] PR target/99708- Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__

2022-03-11 Thread Segher Boessenkool
branch is broken) Mike, please revert it then? Segher

Re: [PATCH, V3] PR target/99708- Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__

2022-03-11 Thread Segher Boessenkool
On Fri, Mar 11, 2022 at 09:57:50PM +0100, Jakub Jelinek wrote: > On Fri, Mar 11, 2022 at 02:51:23PM -0600, Segher Boessenkool wrote: > > On Fri, Mar 11, 2022 at 08:42:27PM +, Joseph Myers wrote: > > > The version of this patch applied to GCC

[PATCH] rs6000: Do not use rs6000_cpu for .machine ppc and ppc64 (PR104829)

2022-03-11 Thread Segher Boessenkool
good idea (even if the errors are actually pre-existing: using -mvsx with a machine that does not have VXX cannot work properly). Will commit later today (if it regstraps fine :-) ) Segher 2022-03-11 Segher Boessenkool PR target/104829 * config/rs6000/rs6000.cc

Re: [PATCH, V3] PR target/99708- Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__

2022-03-12 Thread Segher Boessenkool
On Fri, Mar 11, 2022 at 05:51:05PM -0500, Michael Meissner wrote: > On Fri, Mar 11, 2022 at 02:51:23PM -0600, Segher Boessenkool wrote: > > On Fri, Mar 11, 2022 at 08:42:27PM +, Joseph Myers wrote: > > > The version of this patch applied to GCC

Re: [PATCH] rs6000: Improve .machine

2022-03-15 Thread Segher Boessenkool
Hi! On Tue, Mar 15, 2022 at 03:29:23PM +0100, Sebastian Huber wrote: > now that the PR104829 is fixed could I back port > > Segher Boessenkool (2): > rs6000: Improve .machine > rs6000: Do not use rs6000_cpu for .machine ppc and ppc64 (PR104829) > > to GCC 10 and 11? I

Re: [PATCH] rs6000: Allow using -mlong-double-64 after -mabi={ibm, ieee}longdouble [PR104208, PR87496]

2022-03-16 Thread Segher Boessenkool
essions. > > Ok for the GCC 11 and GCC 10 release branches after a day or two of baking > > on > > trunk? > > Ping. > > The trunk patch has been confirmed to fix the glibc build errors and no issues > with the patch has surfaced, so ok for the GCC11 and GCC10 release branches? If you can confirm it fixes the glibc build error on 11 and 10 as well, then yes please. Thanks! Segher

Re: rs6000: RFC/Update support for addg6s instruction. PR100693

2022-03-16 Thread Segher Boessenkool
;register_operand" "r")] UNSPEC_ADDG6S))] "TARGET_POPCNTD" "addg6s %0,%1,%2" [(set_attr "type" "integer")]) We do not want DI (here, and in most places) for -m32! > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr100693.c > @@ -0,0 +1,68 @@ > +/* { dg-do compile { target { powerpc*-*-linux* } } } */ Why only on Linux? > +/* { dg-skip-if "" { powerpc*-*-darwin* } } */ Why not on Darwin? And why skip it anyway, given the previous line :-) > +/* { dg-require-effective-target powerpc_vsx_ok } */ That is the wrong requirement. You want to test for Power7, not for VSX. I realise you probably copied this from elsewhere :-( (If from another addg6s testcase, just keep it). Segher

Re: rs6000: RFC/Update support for addg6s instruction. PR100693

2022-03-16 Thread Segher Boessenkool
On Wed, Mar 16, 2022 at 03:06:42PM -0500, will schmidt wrote: > On Wed, 2022-03-16 at 13:12 -0500, Segher Boessenkool wrote: > > (define_insn "addg6s" > > [(set (match_operand:GPR 0 "register_operand" "=r") > > (uns

Re: [PATCH] fortran: use fpu-glibc on powerpc*-unknown-freebsd

2022-03-20 Thread Segher Boessenkool
ks > on FreeBSD. > > Signed-off-by: Piotr Kubaj Okay for trunk. Thanks! Segher

Re: [PATCH]rs6000: avoid peeking eof after __vector keyword

2022-03-21 Thread Segher Boessenkool
need to examine the 'tok' parameter. */ ... followed by 17 uses of "tok". Yes, some of those overwrite the function argument, but that doesn't make it any better! :-P Some factoring would help, too, perhaps. Segher

Re: [PATCH]rs6000: avoid peeking eof after __vector keyword

2022-03-22 Thread Segher Boessenkool
Hi! On Tue, Mar 22, 2022 at 01:50:39PM +0800, Jiufu Guo wrote: > Segher Boessenkool writes: > > On Mon, Mar 21, 2022 at 02:14:08PM -0400, David Edelsohn wrote: > >> On Mon, Mar 21, 2022 at 5:13 AM Jiufu Guo wrote: > >> > There is a rare corner case: where

Re: [PATCH] rs6000: wrap const in an error message.

2022-03-22 Thread Segher Boessenkool
quot;passing argument %d of %qE discards % " > + "qualifier from pointer target type", n + 1, fndecl); Please use %qs instead? Segher

Re: [PATCH] rs6000: update error message format.

2022-03-22 Thread Segher Boessenkool
library ABI type %qs for " >"%qs switch", rs6000_veclibabi_name, "-mveclibabi="); Can you make it print -mveclibabi=something instead? With some wordsmithing of course... "unknown vectorization library type in -mveclibabi=blubber" or something? Segher

Re: [PATCH] rs6000: Adjust error messages.

2022-03-23 Thread Segher Boessenkool
"%<-mveclibabi=%s%>", rs6000_veclibabi_name); "ABI type". Okay for trunk with that restored. Thanks! Segher

Re: rs6000/testsuite: Use -mdejagnu-cpu= and -mdejagnu-tune= options

2022-03-25 Thread Segher Boessenkool
those tests should use has_arch_pwrN). > +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c > +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c I missed these two in reviewing when the -mcpu= was introduced, oops. Okay for trunk. Also okay for backports if you want / if you think it useful. Thanks! Segher

Re: rs6000/testsuite: Use -mdejagnu-cpu= and -mdejagnu-tune= options

2022-03-25 Thread Segher Boessenkool
On Fri, Mar 25, 2022 at 06:15:56PM -0500, Peter Bergner wrote: > On 3/25/22 4:08 PM, Segher Boessenkool wrote: > > On Fri, Mar 25, 2022 at 02:51:38PM -0500, Peter Bergner wrote: > > It seems likely many of these tests should move to g++.target/powerpc . > > Probably, that can

Re: [PATCH] rs6000: Support UN[GL][ET] in rs6000_maybe_emit_maxc_minc [PR105002]

2022-03-27 Thread Segher Boessenkool
; btw, LT is by no means more standard than UNGE is. You can say you are folding things so you later have to support fewer cases, or similar? Thanks, Segher

Re: [PATCH 1/4] Optimize vec_splats of constant vec_extract for V2DI/V2DF, PR target 99293.

2022-03-28 Thread Segher Boessenkool
3] = GEN_INT (which_word ? 3 : 0); > + return "xxpermdi %x0,%x1,%x1,%3"; Please use gen_vsx_xxspltd_v2di, instead. Which itself should not use an unspec of course, but that is another patch. > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr99293.c > @@ -0,0 +1,36 @@ > +/* { dg-do compile { target powerpc*-*-* } } */ Don't. This is gcc.target/powerpc/ already. > +/* { dg-final { scan-assembler-times "xxpermdi" 4 } } */ \m \M Thanks, Segher

Re: [PATCH 2/4] Make vsx_splat__reg use correct insn attributes, PR target/99293

2022-03-28 Thread Segher Boessenkool
"*,p9v")]) "we" requires "p9v". Please do a full conversion when getting rid of this? That includes requiring TARGET_POWERPC64 for it (not -m64 as its documentation says; the existing implementation of "we" is correct). Segher

Re: [PATCH 3/4] Make vsx_extract_ use correct insn attributes, PR target 99293.

2022-03-28 Thread Segher Boessenkool
"veclogical,mfvsr,mfvsr,vecperm") > + [(set_attr "type" "vecmove,vecperm,mfvsr,mfvsr") > (set_attr "isa" "*,*,p8v,p9v")]) The generated code is one of no-op mfvsrd fmr xxlor mfvsrld xxpermdi Which of the 4 alts are meant to correspond to which of those six possible generated pieces of code? Segher

<    1   2   3   4   5   6   7   8   9   10   >