[PATCH] Improved handling of shifts/rotates in bit CCP.

2021-08-22 Thread Roger Sayle
therefore avoids changing any cases that potentially might invoke undefined behavior. This patch does optimize (x<<((y&31)|8))&255. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. OK for mainlin

[PATCH] Improved handling of division/modulus in bit CCP.

2021-08-22 Thread Roger Sayle
t; with no new failures. Ok for mainline? 2021-08-22 Roger Sayle gcc/ChangeLog * tree-ssa-ccp.c (bit_value_binop) [TRUNC_MOD_EXPR, TRUNC_DIV_EXPR]: Provide bounds for unsigned (and signed with non-negative operands) division and modulus. Roger -- diff --git a/gcc/tree-ssa-ccp.

[PATCH] Simplify (truncate:QI (subreg:SI (reg:QI x))) to (reg:QI x)

2021-08-19 Thread Roger Sayle
accurately prevent us generating dubious RTL for) those. This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and "make -k check" with no new failures. Ok for mainline? 2021-08-20 Roger Sayle gcc/ChangeLog * simplify-rtx.c (simplify_truncation): Generalize simp

[PATCH] nvptx: Add a __PTX_ISA__ predefined macro based on target ISA.

2021-08-19 Thread Roger Sayle
ful for implementing clock() on nvptx in newlib. Ok for mainline? 2021-08-19 Roger Sayle gcc/ChangeLog * config.gcc (nvptx-*-*): Define {c,c++}_target_objs. * config/nvptx/nvptx-protos.h (nvptx_cpu_cpp_builtins): Prototype. * config/nvptx/nvptx.h (TARGET_CPU_CPP_

RE: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass.

2021-08-20 Thread Roger Sayle
run CSiBE with -m32 and get back to you with the results. Roger -- -Original Message- From: Richard Biener Sent: 20 August 2021 08:29 To: Roger Sayle Cc: GCC Patches Subject: Re: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass. On Thu, Aug 19, 2021 at 6:01 PM Roger Sa

[PATCH] Fold sign of LSHIFT_EXPR to eliminate no-op conversions.

2021-08-22 Thread Roger Sayle
; } This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-23 Roger Sayle gcc/ChangeLog * match.pd (shift transformations): Change the sign of an LSHIFT_EXPR if it re

RE: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass.

2021-08-23 Thread Roger Sayle
Many thanks. Here’s the version that I've committed with a ??? comment as requested (even a no-op else clause to make the logic easier to understand). 2021-08-24 Roger Sayle Richard Biener gcc/ChangeLog * config/i386/i386-features.c (compute_convert_gain): Provide

[PATCH] nvptx: Use cvt to perform sign-extension of truncation.

2021-08-27 Thread Roger Sayle
ing newlib) and a "make check" with no new regressions. Ok for mainline? 2021-08-27 Roger Sayle gcc/ChangeLog * config/nvptx/nvptx.md (*extend_trunc_2_qi, *extend_trunc_2_hi, *extend_trunc_di2_si): New insns. Use cvt to perform sign-extension of truncation in one

[PATCH] Only simplify TRUNCATE to SUBREG on TRULY_NOOP_TRUNCATION targets

