[PATCH] s390: Implement vec_revb(vector short)/bswapv8hi with, verllh.

2022-08-12 Thread Robin Dapp via Gcc-patches
Hi, this patch implements a byte swap for a V8HImode vector via an element rotate by 8 bits. Bootstrapped and regtested, no regressions. Is it OK? Regards Robin gcc/ChangeLog: PR target/100867 * config/s390/vector.md: Add special case for V8HImode. gcc/testsuite/ChangeLog:

[PATCH] s390: Recognize reverse/element swap permute patterns.

2022-08-12 Thread Robin Dapp via Gcc-patches
Hi, this adds functions to recognize reverse/element swap permute patterns for vler, vster as well as vpdi and rotate. Bootstrapped and regtested, no regressions. Is it OK? Regards Robin gcc/ChangeLog: * config/s390/s390.cc (expand_perm_with_vpdi): Recognize swap pattern.

[PATCH] s390: Use vpdi and verllg in vec_reve.

2022-08-12 Thread Robin Dapp via Gcc-patches
Hi, swapping the two elements of a V2DImode or V2DFmode vector can be done with vpdi instead of using the generic way of loading a permutation mask from the literal pool and vperm. Analogous to the V2DI/V2DF case reversing the elements of a four-element vector can be done by first swapping the

[PATCH] s390: Add z15 to s390_issue_rate.

2022-08-12 Thread Robin Dapp via Gcc-patches
Hi, this patch tries to be more explicit by mentioning z15 in s390_issue_rate. No changes in testsuite, bootstrap or SPEC obviously. Is it OK? Regards Robin gcc/ChangeLog: * config/s390/s390.cc (s390_issue_rate): Add z15. --- gcc/config/s390/s390.cc | 1 + 1 file changed, 1

[PATCH] s390: Add -munroll-only-small-loops.

2022-08-12 Thread Robin Dapp via Gcc-patches
Hi, inspired by Power we also introduce -munroll-only-small-loops. This implies activating -funroll-loops and -munroll-only-small-loops at -O2 and above. Bootstrapped and regtested. This introduces one regression in gcc.dg/sms-compare-debug-1.c but currently dumps for sms are broken as well.

[PATCH] s390: Add scheduler description for z16

2022-04-13 Thread Robin Dapp via Gcc-patches
file mode 100644 index 000..bc97bc50b78 --- /dev/null +++ b/gcc/config/s390/3931.md @@ -0,0 +1,2562 @@ +;; Scheduling description for z16. +;; Copyright (C) 2022 Free Software Foundation, Inc. +;; Contributed by Robin Dapp (rd...@linux.ibm.com) + +;; This file is part of GCC. + +;; GCC

[PATCH] testsuite/s390: Silence warning in pr80725.c

2022-04-13 Thread Robin Dapp via Gcc-patches
Hi, this test case checks that we do not ICE but FAILs because of -Wint-to-pointer-cast. Silence this warning. Is it OK? Regards Robin gcc/testsuite/ChangeLog: * gcc.target/s390/pr80725.c: Add -Wno-int-to-pointer-cast. --- gcc/testsuite/gcc.target/s390/pr80725.c | 2 +- 1 file

[PATCH] testsuite/s390: Adapt test expections.

2022-04-04 Thread Robin Dapp via Gcc-patches
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: * gcc.target/s390/zvector/vec-double-compile.c: Expect vl

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

2022-04-04 Thread Robin Dapp via Gcc-patches
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: * gcc.target/s390/ifcvt-two-insns-bool.c: Change nle to h. *

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

2022-04-04 Thread Robin Dapp via Gcc-patches
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 distribute patterns pass on s390 for this test.

Re: [PATCH] arc: Fix for new ifcvt behavior [PR104154]

2022-03-01 Thread Robin Dapp via Gcc-patches
Hi Claudiu, > The patch looks good. Please go ahead and merge it, please let me know if > you cannot. I merged the patch leaving your check if (cmode != SImode && cmode != SFmode && cmode != DFmode) return NULL_RTX; in place. It is not strictly necessary anymore but I figured it also

Re: [committed] arc: Fail conditional move expand patterns

2022-02-25 Thread Robin Dapp via Gcc-patches
> If the movcc comparison is not valid it triggers an assert in the > current implementation. This behavior is not needed as we can FAIL > the movcc expand pattern. In case of a MODE_CC comparison you can also just return it as described here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104154

[PATCH] s390: Change SET rtx_cost handling.

2022-02-25 Thread Robin Dapp via Gcc-patches
: * gcc.target/s390/vector/vec-sum-across-no-lower-subreg-1.c: New test. >From 8c4c6f029dbf0c9db12c2877189a5ec0ce0a9c89 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 3 Feb 2022 12:50:04 +0100 Subject: [PATCH] s390: Change SET rtx_cost handling. The IF_THEN_ELSE detect

