From: Xi Ruoyao Date: Mon, 2 Oct 2023 10:51:00 +0000 (+0800) Subject: LoongArch: Replace UNSPEC_FCOPYSIGN with copysign RTL X-Git-Tag: basepoints/gcc-15~5746 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64eb7b0c47c9bb34991f3d3fd0bbe0882a1f6da5;p=thirdparty%2Fgcc.git LoongArch: Replace UNSPEC_FCOPYSIGN with copysign RTL When I added copysign support for LoongArch (r13-3702), we did not have a copysign RTL insn, so I had to use UNSPEC to represent the copysign instruction. Now the copysign RTX code has been added in r14-1586, so this patch removes those UNSPECs, and it uses the native RTL copysign insn. Inspired by rs6000 patch "Cleanup: Replace UNSPEC_COPYSIGN with copysign RTL" [1] from Michael Meissner. [1]: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631701.html gcc/ChangeLog: * config/loongarch/loongarch.md (UNSPEC_FCOPYSIGN): Delete. (copysign3): Use copysign RTL instead of UNSPEC. --- diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md index 4fcb6d781d5e..3286b0c56ae4 100644 --- a/gcc/config/loongarch/loongarch.md +++ b/gcc/config/loongarch/loongarch.md @@ -37,7 +37,6 @@ UNSPEC_FCLASS UNSPEC_FMAX UNSPEC_FMIN - UNSPEC_FCOPYSIGN UNSPEC_FTINT UNSPEC_FTINTRM UNSPEC_FTINTRP @@ -1129,9 +1128,8 @@ (define_insn "copysign3" [(set (match_operand:ANYF 0 "register_operand" "=f") - (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f") - (match_operand:ANYF 2 "register_operand" "f")] - UNSPEC_FCOPYSIGN))] + (copysign:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] "TARGET_HARD_FLOAT" "fcopysign.\t%0,%1,%2" [(set_attr "type" "fcopysign")