> -----Original Message----- > From: Xi Ruoyao <xry...@xry111.site> > Sent: Thursday, January 4, 2024 10:39 PM > To: Palmer Dabbelt <pal...@dabbelt.com>; Tamar Christina > <tamar.christ...@arm.com> > Cc: gcc-patches@gcc.gnu.org; nd <n...@arm.com>; rguent...@suse.de; Jeff Law > <j...@ventanamicro.com> > Subject: Re: [PATCH]middle-end: Don't apply copysign optimization if target > does > not implement optab [PR112468] > > 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]) > > > + || ([istarget loongarch*-*-*] && [check_effective_target_loongarch_sx]) > > LoongArch has [scalar FP copysign][1] too. > > [1]:https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1- > EN.html#_fscaleblogbcopysign_sd
Ok, so something like: || ([istarget loongarch*-*-*] && ([check_effective_target_loongarch_sx] || [check_effective_target_hard_float])) ? > > > > + || ([istarget powerpc*-*-*] > > > + && ![istarget powerpc-*-linux*paired*]) > > > + || [istarget alpha*-*-*] > > > + || [istarget aarch64*-*-*] > > > + || [is-effective-target arm_neon] > > > + || ([istarget s390*-*-*] > > > + && [check_effective_target_s390_vx]) > > > + || ([istarget riscv*-*-*] > > > + && [check_effective_target_riscv_v]) > > > > Unless I'm missing something, we have copysign in the scalar > > floating-point ISAs as well. So I think this should be > > > > || ([istarget riscv*-*-*] > > && [check_effective_target_hard_float]) > Ah cool, will update it in next version. Thanks, Tamar > -- > Xi Ruoyao <xry...@xry111.site> > School of Aerospace Science and Technology, Xidian University