2021-08-27 Thread Roger Sayle
n the tree [nvptx is currently a STORE_FLAG_VALUE=-1 target]. Ok for mainline? 2021-08-27 Roger Sayle gcc/ChangeLog * combine.c (combine_simplify_rtx): Avoid converting an explicit TRUNCATE into a lowpart SUBREG on !TRULY_NOOP_TRUNCATION targets. * simplify-rtx.c (simplif

RE: [PATCH] Preserve SUBREG_PROMOTED_VAR_P on (extend:HI (subreg/s:QI (reg:SI)))

2021-08-31 Thread Roger Sayle
help testing the attached patch on an affected target would be much appreciated. Sorry for the inconvenience. Roger -- -Original Message- From: Christophe LYON Sent: 31 August 2021 13:32 To: Roger Sayle ; 'GCC Patches' Subject: Re: [PATCH] Preserve SUBREG_PROMOTED_VAR_P on (extend:HI

[Committed] Fix subreg_promoted_mode breakage on various platforms

2021-08-31 Thread Roger Sayle
-gnu (just in case), and confirmation/pre-approval from Jeff Law that this indeed fixes the build failures seen on several platforms. My humble apologies again. 2021-08-31 Roger Sayle gcc/ChangeLog * expr.c (convert_modes): Don't use subreg_promoted_mode on a SUBREG if it can't be

[PATCH] C: PR c/79412: Poison decls with error_mark_node after type mismatch

2021-08-31 Thread Roger Sayle
on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2020-08-31 Roger Sayle gcc/c/ChangeLog PR c/79412 * c-decl.c (duplicate_decls): On significant mismatches, mark the types of both (non-function) decl

[Committed] PR middle-end/102031: Fix typo/mistake in simplify_truncation patch

2021-08-24 Thread Roger Sayle
a full "make bootstrap" and "make -k check" on x86_64-pc-linux-gnu with no new regressions. 2021-08-24 Roger Sayle gcc/ChangeLog PR middle-end/102031 * simplify-rtx.c (simplify_truncation): When comparing precisions use "subreg_prec" varia

[Committed] Restore build on !TARGET_TRULY_NOOP_TRUNCATION targets

2021-08-23 Thread Roger Sayle
has been committed as obvious, after testing that it restores the build on nvptx-none and with a "make bootstrap" on x86_64-pc-linux-gnu to guarantee no surprises [make -k check is underway]. Sorry again. 2021-08-23 Roger Sayle gcc/ChangeLog * simplify-rtx.c (simplify_unary_o

[PATCH] Preserve SUBREG_PROMOTED_VAR_P on (extend:HI (subreg/s:QI (reg:SI)))

2021-08-29 Thread Roger Sayle
ck" with no new failures, and on a cross-compiler to nvptx-none, where the function "long foo(char x) { return x; }" now requires one less instruction. OK for mainline? 2021-08-29 Roger Sayle gcc/ChangeLog * expr.c (convert_modes): Preserve SUBREG_PROMOTED_VAR_P when

[PATCH take 3] Experimental -fpreserve-traps option

2021-08-29 Thread Roger Sayle
. In C++, division by zero is undefined behaviour; having a flag brings us one step closer to implementation defined. This patch has been tested on x86_64-pc-linux-gnu with a "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-29 Roger Sayl

RE: [PATCH take 3] Experimental -fpreserve-traps option

2021-08-30 Thread Roger Sayle
, Roger -- -Original Message- From: Richard Biener Sent: 30 August 2021 08:13 To: Roger Sayle Cc: GCC Patches ; Eric Botcazou Subject: Re: [PATCH take 3] Experimental -fpreserve-traps option On Sun, Aug 29, 2021 at 11:28 AM Roger Sayle wrote: > > > This is another attempt to

[PATCH] PR middle-end/100810: Penalize IV candidates with undefined value bases

2021-08-31 Thread Roger Sayle
pefully, the tree-loop optimization experts agree with my analysis/fix. This patch has been tested on x86_64-pc-linux-gnu with a "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-31 Roger Sayle Andrew Pinski gcc/ChangeLo

RE: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass.

2021-08-20 Thread Roger Sayle
n advance, Roger -- -Original Message- From: Richard Biener Sent: 20 August 2021 08:29 To: Roger Sayle Cc: GCC Patches Subject: Re: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass. On Thu, Aug 19, 2021 at 6:01 PM Roger Sayle wrote: > > > Doh! ENOPATCH. > &g

[PATCH] Fold more constants during veclower pass.

2021-08-19 Thread Roger Sayle
0, 0 }; v = y_4; return; } This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check". Ok for mainline? 2021-08-18 Roger Sayle gcc/ChangeLog * tree-vect-generic.c (expand_vector_operations_1): Use either gimplify_build1 o

[x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass.

2021-08-19 Thread Roger Sayle
has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-19 Roger Sayle gcc/ChangeLog * config/i386/i386-features.c (compute_convert_gain): Provide more accurate values for CONST_

RE: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass.

2021-08-19 Thread Roger Sayle
Doh! ENOPATCH. -Original Message- From: Roger Sayle Sent: 19 August 2021 16:59 To: 'GCC Patches' Subject: [x86_64 PATCH] Tweak -Os costs for scalar-to-vector pass. Back in June I briefly mentioned in one of my gcc-patches posts that a change that should have always reduced code

[Committed] PR middle-end/102029: Stricter typing in LSHIFT_EXPR sign folding.

2021-08-23 Thread Roger Sayle
, after testing that a "make bootstrap" on x86_64-pc-linux-gnu is unaffected [make -k check is underway]. Sorry (yet) again. 2021-08-23 Roger Sayle Jakub Jelinek gcc/ChangeLog PR middle-end/102029 * match.pd (shift transformations): Add an additi

[PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-05 Thread Roger Sayle
gnu with "make bootstrap" and "make -k check" with no new failures, and also on nvptx-none with no new failures. Ok for mainline? 2021-09-05 Roger Sayle gcc/ChangeLog * simplify-rtx.c (simplify_subreg): Optimize paradoxical subreg extensions of TRUNCATE. R

[PATCH] Correct implementation of wi::clz

2021-09-05 Thread Roger Sayle
is a multiple of HOST_BITS_PER_WIDE_INT. The fix is simply to reorder/shuffle the existing tests. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-05 Roger Sayle gcc/ChangeLog

[PATCH] More NEGATE_EXPR folding in match.pd

2021-09-09 Thread Roger Sayle
tested on x86_64-pc-linux-gnu with a "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-09 Roger Sayle gcc/ChangeLog * generic-match-head.c (single_use_is_op_p): New helper function. * gimple-match-head.c (single_use_is_

[PATCH Take 2] More NEGATE_EXPR folding in match.pd

2021-09-10 Thread Roger Sayle
t;make -k check" with no new failures. Ok for mainline? 2021-09-10 Roger Sayle Richard Biener gcc/ChangeLog * match.pd (negation simplifications): Implement some negation folding transformations from fold-const.c's fold_negate_expr.

[PATCH] PR c/102245: Don't warn that ((_Bool)x<<0) isn't a truthvalue.

2021-09-13 Thread Roger Sayle
86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-13 Roger Sayle gcc/c-family/ChangeLog PR c/102245 * c-common.c (c_common_truthvalue_conversion) [LSHIFT_EXPR]: Special case (optimize) sh

[PATCH] Also preserve SUBREG_PROMOTED_VAR_P in expr.c's convert_move.

2021-09-11 Thread Roger Sayle
a problem) minimized the inconvenience]. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures, and on a cross-compiler to nvptx-none, with no new failures in its testsuite. OK for mainline? 2021-09-11 Roger Sa

[PATCH #2] PR c/102245: Disable sign-changing optimization for shifts by zero.

2021-09-14 Thread Roger Sayle
nd "make -k check" with no new failures. Note that test1 in the new testcase is changed from dg-bogus to dg-warning compared with version #1. Ok for mainline? 2021-09-14 Roger Sayle gcc/ChangeLog PR c/102245 * match.pd (shift optimizations): Disable recent sign

RE: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-06 Thread Roger Sayle
you think. Best regards, Roger -- -Original Message- From: Segher Boessenkool Sent: 06 September 2021 11:14 To: Roger Sayle Cc: 'GCC Patches' Subject: Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE On Sun, Sep 05, 2021 at 11:28:30PM +0100, Roger Sayle wrote: >

[PATCH] PR middle-end/88173: More constant folding of NaN comparisons.

2021-09-18 Thread Roger Sayle
k/research whether and why those checks may have been removed in the past]. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-18 Roger Sayle gcc/ChangeLog PR middle-end/88

[PATCH] nvptx: Add (experimental) support for HFmode with -misa=sm_53

2021-09-16 Thread Roger Sayle
description (follow-up patches) in future. I'm happy to defer these changes/hunks until later if reviewers prefer. The following has been tested on nvptx-none, hosted on x86_64-pc-linux-gnu with a "make" and "make -k check" with no new failures. Ok for mainline? 2020-09-16 Roger Sa

[PATCH] nvptx: Adds uses of -misa=sm_75 and -misa=sm_80

2021-09-17 Thread Roger Sayle
in future). Are both parts Ok for mainline? 2020-09-17 Roger Sayle gcc/ChangeLog * config/nvptx/nvptx.md (define_c_enum "unspec"): New UNSPEC_TANH. (define_mode_iterator HSFM): New iterator for HFmode and SFmode. (exp2hf2): New define_insn controlled by TARGE