Re: [PATCH] Don't do int cmoves for IEEE comparisons, PR target/104256.

2022-02-23 Thread Robin Dapp via Gcc-patches
Hi, > Robin's patch has the effct making rs6000_emit_int_cmove return false for > floating point comparisons, so I marked the bug as being a duplicate of PR > target/104335. Didn't I just return false for MODE_CC? This should not affect proper floating-point comparisons. It looks like the

[PATCH] arc: Fix for new ifcvt behavior [PR104154]

2022-02-20 Thread Robin Dapp via Gcc-patches
. Thank you. Regards Robin -- PR104154 gcc/ChangeLog: * config/arc/arc.cc (gen_compare_reg): Return the CC-mode comparison ifcvt passed us. --- >From fa98a40abd55e3a10653f6a8c5b2414a2025103b Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Mon, 7 Feb 2022 08:39:41 +0

Re: [PATCH] rs6000: Workaround for new ifcvt behavior [PR104335]

2022-02-17 Thread Robin Dapp via Gcc-patches
> Please send patches as plain text, not as base64. It seems like Thunderbird does not support this anymore since later versions, grml. Probably need to look for another mail client. > Why that first test? XEXP (op, 0) is required to not be nil. > > The patch is okay without that (if it

[PATCH] rs6000: Workaround for new ifcvt behavior [PR104335]

2022-02-16 Thread Robin Dapp via Gcc-patches
9ebde57266 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 10 Feb 2022 09:01:51 -0600 Subject: [PATCH] rs6000: Workaround for new ifcvt behavior [PR104335]. Since r12-6747-gaa8cfe785953a0 ifcvt passes a "cc comparison" i.e. the representation of the result of a comparison to the

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

2022-02-08 Thread Robin Dapp via Gcc-patches
> Patch is ok. Thanks! As discussed off-list, committed as attached. Regards Robin commit 1e3185e714e877b2b4d14ade0865322f71a8cbf6 Author: Robin Dapp Date: Tue Feb 8 14:56:29 2022 +0100 s390: Increase costs for load on condition and change movqicc expander. This patch chan

Re: s390: Fix bootstrap -Wformat-diag errors

2022-02-03 Thread Robin Dapp via Gcc-patches
Hi Martin, > Either this: > >error ("% is unknown", orig_p); > > or this would be better: > >error ("attribute % is unknown", orig_p); > > The %< %> directives will render it in single quotes like keywords and > identifiers. Using %qs would render it in double quotes like a string, >

Re: ifcvt: Fix PR104153 and PR104198

2022-02-03 Thread Robin Dapp via Gcc-patches
> Do you need to adjust anything now that this is emitting into TEMP > rather than TARGET? The idea now is to emit to TEMP in the first pass and check if we read the initial condition. Overwriting the condition (and of course reading it in every sequence) is the reason temporaries were needed

s390: Fix bootstrap -Wformat-diag errors

2022-02-02 Thread Robin Dapp via Gcc-patches
format strings.commit 41270791b1d1235d580b6d81c315c74ad07c1807 Author: Robin Dapp Date: Tue Feb 1 10:13:52 2022 +0100 s390: Fix bootstrap by splitting format string. Recently -Werror=format-diag was turned on for bootstrap which broke s390 bootstrap. This patch splits

ifcvt: Fix PR104153 and PR104198

2022-02-01 Thread Robin Dapp via Gcc-patches
* ifcvt.cc (noce_convert_multiple_sets_1): Copy rtx instead of using it directly. Rework comparison handling and always perform a second pass. gcc/testsuite/ChangeLog: * gcc.dg/pr104198.c: New test.commit 68489d5729b4879bf2df540753fc7ea8ba1565a5 Author: Robin Dapp Date: Mon Jan 2

[PATCH] s390: Split CCSmode into CCSINT and CCSFP

2022-01-20 Thread Robin Dapp via Gcc-patches
. (s390_branch_condition_mask): Likewise. (s390_reverse_condition): Likewise. * config/s390/s390.h (REVERSIBLE_CC_MODE): Likewise. * config/s390/s390.md: Likewise. * config/s390/subst.md: Likewise.commit d3d4f8486340ff889de0dd709262f31953c54eda Author: Robin Dapp

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

2022-01-20 Thread Robin Dapp via Gcc-patches
/ChangeLog: * config/s390/s390.cc (s390_rtx_costs): Increase costs for load on condition. * config/s390/s390.md: Change mov[qi/si]cc expander.commit b246f96c2a2813d0e509e7916744cda07cc5131c Author: Robin Dapp Date: Fri Jun 18 10:51:22 2021 +0200 s390: Increase costs

Re: [PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-11 Thread Robin Dapp via Gcc-patches
> Could you try the attached? The series with the patch is OK from a testsuite point of view. The other problem appears later. Regards Robin

Re: [PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-11 Thread Robin Dapp via Gcc-patches
Hi Richard, > Could you try the attached? build and bootstrap look OK with it. Testsuite shows lots of fallout but the proper bisect isn't finished yet. The commit before your series is still fine - the problem could also be after it, though. Will report back later. Thanks Robin

Re: [PATCH 5/6] ira: Consider modelling caller-save allocations as loop spills

2022-01-11 Thread Robin Dapp via Gcc-patches
Hi Richard, this causes a bootstrap error on s390 (where IRA_HARD_REGNO_ADD_COST_MULTIPLIER is defined). rclass is used in the #define-guarded area. I guess you also wanted to move this to the new function ira_caller_save_cost? Regards Robin -- ../../gcc/ira-costs.c: In function ‘void

Re: [PATCH] vect: Add bias parameter for partial vectorization

2022-01-10 Thread Robin Dapp via Gcc-patches
Hi Richard, > I think it would be better to fold this into the existing documentation > a bit more: [..] done. Fixed the remaining nits in the attached v5. Bootstrap and regtest are good on s390x, Power9 and i386. Regards Robin -- gcc/ChangeLog: * config/rs6000/vsx.md: Use const0

Re: [PATCH v3 7/7] ifcvt: Run second pass if it is possible to omit a temporary.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/ChangeLog: * ifcvt.c (noce_convert_multiple_sets_1): New function. (noce_convert_multiple_sets): Call function a second time if we can improve the first try.

Re: [PATCH v3 6/7] testsuite/s390: Add tests for noce_convert_multiple.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/testsuite/ChangeLog: * gcc.dg/ifcvt-4.c: Remove s390-specific check. * gcc.target/s390/ifcvt-two-insns-bool.c: New test. * gcc.target/s390/ifcvt-two-insns-int.c: New test. * gcc.target/s390/ifcvt-two-insns-long.c: New

Re: [PATCH v3 5/7] ifcvt: Try re-using CC for conditional moves.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/ChangeLog: * ifcvt.c (cond_exec_get_condition): New parameter to allow getting the reversed comparison. (try_emit_cmove_seq): New function to facilitate creating a cmov sequence. (noce_convert_multiple_sets):

Re: [PATCH v3 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/ChangeLog: * rtl.h (struct rtx_comparison): New struct that holds an rtx comparison. * config/rs6000/rs6000.c (rs6000_emit_minmax): Use struct instead of single parameters. (rs6000_emit_swsqrt): Likewise.

Re: [PATCH v3 3/7] ifcvt: Improve costs handling for noce_convert_multiple.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/ChangeLog: * ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Estimate insns costs. (noce_process_if_block): Use potential costs.

Re: [PATCH v3 2/7] ifcvt: Allow constants for noce_convert_multiple.

2022-01-10 Thread Robin Dapp via Gcc-patches
Posting the ChangeLog before pushing. -- gcc/ChangeLog: * ifcvt.c (noce_convert_multiple_sets): Allow constants. (bb_ok_for_noce_convert_multiple_sets): Likewise.

Re: [PATCH v3 1/7] ifcvt: Check if cmovs are needed.

2022-01-10 Thread Robin Dapp via Gcc-patches
Hi, I included the outstanding minor remarks and believe everything is OK'ed now. Still posting the ChangeLogs that I omitted before continuing. I'd expect some fallout on other targets (hopefully nothing major) since rtx costs are handled differently now for this code path. Regards Robin --

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-12-13 Thread Robin Dapp via Gcc-patches
Hi Richard, I incorporated all your remarks (sorry for the hunk from a different branch) except for this one: > Think it would be better to make it: > > if (use_bias_adjusted_len) > { > gcc_assert (i == 0); > > But do we need to do this? Code should only care

Re: [PATCH v3 7/7] ifcvt: Run second pass if it is possible to omit a temporary.

2021-12-10 Thread Robin Dapp via Gcc-patches
Regards Robincommit 63926561fcdeace9e07b0240fc929b47b7b99404 Author: Robin Dapp Date: Fri Sep 17 20:22:10 2021 +0200 ifcvt: Run second pass if it is possible to omit a temporary. If one of the to-be-converted SETs requires the original comparison (i.e. in order to generate a min/max insn) b

Re: [PATCH v3 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-12-09 Thread Robin Dapp via Gcc-patches
Hi Jeff, thanks for looking into this. > What if the condition has a side effect?  Doesn't this drop the side > effect by converting the conditional move into a simple move? Hmm, good point, if the condition does more than a CC compare, it might get tricky as we are not canonicalizing here (on

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-12-07 Thread Robin Dapp via Gcc-patches
Hi Kewen, Richard, thanks for the comments, I addressed them in the attached v4. Bootstrap and regtest are good as before. Regards Robindiff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index bf033e31c1c..dc2756f83e9 100644 --- a/gcc/config/rs6000/vsx.md +++

[PATCH v3 7/7] ifcvt: Run second pass if it is possible to omit a temporary.

2021-12-06 Thread Robin Dapp via Gcc-patches
If one of the to-be-converted SETs requires the original comparison (i.e. in order to generate a min/max insn) but no other insn after it does, we can omit creating temporaries, thus facilitating costing. --- gcc/ifcvt.c | 33 +++-- 1 file changed, 31 insertions(+), 2

[PATCH v3 6/7] testsuite/s390: Add tests for noce_convert_multiple.

2021-12-06 Thread Robin Dapp via Gcc-patches
Add new s390-specific tests that check if we convert two SETs into two loads on condition. Remove the s390-specific target-check in gcc.dg/ifcvt-4.c. --- gcc/testsuite/gcc.dg/ifcvt-4.c| 2 +- .../gcc.target/s390/ifcvt-two-insns-bool.c| 39 +++

[PATCH v3 5/7] ifcvt: Try re-using CC for conditional moves.

2021-12-06 Thread Robin Dapp via Gcc-patches
Following up on the previous patch, this patch makes noce_convert_multiple emit two cmov sequences: The same one as before and a second one that tries to re-use the existing CC. Then their costs are compared and the cheaper one is selected. --- gcc/ifcvt.c | 112

[PATCH v3 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-12-06 Thread Robin Dapp via Gcc-patches
Currently we only ever call emit_conditional_move with the comparison (as well as its comparands) we got from the jump. Thus, backends are going to emit a CC comparison for every conditional move that is being generated instead of re-using the existing CC. This, combined with emitting temporaries

[PATCH v3 2/7] ifcvt: Allow constants for noce_convert_multiple.

2021-12-06 Thread Robin Dapp via Gcc-patches
This lifts the restriction of not allowing constants for noce_convert_multiple. The code later checks if a valid sequence is produced anyway. --- gcc/ifcvt.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index c98668d5646..4642176957e

[PATCH v3 3/7] ifcvt: Improve costs handling for noce_convert_multiple.

2021-12-06 Thread Robin Dapp via Gcc-patches
When noce_convert_multiple is called the original costs are not yet initialized. Therefore, up to now, costs were only ever unfairly compared against COSTS_N_INSNS (2). This would lead to default_noce_conversion_profitable_p () rejecting all but the most contrived of sequences. This patch

[PATCH v3 1/7] ifcvt: Check if cmovs are needed.

2021-12-06 Thread Robin Dapp via Gcc-patches
When if-converting multiple SETs and we encounter a swap-style idiom if (a > b) { tmp = c; // [1] c = d; d = tmp; } ifcvt should not generate a conditional move for the instruction at [1]. In order to achieve that, this patch goes through all relevant SETs and

[PATCH v3 0/7] ifcvt: Convert multiple

2021-12-06 Thread Robin Dapp via Gcc-patches
if I'm not mistaken, 5/7, 6/7 (very minor) and 7/7 still need review. Robin Dapp (7): ifcvt: Check if cmovs are needed. ifcvt: Allow constants for noce_convert_multiple. ifcvt: Improve costs handling for noce_convert_multiple. ifcvt/optabs: Allow using a CC comparison for emit_conditiona

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-11-12 Thread Robin Dapp via Gcc-patches
Hi Richard, > It's hard to judge this in isolation because it's not clear when > and how the new arguments are going to be used, but it seems OK > in principle. Do you still want: > > /* If earliest == jump, try to build the cmove insn directly. > This is helpful when combine has created

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-11-12 Thread Robin Dapp via Gcc-patches
Hi Kewen and Richard, the attached v3 addresses the comments to v2, among others: - Rename to load_store where appropriate. - Save the adjusted length as a separate control that is used instead of loop_len with a bias != 0 and added to the loop header. - Update the costs to reflect a bias.

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-11-03 Thread Robin Dapp via Gcc-patches
Ping :) Not wanting to pester but I'd have hoped to get this into stage1 still as it helps performance on s390 in some cases. Expecting there will be some more reviewing rounds for the remaining patches, would I need to open a PR in order to be able to "officially" commit this in a later stage?

Re: [PATCH] vect: Add bias parameter for partial vectorization

2021-11-02 Thread Robin Dapp via Gcc-patches
Hi, thanks for the helpful comments. The attached v2 addresses the following points from them: - Save the bias in loop_vinfo and set it once in vect_verify_loop_lens. - Add code to handle the bias in vect_set_loop_controls_directly. - Adjust costing. - Add comments for the new len_load

[PATCH] vect: Add bias parameter for partial vectorization

2021-10-28 Thread Robin Dapp via Gcc-patches
not support lengths of zero bytes and a bias of -1 should be used. Bootstrapped and regtested on Power9 (--with-cpu=power9) and s390 (--with-arch=z15). The tiny changes in the Power backend I will post separately. Regards Robincommit 18a5fcd0f8835247e86d86fb018789fe755404be Author: Robin Dapp Date

Re: [RFC] Partial vectors for s390

2021-10-26 Thread Robin Dapp via Gcc-patches
where we exclude multiple loop_lens is still missing. Would we also check for a viable bias there and then either accept multiple lens or not? Regards Robincommit 2320dbfdfe1477b15a2ac59847d2a52e68de49ab Author: Robin Dapp Date: Tue Oct 26 14:36:08 2021 +0200 bias1 diff --git a/gcc

[RFC] Partial vectors for s390

2021-10-20 Thread Robin Dapp via Gcc-patches
Hi, I have been playing around with making Kewen's partial vector changes workable with s390: We have a vll instruction that can be passed the highest byte to load. The rather unfortunate consequence of this is that a length of zero cannot be specified. The partial vector framework,

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-10-18 Thread Robin Dapp via Gcc-patches
ther archs. Regards Robin commit eb50384ee0cdeeefa61ae89bdbb2875500b7ce60 Author: Robin Dapp Date: Wed Nov 27 13:53:40 2019 +0100 ifcvt/optabs: Allow using a CC comparison for emit_conditional_move. Currently we only ever call emit_conditional_move with the comparison (as w

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-10-14 Thread Robin Dapp via Gcc-patches
Hi Richard, (2) Insert: if (SUBREG_P (src)) src = SUBREG_REG (src); here. OK with those changes if that works. Let me know if they don't — I'll try to be quicker with the next review. thank you, this looks good in a first testsuite run on s390. If you have time, would you

[PATCH 8/7] ifcvt: Second try in order to avoid unnecessary temporaries

2021-09-28 Thread Robin Dapp via Gcc-patches
and regtested on s390, x86 and ppc64. Regards Robin -- gcc/ChangeLog: * ifcvt.c (noce_convert_multiple_sets): Perform a second try with less temporaries. commit dd5a0f8d7d39447025d36ed5305709d38fe3f16b Author: Robin Dapp Date: Fri Sep 17 20:22:10 2021 +0200 ifcvt: Run second pass

Re: [PATCH] combine: Check for paradoxical subreg

2021-09-24 Thread Robin Dapp via Gcc-patches
Hi, pinging this patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573509.html It introduces a check for a paradoxical subreg in combine that would ICE otherwise. Regards Robin

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-09-15 Thread Robin Dapp via Gcc-patches
n't manage to trigger it myself). Regards Robin commit 2d909ee93ee1eb0f7474ed57581713367c22ba6c Author: Robin Dapp Date: Thu Jun 24 16:40:04 2021 +0200 ifcvt: Check if cmovs are needed. When if-converting multiple SETs and we encounter a swap-style idiom if (a > b)

Re: [PATCH 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-07-27 Thread Robin Dapp via Gcc-patches
Hmm, OK. Doesn't expanding both versions up-front create the same kind of problem that the patch is fixing, in that we expand (and therefore cost) both the reversed and unreversed comparison? Also… [..] …for min/max, I would have expected this swap to create the canonical operand order for

Re: [PATCH 5/7] ifcvt: Try re-using CC for conditional moves.

2021-07-22 Thread Robin Dapp via Gcc-patches
Hi, v2 now properly gets the reversed CC comparison. It also handles a cost2 == 0 situation that would prefer an empty seq2 before. Regards Robin >From 12b796c4e081ba8a2e136958f4bf919c63516de6 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 24 Jun 2021 15:22:42 +0200 Subject: [PATCH

Re: [PATCH 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-07-22 Thread Robin Dapp via Gcc-patches
obin >From 0526fa57290941c8b7febd138ab4c637b83f3d05 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Wed, 27 Nov 2019 13:53:40 +0100 Subject: [PATCH v2 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move. Currently we only ever call emit_conditional_move with the comparison (a

Re: [PATCH 3/7] ifcvt: Improve costs handling for noce_convert_multiple.

2021-07-22 Thread Robin Dapp via Gcc-patches
rom 54508fa00fbee082fa62f4e1a8167f477938e781 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Wed, 27 Nov 2019 13:46:17 +0100 Subject: [PATCH v2 3/7] ifcvt: Improve costs handling for noce_convert_multiple. When noce_convert_multiple is called the original costs are not yet initialized. Therefore, up to

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-07-22 Thread Robin Dapp via Gcc-patches
in the condition as well. If needed this could be two separate patches (most of the second patch would be comments, though). Regards Robin >From bf7e372d7f48e614f20676c7cf4b2fbde741d4fc Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 24 Jun 2021 16:40:04 +0200 Subject: [PATCH v2 1/7] ifcvt: Ch

Re: [PATCH 0/7] ifcvt: Convert multiple

2021-07-13 Thread Robin Dapp via Gcc-patches
Ping :)

Re: [PATCH] combine: Check for paradoxical subreg

2021-07-05 Thread Robin Dapp via Gcc-patches
gcc/ChangeLog: * combine.c (try_combine): Check for paradoxical subreg. ping.

[PATCH 7/7] s390: Increase costs for load on condition and change movqicc expander.

2021-06-25 Thread Robin Dapp via Gcc-patches
--- gcc/config/s390/s390.c | 2 +- gcc/config/s390/s390.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 6bbeb640e1f..e3b1f99669f 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3636,7 +3636,7

[PATCH 3/7] ifcvt: Improve costs handling for noce_convert_multiple.

2021-06-25 Thread Robin Dapp via Gcc-patches
When noce_convert_multiple is called the original costs are not yet initialized. Therefore, up to now, costs were only ever unfairly compared against COSTS_N_INSNS (2). This would lead to default_noce_conversion_profitable_p () rejecting all but the most contrived of sequences. This patch

[PATCH 2/7] ifcvt: Allow constants for noce_convert_multiple.

2021-06-25 Thread Robin Dapp via Gcc-patches
This lifts the restriction of not allowing constants for noce_convert_multiple. The code later checks if a valid sequence is produced anyway. --- gcc/ifcvt.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index eef6490626a..6006055f26a

[PATCH 6/7] testsuite/s390: Add tests for noce_convert_multiple.

2021-06-25 Thread Robin Dapp via Gcc-patches
Add new s390-specific tests that check if we convert two SETs into two loads on condition. Remove the s390-specific target-check in gcc.dg/ifcvt-4.c. --- gcc/testsuite/gcc.dg/ifcvt-4.c| 2 +- .../gcc.target/s390/ifcvt-two-insns-bool.c| 39 +++

[PATCH 5/7] ifcvt: Try re-using CC for conditional moves.

2021-06-25 Thread Robin Dapp via Gcc-patches
Following up on the previous patch, this patch makes noce_convert_multiple emit two cmov sequences: The same one as before and a second one that tries to re-use the existing CC. Then their costs are compared and the cheaper one is selected. --- gcc/ifcvt.c | 94

[PATCH 0/7] ifcvt: Convert multiple

2021-06-25 Thread Robin Dapp via Gcc-patches
situation on s390 and, in general, allows more accurate costing. Regards Robin Robin Dapp (7): ifcvt: Check if cmovs are needed. ifcvt: Allow constants for noce_convert_multiple. ifcvt: Improve costs handling for noce_convert_multiple. ifcvt/optabs: Allow using a CC comparison for emit_condit

[PATCH 4/7] ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.

2021-06-25 Thread Robin Dapp via Gcc-patches
Currently we only ever call emit_conditional_move with the comparison (as well as its comparands) we got from the jump. Thus, backends are going to emit a CC comparison for every conditional move that is being generated instead of re-using the existing CC. This, combined with emitting temporaries

[PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-06-25 Thread Robin Dapp via Gcc-patches
When if-converting multiple SETs and we encounter a swap-style idiom if (a > b) { tmp = c; // [1] c = d; d = tmp; } ifcvt should not generate a conditional move for the instruction at [1]. In order to achieve that, this patch goes through all relevant SETs and

[PATCH] combine: Check for paradoxical subreg

2021-06-23 Thread Robin Dapp via Gcc-patches
cal subreg. >From 2b74c66f8d97c30c45e99336c9871cccd8cf94e1 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 22 Jun 2021 17:35:37 +0200 Subject: [PATCH 11/11] combine paradoxical subreg fix. --- gcc/combine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/combine.c

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

2021-06-09 Thread Robin Dapp via Gcc-patches
(eq (match_operand: 3 "register_operand" "") Ah, yes, it's indeed much simpler that way. Attached the revised version with the small change and the new tests as a single patch now. Regtest and bootstrap was successful. Regards Robin >From 790feb49a6494c33f0fd4386a8148e0a4

Re: [PATCH] testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c

2021-06-09 Thread Robin Dapp via Gcc-patches
gcc/testsuite/ChangeLog:     * gcc.dg/vect/pr56541.c: Add vect_floatint_cvt. OK.  I'd tend to use XFAIL for a compiler bug that we haven't fixed.  In this case the target doesn't support what the test is trying to do.  So skipping the test in one manner or another seems better. Just

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-09 Thread Robin Dapp via Gcc-patches
As you say, the logic is convoluted.  Let's simplify it rather than make it more convoluted.  One possibility would be to change || to | to avoid the shortcut, and then bool note = lastalign > curalign; if (note)     curalign = lastalign; I went with your suggestion in the attached v2. 

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-01 Thread Robin Dapp via Gcc-patches
This is the revised testsuite change with v2 adding a check for no separate note for __attribute__((aligned (32), aligned (4)). Regards Robin diff --git a/gcc/testsuite/c-c++-common/Wattributes.c b/gcc/testsuite/c-c++-common/Wattributes.c index 4ad90441b4d..a97e5ad5f74 100644 ---

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-06-01 Thread Robin Dapp via Gcc-patches
As you say, the logic is convoluted. Let's simplify it rather than make it more convoluted. One possibility would be to change || to | to avoid the shortcut, and then bool note = lastalign > curalign; if (note) curalign = lastalign; I went with your suggestion in the attached v2.

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-25 Thread Robin Dapp via Gcc-patches
Hi Martin and Jason, The removal of the dead code looks good to me.  The change to "re-init lastalign" doesn't seem right.  When it's zero it means the conflict is between two attributes on the same declaration, in which case the note shouldn't be printed (it would just point to the same

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-17 Thread Robin Dapp via Gcc-patches
on s390 a warning test fails: inline int ATTR ((cold, aligned (8))) finline_hot_noret_align (int); inline int ATTR ((warn_unused_result)) finline_hot_noret_align (int); inline int ATTR ((aligned (4))) finline_hot_noret_align (int); /* { dg-warning "ignoring attribute .aligned \\(4\\).

Re: [PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-10 Thread Robin Dapp via Gcc-patches
Ping.

[PATCH] s390: Add more vcond_mask patterns.

2021-05-05 Thread Robin Dapp via Gcc-patches
vcond_mask with mixed mode. (vcond_mask_): Dito. gcc/testsuite/ChangeLog: * gcc.target/s390/vector/vcond-mixed-double.c: New test. * gcc.target/s390/vector/vcond-mixed-float.c: New test. >From 4ce2d9a3f43c44d35142a726921258540adfca51 Mon Sep 17 00:00:00 2001 From: Ro

[PATCH] testsuite: Add s390 to vect_*_cvt checks

2021-05-05 Thread Robin Dapp via Gcc-patches
Hi, this patch adds some s390 checks for vect_*_cvts. Is it OK? Regards Robin gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add s390 checks for vect conversions. >From 959251d5d2684a9ffebec1b341a4413c2f2328db Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 22 Apr 2021

[PATCH] testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c

2021-05-05 Thread Robin Dapp via Gcc-patches
ter an xfail with ! vect_floatint_cvt? Regards Robin gcc/testsuite/ChangeLog: * gcc.dg/vect/pr56541.c: Add vect_floatint_cvt. >From 4c19323b2c392923391a3c37b92054852d671c19 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 22 Apr 2021 09:22:07 +0200 Subject: [PATCH 03/1

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

2021-05-04 Thread Robin Dapp via Gcc-patches
pattern. >From ca1a204ff1753f4902bb58668d0ceafcc17d1232 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 27 Apr 2021 16:17:35 +0200 Subject: [PATCH] testsuite/s390: Fix risbg-ll-3.c f2_cconly test. Instead of selecting bits 62 to (wraparound) 59 from r2 and inserting them into r3, we sel

[PATCH] testsuite: Add s390 to gcc.dg/vect/slp-21.c

2021-05-04 Thread Robin Dapp via Gcc-patches
Hi, on s390 we vectorize 4 statements using SLP. Add s390*-*-* to the appropriate dg-finals. Is that OK? Regards Robin gcc/testsuite/ChangeLog: * gcc.dg/vect/slp-21.c: Add s390. >From 5f31f411ee36be8c8f3000cfc07b2609796142b7 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue,

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

2021-05-04 Thread Robin Dapp via Gcc-patches
Hi, Yeah, that's because of the very limited analysis we do in the backend to detect such cases. In fact we probably would want to have an OSC break in many of them as well. For me the testcase appears to work with -O2 on all the -march levels. I think -O2 would be preferred because that's

[PATCH 2/2] testsuite: Fix Wattributes test cases for s390 and add new test

2021-05-03 Thread Robin Dapp via Gcc-patches
/Wattributes-6.c: Dito. >From 0bfe8dff9190862e514e735053d50ea2426dbde7 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Tue, 16 Mar 2021 11:52:32 +0100 Subject: [PATCH 2/2] testsuite: Fix Wattributes test cases for s390 and add new test. There are several FAILs because we have an s390-specific ch

[PATCH 1/2] c-family: Copy DECL_USER_ALIGN even if DECL_ALIGN is similar.

2021-05-03 Thread Robin Dapp via Gcc-patches
gcc/c-family/ChangeLog: * c-attribs.c (common_handle_aligned_attribute): Re-init lastalign and remove case. gcc/c/ChangeLog: * c-decl.c (merge_decls): Copy DECL_USER_ALIGN even for similar DECL_ALIGN. gcc/cp/ChangeLog: * decl.c (duplicate_decls): Dito. >From f3a9f8b9

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

2021-04-16 Thread Robin Dapp via Gcc-patches
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. Is it OK? Regards Robin -- gcc/testsuite/ChangeLog:

Re: [PATCH] testsuite: Move gimplefe40.c and gimplefe41.c

2021-04-16 Thread Robin Dapp via Gcc-patches
Do the testcases currently fail? How? In principle moving to vect/ is OK but then having the gimplefe testcases in one place is nice ... yes, they ICE on targets that do not have vector capabilities: gimplefe-40.c:7:1: internal compiler error: in emit_move_insn, at expr.c:3821 Normally we

[PATCH] testsuite: Move gimplefe40.c and gimplefe41.c

2021-04-15 Thread Robin Dapp via Gcc-patches
tory. Is this OK? Regards Robin -- gcc/testsuite/ChangeLog: * gcc.dg/gimplefe-40.c: Moved to... * gcc.dg/vect/gimplefe-40.c: ...here. * gcc.dg/gimplefe-41.c: Moved to... * gcc.dg/vect/gimplefe-41.c: ...here. commit 1acd4d01c41aeea78ec3c188beb25b245dda4c8b

Re: [PATCH] [dlang/phobos] S/390: Fix PR91628

2019-11-28 Thread Robin Dapp
> OK from me, what about earlier comments of using __asm__ in a C > source file? > > I wouldn't really object to converting all .S sources (infact I can > do this myself) if it meant slightly better portability. Adding to yesterday's message: feel free to apply the current version if it's OK.

Re: [PATCH] [dlang/phobos] S/390: Fix PR91628

2019-11-27 Thread Robin Dapp
Hi Iain, > OK from me, what about earlier comments of using __asm__ in a C > source file? I don't mind too much either way but I gathered from the discussion in the bugzilla that .S was preferred for now. Regards Robin

[PATCH] [dlang/phobos] S/390: Fix PR91628

2019-11-27 Thread Robin Dapp
Hi, in order to not use a glibc-internal symbol anymore, this patch adds separate .S files for s390x and s390 that allow to obtain the tls offset. I bootstrapped on s390x -m64 and -m31 and test on s390x, s390 seeing no new regressions. Regards Robin -- libphobos/ChangeLog: 2019-11-27 Robin

[PATCH] S/390: Add undef for MUSL_DYNAMIC_LINKERxx

2019-11-26 Thread Robin Dapp
Hi, I committed this patch (obvious). It fixes the s390 bootstrap by undefining existing defines before redefining them. Regards Robin -- gcc/ChangeLog: 2019-11-26 Robin Dapp * config/s390/linux.h: Add undef for MUSL_DYNAMIC_LINKERxx. commit

Re: [PATCH/RFC] Simplify wrapped RTL op

2019-08-29 Thread Robin Dapp
>> PR37451. Not clear what target that regressed on, btw. > > And PR55190 and PR67288 and probably more. Thanks for finding those. So the hope is to get this fixed or rather move towards a fix with the patch series that's currently reviewed which injects some doloop knowledge into ivopts? As

[PATCH/RFC] Simplify wrapped RTL op

2019-08-27 Thread Robin Dapp
Hi, as announced in the wrapped-binop gimple patch mail, on s390 we still emit odd code in front of loops: void v1 (unsigned long *in, unsigned long *out, unsigned int n) { int i; for (i = 0; i < n; i++) { out[i] = in[i]; } } --> aghi%r1,-8 srlg

<    3   4   5   6   7   8   9   10   >