Re: [PATCH] testsuite: Skip pr105250.c for powerpc and s390 [PR105266]

2022-04-14 Thread Andreas Krebbel via Gcc-patches
On 4/14/22 05:10, Kewen.Lin wrote: > Hi, > > The test case pr105250.c is like its related pr105140.c, which > suffers the error with message like "{AltiVec,vector} argument > passed to unprototyped" on powerpc and s390. So like commits > r12-8025 and r12-8039, this fix is to add the dg-skip-if

[Committed] IBM zSystems: Add support for z16 as CPU name.

2022-04-12 Thread Andreas Krebbel via Gcc-patches
So far z16 was identified as arch14. After the machine has been announced we can now add the real name. gcc/ChangeLog: * common/config/s390/s390-common.cc: Rename PF_ARCH14 to PF_Z16. * config.gcc: Add z16 as march/mtune switch. * config/s390/driver-native.cc

[PATCH] v2 PR102024 - IBM Z: Add psabi diagnostics

2022-04-11 Thread Andreas Krebbel via Gcc-patches
v2: - Remove redundant num_zero_width_bf_seen and num_fields_seen tracking. (Thanks Stefan Schulze-Frielinghaus) Re-tested with testsuite and ABI tests. For IBM Z in particular there is a problem with structs like: struct A { float a; int :0; }; Our ABI document allows passing a struct in

Re: [PATCH] rs6000/testsuite: Skip pr105140.c

2022-04-06 Thread Andreas Krebbel via Gcc-patches
On 4/6/22 17:32, Segher Boessenkool wrote: > This test fails with error "AltiVec argument passed to unprototyped > function", but the code (in rs6000.c:invalid_arg_for_unprototyped_fn, > from 2005) actually tests for any vector type argument. It also does > not fail on Darwin, not reflected here

Re: [PATCH] testsuite/s390: Adapt test expections.

2022-04-04 Thread Andreas Krebbel via Gcc-patches
On 4/4/22 13:52, Robin Dapp wrote: > Hi, > > some tests expect a convert instruction but nowadays the conversion is > already done at compile time. This results in a literal-pool load. > Change the tests accordingly. > > OK for trunk? > > Regards > Robin > > gcc/testsuite/ChangeLog: > >

Re: [PATCH] testsuite/s390: Change nle -> h in ifcvt tests.

2022-04-04 Thread Andreas Krebbel via Gcc-patches
On 4/4/22 13:51, Robin Dapp wrote: > Hi, > > we have been emitting the "higher" variantes instead of the "not less or > equal" ones for a while. Change the test expectations accordingly. > > OK for trunk? > > Regards > Robin > > gcc/testsuite/ChangeLog: > > *

Re: [PATCH] testsuite: Add -fno-tree-loop-distribute-patterns for s390.

2022-04-04 Thread Andreas Krebbel via Gcc-patches
On 4/4/22 13:51, Robin Dapp wrote: > Hi, > > in gcc.dg/Wuse-after-free-2.c we try to detect a use-after-free. On > s390 the test's while loop is converted into a rawmemchr builtin making > it impossible to determine that the pointers *p and *q are related. > > Therefore, disable the tree loop

[PATCH] PR102024 - IBM Z: Add psabi diagnostics

2022-03-25 Thread Andreas Krebbel via Gcc-patches
For IBM Z in particular there is a problem with structs like: struct A { float a; int :0; }; Our ABI document allows passing a struct in an FPR only if it has exactly one member. On the other hand it says that structs of 1,2,4,8 bytes are passed in a GPR. So this struct is expected to be passed

Re: [PATCH] s390: Fix up *cmp_and_trap_unsigned_int constraints [PR104775]

2022-03-07 Thread Andreas Krebbel via Gcc-patches
On 3/5/22 09:33, Jakub Jelinek wrote: > Hi! > > The following testcase fails to assemble due to clgte %r6,0(%r1,%r10) > insn not being accepted by assembler. > My rough understanding is that in the RSY-b insn format the spot > in other formats used for index registers is used instead for M3 what

Re: [PATCH] s390: Change SET rtx_cost handling.

2022-02-25 Thread Andreas Krebbel via Gcc-patches
On 2/25/22 12:38, Robin Dapp wrote: > Hi, > > the IF_THEN_ELSE detection currently prevents us from properly costing > register-register moves which causes the lower-subreg pass to assume > that a VR-VR move is as expensive as two GPR-GPR moves. > > This patch adds handling for SETs containing

Re: [PATCH] Check always_inline flag in s390_can_inline_p [PR104327]

2022-02-07 Thread Andreas Krebbel via Gcc-patches
On 2/7/22 09:11, Jakub Jelinek wrote: ... > 1) formatting, = should be at the start of next line rather than end of the >line > 2) all_masks, always_inline_safe_masks and caller_required_masks aren't >ever modified, perhaps make them const? > 3) I wonder if there is any advantage to have

[PATCH] Check always_inline flag in s390_can_inline_p [PR104327]

2022-02-06 Thread Andreas Krebbel via Gcc-patches
MASK_MVCLE is set for -Os but not for other optimization levels. In general it should not make much sense to inline across calls where the flag is different but we have to allow it for always_inline. The patch also rearranges the hook implementation a bit based on the recommendations from Jakub

Re: [PATCH][GCC11] IBM Z: fix `section type conflict` with -mindirect-branch-table

