Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-20 Thread Jakub Jelinek via Gcc
On Tue, Jun 20, 2023 at 03:03:19PM +, Michael Matz via Gcc wrote: > Hello, > > On Tue, 20 Jun 2023, Jakub Jelinek via Gcc wrote: > > > ce1 pass results in emit_conditional_move with > > (gt (reg/v:SF 83 [ x ]) (reg:SF 84)), (reg/v:SF 83 [ x ]), (reg:SF 84) > > operands in the GCC 11 case and

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-20 Thread Michael Matz via Gcc
Hello, On Tue, 20 Jun 2023, Jakub Jelinek via Gcc wrote: > ce1 pass results in emit_conditional_move with > (gt (reg/v:SF 83 [ x ]) (reg:SF 84)), (reg/v:SF 83 [ x ]), (reg:SF 84) > operands in the GCC 11 case and so is successfully matched by > ix86_expand_fp_movcc as ix86_expand_sse_fp_minmax.

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-20 Thread Jakub Jelinek via Gcc
On Tue, Jun 20, 2023 at 10:15:37AM +0200, Richard Biener wrote: > On Mon, Jun 19, 2023 at 9:45 PM Jakub Jelinek via Gcc wrote: > > > > On Mon, Jun 19, 2023 at 09:10:53PM +0200, André Günther via Gcc wrote: > > > I noticed that a simple function like > > > auto relu( float x ) { > > > return x

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-20 Thread Richard Biener via Gcc
On Mon, Jun 19, 2023 at 9:45 PM Jakub Jelinek via Gcc wrote: > > On Mon, Jun 19, 2023 at 09:10:53PM +0200, André Günther via Gcc wrote: > > I noticed that a simple function like > > auto relu( float x ) { > > return x > 0.f ? x : 0.f; > > } > > compiles to different ASM using GCC11 (or lower)

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-19 Thread Marc Glisse via Gcc
On Mon, 19 Jun 2023, André Günther via Gcc wrote: I noticed that a simple function like auto relu( float x ) { return x > 0.f ? x : 0.f; } compiles to different ASM using GCC11 (or lower) and GCC12 (or higher). On -O3 -mavx2 the former compiles above function to relu(float): vmaxss xmm0,

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-19 Thread Jakub Jelinek via Gcc
On Mon, Jun 19, 2023 at 09:10:53PM +0200, André Günther via Gcc wrote: > I noticed that a simple function like > auto relu( float x ) { > return x > 0.f ? x : 0.f; > } > compiles to different ASM using GCC11 (or lower) and GCC12 (or higher). On > -O3 -mavx2 the former compiles above function

Different ASM for ReLU function between GCC11 and GCC12

2023-06-19 Thread André Günther via Gcc
Hi, I noticed that a simple function like auto relu( float x ) { return x > 0.f ? x : 0.f; } compiles to different ASM using GCC11 (or lower) and GCC12 (or higher). On -O3 -mavx2 the former compiles above function to relu(float): vmaxss xmm0, xmm0, DWORD PTR .LC0[rip] ret .LC0: