RE: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-10 Thread Richard Biener
On Fri, 5 Jan 2024, Tamar Christina wrote: > > On Fri, 2024-01-05 at 11:02 +, Tamar Christina wrote: > > > Ok, so something like: > > > > > > > > ([istarget loongarch*-*-*] && > > > > > ([check_effective_target_loongarch_sx] || > > > > > [check_effective_target_hard_float])) > > > ? > > > >

RE: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-10 Thread Tamar Christina
ping > -Original Message- > From: Tamar Christina > Sent: Friday, January 5, 2024 1:31 PM > To: Xi Ruoyao ; Palmer Dabbelt > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de; Jeff Law > > Subject: RE: [PATCH]middle-end: Don't apply copysign optimizat

RE: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-05 Thread Tamar Christina
> On Fri, 2024-01-05 at 11:02 +, Tamar Christina wrote: > > Ok, so something like: > > > > > > ([istarget loongarch*-*-*] && > > > > ([check_effective_target_loongarch_sx] || > > > > [check_effective_target_hard_float])) > > ? > > We don't need "[check_effective_target_loongarch_sx] ||"

Re: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-05 Thread Xi Ruoyao
On Fri, 2024-01-05 at 11:02 +, Tamar Christina wrote: > Ok, so something like: > > > > ([istarget loongarch*-*-*] && > > > ([check_effective_target_loongarch_sx] ||  > > > [check_effective_target_hard_float])) > ? We don't need "[check_effective_target_loongarch_sx] ||" because SIMD requires

RE: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-05 Thread Tamar Christina
> -Original Message- > From: Xi Ruoyao > Sent: Thursday, January 4, 2024 10:39 PM > To: Palmer Dabbelt ; Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de; Jeff Law > > Subject: Re: [PATCH]middle-end: Don't apply copysign optimi

Re: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-04 Thread Xi Ruoyao
On Thu, 2024-01-04 at 14:32 -0800, Palmer Dabbelt wrote: > > +proc check_effective_target_ifn_copysign { } { > > +    return [check_cached_effective_target_indexed ifn_copysign { > > +  expr { > > +(([istarget i?86-*-*] || [istarget x86_64-*-*]) > > +    && [is-effective-target sse]) > >

Re: [PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-04 Thread Palmer Dabbelt
On Thu, 04 Jan 2024 10:20:25 PST (-0800), tamar.christ...@arm.com wrote: > Hi All, > > currently GCC does not treat IFN_COPYSIGN the same as the copysign tree expr. > The latter has a libcall fallback and the IFN can only do optabs. > > Because of this the change I made to optimize copysign only

[PATCH]middle-end: Don't apply copysign optimization if target does not implement optab [PR112468]

2024-01-04 Thread Tamar Christina
Hi All, currently GCC does not treat IFN_COPYSIGN the same as the copysign tree expr. The latter has a libcall fallback and the IFN can only do optabs. Because of this the change I made to optimize copysign only works if the target has impemented the optab, but it should work for those that have