Re: [PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2024-02-22 Thread Jeff Law
On 2/20/24 07:21, Alexandre Oliva wrote: On Feb 20, 2024, Jeff Law wrote: On 2/19/24 21:26, Alexandre Oliva wrote: This backport for gcc-13 is required for pr90838.c to get the expected count of andi instructions on riscv64-elf . In general, shouldn't backports be focused on correctness

Re: [PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2024-02-20 Thread Alexandre Oliva
On Feb 20, 2024, Jeff Law wrote: > On 2/19/24 21:26, Alexandre Oliva wrote: >> This backport for gcc-13 is required for pr90838.c to get the expected >> count of andi instructions on riscv64-elf . > In general, shouldn't backports be focused on correctness issues? *nod*. > It's unclear what

Re: [PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2024-02-19 Thread Jeff Law
On 2/19/24 21:26, Alexandre Oliva wrote: This backport for gcc-13 is required for pr90838.c to get the expected count of andi instructions on riscv64-elf, rather than fail because of two extra andi insns in functions where it is not necessary. (On riscv32-elf, it passes). Regstrapped on

[PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2024-02-19 Thread Alexandre Oliva
This backport for gcc-13 is required for pr90838.c to get the expected count of andi instructions on riscv64-elf, rather than fail because of two extra andi insns in functions where it is not necessary. (On riscv32-elf, it passes). Regstrapped on x86_64-linux-gnu, along with other backports, and

Re: [PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2023-05-06 Thread Jeff Law via Gcc-patches
On 5/4/23 11:14, Raphael Moreira Zinsly wrote: We were not able to match the CTZ sign extend pattern on RISC-V because it get optimized to zero extend and/or to ANDI patterns. For the ANDI case, combine scrambles the RTL and generates the extension by using subregs. So to provide a few more

[PATCH] RISC-V: Fix CTZ unnecessary sign extension [PR #106888]

2023-05-04 Thread Raphael Moreira Zinsly
We were not able to match the CTZ sign extend pattern on RISC-V because it get optimized to zero extend and/or to ANDI patterns. For the ANDI case, combine scrambles the RTL and generates the extension by using subregs. gcc/ChangeLog: PR target/106888 *