Re: [PATCH] IBM zSystems: Do not use @PLT with larl

2025-02-03 Thread Andreas Krebbel
gcc/ChangeLog: * config/s390/s390.cc (print_operand): Remove the no longer necessary 31-bit and weak symbol handling. * config/s390/s390.md (*movdi_64): Do not use @PLT with larl. (*movsi_larl): Likewise. (main_base_64): Likewise. (reload_base_64):

Re: [PATCH] s390: Fix UNSPEC_CC_TO_INT canonicalization

2024-12-09 Thread Andreas Krebbel
On 12/6/24 19:00, Juergen Christ wrote: Canonicalization of comparisons for UNSPEC_CC_TO_INT missed one case causing unnecessarily complex code. This especially seems to hit the Linux kernel. gcc/ChangeLog: * config/s390/s390.cc (s390_canonicalize_comparison): Add missing UN

Re: [PATCH v2] s390: Add expander for uaddc/usubc optabs

2024-11-28 Thread Andreas Krebbel
On 11/21/24 09:38, Stefan Schulze Frielinghaus wrote: Bootstrap and regtest are still running. If those are successful and there are no further comments I will push this one in the coming days. -- >8 -- gcc/ChangeLog: * config/s390/s390-protos.h (s390_emit_compare): Add mode p

Re: [PATCH] s390: Add expander for uaddc/usubc optabs

2024-11-18 Thread Andreas Krebbel
Hi Stefan, On 11/12/24 10:35, Stefan Schulze Frielinghaus wrote: + rtx cond = gen_rtx_LTU (mode, gen_rtx_REG (CCL1mode, CC_REGNUM), const0_rtx); + if (operands[4] == const0_rtx) +emit_insn (gen_add3_carry1_cc (operands[0], operands[2], operands[3])); + else If we would just generate t

Re: [PATCH] s390: Add expander for uaddc/usubc optabs

2024-11-11 Thread Andreas Krebbel
Hi Stefan, thanks for the patch and sorry for the slow review. On 9/18/24 19:25, Stefan Schulze Frielinghaus wrote: Bootstrapped and regtested on s390. Both expander are constrained to z196 because of the conditional moves. I guess this is reasonable nowadays. The reason for the limitation

Re: [PATCH] s390: Remove -m{,no-}lra option

2024-09-20 Thread Andreas Krebbel
On 9/19/24 16:05, Stefan Schulze Frielinghaus wrote: I have been missing the two test cases and removed them since they depend on -mno-lra. -- 8< -- Since the old reload pass is about to be removed and we defaulted to LRA for over a decade, remove option -m{,no-}lra. PR target/113953 gcc/Chan

Re: [PATCH] s390: Fix strict_low_part generation

2024-09-11 Thread Andreas Krebbel
On 8/16/24 09:14, Stefan Schulze Frielinghaus wrote: In s390_expand_insv(), if generating code for ICM et al. src is a MEM and gen_lowpart might force src into a register such that we end up with patterns which do not match anymore. Use adjust_address() instead in order to preserve a MEM. Furth

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Andreas Krebbel
On 9/12/24 08:14, Stefan Schulze Frielinghaus wrote: .. Right, so offsettable_memref_p only ensures that any resulting address is a valid general address.  So we have to manually check for short displacement. Maybe something along the lines: diff --git a/gcc/config/s390/s390.cc b/gcc/config/s

Re: [PATCH] s390: Fix TF to FPRX2 conversion [PR115860]

2024-09-11 Thread Andreas Krebbel
Ok, Thanks! Andreas On 8/16/24 09:41, Stefan Schulze Frielinghaus wrote: Currently subregs originating from *tf_to_fprx2_0 and *tf_to_fprx2_1 survive register allocation. This in turn leads to wrong register renaming. Keeping the current approach would mean we need two insns for *tf_to_fprx2_

Re: [PATCH] s390: Remove vector intrinsics

2024-08-14 Thread Andreas Krebbel
On 8/8/24 20:29, Stefan Schulze Frielinghaus wrote: The following intrinsics are not implemented. Thus, remove them. Ok for mainline? gcc/ChangeLog: * config/s390/vecintrin.h (vec_vstbrh): Remove. (vec_vstbrf): Remove. (vec_vstbrg): Remove. (vec_vstbrq): Remove

Re: [PATCH] s390: Fix high-level builtins vec_gfmsum{,_accum}_128

2024-08-14 Thread Andreas Krebbel
On 8/8/24 20:28, Stefan Schulze Frielinghaus wrote: Starting with r14-9449-g9f2b16ce1efef0 builtins were streamlined with those in LLVM. In particular s390_vgfm{,a}g have been changed from UV16QI to UINT128 in order to match those in LLVM. However, these low-level builtins are directly used by

Re: [PATCH] s390: Fix unresolved iterators bhfgq and xdee

2024-07-20 Thread Andreas Krebbel
On 7/20/24 08:39, Stefan Schulze Frielinghaus wrote: I'm pinging this early since I would like to make sure that it gets into 14.2 RC which is about to be done on Tuesday 23rd July. On Tue, Jul 16, 2024 at 04:50:29PM +0200, Stefan Schulze Frielinghaus wrote: Code attribute bhfgq is missing a

Re: [PATCH] s390: Fix unresolved iterators bhfgq and xdee