2022-02-02 Thread Andreas Krebbel via Gcc-patches
On 2/2/22 12:57, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for > releases/gcc-11? > > > > s390_code_end () puts indirect branch tables into separate sections and > tries to switch back to wherever it was in the beginning by calling > switch_to_section

Re: [PATCH] IBM Z: fix `section type conflict` with -mindirect-branch-table

2022-02-01 Thread Andreas Krebbel via Gcc-patches
On 2/1/22 21:49, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > s390_code_end () puts indirect branch tables into separate sections and > tries to switch back to wherever it was in the beginning by calling > switch_to_section

[PATCH] PR101260 regcprop: Add mode change check for copy reg

2022-01-21 Thread Andreas Krebbel via Gcc-patches
When propagating a multi-word register into an access with a smaller mode the can_change_mode backend hook is already consulted for the original register. This however is also required for the intermediate copy in copy_regno which might use a different register class. Bootstrapped on x86_64 and

Re: [PATCH] s390: Change costs for load on condition.

2022-01-21 Thread Andreas Krebbel via Gcc-patches
On 1/20/22 11:10, Robin Dapp wrote: > Hi, > > this patch is a follow-up patch to the recent ifcvt changes. It > increased costs for a load on condition to 6. This ensures that we > if-convert sequences of three regular instructions (of cost 4) e.g. a > compare and two SETs into two loads on

Re: [PATCH] s390: Split CCSmode into CCSINT and CCSFP

2022-01-21 Thread Andreas Krebbel via Gcc-patches
On 1/20/22 17:13, Robin Dapp wrote: > Hi, > > this patch splits the CCSmode into an integer and a floating point > variant. This allows ifcvt to consider floating point compares which > would be rejected before because they could not be reversed. > > Bootstrapped and regtested on s390x. > > Is

Re: [PATCH v2] Disable -fsplit-stack support on non-glibc targets

2022-01-20 Thread Andreas Krebbel via Gcc-patches
On 1/20/22 23:52, Richard Sandiford wrote: > cc:ing the x86 and s390 maintainers > > soeren--- via Gcc-patches writes: >> From: Sören Tempel >> >> The -fsplit-stack option requires the pthread_t TCB definition in the >> libc to provide certain struct fields at specific hardcoded offsets. As >>

Re: [PATCH] cprop_hardreg: Workaround for narrow mode != lowpart targets

2022-01-14 Thread Andreas Krebbel via Gcc-patches
On 1/14/22 20:41, Andreas Krebbel via Gcc-patches wrote: > On 1/14/22 08:37, Richard Biener wrote: > ... >> Can the gist of this bug be put into the GCC bugzilla so the rev can >> refer to it? > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104034 > >> Can we have a

Re: [PATCH] cprop_hardreg: Workaround for narrow mode != lowpart targets

2022-01-14 Thread Andreas Krebbel via Gcc-patches
On 1/14/22 08:37, Richard Biener wrote: ... > Can the gist of this bug be put into the GCC bugzilla so the rev can > refer to it? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104034 > Can we have a testcase even? The testcase from Jakub is in the BZ. However, since it doesn't fail with head I

Re: [PATCH] cprop_hardreg: Workaround for narrow mode != lowpart targets

2022-01-13 Thread Andreas Krebbel via Gcc-patches
On 1/13/22 18:11, Andreas Krebbel via Gcc-patches wrote: ... > @@ -5949,7 +5959,7 @@ register if floating point arithmetic is not being > done. As long as the\n\ > floating registers are not in class @code{GENERAL_REGS}, they will not\n\ > be used unless some pattern's constraint

[PATCH] cprop_hardreg: Workaround for narrow mode != lowpart targets

2022-01-13 Thread Andreas Krebbel via Gcc-patches
The cprop_hardreg pass is built around the assumption that accessing a register in a narrower mode is the same as accessing the lowpart of the register. This unfortunately is not true for vector registers on IBM Z. This caused a miscompile of LLVM with GCC 8.5. The problem could not be reproduced

Re: [PATCH] IBM Z: Fix load-and-test peephole2 condition

2021-11-19 Thread Andreas Krebbel via Gcc-patches
On 11/19/21 10:45, Stefan Schulze Frielinghaus wrote: ... > diff --git a/gcc/testsuite/gcc.target/s390/2029.c > b/gcc/testsuite/gcc.target/s390/2029.c > new file mode 100644 > index 000..1a6df4f4b89 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/s390/2029.c > @@ -0,0 +1,12

Re: [PATCH] Fix PR103028

2021-11-05 Thread Andreas Krebbel via Gcc-patches
On 11/5/21 20:34, Jeff Law wrote: > > > On 11/5/2021 4:19 AM, Andreas Krebbel via Gcc-patches wrote: >> This prevents find_cond_trap from being invoked after reload. It may >> generate compares which would require reloading. >> >> Bootstrapped and reg

[PATCH] Fix PR103028

2021-11-05 Thread Andreas Krebbel via Gcc-patches
This prevents find_cond_trap from being invoked after reload. It may generate compares which would require reloading. Bootstrapped and regression tested on s390x. Ok for mainline? gcc/ChangeLog: PR rtl-optimization/103028 * ifcvt.c (find_if_header): Invoke find_cond_trap only

[Committed] IBM Z: Define STACK_CHECK_MOVING_SP