[Committed] Make gimple_could_trap_p const-safe.

2021-07-13 Thread Roger Sayle
const gimple (such as gimple_has_side_effects), and update its prototypes. These chunks have been (re)tested on x86_64-pc-linux-gnu with a "make bootstrap" and "make -k check" with no new failures. Committed to mainline as obvious/pre-approved. 2021-07-13 Roger Sayle

RE: [PATCH take 2] Fold (X<

2021-08-05 Thread Roger Sayle
ow, and that synth_mult (and the addition form) should also avoid generating this insn? Thanks in advance, Roger -- From: Christophe Lyon Sent: 05 August 2021 14:53 To: Roger Sayle Cc: GCC Patches ; Marc Glisse Subject: Re: [PATCH take 2] Fold (X<mailto:ro...@nextmovesoftware.com&g

[PATCH] Improved handling of MULT_EXPR in bit CCP.

2021-08-09 Thread Roger Sayle
no bits that are guaranteed to be set. I have no evidence that this functionality causes performance issues, it's just that sparse multipliers provide the largest benefit to CCP. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new

[PATCH] Recognize highpart multiplication during RTL expansion

2021-08-08 Thread Roger Sayle
t;make -k check", and on x86-pc-linux-gnu with a "make bootstrap" and "make -k check" both with no new failures. Future work may also support WIDEN_MULT_EXPR and larger shifts, but the current matching is already complex enough for v1.0. Ok for mainline? 2021-08-08 Roger

[PATCH] Improve handling of unknown sign bit in CCP.

2021-08-08 Thread Roger Sayle
h has been tested on x86_64-pc-linux-gnu with a "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-08 Roger Sayle gcc/ChangeLog * tree-ssa-ccp.c (value_mask_to_min_max): Helper function to determine the upper and lower

[PATCH] Recognize highpart multiplication during RTL expansion

2021-08-08 Thread Roger Sayle
Doh! ENOPATCH. This time with attachments... https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576922.html Roger -- diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index 108de1c..2b18f6a 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -614,6

[PATCH] Improved handling of MINUS_EXPR in bit CCP.

2021-08-12 Thread Roger Sayle
h this patch is now simplified to the constant value 2. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-08-12 Roger Sayle gcc/ChangeLog * tree-ssa-ccp.c (bit_value_binop) [MINUS_E

RE: [r12-2640 Regression] FAIL: gcc.target/i386/dec-cmov-2.c scan-assembler-not test(l|q|w) on Linux/x86_64

2021-07-31 Thread Roger Sayle
these failures. Committed as obvious. 2021-07-31 Roger Sayle gcc/testsuite/ChangeLog * gcc.target/i386/dec-cmov-2.c: Require -march=core2 with -m32. Roger -- -Original Message- From: sunil.k.pandey Sent: 31 July 2021 08:13 To: gcc-patches@gcc.gnu.org; gcc-regress

[PATCH] Optimize x ? bswap(x) : 0 in tree-ssa-phiopt

2021-07-31 Thread Roger Sayle
check" with no new failures. Ok for mainline? 2021-07-31 Roger Sayle gcc/ChangeLog * tree-ssa-phiopt.c (cond_removal_in_builtin_zero_pattern): Renamed from cond_removal_in_popcount_clz_ctz_pattern. Add support for BSWAP, FFS, PARITY and CLRSB builtins. (tre

[Committed] Use CFN_BUILT_IN_CLRSB instead of BUILT_IN_CLRSB in switch.

2021-08-06 Thread Roger Sayle
). This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Committed as obvious. 2021-08-06 Roger Sayle gcc/ChangeLog * tree-ssa-phiopt.c (cond_removal_in_builtin_zero_pattern): Use CFN_BUILT_IN_CLRSB* inste

[PATCH] Introduce sh_mul and uh_mul RTX codes for high-part multiplications

2021-09-25 Thread Roger Sayle
ref warnings in invoke.texi. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-25 Roger Sayle gcc/ChangeLog * gcc/rtl.def (SH_MULT, UH_MULT): New RTX codes for representing

[PATCH] Make flag_trapping_math a non-binary Boolean.

2021-09-25 Thread Roger Sayle
4-pc-linux-gnu with "make bootstrap" and "make -k check", all languages including Ada, with no new failures. Ok for mainline? 2021-09-25 Roger Sayle gcc/ChangeLog * flag-types.h (trapping_math_model): New enumeration (of bits) specifying possible floating-

[PATCH v2] x86_64: Some SUBREG related optimization tweaks to i386 backend.

2021-10-13 Thread Roger Sayle
. I've left the existing behaviour the same, so that memory-to-memory moves (continue to) use ix86_gen_scatch_sse_rtx. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-10-13 Roger Sa

[Committed] Tweak new test cases for -march=cascadelake strangeness.

2021-10-08 Thread Roger Sayle
of these differences. Tested on x86_64-pc-linux-gnu (with and without -march=cascadelake). 2021-10-08 Roger Sayle gcc/testsuite/ChangeLog * gcc.target/i386/sse2-mmx-paddsb-2.c: Test for -128 or 128. * gcc.target/i386/sse2-mmx-paddusb-2.c: Test for -1 or 255. * gcc.target

[PATCH] bfin: Popcount-related improvements to machine description.

2021-10-17 Thread Roger Sayle
); R0.L = ONES R0; R0 = R1 & R0; rts; This patch has been tested on a cross-compiler to bfin-elf hosted on x86_64-pc-linux-gnu, but without a toolchain, and shows no regressions in the compile-only parts of the testsuite. Ok for mainline? 2021-10-17 Roger Sayle gcc/Chang

[PATCH] Constant fold SS_NEG and SS_ABS in simplify-rtx.c

2021-10-17 Thread Roger Sayle
to: _foo: nop; nop; nop; R0 = 32767 (X); rts; _bar: nop; nop; R0 = -1 (X); R0.H = 32767; rts; This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for

[PATCH] x86_64: Some SUBREG related optimization tweaks to i386 backend.

2021-10-11 Thread Roger Sayle
-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. In theory, my recent "obvious" regexp fix to accommodate -march=cascadelake is no longer required, but there's no harm leaving the testsuite as it is. Ok for mainline? 2021-10-11

[PATCH] PR target/102785: Correct addsub/subadd patterns on bfin.

2021-10-18 Thread Roger Sayle
evaluating these expressions at compile-time, when the mismatch was caught by the testsuite. Many thanks to Jeff Law for confirming that this patch fixes these regressions on bfin-elf. Ok for mainline? 2021-10-18 Roger Sayle gcc/ChangeLog PR target/102785 * config/bfin/bfin.md

[PATCH] Allow early sets of SSE hard registers from standard_sse_constant_p

2021-10-15 Thread Roger Sayle
uot;make bootstrap" and "make -k check" on x86_64-pc-linux-gnu with no new failures. Ok for mainline? Sorry again for the temporary inconvenience. 2021-10-15 Roger Sayle gcc/ChangeLog * config/i386/i386.c (ix86_hardreg_mov_ok): For vector modes, allow standard_s

RE: [PATCH] Make flag_trapping_math a non-binary Boolean.

2021-09-28 Thread Roger Sayle
middle-end. Indeed, if flag_trapping_math is restricted to only be FLAG_TRAPPING_DEFAULT in a front-end(s), they will be. Best regards, Roger -- -Original Message- From: Joseph Myers Sent: 27 September 2021 21:05 To: Roger Sayle Cc: 'GCC Patches' ; 'Eric Botcazou' Subject: Re: [PATCH] Make flag_trap

[RFC] Experimental __attribute__((saturating)) on integer types.

2021-09-26 Thread Roger Sayle
w C-family attribute is unsuitable, is my logic/implementation in handle_saturating_attribute correct? 2021-09-26 Roger Sayle gcc/c-family/ChangeLog * c-attribs (handle_saturating_attribute): New callback function for a "saturating" attribute to set the

[PATCH #2] Introduce smul_highpart and umul_highpart RTX for high-part multiplications

2021-09-29 Thread Roger Sayle
test cases. This patch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-09-29 Roger Sayle Richard Sandiford gcc/ChangeLog * gcc/rtl.def (SMUL_HIGHPART, UMUL_HIGH

[RFC/PATCH] C++ constexpr vs. floating point exceptions.

2021-09-21 Thread Roger Sayle
nd considers valid should be independent of whether the user specified -fno-trapping-math (or -ffast-math) to the middle-end. Thoughts? Ok for mainline? 2021-09-21 Roger Sayle gcc/cp/ChangeLog * constexpr.c (cxx_eval_outermost_const_expr): Temporarily disable the middle-end from honori

[PATCH] Try placing RTL folded constants in constant pool

2021-10-03 Thread Roger Sayle
atch has been tested on x86_64-pc-linux-gnu with "make bootstrap" and "make -k check" with no new failures. Ok for mainline? 2021-10-03 Roger Sayle gcc/ChangeLog * combine.c (recog_for_combine): For an unrecognized move/set of a constant, try fo

[PATCH] Transition nvptx backend to STORE_FLAG_VALUE = 1

2021-10-05 Thread Roger Sayle
sses to eventually generate a much shorter sequence using an and.pred instruction (just like Nvidia's nvcc compiler). This patch has been tested nvptx-none with a "make" and "make -k check" (including newlib) hosted on x86_64-pc-linux-gnu with no new failures. Ok for mainline? 20

RE: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE

2021-09-21 Thread Roger Sayle
: Segher Boessenkool ; Richard Biener ; Roger Sayle Subject: Re: [PATCH] Simplify paradoxical subreg extensions of TRUNCATE [Using this is a convenient place to reply to the thread as a whole] Richard Biener via Gcc-patches writes: > On Mon, Sep 6, 2021 at 12:15 PM Segher Boessenkool > w

RE: [RFC/PATCH] C++ constexpr vs. floating point exceptions.

2021-09-21 Thread Roger Sayle
Can you double check? Integer division by zero is undefined, but isn't floating point division by zero defined by the appropriate IEEE standards? Roger -- -Original Message- From: Xi Ruoyao Sent: 21 September 2021 14:07 To: Roger Sayle ; 'GCC Patches' Subject: Re: [RFC/PATCH] C

RE: [RFC/PATCH] C++ constexpr vs. floating point exceptions.

2021-09-21 Thread Roger Sayle
ember 2021 14:22 To: Roger Sayle ; Jason Merrill ; Jonathan Wakely Cc: 'Xi Ruoyao' ; 'GCC Patches' Subject: Re: [RFC/PATCH] C++ constexpr vs. floating point exceptions. On Tue, Sep 21, 2021 at 02:15:59PM +0100, Roger Sayle wrote: > Can you double check? Integer division by zero is undefined

[Committed] Tidy up !POINTER_TYPE_P test in match.pd LSHIFT_EXPR folding

2021-08-26 Thread Roger Sayle
ake bootstrap" and "make -k check" with no new failures on x86_64-pc-linux-gnu. 2021-08-26 Roger Sayle Richard Biener gcc/ChangeLog * match.pd (shift transformations): Remove a redundant !POINTER_TYPE_P check. Roger -- diff --git a/gcc/match.pd b/gcc/

[PATCH] x86_64: Implement V1TI mode shifts/rotates by a constant

2021-10-24 Thread Roger Sayle
with no new failures. Ok for mainline? 2021-10-24 Roger Sayle gcc/ChangeLog * config/i386/i386-expand.c (ix86_expand_v1ti_shift): New helper function to expand V1TI mode logical shifts by integer constants. (ix86_expand_v1ti_rotate): New helper function to expand V1TI

[Committed] Correct testcase gcc.target/bfin/20090914-3.c

2021-10-24 Thread Roger Sayle
g the code into a function returning the final "fract32" result, as simply specifying an "int" return type for main, results in the entire function being optimized away, as the result is unused. Checked-in as obvious. 2021-10-24 Roger Sayle gcc/testsuite/ChangeLog

[PATCH] x86_64: Add insn patterns for V1TI mode logic operations.

2021-10-22 Thread Roger Sayle
check" with no new failures. Ok for mainline? 2021-10-22 Roger Sayle gcc/ChangeLog * config/i386/sse.md (v1ti3): New define_insn to implement V1TImode AND, IOR and XOR on TARGET_SSE2 (and above). (one_cmplv1ti2): New define expand. gcc/testsuite/ChangeLog

[PATCH] Constant fold/simplify SS_ASHIFT and US_ASHIFT in simplify-rtx.c

2021-10-25 Thread Roger Sayle
rts; _stest_sat_min: nop; nop; nop; R0 = -32768 (X); rts; This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check with no new failures, and on a cross-compiler to bfin-elf with no regressions. Ok for mainline? 2021-

[PATCH take #2] x86_64: PR target/100711: Splitters for pandn

2021-11-29 Thread Roger Sayle
? 2021-11-29 Roger Sayle Uroš Bizjak gcc/ChangeLog PR target/100711 * config/i386/sse.md (define_split): New splitters to simplify not;vec_duplicate;and as vec_duplicate;andn. gcc/testsuite/ChangeLog PR target/100711 * gcc.target/i386/pr100711-1

[PATCH take #2] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-03 Thread Roger Sayle
add_geu: subfc 5,5,4 addze 3,3 blr This patch has been tested on powerpc64-unknown-linux-gnu (many thanks to gcc203.fsffrance.org on the GCC compile farm) with a make bootstrap and make -k check with now new failures. Ok for mainline? 2021-12-03 Roger Sayle gcc/Chan

[PATCH take #2] x86_64: Improve code expanded for highpart multiplications.

2021-12-20 Thread Roger Sayle
(with and without RUNTESTFLAGS="--target_board='unix{-m32}'") with no new failures. Ok for mainline? 2021-12-20 Roger Sayle Uroš Bizjak gcc/ChangeLog * config/i386/i386.md (any_mul_highpart): New code iterator. (sgnprefix, s): Add attribute support for [su]mu

[PATCH] x86: Shrink writing 0/-1 to memory using and/or with -Oz.

2021-12-21 Thread Roger Sayle
and the new testcase checked both with and without -m32. Ok for mainline? 2021-12-21 Roger Sayle gcc/ChangeLog * gcc/config/i386/i386.md (define_peephole2): With -Oz use andl $0,mem instead of movl $0,mem and orl $-1,mem instead of movl $-1,mem. gcc

[PATCH] PR target/103773: Fix wrong-code with -Oz from pop to memory.

2021-12-21 Thread Roger Sayle
and make -k check with no new failures. Ok for mainline? 2021-12-21 Roger Sayle gcc/ChangeLog PR target/103773 * config/i386/i386.md (*movdi_internal): Only use short push/pop sequence for register (non-memory) destinations. (*movsi_internal): Likewise. gcc/testsuite

[PATCH take #3] PR target/103773: Fix wrong-code with -Oz from pop to memory.

2021-12-23 Thread Roger Sayle
and make -k check with no new failures, and the new testcase checked both with and without -m32. Ok for mainline? 2021-12-23 Roger Sayle Uroš Bizjak gcc/ChangeLog PR target/103773 * config/i386/i386.md (*mov_and): New define_insn for writing a zero to memory

RE: [PATCH] PR target/103773: Fix wrong-code with -Oz from pop to memory.

2021-12-22 Thread Roger Sayle
g included the 0/-1 write to memory changes). Tested (overnight) on x86_64-pc-linux-gnu with make bootstrap and make -k check with no new failures. 2021-12-22 Roger Sayle gcc/ChangeLog PR target/103773 * config/i386/i386.md (*movdi_internal): Only use short push/po

[PATCH] x86_64: Improved V1TImode rotations by non-constant amounts.

2021-11-28 Thread Roger Sayle
ret This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check with no new failures. Ok for mainline? 2021-11-28 Roger Sayle gcc/ChangeLog * config/i386/i386-expand.c (ix86_expand_v1ti_to_ti): Perform the conversion via V2

[PATCH] x86_64: PR target/100711: Splitters for pandn

2021-11-28 Thread Roger Sayle
. Ok for mainline? 2021-11-28 Roger Sayle gcc/ChangeLog PR target/100711 * config/i386/sse.md (define_split): New splitters to simplify not;vec_duplicate;and as vec_duplicate;andn. gcc/testsuite/ChangeLog PR target/100711 * gcc.target/i386/pr100711-1.c

[PATCH] Final value replacement improvements for until-wrap loops.

2021-11-29 Thread Roger Sayle
1) > Y ? -X : 1 simplifies to X >= Y ? -X : 1 when X is unsigned, as when X + 1 overflows, X is -1, so -X == 1. This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check with no new failures. Ok for mainline? 2021-11-29 Roger Sayle gcc/Chang

[PATCH] PR middle-end/103406: Check for Inf before simplifying x-x.

2021-11-25 Thread Roger Sayle
-k check with no new failures. Ok for mainline? 2021-11-25 Roger Sayle gcc/ChangeLog PR middle-end/103406 * match.pd (minus @0 @0): Check tree_expr_maybe_infinite_p. gcc/testsuite/ChangeLog PR middle-end/103406 * gcc.dg/pr103406.c: New test case. Thanks

[PATCH] tree-optimization/103345: Improved load merging

2021-11-22 Thread Roger Sayle
for mainline? 2021-11-22 Roger Sayle gcc/ChangeLog PR tree-optimization/98953 PR tree-optimization/103345 * gimple-ssa-store-merging.c (find_bswap_or_nop_1): Handle BIT_XOR_EXPR and PLUS_EXPR the same as BIT_IOR_EXPR. (pass_optimize_bswap::execute

[PATCH take 2] ivopts: Improve code generated for very simple loops.

2021-11-18 Thread Roger Sayle
Hi Richard, Many thanks for the patch review. On Tue, Nov 16, 2021 at 12:38 Richard Biener wrote: > On Mon, Nov 15, 2021 at 2:04 PM Roger Sayle > wrote: > > > > This patch tidies up the code that GCC generates for simple loops, by > > selecting/generating a simpl

[PATCH] Tweak tree-ssa-math-opts.c to solve PR target/102117

2021-11-20 Thread Roger Sayle
-gnu with a bootstrap and regression test just to confirm that there are no unanticipated side-effects. Ok for mainline? 2021-11-20 Roger Sayle Robin Dapp gcc/ChangeLog PR target/102117 * tree-ssa-math-opts.c (convert_mult_to_widen): Recognize signed

[PATCH] ivopts: Improve code generated for very simple loops.

2021-11-15 Thread Roger Sayle
%rdx, (%rsi,%rax) addq$8, %rax cmpq%rax, %rcx jne .L3 .L1:ret This patch has been tested on x86_64-pc-linux-gnu with a make bootstrap and make -k check with no new failures. Ok for mainline? 2021-11-15 Roger Sayle gcc/ChangeLog * tree-ssa-loop-ivopts.

[PATCH] x86_64: Avoid rorx rotation instructions with -Os

2021-11-15 Thread Roger Sayle
-linux-gnu with make bootstrap and make -k check with no new failures. Ok for mainline? 2021-11-15 Roger Sayle gcc/ChangeLog * config/i386/i386.md (*bmi2_rorx_1): Make conditional on !optimize_function_for_size_p. (*3_1): Add preferred_for_size at

[PATCH take 3] ivopts: Improve code generated for very simple loops.

2021-11-25 Thread Roger Sayle
On Tue, Nov 23, 2021 at 12:46PM Richard Biener < richard.guent...@gmail.com> wrote: > On Thu, Nov 18, 2021 at 4:18 PM Roger Sayle > wrote: > > > The patch doesn't add any testcase. > > > > The three new attached tests check that the critical invariants have

[PATCH] x86_64: Expand ashrv1ti (and PR target/102986)

2021-10-30 Thread Roger Sayle
, but the functionality overlaps and this patch was nearly ready to submit to gcc-patches when 102986 appeared in bugzilla. 2021-10-30 Roger Sayle gcc/ChangeLog PR target/102986 * config/i386/i386-expand.c (ix86_expand_v1ti_to_ti, ix86_expand_ti_to_v1ti): New helper functions

RE: [PATCH] x86_64: Implement V1TI mode shifts/rotates by a constant

2021-10-25 Thread Roger Sayle
bytes, shrinks to 5 bytes with this patch). Please let me know what you think. Roger -- -Original Message- From: Uros Bizjak Sent: 25 October 2021 09:02 To: Roger Sayle Cc: GCC Patches Subject: Re: [PATCH] x86_64: Implement V1TI mode shifts/rotates by a constant On Sun, Oct 24, 2021

RE: Some PINGs

2021-11-07 Thread Roger Sayle
>On 11/6/2021 4:20 PM, Roger Sayle wrote: >> Simplify paradoxical subreg extensions of TRUNCATE >> https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578848.html > So the discussion seemed to end with a recommendation to try and address this > earlier in the c

Some PINGs

2021-11-06 Thread Roger Sayle
I wonder if reviewers could take a look (or a second look) at some of my outstanding patches. Four nvptx backend patches: nvptx: Use cvt to perform sign-extension of truncation. https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578256.html nvptx: Add (experimental) support for HFmode with

RE: Some PINGs

2021-11-08 Thread Roger Sayle
Hi Richard, >> I wonder if reviewers could take a look (or a second look) at some of >> my outstanding patches. >> PR middle-end/100810: Penalize IV candidates with undefined value >> bases >> https://gcc.gnu.org/pipermail/gcc-patches/2021-August/578441.html > > I did comment on this one,

[PATCH Take #2] x86_64: Expand ashrv1ti (and PR target/102986)

2021-10-31 Thread Roger Sayle
Roger Sayle Jakub Jelinek gcc/ChangeLog PR target/102986 * config/i386/i386-expand.c (ix86_expand_v1ti_to_ti, ix86_expand_ti_to_v1ti): New helper functions. (ix86_expand_v1ti_shift): Check if the amount operand is an integer constant, and expand

[PATCH] x86_64: Improved implementation of TImode rotations.

2021-11-01 Thread Roger Sayle
and make -k check with no new failures. Interestingly the correct behaviour is already tested by (amongst other tests) sse2-v1ti-shift-3.c that confirms V1TImode rotates by constants match rotlti3/rotrti3. Ok for mainline? 2021-11-01 Roger Sayle * config/i386/i386.md (ti3): Provi

RE: [PATCH] Final value replacement improvements for until-wrap loops.

2021-12-01 Thread Roger Sayle
Hi Richard, Many thanks for the review. Here's the final version that I've committed, including your suggested improvements, following another make bootstrap and make -k check on x86_64-pc-linux-gnu with no new failures. Thanks again. 2021-12-01 Roger Sayle Richard Biener

[Committed] PR testsuite/103477: Fix big-endian mistake in new test case.

2021-11-30 Thread Roger Sayle
I missed a spot when adding the "#if __BYTE_ORDER__ == ..." guards to the new test case for PR tree-optimization/103345. Committed as obvious. 2021-11-30 Roger Sayle gcc/testsuite/ChangeLog PR testsuite/103477 * gcc.dg/tree-ssa/pr103345.c: Correct xor test for

[PATCH] PR ipa/103601: ICE compiling CSiBE in ipa-modref's insert_kill

2021-12-10 Thread Roger Sayle
but I'm happy to change this]. This patch has been tested on x86_64-pc-linux-gnu with a make bootstrap and make -k check with no new failures. Ok for mainline? 2021-12-10 Roger Sayle gcc/ChangeLog PR ipa/103601 * ipa-modref-tree.h (useful_for_kill_p): Zero width ac

[PATCH] PR target/103611: Avoid generating orb $0, %ah on x86.

2021-12-13 Thread Roger Sayle
t splitter, either eliminating the instruction or turning it into a simple move. This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without "--target_board='unix{-m32}'" with no new failures. OK for mainline? 2021-12-13 Roger Sayle gcc

[PATCH] x86: PR target/103611: Splitter for DST:DI = (HI:SI<<32)|LO:SI.

2021-12-13 Thread Roger Sayle
reasonable (but this patch has been tested both with and without this last change, if it's consider controversial). This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without "--target_board='unix{-m32}'" with no new failures. OK for mainl

[PATCH] PR target/32803: Add -Oz option for improved clang compatibility.

2021-12-10 Thread Roger Sayle
3513 bytes total down to 3668516 bytes). This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check with no new failures. Ok for mainline? 2021-12-10 Roger Sayle gcc/ChangeLog PR target/32803 * common.opt (Oz): New command line option. * lto

[PATCH] PR target/43892: Some carry flag (CA) optimizations on PowerPC.

2021-12-02 Thread Roger Sayle
3 blr This patch has been tested on powerpc64-unknown-linux-gnu (many thanks to gcc203.fsffrance.org on the GCC compile farm) with a make bootstrap and make -k check with now new failures. Ok for mainline? 2021-12-02 Roger Sayle gcc/ChangeLog PR target/43892

[PATCH] mips: Improved RTL representation of wsbh/dsbh/dshd

2021-12-10 Thread Roger Sayle
-multilib --enable-targets=all --with-arch-32=mips32r2 --with-arch-64=mips64r2 (thanks to the compile farm's gcc230.fsffrance.org) and a cross-compiler to mips64-linux-gnu hosted on x86_64-pc-linux-gnu. Ok for mainline? 2021-12-10 Roger Sayle gcc/ChangeLog * config/mips/mips.c

[PATCH] Improved handling of REG_UNUSED notes on PARALLEL in try_combine.

2021-12-10 Thread Roger Sayle
l/gcc-patches/2021-December/585977.html) I'll include a testcase for this functionality with the final rs6000 backend patch in the series. Ok for mainline? 2021-12-10 Roger Sayle gcc/ChangeLog * combine.c (try_combine): When I2 or I3 is PARALLEL without clobbers that is eff

  1   2   3   4   5   6   7   >