]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Use standard pattern name for xvfrsqrt/vfrsqrt instructions.
authorJiahao Xu <xujiahao@loongson.cn>
Wed, 6 Dec 2023 07:04:50 +0000 (15:04 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 8 Dec 2023 08:29:50 +0000 (16:29 +0800)
commitcd2f1d911c766926c1e690476966d6d0b8089623
tree3785a4da1a78476ad9ca5110df8cc585043d4ade
parent61f1001f2f4ab9128e5eb6e9a4adbbb0f9f0bc75
LoongArch: Use standard pattern name for xvfrsqrt/vfrsqrt instructions.

Rename lasx_xvfrsqrt*/lsx_vfrsqrt* to rsqrt<mode>2 to align with standard
pattern name. Define function use_rsqrt_p to decide when to use rsqrt optab.

gcc/ChangeLog:

* config/loongarch/lasx.md (lasx_xvfrsqrt_<flasxfmt>): Renamed to ..
(rsqrt<mode>2): .. this.
* config/loongarch/loongarch-builtins.cc
(CODE_FOR_lsx_vfrsqrt_d): Redefine to standard pattern name.
(CODE_FOR_lsx_vfrsqrt_s): Ditto.
(CODE_FOR_lasx_xvfrsqrt_d): Ditto.
(CODE_FOR_lasx_xvfrsqrt_s): Ditto.
* config/loongarch/loongarch.cc (use_rsqrt_p): New function.
(loongarch_optab_supported_p): Ditto.
(TARGET_OPTAB_SUPPORTED_P): New hook.
* config/loongarch/loongarch.md (*rsqrt<mode>a): Remove.
(*rsqrt<mode>2): New insn pattern.
(*rsqrt<mode>b): Remove.
* config/loongarch/lsx.md (lsx_vfrsqrt_<flsxfmt>): Renamed to ..
(rsqrt<mode>2): .. this.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/vector/lasx/lasx-rsqrt.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-rsqrt.c: New test.
gcc/config/loongarch/lasx.md
gcc/config/loongarch/loongarch-builtins.cc
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.md
gcc/config/loongarch/lsx.md
gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-rsqrt.c [new file with mode: 0644]
gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-rsqrt.c [new file with mode: 0644]