2021-11-04 Thread Andreas Krebbel via Gcc-patches
With -fstack-check the stack probes emitted access memory below the stack pointer. Bootstrapped and regression tested on s390x. Committed to mainline gcc/ChangeLog: * config/s390/s390.h (STACK_CHECK_MOVING_SP): New macro definition. --- gcc/config/s390/s390.h | 5 + 1 file

Re: [PATCH] IBM Z: Free bbs in s390_loop_unroll_adjust

2021-11-03 Thread Andreas Krebbel via Gcc-patches
On 11/2/21 18:31, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested on IBM Z. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390.c (s390_loop_unroll_adjust): In case of early > exit free bbs. Ok. Thanks! Andreas

Re: [PATCH] IBM Z: ldist-{rawmemchr,strlen} tests require vector extensions

2021-11-02 Thread Andreas Krebbel via Gcc-patches
On 11/2/21 15:54, Stefan Schulze Frielinghaus wrote: > The tests require vector extensions which are only available for z13 and > later while using the z/Architecture. > > Bootstrapped and regtested on IBM Z. Ok for mainline? > > gcc/testsuite/ChangeLog: > > *

Re: [PATCH] IBM Z: Fix address of operands will never be NULL warnings

2021-11-02 Thread Andreas Krebbel via Gcc-patches
On 10/30/21 12:43, Stefan Schulze Frielinghaus wrote: > Since a recent enhancement of -Waddress a couple of warnings are emitted > and turned into errors during bootstrap: > > gcc/config/s390/s390.md:12087:25: error: the address of 'operands' will never > be NULL [-Werror=address] > 12087 |

Re: [PATCH] IBM Z: Provide rawmemchr{qi,hi,si} expander

2021-10-08 Thread Andreas Krebbel via Gcc-patches
On 10/8/21 16:23, Stefan Schulze Frielinghaus wrote: > On Thu, Oct 07, 2021 at 11:16:24AM +0200, Andreas Krebbel wrote: >> On 9/20/21 11:24, Stefan Schulze Frielinghaus wrote: >>> This patch implements the rawmemchr expander as introduced in >>> https://gcc.gnu.org

Re: [PATCH] IBM Z: Provide rawmemchr{qi,hi,si} expander