2024-07-16 Thread Andreas Krebbel
On 7/16/24 10:29, Stefan Schulze Frielinghaus wrote: Code attribute bhfgq is missing a mapping for TF. This results in unresolved iterators in assembler templates for *bswaptf. With the TF mapping added the base mnemonics vlbr and vstbr are not "used" anymore but only the extended mnemonics (

Re: [PATCH] s390: Fully exploit vgm, vgbm, vrepi

2024-07-12 Thread Andreas Krebbel
On 7/2/24 15:48, Stefan Schulze Frielinghaus wrote: Currently instructions vgm and vrepi are utilized only for constant vectors where the element mode equals the element mode of the corresponding instruction. This patch lifts this restriction by making use of those instructions for constant vect

Re: [PATCH 0/3] Prepare and drop vcond expanders

2024-07-12 Thread Andreas Krebbel
On 7/1/24 10:32, Stefan Schulze Frielinghaus wrote: This drops vcond expanders. The first patch "s390: Emulate vec_cmp{eq,gt,gtu} for 128-bit integers" is somewhat independent of the other two, since we run already in ICEs. However, since after removing vcond expanders testsuite shows one addi

Re: [PATCH] s390: Fix output template for movv1qi

2024-07-11 Thread Andreas Krebbel
On 7/2/24 15:43, Stefan Schulze Frielinghaus wrote: Although for instructions MVI and MVIY it does not make a difference whether the immediate is interpreted as signed or unsigned, GAS expects unsigned immediates for instruction format SI_URD. gcc/ChangeLog: * config/s390/vector.md (mo

Re: [PATCH] s390: Align *cjump_64 and *icjump_64

2024-07-11 Thread Andreas Krebbel
On 7/11/24 16:29, Stefan Schulze Frielinghaus wrote: During machine reorg we optimize backward jumps and transform insns as e.g. (jump_insn 118 117 119 (set (pc) (if_then_else (ne (reg:CCRAW 33 %cc) (const_int 8 [0x8])) (label_ref 134) (pc)))

Re: [PATCH] s390: Check for ADDR_REGS in s390_decompose_addrstyle_without_index

2024-06-27 Thread Andreas Krebbel
On 6/26/24 14:15, Stefan Schulze Frielinghaus wrote: An explicit check for address registers was not required so far since during register allocation the processing of address constraints was sufficient. However, address constraints themself do not check for REGNO_OK_FOR_{BASE,INDEX}_P. Thus, w

Re: [committed] testsuite: Add -Wno-psabi to vshuf-mem.C test

2024-06-17 Thread Andreas Krebbel
On 6/14/24 20:03, Jakub Jelinek wrote: Also wonder about the // { dg-additional-options "-march=z14" { target s390*-*-* } } line, doesn't that mean the test will FAIL on all pre-z14 HW? Shouldn't it use some z14_runtime or similar effective target, or check in main (in that case copied over to g+

Re: [PATCH] s390: testsuite: Fix nobp-table-jump-*.c

2024-06-14 Thread Andreas Krebbel
On Mon, Jun 03, 2024 at 03:43:39PM +0200, Stefan Schulze Frielinghaus wrote: Starting with r14-5628-g53ba8d669550d3 interprocedural VRP became strong enough in order to render these tests useless. Fixed by disabling IPA. gcc/testsuite/ChangeLog: * gcc.target/s390/nobp-table-jump-inline

Re: PING^1 [PATCH 44/52] s390: New hook implementation s390_c_mode_for_floating_type

2024-06-14 Thread Andreas Krebbel
On 6/13/24 09:43, Kewen.Lin wrote: Hi, Gentle ping: https://gcc.gnu.org/pipermail/gcc-patches/2024-June/653382.html BR, Kewen on 2024/6/3 11:01, Kewen Lin wrote: This is to remove macros {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE defines in s390 port, and add new port specific hook implementation s390

Re: [PATCH] s390: testsuite: Fix ifcvt-one-insn-bool.c

2024-06-13 Thread Andreas Krebbel
On Wed, Jun 05, 2024 at 08:00:15AM +0200, Stefan Schulze Frielinghaus wrote: With the change of r15-787-g57e04879389f9c I forgot to also update this test. gcc/testsuite/ChangeLog: * gcc.target/s390/ifcvt-one-insn-bool.c: Fix loc. Ok. Thanks! Andreas --- Ok for mainline? Ok for

Re: [PATCH v2] s390: Implement TARGET_NOCE_CONVERSION_PROFITABLE_P [PR109549]

2024-06-13 Thread Andreas Krebbel
On 6/2/24 14:07, Stefan Schulze Frielinghaus wrote: Since the patch works fine so far for mainline, ok to backport to GCC 14? Yes please do. Thanks! Andreas On Fri, May 17, 2024 at 08:59:05AM +0200, Stefan Schulze Frielinghaus wrote: I've adapted the patch as follows and will push. Than

Re: [PATCH] s390: Extend two element float vector

2024-06-11 Thread Andreas Krebbel
On 6/11/24 10:26, Stefan Schulze Frielinghaus wrote: This implements a V2SF -> V2DF extend. gcc/ChangeLog: * config/s390/vector.md (*vmrhf): New. (extendv2sfv2df2): New. gcc/testsuite/ChangeLog: * gcc.target/s390/vector/vec-extend-3.c: New test. Since we already have

Re: [PATCH] s390: Extend two/four element integer vectors

2024-06-11 Thread Andreas Krebbel
On 6/11/24 10:24, Stefan Schulze Frielinghaus wrote: For the moment I deliberately left out one-element QHS vectors since it is unclear whether these are pathological cases or whether they are really used. If we ever get an extend for V1DI -> V1TI we should reconsider this. As a side-effect t

[Committed] IBM Z: Fix ICE in expand_perm_as_replicate

2024-06-10 Thread Andreas Krebbel
The current implementation assumes to always be invoked with register operands. For memory operands we even have an instruction though (vlrep). With the patch we try this first and only if it fails force the input into a register and continue. vec_splats generation fails for single element 128bit

Re: [PATCH] s390: Implement TARGET_NOCE_CONVERSION_PROFITABLE_P [PR109549]

2024-05-16 Thread Andreas Krebbel
On 5/8/24 10:06, Stefan Schulze Frielinghaus wrote: > Consider a NOCE conversion as profitable if there is at least one > conditional move. > > gcc/ChangeLog: > > * config/s390/s390.cc (TARGET_NOCE_CONVERSION_PROFITABLE_P): > Define. > (s390_noce_conversion_profitable_p): Implem

Re: [PATCH] s390: testsuite: Fix risbg-ll-2.c

2024-04-30 Thread Andreas Krebbel
On 4/30/24 10:34, Stefan Schulze Frielinghaus wrote: > Starting with r14-2047-gd0e891406b16dc we see through subregs which > means for f10 in risbg-ll-2.c we do not end up with rosbg_si_noshift but > rather rosbg_di_noshift which materializes in slightly different start > index. This saves us an e

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

2024-04-30 Thread Andreas Krebbel
On 4/30/24 10:32, Stefan Schulze Frielinghaus wrote: > Starting with r12-2731-g96146e61cd7aee we do not generate code like > > _5 = (unsigned int) c_2(D); > i_6 = _5 << 8; > _7 = _5 << 20; > i_8 = i_6 | _7; > > anymore but instead > > _5 = (unsigned int) c_2(D); > _3 = _5 * 1048832; > > which l

[Committed] s390x: Fix vec_xl/vec_xst type aliasing [PR114676]

2024-04-23 Thread Andreas Krebbel
The requirements of the vec_xl/vec_xst intrinsincs wrt aliasing of the pointer argument are not really documented. As it turns out, users are likely to get it wrong. With this patch we let the pointer argument alias everything in order to make it more robust for users. Committed to mainline. Wil

[Committed] s390x: Do not default to -mvx for -mesa

2024-04-22 Thread Andreas Krebbel
We currently enable the vector extensions also for -march=z13 -m31 mesa which is very wrong. Not a regression but an obvious fix, so I've committed it to mainline now. Will have to cherry-pick it for stable branches as well. gcc/ChangeLog: * config/s390/s390.cc (s390_option_override_inte

Re: [PATCH] s390: testsuite: Fix forwprop-4{0,1}.c

2024-04-22 Thread Andreas Krebbel
Hi Stefan, due to that missed optimization we currently generate silly code for these two tests and should really fix this (after gcc entering stage1). So just skipping it on s390x would definitely be the wrong choice I think. I think our vectorize_vec_perm_const correctly rejects this permute

Re: [PATCH] s390: testsuite: Remove xfail for vpopct{b,h}

2024-04-21 Thread Andreas Krebbel
On 4/22/24 08:01, Stefan Schulze Frielinghaus wrote: > Starting with r14-9316-g7890836de20912 patterns for vpopct{b,h} are also > detected. Thus, remove xfails. > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/vxe/popcount-1.c: Remove xfail. Ok. Thanks! Andreas > --- > Ok for mainlin

Re: [PATCH] s390: avoid peeking eof after __vector

2024-04-16 Thread Andreas Krebbel
On 4/17/24 03:52, Jiufu Guo wrote: > > Hi, > > I would like to ping this patch. > > > Jeff (Jiufu Guo) > > Jiufu Guo writes: > >> Hi, >> >> Same like PR101168, this patch is need for s390 to >> avoid peeking eof after vector keyword. >> And similar test case is also ok for s390. >> >> Is thi

Re: [PATCH] s390: testsuite: Xfail range-sincos.c and vrp-float-abs-1.c

2024-04-12 Thread Andreas Krebbel
On 4/12/24 10:16, Stefan Schulze Frielinghaus wrote: > As mentioned in PR114678 those failures will be fixed by > https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648303.html > For GCC 14 just xfail them which should be reverted once the patch is > applied. > > gcc/testsuite/ChangeLog: > >

Re: [PATCH v2] s390x: Optimize vector permute with constant indexes

2024-04-09 Thread Andreas Krebbel
On 4/9/24 16:31, Juergen Christ wrote: > Loop vectorizer can generate vector permutes with constant indexes > where all indexes are equal. Optimize this case to use vector > replicate instead of vector permute. > > gcc/ChangeLog: > > * config/s390/s390.cc (expand_perm_as_replicate): Implem

Re: [PATCH] s390: Fix s390_const_int_pool_entry_p and movdi peephole2 [PR114605]

2024-04-08 Thread Andreas Krebbel
On 4/8/24 13:43, Ilya Leoshkevich wrote: > On Sat, 2024-04-06 at 18:58 +0200, Jakub Jelinek wrote: >> Hi! >> >> The following testcase is miscompiled, because we have initially >> a movti which loads the 0x3f803f80ULL TImode constant >> from constant pool.  Later on we split it into a pair

Re: [PATCH] libsanitizer: Do not mention MSan and DFSan in an error message

2024-04-04 Thread Andreas Krebbel
On 4/4/24 14:22, Jakub Jelinek wrote: > On Thu, Apr 04, 2024 at 02:19:08PM +0200, Andreas Krebbel wrote: >> On 4/4/24 13:38, Ilya Leoshkevich wrote: >>> Bootstrapped and regtested on s390x-redhat-linux. Ok for master? >>> >>> >>> libsaniti

Re: [PATCH] libsanitizer: Do not mention MSan and DFSan in an error message

2024-04-04 Thread Andreas Krebbel
On 4/4/24 13:38, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > libsanitizer/ChangeLog: > > * sanitizer_common/sanitizer_linux_s390.cpp (AvoidCVE_2016_2143): > Do not mention MSan and DFSan, which are not supported by GCC. Ok, Thank

Re: [PATCH] s390: testsuite: Fix backprop-6.c

2024-03-22 Thread Andreas Krebbel
On 3/22/24 10:49, Stefan Schulze Frielinghaus wrote: > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/backprop-6.c: On s390 we also have a copysign > optab for long double. Thus, scan 3 instead of 2 times for it. > --- > OK for mainline? Ok. Thanks! Andreas

Re: [PATCH] s390: testsuite: Fix abs-4.c

2024-03-21 Thread Andreas Krebbel
On 3/21/24 15:41, Stefan Schulze Frielinghaus wrote: > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/abs-4.c: On s390 we also have a copysign optab > for long double. Thus, scan 3 instead of 2 times for it. > --- > Ok for mainline? Ok. Thanks! Andreas

[Committed] IBM Z: Fix -munaligned-symbols

2024-03-14 Thread Andreas Krebbel
With this fix we make sure that only symbols with a natural alignment smaller than 2 are considered misaligned with -munaligned-symbols. Background is that -munaligned-symbols is only supposed to affect symbols whose natural alignment wouldn't be enough to fulfill our ABI requirement of having all

Re: [PATCH] s390: Deprecate some vector builtins

2024-03-11 Thread Andreas Krebbel
On 3/1/24 16:57, Stefan Schulze Frielinghaus wrote: > According to IBM Open XL C/C++ for z/OS version 1.1 builtins > > - vec_permi > - vec_ctd > - vec_ctsl > - vec_ctul > - vec_ld2f > - vec_st2f > > are deprecated. Also deprecate helper builtins vec_ctd_s64 and > vec_ctd_u64. > > Furthermore, t

Re: [PATCH] s390: Streamline vector builtins with LLVM

2024-03-11 Thread Andreas Krebbel
On 3/1/24 10:29, Stefan Schulze Frielinghaus wrote: > Similar as to s390_lcbb, s390_vll, s390_vstl, et al. make use of a > signed vector type for vlbb. Furthermore, a const void pointer seems > more common and an integer for the mask. > > For s390_vfi(s,d)b make use of integers for masks, too. >

Re: [PATCH] s390: Fix test vector/long-double-to-i64.c

2024-03-11 Thread Andreas Krebbel
On 2/29/24 13:15, Stefan Schulze Frielinghaus wrote: > Starting with r14-8319-g86de9b66480b71 fwprop improved so that vpdi is > no longer required. > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/vector/long-double-to-i64.c: Fix scan > assembler directive. Should we perhaps rather

Re: [PATCH] s390: Fix tests rosbg_si_srl and rxsbg_si_srl

2024-03-11 Thread Andreas Krebbel
On 2/29/24 13:14, Stefan Schulze Frielinghaus wrote: > Starting with r14-2047-gd0e891406b16dc two SI mode tests are optimized > into DI mode. Thus, the scan-assembler directives fail. For example > RTL expression > > (ior:SI (subreg:SI (lshiftrt:DI (reg:DI 69) > (const_int 2 [0x2]))

Re: [PATCH] s390: Fix TARGET_SECONDARY_RELOAD for non-SYMBOL_REFs

2024-03-11 Thread Andreas Krebbel
On 2/29/24 13:13, Stefan Schulze Frielinghaus wrote: > RTX X must not necessarily be a SYMBOL_REF and may e.g. be an > UNSPEC_GOTENT for which SYMBOL_FLAG_NOTALIGN2_P fails. > > gcc/ChangeLog: > > * config/s390/s390.cc (s390_secondary_reload): Guard > SYMBOL_FLAG_NOTALIGN2_P. Ok. Than

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

2024-02-19 Thread Andreas Krebbel
On 2/19/24 13:39, Ilya Leoshkevich wrote: > DSE, DCE, and other passes are removing redundant signaling comparisons > from these tests, but the whole point is to check that GCC knows how to > emit them. Use -fno-delete-dead-exceptions to prevent that. > > gcc/testsuite/ChangeLog: > > * g

Re: [PATCH] [s390] target/112280 - properly guard permute query

2024-01-11 Thread Andreas Krebbel
On 1/11/24 14:58, Richard Biener wrote: > The following adds guards avoiding code generation to > expand_perm_as_a_vlbr_vstbr_candidate when d.testing_p. > > Built and tested on the testcase in the PR. > > OK to push as obvious? Otherwise please pick up, test and push. Ok to commit now. Thanks

[Committed] IBM Z: Cover weak symbols with -munaligned-symbols

2023-12-18 Thread Andreas Krebbel
With the recently introduced -munaligned-symbols option byte-sized variables which are resolved externally are considered to be potentially misaligned. However, this should rather also be applied to symbols which resolve locally if they are weak. Done with this patch. Committed to mainline. gcc/C

Re: [PATCH] s390: Fix expansion of vec_step

2023-12-06 Thread Andreas Krebbel
On 12/4/23 11:14, Stefan Schulze Frielinghaus wrote: > Add missing "s390" while expanding vec_step to __builtin_s390_vec_step. > > gcc/ChangeLog: > > * config/s390/vecintrin.h (vec_step): Expand vec_step to > __builtin_s390_vec_step. Ok, Thanks! Andreas

Re: [PATCH] testsuite: Fix up gcc.target/s390/pr96127.c test for modern C [PR96127]

2023-12-06 Thread Andreas Krebbel
On 12/3/23 19:36, Jakub Jelinek wrote: > Hi! > > I've noticed this test regressed on s390x-linux with the addition of the > switch to modern C patchset. Haven't tried to reproduce the ICE, but as it > was a backend ICE and FE after warning used to add such casts before (now > errors), I think thi

Re: [PATCH] s390x: Fix PR112753

2023-11-30 Thread Andreas Krebbel
On 11/30/23 16:45, Juergen Christ wrote: > Commit 466b100e5fee808d77598e0f294654deec281150 introduced a bug in > s390_md_asm_adjust if vector extensions are not available. Fix the control > flow of this function to not adjust long double values. > > gcc/ChangeLog: > > * config/s390/s390.cc

Re: [PATCH] s390: Fix builtin-classify-type-1.c on s390 too [PR112725]

2023-11-30 Thread Andreas Krebbel
On 11/30/23 17:34, Jakub Jelinek wrote: > On Wed, Nov 29, 2023 at 07:27:20PM +0100, Jakub Jelinek wrote: >> Given that the s390 backend defines pretty much the same target hook >> as rs6000, I believe it suffers (at least when using -mvx?) the same >> problem as rs6000, though admittedly this is so

Re: [PATCH] s390: Add missing builtin type

2023-11-27 Thread Andreas Krebbel
On 11/27/23 13:38, Stefan Schulze Frielinghaus wrote: > One builtin type slipped through the cracks of the last commits. > > Bootstrapped on s390. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390-builtin-types.def (BT_FN_UV8HI_UV8HI_UINT): > Add missing builtin type. Ok

Re: [PATCH] s390: Fixup builtins vec_rli and verll

2023-11-27 Thread Andreas Krebbel
On 11/27/23 10:53, Stefan Schulze Frielinghaus wrote: > Commit 248df13b966f46649e16dc3c8c92b263790ef503 restricted the rotate > count to immediates. Although the documentation of vec_rli (Vector > Element Rotate Left Immediate) can be read as if it where restricted to > immediates, this is not the

Re: [PATCH] s390: Streamline NNPA builtins with their LLVM counterparts

2023-11-27 Thread Andreas Krebbel
Ok, thanks! Andreas On 11/27/23 10:12, Stefan Schulze Frielinghaus wrote: > Ping. > > On Thu, Nov 16, 2023 at 01:07:30PM +0100, Stefan Schulze Frielinghaus wrote: >> For the opaque NNP-data type prefer unsigned over signed integer types. >> >> gcc/ChangeLog: >> >> * config/s390/s390-builtin

Re: [PATCH] s390: Fix constraint for insn *cmphi_ccu

2023-11-27 Thread Andreas Krebbel
Ok, thanks! Andreas On 11/27/23 10:12, Stefan Schulze Frielinghaus wrote: > Ping. > > On Wed, Oct 25, 2023 at 11:27:33AM +0200, Stefan Schulze Frielinghaus wrote: >> Currently for an unsigned 16-bit comparison between memory and an >> immediate where the high bit is set, a clc is emitted. This

Re: [PATCH] s390: Fix builtins floating-point convert to/from fixed

2023-11-27 Thread Andreas Krebbel
Ok, thanks! Andreas On 11/27/23 10:11, Stefan Schulze Frielinghaus wrote: > Ping. > > On Tue, Nov 14, 2023 at 04:19:59PM +0100, Stefan Schulze Frielinghaus wrote: >> Remove flags for non-existing operands 2 and 3. >> >> Bootstrapped on s390. Ok for mainline? >> >> gcc/ChangeLog: >> >> * co

Re: [PATCH] s390: implement flags output

2023-11-23 Thread Andreas Krebbel
On 11/15/23 14:15, Juergen Christ wrote: > Implement flags output for inline assemblies. Only use one output constraint > that captures the whole condition code. No breakout into different condition > codes is allowed. Also, only one condition code variable is allowed. > > Add further logic to

Re: [PATCH] s390: split int128 load

2023-11-23 Thread Andreas Krebbel
On 11/15/23 14:15, Juergen Christ wrote: > Issue two loads when using GPRs instead of one load-multiple. > > Bootstrapped and tested on s390. OK for mainline? > > gcc/ChangeLog: > > * config/s390/s390.md: Split TImode loads. > > gcc/testsuite/ChangeLog: > > * gcc.target/s390/int12

Re: [PATCH] s390: Fix ICE in testcase pr89233

2023-11-23 Thread Andreas Krebbel
On 11/15/23 14:12, Juergen Christ wrote: > When using GNU vector extensions, an access outside of the vector size > caused an ICE on s390. Fix this by aligning with the vec_extract > builtin, i.e., computing constant index modulo number of lanes. > > Fixes testcase gcc.target/s390/pr89233.c. > >

Re: [PATCH] s390: Fix generation of s390-gen-builtins.h

2023-11-15 Thread Andreas Krebbel
On 11/15/23 14:29, Stefan Schulze Frielinghaus wrote: > By default the preprocessed output includes linemarkers. This leads to > an error if -pedantic is used as e.g. during bootstrap: > > s390-gen-builtins.h:1:3: error: style of line directive is a GCC extension > [-Werror] > > Fixed by omitti

Re: [PATCH] s390: Fix vec_scatter_element for vectors of floats

2023-11-14 Thread Andreas Krebbel
On 11/14/23 12:44, Stefan Schulze Frielinghaus wrote: > The offset for vec_scatter_element of floats should be a vector of type > UV4SI instead of V4SF. Note, this is an incompatibility change. > > Bootstrapped on s390. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390-builtin-t

[Committed] IBM Z: Add GTY marker to builtin data structures

2023-11-14 Thread Andreas Krebbel
This adds GTY markers to s390_builtin_types, s390_builtin_fn_types, and s390_builtin_decls. These were missing causing problems in particular when using builtins after including a precompiled header. Unfortunately the declaration of these data structures use enum values from s390-builtins.h. This

[Committed] IBM Z: Fix ICE with overloading and checking enabled

2023-11-14 Thread Andreas Krebbel
s390_resolve_overloaded_builtin, when called on NON_DEPENDENT_EXPR, ICEs when using the type from it which ends up as error_mark_node. This particular instance of the problem does not occur anymore since NON_DEPENDENT_EXPR has been removed. Nevertheless that case needs to be handled here. Bootst

Re: [PATCH] s390: Reduce number of patterns where the condition is false anyway

2023-11-09 Thread Andreas Krebbel
On 11/9/23 09:24, Stefan Schulze Frielinghaus wrote: > For patterns which make use of two modes, do not build the cross product > and then exclude illegal combinations via conditions but rather do not > create those in the first place. Here we are following the idea of the > attribute TOINTVEC/toi

Re: [PATCH 2/3] s390: Add expand_perm_reverse_elements

2023-11-09 Thread Andreas Krebbel
On 11/9/23 09:22, Stefan Schulze Frielinghaus wrote: > Replace expand_perm_with_rot, expand_perm_with_vster, and > expand_perm_with_vstbrq with a general implementation > expand_perm_reverse_elements. > > Bootstrapped and regtested on s390. Ok for mainline? > > gcc/ChangeLog: > > * config

Re: [PATCH 3/3] s390: Revise vector reverse elements

2023-11-09 Thread Andreas Krebbel
On 11/9/23 09:22, Stefan Schulze Frielinghaus wrote: > Replace UNSPEC_VEC_ELTSWAP with a vec_select implementation. > > Furthermore, for a vector reverse elements operation between registers > of mode V8HI perform three rotates instead of a vperm operation since > the latter involves loading the p

Re: [PATCH 1/3] s390: Recognize further vpdi and vmr{l,h} pattern

2023-11-09 Thread Andreas Krebbel
On 11/9/23 09:22, Stefan Schulze Frielinghaus wrote: > Deal with cases where vpdi and vmr{l,h} are still applicable if the > operands of those instructions are swapped. For example, currently for > > V2DI foo (V2DI x) > { > return (V2DI) {x[1], x[0]}; > } > > the assembler sequence > > vlgvg

Re: [PATCH] s390: fix htm-builtins test cases

2023-10-25 Thread Andreas Krebbel
On 10/25/23 16:50, Juergen Christ wrote: > Transactional and non-transactional stores to the same cache line cause > transactions to abort on newer generations. Add sufficient padding to make > sure another cache line is used. > > Tested on s390. > > gcc/testsuite/ChangeLog: > > * gcc.tar

Re: [PATCH] s390: Fix expander popcountv8hi2_vx

2023-10-16 Thread Andreas Krebbel
On 10/16/23 13:20, Stefan Schulze Frielinghaus wrote: > The normal form of a CONST_INT which represents an integer of a mode > with fewer bits than in HOST_WIDE_INT is sign extended. This even holds > for unsigned integers. > > This fixes an ICE during cse1 where we bail out at rtl.h:2297 since >

Re: [PATCH] s390: Make use of new copysign RTL

2023-10-06 Thread Andreas Krebbel
On 10/5/23 08:46, Stefan Schulze Frielinghaus wrote: > gcc/ChangeLog: > > * config/s390/s390.md: Make use of new copysign RTL. Ok. Thanks! Andreas > --- > gcc/config/s390/s390.md | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/gcc/config/s390/s390.md b/gcc

Re: [PATCH] s390: Fix builtins vec_rli and verll

2023-09-11 Thread Andreas Krebbel via Gcc-patches
On 9/11/23 08:56, Stefan Schulze Frielinghaus wrote: > On Mon, Aug 28, 2023 at 11:33:37AM +0200, Andreas Krebbel wrote: >> Hi Stefan, >> >> do you really need to introduce a new flag for U64 given that the type of >> the builtin is unsigned long? > > In f

Re: [PATCH] s390: Fix builtins vec_rli and verll

2023-08-28 Thread Andreas Krebbel via Gcc-patches
Hi Stefan, do you really need to introduce a new flag for U64 given that the type of the builtin is unsigned long? Andreas On 8/21/23 17:56, Stefan Schulze Frielinghaus wrote: > The second argument of these builtins is an unsigned immediate. For > vec_rli the API allows immediates up to 64 bit

Re: [PATCH] s390: Fix some builtin definitions

2023-08-28 Thread Andreas Krebbel via Gcc-patches
On 8/21/23 17:58, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested on s390. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390-builtins.def (s390_vec_signed_flt): Fix > builtin flag. > (s390_vec_unsigned_flt): Ditto. > (s390_vec_revb_flt): Ditto. >

Re: [PATCH] s390: Try to emit vlbr/vstbr instead of vperm et al.

2023-08-03 Thread Andreas Krebbel via Gcc-patches
On 8/3/23 08:51, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested on s390x. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390.cc (expand_perm_as_a_vlbr_vstbr_candidate): > New function which handles bswap patterns for vec_perm_const. > (vectorize_vec_per

Re: [PATCH] s390: Enable vect_bswap test cases

2023-08-03 Thread Andreas Krebbel via Gcc-patches
On 8/3/23 08:48, Stefan Schulze Frielinghaus wrote: > This enables the following tests which rely on instruction vperm which > is available since z13 with the initial vector support. > > testsuite/gcc.dg/vect/vect-bswap16.c > 42:/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {

[Committed] IBM Z: Handle unaligned symbols

2023-08-01 Thread Andreas Krebbel via Gcc-patches
The IBM Z ELF ABI mandates every symbol to reside on a 2 byte boundary in order to be able to use the larl instruction. However, in some situations it is difficult to enforce this, e.g. for common linker scripts as used in the Linux kernel. This patch introduces the -munaligned-symbols option. When

Re: [PATCH] s390: Optimize vec_cmpge followed by vec_sel

2023-07-17 Thread Andreas Krebbel via Gcc-patches
On 7/17/23 17:09, Juergen Christ wrote: > A vec_cmpge produces a negation. Replace this negation by swapping the two > selection choices of a vec_sel based on the result of the vec_cmpge. > > Bootstrapped and regression tested on s390x. > > gcc/ChangeLog: > > * config/s390/vx-builtins.md:

Re: [PATCH] s390: Fix vec_init default expander

2023-07-07 Thread Andreas Krebbel via Gcc-patches
On 7/7/23 15:51, Juergen Christ wrote: > Do not reinitialize vector lanes to zero since they are already initialized to > zero. > > Bootstrapped and regression tested on s390x. > > gcc/ChangeLog: > > * config/s390/s390.cc (vec_init): Fix default case > > gcc/Testsuite/ChangeLog: > >

[Committed] IBM zSystems: Assume symbols without explicit alignment to be ok

2023-06-26 Thread Andreas Krebbel via Gcc-patches
A change we have committed back in 2015 relies on the backend requested ABI alignment to be applied to ALL symbols by the middle-end. However, this does not appear to be the case for external symbols. With this commit we assume all symbols without explicit alignment to be aligned according to the A

Re: [PATCH] libgcc: Use initarray section type for .init_stack

2023-05-25 Thread Andreas Krebbel via Gcc-patches
On 3/20/23 07:33, Kewen.Lin wrote: > Hi, > > One of my workmates found there is a warning like: > > libgcc/config/rs6000/morestack.S:402: Warning: ignoring > incorrect section type for .init_array.0 > > when compiling libgcc/config/rs6000/morestack.S. > > Since commit r13-6545 touched

Re: [PATCH] s390: Implement TARGET_ATOMIC_ALIGN_FOR_MODE

2023-05-16 Thread Andreas Krebbel via Gcc-patches
On 5/16/23 08:43, Stefan Schulze Frielinghaus wrote: > So far atomic objects are aligned according to their default alignment. > For 128 bit scalar types like int128 or long double this results in an > 8 byte alignment which is wrong and must be 16 byte. > > libstdc++ already computes a correct al

Re: [PATCH 0/3] Refactor memory block operations

2023-05-15 Thread Andreas Krebbel via Gcc-patches
On 5/15/23 09:17, Stefan Schulze Frielinghaus wrote: > Bootstrapped and regtested. Ok for mainline? > > Stefan Schulze Frielinghaus (3): > s390: Refactor block operation cpymem > s390: Add block operation movmem > s390: Refactor block operation setmem > > gcc/config/s390/s390-protos.h

Re: [PATCH] s390: Fix ifcvt test cases

2023-03-03 Thread Andreas Krebbel via Gcc-patches
On 3/2/23 19:13, Robin Dapp wrote: > Hi, > > we seem to flip flop between the "high" and "not low" variants of load on > condition. Accept both in the affected test cases. > > Going to commit this as obvious. > > Regards > Robin > > -- > > gcc/testsuite/ChangeLog: > > * gcc.target/s39

Re: [PATCH] s390: libatomic: Fix 16 byte atomic {cas,load,store}

2023-03-03 Thread Andreas Krebbel via Gcc-patches
On 3/2/23 16:24, Stefan Schulze Frielinghaus wrote: > This is a follow-up to commit a4c6bd0821099f6b8c0f64a96ffd9d01a025c413 > introducing a runtime check for alignment for 16 byte atomic > compare-exchange, load, and store. > > Bootstrapped and regtested on s390. > Ok for mainline and gcc-{12,11,

Re: [PATCH] s390: Use arch14 instead of z16 for -march=native.

2023-03-03 Thread Andreas Krebbel via Gcc-patches
On 3/2/23 19:17, Robin Dapp wrote: > Hi, > > When compiling on a system where binutils do not yet support the 'z16' > name assembling fails with -march=native which we currently interpret > as -march=z16 (on a z16 machine). This patch uses -march=arch14 > instead. > > Is it OK? Ok. Thanks! And

Re: [PATCH] s390: Add LEN_LOAD/LEN_STORE support.

2023-02-27 Thread Andreas Krebbel via Gcc-patches
On 2/27/23 11:13, Robin Dapp wrote: >> Do you really need a copy of the address register? Couldn't you just do a >> src = adjust_address (operands[1], BLKmode, 0); >> You create a paradoxical subreg of the QImode input but vll actually >> uses the whole 32 bit value. Couldn't we end up with uniniti

Re: [PATCH] IBM zSystems: Do not propagate scheduler state across basic blocks [PR108102]

2023-02-13 Thread Andreas Krebbel via Gcc-patches
On 2/11/23 16:59, Stefan Schulze Frielinghaus wrote: > So far we propagate scheduler state across basic blocks within EBBs and > reset the state otherwise. In certain circumstances the entry block of > an EBB might be empty, i.e., no_real_insns_p is true. In those cases > scheduler state is not r

Re: [PATCH] IBM zSystems: Fix predicate execute_operation

2023-02-13 Thread Andreas Krebbel via Gcc-patches
On 2/11/23 17:10, Stefan Schulze Frielinghaus wrote: > Use constrain_operands in order to check whether there exists a valid > alternative instead of extract_constrain_insn which ICEs in case no > alternative is found. > > Bootstrapped and regtested on IBM zSystems. Ok for mainline? > > gcc/Chan

Re: [PATCH] s390: Add LEN_LOAD/LEN_STORE support.

2023-02-13 Thread Andreas Krebbel via Gcc-patches
On 2/2/23 09:43, Robin Dapp wrote: > Hi, > > this patch adds LEN_LOAD/LEN_STORE support for z14 and newer. > It defines a bias value of -1 and implements the LEN_LOAD and LEN_STORE > optabs. > > It also includes various vll/vstl testcases adapted from Kewen Lin's patch > for Power. > > Bootstrap

[PATCH 2/3] IBM zSystems: Make stack_tie to work with hard frame-pointer

2023-02-01 Thread Andreas Krebbel via Gcc-patches
With this patch a scheduling barrier is created to prevent the insn setting up the frame-pointer and instructions which save GPRs to the stack to be swapped. Otherwise broken CFI information would be generated since the stack save insns would use a base register which is not currently declared as

[PATCH 3/3] IBM zSystems: Save argument registers to the stack -mpreserve-args

2023-02-01 Thread Andreas Krebbel via Gcc-patches
This adds support for preserving the content of parameter registers to the stack and emit CFI for it. This useful for applications which want to implement their own stack unwinding and need access to function arguments without having to rely on debug information. With the -mpreserve-args option GP

[PATCH 1/3] New reg note REG_CFA_NORESTORE

2023-02-01 Thread Andreas Krebbel via Gcc-patches
This patch introduces a new reg note which can be used to tell the CFI verification in dwarf2cfi that a register is stored without intending to restore from it. This is useful when storing e.g. register contents to the stack and generate CFI for it although the register is not really supposed to b

[Committed 0/3] IBM zSystems: Add -mpreserve-args option

2023-02-01 Thread Andreas Krebbel via Gcc-patches
GPRs and FPRs are save to the stack slots which are reserved for stdargs in the register save area. The introduction of REG_CFA_NORESTORE is a common code change which has been approved last year already. Bootstrapped and regtested on s390x. Committed to mainline. Andreas Krebbel (3): New reg

Re: [PATCH v2] IBM zSystems: Fix TARGET_D_CPU_VERSIONS

2023-01-24 Thread Andreas Krebbel via Gcc-patches
On 1/24/23 09:47, Stefan Schulze Frielinghaus wrote: > In the context of D the interpretation of S390, S390X, and SystemZ is a > bit fuzzy. The wording S390X was wrongly deprecated in favour of > SystemZ by commit > https://github.com/dlang/dlang.org/commit/3b50a4c3faf01c32234d0ef8be5f82915a61c23f

Re: PING: New reg note REG_CFA_NORESTORE

2023-01-11 Thread Andreas Krebbel via Gcc-patches
On 12/27/22 19:23, Jeff Law wrote: > > > On 12/13/22 01:55, Andreas Krebbel via Gcc-patches wrote: >> Hi, >> >> I need a way to save registers on the stack and generate proper CFI for it. >> Since I do not intend to >> restore them I needed a way t

[Committed] IBM zSystems: Use NAND instruction to implement bit not

2023-01-11 Thread Andreas Krebbel via Gcc-patches
Bootstrapped and regression tested on s390x. Committed to mainline. gcc/ChangeLog: * config/s390/s390.md (*not): New pattern. gcc/testsuite/ChangeLog: * gcc.target/s390/not.c: New test. --- gcc/config/s390/s390.md | 8 gcc/testsuite/gcc.target/s390/not.c

[Committed] IBM zSystems: Make -fcall-saved-... work.

2023-01-10 Thread Andreas Krebbel via Gcc-patches
Committed to mainline. Bootstrap and regression tests are clean. gcc/ChangeLog: * config/s390/s390.cc (s390_register_info): Check call_used_regs instead of hard-coding the register numbers for call saved registers. (s390_optimize_register_info): Likewise. gcc/test

  1   2   3   4   5   6   7   8   9   10   >