[PATCH] RISC-V: Add Veyron V1 pipeline description

2023-06-07 Thread Raphael Moreira Zinsly
gcc/ChangeLog: * config/riscv/riscv-cores.def: Add veyron-v1 core and tune info. * config/riscv/riscv-opts.h (riscv_microarchitecture_type): Add veyron-v1. * config/riscv/riscv.cc (veyron_v1_tune_info): New. * config/riscv/riscv.md: Include

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

2023-05-08 Thread Raphael Moreira Zinsly
Changes since v1: - Remove subreg from operand 1. -- >8 -- We were not able to match the CTZ sign extend pattern on RISC-V because it gets optimized to zero extend and/or to ANDI patterns. For the ANDI case, combine scrambles the RTL and generates the extension by using subregs.

[PATCH v2] RISC-V: Add bext pattern for ZBS

2023-05-08 Thread Raphael Moreira Zinsly
Changes since v1: - Removed name clash change. - Fix new pattern indentation. -- >8 -- When (a & (1 << bit_no)) is tested inside an IF we can use a bit extract. gcc/ChangeLog: * config/riscv/bitmanip.md (branch_bext): New split pattern.

[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 *

[PATCH] RISC-V: Add bext pattern for ZBS

2023-05-04 Thread Raphael Moreira Zinsly
When (a & (1 << bit_no)) is tested inside an IF we can use a bit extract. gcc/ChangeLog: * config/riscv/bitmanip.md (bext): Rename one to avoid name clash. (branch_bext): New split pattern. gcc/testsuite/ChangeLog:

[PATCH] RISC-V: Optimize min/max with SImode sources on 64-bit

2022-12-28 Thread Raphael Moreira Zinsly
The Zbb min/max pattern was not matching 32-bit sources when compiling for 64-bit. This patch separates the pattern into SImode and DImode, and use a define_expand to handle SImode on 64-bit. zbb-min-max-02.c generates different code as a result of the new expander.  The resulting code is as

[PATCH v2] RISC-V: Produce better code with complex constants [PR95632] [PR106602]

2022-12-09 Thread Raphael Moreira Zinsly
big constants combine is failing to match such operations and is not being able to produce optimal code as it keeps splitting them. By pretending we can do those operations we can get more opportunities for simplification of surrounding instructions. 2022-12-06 Raphael Moreira Zinsly Jeff

[PATCH] RISC-V: Produce better code with complex constants [PR95632] [PR106602]

2022-12-07 Thread Raphael Moreira Zinsly
. 2022-12-06 Raphael Moreira Zinsly Jeff Law gcc/Changelog: PR target/95632 PR target/106602 * config/riscv/riscv.md: New pattern to simulate complex const_int loads. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr95632.c: New test

[PATCH v2] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-11 Thread Raphael Moreira Zinsly via Gcc-patches
Changes since v1: - Removed -Wmissing-prototypes fix. - Fixed formatting of Changelog and patch. --->8--- At the end of the backtrace stream _Unwind_Find_FDE() may not be able to find the frame unwind info and will later call the backtrace fallback instead of finishing. This

[PATCH] libgcc: fix backtrace fallback on PowerPC Big-endian. [PR103004]

2021-11-10 Thread Raphael Moreira Zinsly via Gcc-patches
At the end of the backtrace stream _Unwind_Find_FDE() may not be able to find the frame unwind info and will later call the backtrace fallback instead of finishing. This occurs when using an old libc on ppc64 due to dl_iterate_phdr() not being able to set the fde in the last trace. When this

[PATCH v3] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-10-05 Thread Raphael Moreira Zinsly via Gcc-patches
Without dwarf2 unwind tables available _Unwind_Backtrace() is not able to return the full backtrace. This patch adds a fallback function on powerpc to get the backtrace by doing a backchain, this code was originally at glibc. libgcc/ChangeLog: * config/rs6000/linux-unwind.h (struct

[PATCH v2] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-08-26 Thread Raphael Moreira Zinsly via Gcc-patches
Without dwarf2 unwind tables available _Unwind_Backtrace() is not able to return the full backtrace. This patch adds a fallback function on powerpc to get the backtrace by doing a backchain, this code was originally at glibc. libgcc/ChangeLog: * config/rs6000/linux-unwind.h (struct

[PATCH] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-08-13 Thread Raphael Moreira Zinsly via Gcc-patches
This is followup to this RFC: https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573954.html ---8<--- Without dwarf2 unwind tables available _Unwind_Backtrace() is not able to return the full backtrace. This patch adds a fallback function on powerpc to get the backtrace by doing a backchain,

[PATCH] [RFC] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-06-29 Thread Raphael Moreira Zinsly via Gcc-patches
to have the trace_arg struct here or should this be handled by the trace function passed to _Unwind_Backtrace()? Any comments are appreciated. Best Regards, Raphael Moreira Zinsly [1] https://sourceware.org/pipermail/libc-alpha/2021-February/122600.html --- libgcc/config/rs6000/linux-unwind.h | 58