2021-10-07 Thread Andreas Krebbel via Gcc-patches
aa; \ > + /* unaligned + 3rd load */ \ > + q[19] = pattern; \ > + assert ((rawmemchr_##T ([2]) == [19])); \ > + q[19] = (T) 0x; \ > + /* unaligned + 4th lo

Re: [PATCH gcc-11 0/2] Backport kpatch changes

2021-09-30 Thread Andreas Krebbel via Gcc-patches
On 9/30/21 10:50, Ilya Leoshkevich wrote: > Hi, > > This series contains a backport of kpatch changes needed to support > https://github.com/dynup/kpatch/pull/1203 so that it could be used in > RHEL 9. The patches have been in master for 4 months now without > issues. > > Bootstrapped and

[Committed] IBM Z: TPF: Add cc clobber to profiling expanders

2021-09-22 Thread Andreas Krebbel via Gcc-patches
The code sequence emitted uses CC internally. gcc/ChangeLog: * config/s390/tpf.md (prologue_tpf, epilogue_tpf): Add cc clobber. --- gcc/config/s390/tpf.md | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/s390/tpf.md b/gcc/config/s390/tpf.md index

[Committed] IBM Z: Fix PR102222

2021-09-22 Thread Andreas Krebbel via Gcc-patches
Avoid emitting a strict low part move if the insv target actually affects the whole target reg. Bootstrapped and regression tested on s390x. gcc/ChangeLog: PR target/10 * config/s390/s390.c (s390_expand_insv): Emit a normal move if it is actually a full copy of the

[PATCH 1/5] IBM Z: Get rid of vec merge unspec

2021-07-29 Thread Andreas Krebbel via Gcc-patches
This patch gets rid of the unspecs we were using for the vector merge instruction and replaces it with generic rtx. gcc/ChangeLog: * config/s390/s390-modes.def: Add more vector modes to support concatenation of two vectors. * config/s390/s390-protos.h

[PATCH 3/5] IBM Z: Remove redundant V_HW_64 mode iterator.

2021-07-29 Thread Andreas Krebbel via Gcc-patches
gcc/ChangeLog: * config/s390/vector.md (V_HW_64): Remove mode iterator. (*vec_load_pair): Use V_HW_2 instead of V_HW_64. * config/s390/vx-builtins.md (vec_scatter_element_SI): Use V_HW_2 instead of V_HW_64. --- gcc/config/s390/vector.md | 7 +++

[PATCH 2/5] IBM Z: Get rid of vpdi unspec

2021-07-29 Thread Andreas Krebbel via Gcc-patches
The patch gets rid of the unspec used for the vector permute double immediate instruction and replaces it with generic rtx. gcc/ChangeLog: * config/s390/s390.md (UNSPEC_VEC_PERMI): Remove constant definition. * config/s390/vector.md (*vpdi1, *vpdi4): New pattern

[PATCH 0/5] IBM Z: Implement TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-29 Thread Andreas Krebbel via Gcc-patches
. As expected various occurrences of the vperm instruction get replaced with vmr* and vpdi. I'll commit the patches after giving it a few days for comments. Andreas Krebbel (5): IBM Z: Get rid of vec merge unspec IBM Z: Get rid of vpdi unspec IBM Z: Remove redundant V_HW_64 mode iterator. IBM Z

[PATCH 5/5] IBM Z: Implement TARGET_VECTORIZE_VEC_PERM_CONST for vpdi

2021-07-29 Thread Andreas Krebbel via Gcc-patches
This patch makes use of the vector permute double immediate instruction for constant permute vectors. gcc/ChangeLog: * config/s390/s390.c (expand_perm_with_vpdi): New function. (vectorize_vec_perm_const_1): Call expand_perm_with_vpdi. * config/s390/vector.md (*vpdi1,

[PATCH 4/5] IBM Z: Implement TARGET_VECTORIZE_VEC_PERM_CONST for vector merge

2021-07-29 Thread Andreas Krebbel via Gcc-patches
This patch implements the TARGET_VECTORIZE_VEC_PERM_CONST in the IBM Z backend. The initial implementation only exploits the vector merge instruction but there is more to come. gcc/ChangeLog: * config/s390/s390.c (MAX_VECT_LEN): Define macro. (struct expand_vec_perm_d): Define

Re: [PATCH] IBM Z: Fix 5 tests in 31-bit mode

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/23/21 2:47 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/global-array-element-pic2.c: Add -mzarch, add > an expectation for 31-bit mode. > *

Re: [PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/28/21 9:43 AM, Richard Biener wrote: > On Wed, Jul 28, 2021 at 8:44 AM Andreas Krebbel via Gcc-patches > wrote: >> >> There are also memory operands passed for in0 and in1. >> >> Ok for mainline? > > They can also be constant vectors, I'd just not

Re: [PATCH] IBM Z: Enable LSan and TSan

2021-07-28 Thread Andreas Krebbel via Gcc-patches
On 7/27/21 10:04 PM, Ilya Leoshkevich via Gcc-patches wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > libsanitizer/ChangeLog: > > * configure.tgt (s390*-*-linux*): Enable LSan and TSan for > s390x. Ok. Thanks! Andreas

[PATCH] Adjust docu of TARGET_VECTORIZE_VEC_PERM_CONST

2021-07-28 Thread Andreas Krebbel via Gcc-patches
There are also memory operands passed for in0 and in1. Ok for mainline? gcc/ChangeLog: * target.def: Describe in0 and in1 as being either register or memory operands. * doc/tm.texi: Regenerate. --- gcc/doc/tm.texi | 7 --- gcc/target.def | 7 --- 2 files

Re: [PATCH v3] IBM Z: Use @PLT symbols for local functions in 64-bit mode

2021-07-16 Thread Andreas Krebbel via Gcc-patches
On 7/12/21 9:23 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > v1: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573614.html > v1 -> v2: Do not use UNSPEC_PLT in 64-bit code and rename it to > UNSPEC_PLT31 (Ulrich, Andreas). Do

Re: [PATCH v2] IBM Z: Define NO_PROFILE_COUNTERS

2021-06-23 Thread Andreas Krebbel via Gcc-patches
On 6/24/21 12:42 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > v1: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573348.html > v1 -> v2: Use ATTRIBUTE_UNUSED, compact op[] array (Andreas). > I've also noticed that one of the

Re: [PATCH] IBM Z: Define NO_PROFILE_COUNTERS

2021-06-22 Thread Andreas Krebbel via Gcc-patches
On 6/22/21 12:20 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > s390 glibc does not need counters in the .data section, since it stores > edge hits in its own data structure. Therefore counters only waste > space and confuse diffing

Re: [PATCH] s390: Add more vcond_mask patterns.

2021-06-09 Thread Andreas Krebbel via Gcc-patches
On 6/9/21 2:47 PM, Robin Dapp wrote: >> I think the real problem is the expander name. That's why it could not be >> found by optab. The second >> mode needs to be the int vector mode of op3. With that change the testcases >> work as expected: >> >> diff --git a/gcc/config/s390/vector.md

Re: [PATCH] IBM Z: Remove match_scratch workaround

2021-06-02 Thread Andreas Krebbel via Gcc-patches
On 6/2/21 4:21 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > Since commit dd1ef00c45ba ("Fix bug in the define_subst handling that > made match_scratch unusable for multi-alternative patterns.") the > workaround for that bug in

[Committed] IBM Z: Support vector _Bool language extension

2021-05-18 Thread Andreas Krebbel via Gcc-patches
_Bool needs to be defined as macro in order to trigger the context-sensitive macro expansion mechanism. Bootstrapped and regtested on s390x. Committed to mainline. gcc/ChangeLog: * config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define _Bool as macro expanding to _Bool.

Re: [PATCH 1/1 v2] PR100281 C++: Fix SImode pointer handling

2021-05-13 Thread Andreas Krebbel via Gcc-patches
v1 -> v2: build_reference_type_for_mode and build_pointer_type_for_mode now pick pointer mode if MODE argument is VOIDmode. Bootstrapped and regression tested on x86_64 and s390x. Ok for mainline and GCC 11? Andreas gcc/cp/ChangeLog: PR c++/100281 * cvt.c

Re: [PATCH 1/1] PR100281 C++: Fix SImode pointer handling

2021-05-12 Thread Andreas Krebbel via Gcc-patches
Ping On 4/30/21 8:32 AM, Andreas Krebbel via Gcc-patches wrote: > The problem appears to be triggered by two locations in the front-end > where non-POINTER_SIZE pointers aren't handled right now. > > 1. An assertion in strip_typedefs is triggered because the alignment > of the ty

Re: [PATCH] s390: Add more vcond_mask patterns.

2021-05-11 Thread Andreas Krebbel via Gcc-patches
Hi Robin, On 5/5/21 5:18 PM, Robin Dapp wrote: ... > diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md > index c80d582a300..7c730432d80 100644 > --- a/gcc/config/s390/vector.md > +++ b/gcc/config/s390/vector.md > @@ -36,6 +36,7 @@ > (define_mode_iterator V_HW2 [V16QI V8HI V4SI

Re: [PATCH] testsuite/s390: Fix risbg-ll-3.c f2_cconly test.

2021-05-11 Thread Andreas Krebbel via Gcc-patches
On 5/4/21 5:08 PM, Robin Dapp wrote: > Hi, > > instead of selecting bits 62 to (wraparound) 59 from r2 and inserting > them into r3, we select bits 60 to 62 from r3 and insert them into r2 > nowadays. Adjust the test accordingly. > > Is this OK? > > Regards > Robin > >

Re: [PATCH] IBM Z: Fix error checking for builtin vec_permi

2021-05-06 Thread Andreas Krebbel via Gcc-patches
On 5/6/21 9:56 AM, Marius Hillenbrand wrote: > Hi, > > this patch fixes the check of immediate operands to the builtin vec_permi and > adds a new test for this built-in. > > Reg-rested and bootstrapped on s390x. > > Is it OK for master? Is it OK for backporting to gcc-11? > > Regards, > Marius

Re: [PATCH v2] IBM Z: Handle hard registers in s390_md_asm_adjust()

2021-05-05 Thread Andreas Krebbel via Gcc-patches
On 5/3/21 1:09 PM, Ilya Leoshkevich wrote: > On Fri, 2021-04-30 at 08:49 +0200, Andreas Krebbel wrote: >> On 4/28/21 3:48 AM, Ilya Leoshkevich wrote: >>> Bootstrapped and regtested on s390x-redhat-linux.  Tested with >>> valgrind >>> too (PR 100278 is no

Re: [PATCH v2] IBM Z: Handle hard registers in s390_md_asm_adjust()

2021-04-30 Thread Andreas Krebbel via Gcc-patches
On 4/28/21 3:48 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Tested with valgrind > too (PR 100278 is now fixed). Ok for master? > > v1: https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568771.html > v1 -> v2: Use the UNSPEC pattern, which is less

[PATCH 1/1] PR100281 C++: Fix SImode pointer handling

2021-04-30 Thread Andreas Krebbel via Gcc-patches
The problem appears to be triggered by two locations in the front-end where non-POINTER_SIZE pointers aren't handled right now. 1. An assertion in strip_typedefs is triggered because the alignment of the types don't match. This in turn is caused by creating the new type with build_pointer_type

Re: [PATCH 1/1] PR100281 Fix SImode pointer handling

2021-04-28 Thread Andreas Krebbel via Gcc-patches
On 4/28/21 10:12 AM, Richard Biener wrote: > On Wed, Apr 28, 2021 at 8:54 AM Andreas Krebbel via Gcc-patches > wrote: >> >> The problem appears to be triggered by two locations in the front-end >> where non-POINTER_SIZE pointers aren't handled right now. >> >&g

Re: [PATCH 1/1] PR100281 Fix SImode pointer handling

2021-04-28 Thread Andreas Krebbel via Gcc-patches
On 4/28/21 10:22 AM, Andreas Krebbel via Gcc-patches wrote: > On 4/28/21 10:12 AM, Richard Biener wrote: >> On Wed, Apr 28, 2021 at 8:54 AM Andreas Krebbel via Gcc-patches >> wrote: >>> >>> The problem appears to be triggered by two locations in the front-end &g

Re: [PATCH 1/1] PR100281 Fix SImode pointer handling

2021-04-28 Thread Andreas Krebbel via Gcc-patches
On 4/28/21 10:12 AM, Richard Biener wrote: > On Wed, Apr 28, 2021 at 8:54 AM Andreas Krebbel via Gcc-patches > wrote: >> >> The problem appears to be triggered by two locations in the front-end >> where non-POINTER_SIZE pointers aren't handled right now. >> >&g

[PATCH 1/1] PR100281 Fix SImode pointer handling

2021-04-27 Thread Andreas Krebbel via Gcc-patches
The problem appears to be triggered by two locations in the front-end where non-POINTER_SIZE pointers aren't handled right now. 1. An assertion in strip_typedefs is triggered because the alignment of the types don't match. This in turn is caused by creating the new type with build_pointer_type

[PATCH] Fix PR88085

2021-04-20 Thread Andreas Krebbel via Gcc-patches
With the current handling of decl alignments it is impossible to reduce the alignment requirement as part of a variable declaration. This change has been proposed by Richard in the PR. It fixes the align-1.c testcase on IBM Z. Bootstrapped on x86_64 and s390x. No regressions. Ok for mainline?

Re: [PATCH] testsuite: Fix up gcc.target/s390/zero-scratch-regs-1.c

2021-04-20 Thread Andreas Krebbel via Gcc-patches
On 4/20/21 9:17 AM, Stefan Schulze Frielinghaus wrote: > Depending on whether GCC is configured using --with-mode=zarch or not, > for the 31bit target instructions are generated either for ESA or > z/Architecture. For the sake of simplicity and robustness test only for > the latter by adding

Re: [PATCH] s390/testsuite: Fix oscbreak-1.c.

2021-04-20 Thread Andreas Krebbel via Gcc-patches
On 4/16/21 3:59 PM, Robin Dapp wrote: > Hi, > > checking for an osc break is somewhat brittle especially with many > passes potentially introducing new insns and moving them around. > Therefore, only run the test with -O1 -fschedule-insns in order to limit > the influence of other passes. Yeah,

Re: [PATCH] IBM Z: Add alternative to *movdi_{31, 64} in order to load a DFP zero

2021-04-16 Thread Andreas Krebbel via Gcc-patches
On 4/12/21 3:40 PM, Stefan Schulze Frielinghaus wrote: > Bootstraped and regtested on IBM Z. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390.md ("*movdi_31", "*movdi_64"): Add > alternative in order to load a DFP zero. Ok, thanks! Andreas > --- >

[Committed] IBM Z: Fix error checking for immediate builtin operands

2021-04-14 Thread Andreas Krebbel via Gcc-patches
This fixes the error checking for two of the vector builtins which accept irregular (e.g. non-contigiuous) ranges of values. Regression tested on s390x (--with-arch=arch13). Applied to mainline. Needs to go into 9 and 10 branch as well. gcc/ChangeLog: * config/s390/s390-builtins.def

Re: [PATCH] IBM Z: Add alternative to *movdi_{31, 64} in order to load a DFP zero

2021-04-12 Thread Andreas Krebbel via Gcc-patches
On 4/12/21 3:40 PM, Stefan Schulze Frielinghaus wrote: > Bootstraped and regtested on IBM Z. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390.md ("*movdi_31", "*movdi_64"): Add > alternative in order to load a DFP zero. Ok. Thanks! Andreas > --- >

Re: [PATCH] testsuite: Disable zero-scratch-regs-{8,9,10,11}.c on s390* [PR97680]

2021-03-30 Thread Andreas Krebbel via Gcc-patches
On 3/30/21 12:43 PM, Jakub Jelinek wrote: > Hi! > > These test FAIL on s390*: > /builddir/build/BUILD/gcc-11.0.1-20210324/gcc/testsuite/c-c++-common/zero-scratch-regs-10.c: > In function 'foo8': > /builddir/build/BUILD/gcc-11.0.1-20210324/gcc/testsuite/c-c++-common/zero-scratch-regs-10.c:71:1: >

Re: [PATCH] IBM Z: Fix "+fvm" constraint with long doubles

2021-03-16 Thread Andreas Krebbel via Gcc-patches
On 3/16/21 1:16 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > When a long double is passed to an asm statement with a "+fvm" > constraint, a LRA loop occurs. This happens, because LRA chooses the > widest register class in this case

[Committed] IBM Z: arch14 fix option string used for Binutils

2021-03-09 Thread Andreas Krebbel via Gcc-patches
gcc/ChangeLog: * config/s390/s390.c (struct s390_processor processor_table): Binutils name string must not be empty. --- gcc/config/s390/s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index

[Committed] IBM Z: Fix vcond-shift.c testcase.

2021-03-08 Thread Andreas Krebbel via Gcc-patches
Due to a common code change the comparison in the testcase is emitted via vec_cmp instead of vcond. The testcase checks for an optimization currently only available via vcond. Fixed by implementing the same optimization also in s390_expand_vec_compare. Bootstrapped and regression tested on

Re: [PATCH v3] IBM Z: Fix usage of "f" constraint with long doubles

2021-03-07 Thread Andreas Krebbel via Gcc-patches
On 3/4/21 3:08 PM, Ilya Leoshkevich wrote: > v1: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563799.html > v1 -> v2: > - Handle constraint modifiers, use AR constraint instead of R, add > testcases for & and %. > > v2:

Re: [PATCH] IBM Z: Run mul-signed-overflow-*.c only on z14+

2021-03-03 Thread Andreas Krebbel via Gcc-patches
On 3/3/21 11:50 AM, Ilya Leoshkevich wrote: > On Wed, 2021-03-03 at 07:50 +0100, Andreas Krebbel wrote: >> On 3/2/21 11:59 PM, Ilya Leoshkevich wrote: >>> mul-signed-overflow-*.c execution tests fail on z13, because they >>> contain z14-specific instructions.  F

Re: [PATCH] IBM Z: Run mul-signed-overflow-*.c only on z14+

2021-03-02 Thread Andreas Krebbel via Gcc-patches
On 3/2/21 11:59 PM, Ilya Leoshkevich wrote: > mul-signed-overflow-*.c execution tests fail on z13, because they > contain z14-specific instructions. Fix by requiring s390_z14_hw > target. > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/mul-signed-overflow-1.c: Run only on z14+. >

[Committed 2/2] IBM Z: arch14: New instrinsics

2021-03-02 Thread Andreas Krebbel via Gcc-patches
This adds support for 5 new builtins. gcc/ChangeLog: * config/s390/s390-builtin-types.def (BT_FN_V4SF_V8HI_UINT): New builtin signature. (BT_FN_V8HI_V8HI_UINT): Likewise. (BT_FN_V8HI_V4SF_V4SF_UINT): Likewise. * config/s390/s390-builtins.def (B_NNPA): New

[Committed 1/2] IBM Z: arch14: Add command line options

2021-03-02 Thread Andreas Krebbel via Gcc-patches
Prepare GCC for a future architecture extension. gcc/ChangeLog: * common/config/s390/s390-common.c (processor_flags_table): New entry. * config.gcc: Enable arch14 for --with-arch and --with-tune. * config/s390/driver-native.c (s390_host_detect_local_cpu): Pick

[Committed] IBM Z: Run mul-signed-overflow tests only on z14

2021-03-02 Thread Andreas Krebbel via Gcc-patches
gcc/testsuite/ChangeLog: * gcc.target/s390/mul-signed-overflow-1.c: Run only on z14. * gcc.target/s390/mul-signed-overflow-2.c: Run only on z14. --- gcc/testsuite/gcc.target/s390/mul-signed-overflow-1.c | 2 +- gcc/testsuite/gcc.target/s390/mul-signed-overflow-2.c | 2 +- 2 files

Re: [PATCH] IBM Z: Fix testcase vcond-shift.c

2021-03-01 Thread Andreas Krebbel via Gcc-patches
On 3/1/21 5:00 PM, Stefan Schulze Frielinghaus wrote: > As of commit 3a6e3ad38a17a03ee0139b49a0946e7b9ded1eb1 expressions > x CMP y ? -1 : 0 are fold into x CMP y. Due to this we do not see > shifts anymore after expand in our testcases but comparisons. Thus > replace instructions vesraX by

Re: [PATCH 0/2] IBM Z: Fix long double <-> DFP conversions

2021-02-19 Thread Andreas Krebbel via Gcc-patches
On 2/18/21 1:57 PM, Ilya Leoshkevich wrote: > This series fixes PR99134. Patch 1 is factored out from the pending > [1], patch 2 is the actual fix. Bootstrapped and regtested on > s390x-redhat-linux. Ok for master? > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-January/564380.html > >

Re: [PATCH] IBM Z: Fix usage of "f" constraint with long doubles

2021-01-26 Thread Andreas Krebbel via Gcc-patches
On 1/18/21 10:54 PM, Ilya Leoshkevich wrote: ... > +static rtx_insn * > +s390_md_asm_adjust (vec , vec , > + vec _modes, > + vec , vec & /*clobbers*/, > + HARD_REG_SET & /*clobbered_regs*/) > +{ > + if (!TARGET_VXE) > +/* Long doubles are

[PATCH] tree-optimization/98221 - fix wrong unpack operation used for big-endian

2021-01-11 Thread Andreas Krebbel via Gcc-patches
d side of the vector - in this case the zeroes. Bootstrap & regtest running on x86_64-unknown-linux-gnu. 2021-01-11 Andreas Krebbel * tree-ssa-forwprop.c (simplify_vector_constructor): For big-endian, use UNPACK[_FLOAT]_HI. --- gcc/tree-ssa-forwprop.c | 21 +--

Re: [PATCH] IBM Z: Fix constraints in vpdi patterns

2021-01-08 Thread Andreas Krebbel via Gcc-patches
On 1/8/21 5:35 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > The destination register is only partially overwritten, so + should be > used instead of =. > > gcc/ChangeLog: > > 2021-01-08 Ilya Leoshkevich > > *

Re: [PATCH v2] IBM Z: Introduce __LONG_DOUBLE_VX__ macro

2021-01-08 Thread Andreas Krebbel via Gcc-patches
On 1/8/21 2:14 PM, Ilya Leoshkevich wrote: > v1: https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563034.html > v1 -> v2: Use TARGET_VXE_P instead of TARGET_Z14_P. > > > > Give end users the opportunity to find out whether long doubles are > stored in floating-point register pairs or in

Re: [PATCH] IBM Z: Introduce __LONG_DOUBLE_VX__ macro

2021-01-08 Thread Andreas Krebbel via Gcc-patches
On 1/8/21 1:17 AM, Ilya Leoshkevich wrote: > + s390_def_or_undef_macro ( > + pfile, > + [] (const struct cl_target_option *opts) { return TARGET_Z14_P (opts); > }, > + old_opts, opts, "__LONG_DOUBLE_VX__", "__LONG_DOUBLE_VX__"); Shouldn't this rather check TARGET_VXE_P instead?

Re: [PATCH] IBM Z: Fix check_effective_target_s390_z14_hw

2021-01-05 Thread Andreas Krebbel via Gcc-patches
On 1/5/21 7:37 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on z14. Ok for master? > > > > Commit 2f473f4b065d ("IBM Z: Do not run long double tests on old > machines") introduced a predicate for tests that must run only on z14+. > However, due to a syntax error, the predicate

Re: [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions

2020-12-08 Thread Andreas Krebbel via Gcc-patches
On 12/3/20 2:22 AM, Ilya Leoshkevich wrote: > According to > https://gcc.gnu.org/pipermail/gcc/2020-November/234344.html, GCC is > allowed to perform optimizations that remove floating point traps, > since they do not affect the modeled control flow. This interferes with > two signaling

[Committed] IBM Z: Change Pmode to word_mode for stack probes

2020-12-07 Thread Andreas Krebbel via Gcc-patches
In s390.c we are still using Pmode for the stack probes. This breaks with -m31 -mzarch where Pmode != word_mode. The patch also adds a new target check to s390.exp which allows us to implement zarch specific checks in the testcases. Bootstrapped and regression tested on s390x with and without

[Committed] IBM Z: Fix mode in probe_stack pattern

2020-12-03 Thread Andreas Krebbel via Gcc-patches
The probe pattern uses Pmode but the middle-end wants to emit a word_mode probe check. This - as usual - breaks on Z with -m31 -mzarch were word_mode doesn't match Pmode. Bootstrapped and regression-tested on s390x. gcc/ChangeLog: * config/s390/s390.md ("@probe_stack2"): Change mode

Re: [PATCH v2] IBM Z: Use llihf and oilf to load large immediates into GPRs

2020-12-02 Thread Andreas Krebbel via Gcc-patches
On 12/2/20 4:08 PM, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > v1: https://gcc.gnu.org/pipermail/gcc-patches/2020-December/560822.html > > v1 -> v2: > - Use SYMBOL_REF_P. > - Fix usage of gcc_assert. > - Use GEN_INT. > > > > Currently GCC

Re: [PATCH] IBM Z: Use llihf and oilf to load large immediates into GPRs

2020-12-01 Thread Andreas Krebbel via Gcc-patches
On 12/2/20 2:34 AM, Ilya Leoshkevich wrote: > Bootstrapped and regtesed on s390x-redhat-linux. There are slight > improvements in all SPEC benchmarks, no regressions that could not be > "fixed" by adding nops. Ok for master? > > > > Currently GCC loads large immediates into GPRs from the

Re: [PATCH 2/2] gcc/testsuite/s390: Add test cases for float_t

2020-12-01 Thread Andreas Krebbel via Gcc-patches
On 11/25/20 6:06 PM, Marius Hillenbrand wrote: > Add two test cases that check for acceptable combinations of float_t and > FLT_EVAL_METHOD on s390x. > > Tested against an as-is glibc and one modified so that it derives > float_t from FLT_EVAL_METHOD. > > gcc/testsuite/ChangeLog: > > 2020-11-25

Re: [PATCH 1/2] IBM Z: Configure excess precision for float at compile-time

2020-12-01 Thread Andreas Krebbel via Gcc-patches
On 11/25/20 6:06 PM, Marius Hillenbrand wrote: > Historically, float_t has been defined as double on s390 and gcc would > emit double precision insns for evaluating float expressions when in > standard-compliant mode. Configure that behavior at compile-time as prep > for changes in glibc: When

Re: [PATCH] IBM Z: Restrict vec_cmp on z13

2020-11-24 Thread Andreas Krebbel via Gcc-patches
On 24.11.20 12:55, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > Commit 5d9ade39b872 ("IBM Z: Fix PR97326: Enable fp compares in > vec_cmp") made it possible to create rtxes that describe signaling > comparisons on z13, which are not

Re: [PATCH] IBM Z: Update autovec-*-quiet-uneq expectations

2020-11-23 Thread Andreas Krebbel via Gcc-patches
On 23.11.20 22:38, Ilya Leoshkevich wrote: > Commit 229752afe315 ("VEC_COND_EXPR optimizations") has improved code > generation: we no longer need "vx x,x,-1", which turned out to be > superfluous. Instead, we simply swap 0 and -1 arguments of the > preceding "vsel". > > gcc/testsuite/ChangeLog:

Re: [PATCH] IBM Z: Do not run long double tests on old machines

2020-11-16 Thread Andreas Krebbel via Gcc-patches
On 13.11.20 23:23, Ilya Leoshkevich wrote: > Bootstrapped and regtested on z13 s390x-redhat-linux. Ok for master? > > gcc/testsuite/ChangeLog: > > 2020-11-12 Ilya Leoshkevich > > * gcc.target/s390/s390.exp (check_effective_target_s390_z14_hw): > New predicate. > *

Re: [PATCH] IBM Z: Define vec_vfees instruction pattern

2020-11-12 Thread Andreas Krebbel via Gcc-patches
On 12.11.20 13:21, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested on IBM Z. Ok for master? > > gcc/ChangeLog: > > * config/s390/vector.md ("vec_vfees"): New insn pattern. > --- > gcc/config/s390/vector.md | 26 ++ > 1 file changed, 26

Re: [PATCH] IBM Z: Fix output template for "*vfees"

2020-11-12 Thread Andreas Krebbel via Gcc-patches
On 12.11.20 13:25, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested on IBM Z. Ok for master? > > gcc/ChangeLog: > > * config/s390/vx-builtins.md ("*vfees"): Fix output > template. > --- > gcc/config/s390/vx-builtins.md | 2 +- > 1 file changed, 1 insertion(+), 1

[Committed 2/2] IBM Z: Fix PR97326: Enable fp compares in vec_cmp

2020-11-11 Thread Andreas Krebbel via Gcc-patches
Bootstrapped and regression tested on s390x. gcc/ChangeLog: PR target/97326 * config/s390/vector.md: Support vector floating point modes in vec_cmp. --- gcc/config/s390/vector.md | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git

[Committed 1/2] IBM Z: Rename mode attr tointvec to TOINTVEC

2020-11-11 Thread Andreas Krebbel via Gcc-patches
Just a preparation to add a lower-case tointvec. Bootstrapped and regression tested on s390x. gcc/ChangeLog: * config/s390/vector.md: Rename tointvec to TOINTVEC. * config/s390/vx-builtins.md: Likewise. --- gcc/config/s390/vector.md | 142 -

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