]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Use fcmp.caf.s instead of movgr2cf for zeroing a fcc
authorXi Ruoyao <xry111@xry111.site>
Tue, 17 Oct 2023 13:55:05 +0000 (21:55 +0800)
committerXi Ruoyao <xry111@xry111.site>
Wed, 18 Oct 2023 08:25:05 +0000 (16:25 +0800)
During the review of an LLVM change [1], on LA464 we found that zeroing
an fcc with fcmp.caf.s is much faster than a movgr2cf from $r0.

[1]: https://github.com/llvm/llvm-project/pull/69300

gcc/ChangeLog:

* config/loongarch/loongarch.md (movfcc): Use fcmp.caf.s for
zeroing a fcc.

gcc/config/loongarch/loongarch.md

index 3286b0c56ae48555e0cadf90a2a4d37b5703ada3..9f5a753908298436f8730900c9c72612b89bdca9 100644 (file)
   [(set (match_operand:FCC 0 "register_operand" "=z")
        (const_int 0))]
   ""
-  "movgr2cf\t%0,$r0")
+  "fcmp.caf.s\t%0,$f0,$f0")
 
 ;; Conditional move instructions.