[0/3] Optimize loongarch vector implementation.

Message ID 20231016020014.41979-1-xujiahao@loongson.cn
Headers
Series Optimize loongarch vector implementation. |

Message

Jiahao Xu Oct. 16, 2023, 2 a.m. UTC
  The following three patches further enhance loongarch’s vectorization capabilities.

Patch one add LoongArch support for AVG_CEIL/FLOOR.

Patch 2 add LoongArch support for vec_widen_mult/add/sub_lo/hi patterns.

patch 3 make loongarch use the new vector hooks and implements the costing
function determine_suggested_unroll_factor, to make it be able to suggest the
unroll factor for a given loop being vectorized base vec_ops analysis during
vector costing and the available issue information.The patch also adjusts cost
model through performance analysis.

Jiahao Xu (3):
  LoongArch:Implement avg and sad standard names.
  LoongArch:Implement vec_widen standard names.
  LoongArch:Implement the new vector cost model framework.

 gcc/config/loongarch/genopts/loongarch.opt.in |  15 +-
 gcc/config/loongarch/lasx.md                  | 156 ++++++++-
 gcc/config/loongarch/loongarch-protos.h       |   1 +
 gcc/config/loongarch/loongarch.cc             | 309 +++++++++++++++++-
 gcc/config/loongarch/loongarch.md             |   2 +
 gcc/config/loongarch/loongarch.opt            |  15 +-
 gcc/config/loongarch/lsx.md                   |  74 +++++
 gcc/doc/invoke.texi                           |   7 +
 .../gcc.target/loongarch/avg-ceil-lasx.c      |  22 ++
 .../gcc.target/loongarch/avg-ceil-lsx.c       |  22 ++
 .../gcc.target/loongarch/avg-floor-lasx.c     |  22 ++
 .../gcc.target/loongarch/avg-floor-lsx.c      |  22 ++
 gcc/testsuite/gcc.target/loongarch/sad-lasx.c |  20 ++
 gcc/testsuite/gcc.target/loongarch/sad-lsx.c  |  20 ++
 .../gcc.target/loongarch/vect-widen-add.c     |  26 ++
 .../gcc.target/loongarch/vect-widen-mul.c     |  26 ++
 .../gcc.target/loongarch/vect-widen-sub.c     |  26 ++
 17 files changed, 746 insertions(+), 39 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-ceil-lasx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-ceil-lsx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-floor-lasx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-floor-lsx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/sad-lasx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/sad-lsx.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-add.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-mul.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-sub.c
  

Comments

chenglulu Oct. 19, 2023, 6:16 a.m. UTC | #1
Pushed to r14-4730.

在 2023/10/16 上午10:00, Jiahao Xu 写道:
> The following three patches further enhance loongarch’s vectorization capabilities.
>
> Patch one add LoongArch support for AVG_CEIL/FLOOR.
>
> Patch 2 add LoongArch support for vec_widen_mult/add/sub_lo/hi patterns.
>
> patch 3 make loongarch use the new vector hooks and implements the costing
> function determine_suggested_unroll_factor, to make it be able to suggest the
> unroll factor for a given loop being vectorized base vec_ops analysis during
> vector costing and the available issue information.The patch also adjusts cost
> model through performance analysis.
>
> Jiahao Xu (3):
>    LoongArch:Implement avg and sad standard names.
>    LoongArch:Implement vec_widen standard names.
>    LoongArch:Implement the new vector cost model framework.
>
>   gcc/config/loongarch/genopts/loongarch.opt.in |  15 +-
>   gcc/config/loongarch/lasx.md                  | 156 ++++++++-
>   gcc/config/loongarch/loongarch-protos.h       |   1 +
>   gcc/config/loongarch/loongarch.cc             | 309 +++++++++++++++++-
>   gcc/config/loongarch/loongarch.md             |   2 +
>   gcc/config/loongarch/loongarch.opt            |  15 +-
>   gcc/config/loongarch/lsx.md                   |  74 +++++
>   gcc/doc/invoke.texi                           |   7 +
>   .../gcc.target/loongarch/avg-ceil-lasx.c      |  22 ++
>   .../gcc.target/loongarch/avg-ceil-lsx.c       |  22 ++
>   .../gcc.target/loongarch/avg-floor-lasx.c     |  22 ++
>   .../gcc.target/loongarch/avg-floor-lsx.c      |  22 ++
>   gcc/testsuite/gcc.target/loongarch/sad-lasx.c |  20 ++
>   gcc/testsuite/gcc.target/loongarch/sad-lsx.c  |  20 ++
>   .../gcc.target/loongarch/vect-widen-add.c     |  26 ++
>   .../gcc.target/loongarch/vect-widen-mul.c     |  26 ++
>   .../gcc.target/loongarch/vect-widen-sub.c     |  26 ++
>   17 files changed, 746 insertions(+), 39 deletions(-)
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-ceil-lasx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-ceil-lsx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-floor-lasx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/avg-floor-lsx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/sad-lasx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/sad-lsx.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-add.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-mul.c
>   create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-widen-sub.c
>