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

2022-12-29 Thread Jeff Law via Gcc-patches
On 12/29/22 07:50, Philipp Tomsich wrote: We have two issues around min/max here: 1. That it doesn't apply to the SImode abs case (which is due to expand_abs_nojump() blindly testing for the current mode in smax_optab). Mode testing is inherent in the optab query interface. 2. That we h

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

2022-12-29 Thread Philipp Tomsich
On Wed, 28 Dec 2022 at 19:18, Raphael Moreira Zinsly < rzin...@ventanamicro.com> wrote: > 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-

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

2022-12-29 Thread Jeff Law via Gcc-patches
On 12/29/22 05:23, Raphael Zinsly wrote: On Wed, Dec 28, 2022 at 10:36 PM Jeff Law wrote: On 12/28/22 11:18, Raphael Moreira Zinsly wrote: 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

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

2022-12-29 Thread Raphael Zinsly
On Wed, Dec 28, 2022 at 10:36 PM Jeff Law wrote: > > > > On 12/28/22 11:18, Raphael Moreira Zinsly wrote: > > 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 SI

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

2022-12-28 Thread Jeff Law via Gcc-patches
On 12/28/22 11:18, Raphael Moreira Zinsly wrote: 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