Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-01 Thread ro...@nextmovesoftware.com
The motivation for the current design (requiring the result and the operand to have the same mode) was from PR middle-end/50161. The challenge there is that when the RTL optimizers can determine that the operand is a constant, simplify_rtx sees just a CONST_INT with VOIDmode and therefore does

Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-01 Thread Segher Boessenkool
Hi! On Sun, Jan 01, 2023 at 03:55:26PM -, Roger Sayle wrote: > In 2011, the rtl.texi documentation was updated to reflect that the > modes of the RTX unary operations FFS, POPCOUNT and PARITY must > match those of their operands. Is that not a limitation we should try to get rid of? It does

Re: [x86 PATCH] PR target/108229: A minor STV compute_convert_gain tweak.

2023-01-01 Thread Uros Bizjak via Gcc-patches
On Sun, Jan 1, 2023 at 5:53 PM Roger Sayle wrote: > > > This patch addresses PR target/108229, which is a change in code > generation during the STV pass, due to the recently approved patch > to handle vec_select (reductions) in the vector unit. The recent > change is innocent, but exposes a late

[x86 PATCH] PR target/108229: A minor STV compute_convert_gain tweak.

2023-01-01 Thread Roger Sayle
This patch addresses PR target/108229, which is a change in code generation during the STV pass, due to the recently approved patch to handle vec_select (reductions) in the vector unit. The recent change is innocent, but exposes a latent STV "gain" calculation issue that is benign (or closely bal

[PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY.

2023-01-01 Thread Roger Sayle
In 2011, the rtl.texi documentation was updated to reflect that the modes of the RTX unary operations FFS, POPCOUNT and PARITY must match those of their operands. Unfortunately, some of the transformations in simplify-rtx.cc predate this tightening of RTL semantics, and have not (until now) been u

Re: [x86_64 PATCH] Add post-reload splitter for extendditi2.

2023-01-01 Thread Uros Bizjak via Gcc-patches
On Sun, Jan 1, 2023 at 3:55 PM Roger Sayle wrote: > > > Hi Uros, > Happy New Year. > As requested here's a revised version of my patch to introduce a pattern for > extendditi2, but implementing your suggestion to re-use the existing > extendsidi2_1 splitters and peephole2 optimizations by using DW

RE: [x86_64 PATCH] Add post-reload splitter for extendditi2.

2023-01-01 Thread Roger Sayle
Hi Uros, Happy New Year. As requested here's a revised version of my patch to introduce a pattern for extendditi2, but implementing your suggestion to re-use the existing extendsidi2_1 splitters and peephole2 optimizations by using DWI/DWIH mode iterators. This patch has been tested on x86_64-pc-