[v2,0/3] LoongArch: SIMD fixes and optimizations

Message ID 20231119143037.16443-1-xry111@xry111.site
Headers
Series LoongArch: SIMD fixes and optimizations |

Message

Xi Ruoyao Nov. 19, 2023, 2:30 p.m. UTC
  The [1/3] patch is the PR112578 fix at
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637097.html
unchanged.  As I've made other two patches depending on the simd.md
file introduced by it, resend it as a part of this series.

As many LASX instructions are only differentiated from the corresponding
LSX instruction with operand length, create simd.md file to contain the
RTX templates sharable by LSX and LASX.  This makes the code cleaner and
easier to maintain.

The [2/3] and [3/3] patches make vector product highpart and rotate
shift operations for GNU vectors and auto vectorization.

Bootstrapped and regtested on loongarch64-linux-gnu.  Ok for trunk?

Xi Ruoyao (3):
  LoongArch: Fix usage of LSX and LASX frint/ftint instructions
    [PR112578]
  LoongArch: Use standard pattern name and RTX code for LSX/LASX muh
    instructions
  LoongArch: Use standard pattern name and RTX code for LSX/LASX rotate
    shift

 gcc/config/loongarch/lasx.md                  | 271 -----------------
 gcc/config/loongarch/loongarch-builtins.cc    |  52 ++--
 gcc/config/loongarch/loongarch.md             |   7 +-
 gcc/config/loongarch/lsx.md                   | 284 ------------------
 gcc/config/loongarch/simd.md                  | 238 +++++++++++++++
 .../loongarch/vect-frint-no-inexact.c         |  48 +++
 .../gcc.target/loongarch/vect-frint.c         |  82 +++++
 .../loongarch/vect-ftint-no-inexact.c         |  44 +++
 .../gcc.target/loongarch/vect-ftint.c         |  80 +++++
 gcc/testsuite/gcc.target/loongarch/vect-muh.c |  36 +++
 .../gcc.target/loongarch/vect-rotr.c          |  36 +++
 11 files changed, 598 insertions(+), 580 deletions(-)
 create mode 100644 gcc/config/loongarch/simd.md
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-frint.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-ftint.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-muh.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-rotr.c