Juzhe-Zhong 9cba4fce83 RISC-V: Support VLS basic operation auto-vectorization
This patch support VLS modes auto-vectorization to enhance VLA auto-vectorization
when niters is known.

Consider this following case:

  void __attribute__ ((noinline, noclone))                                     \
  PREFIX##_##TYPE##NUM (TYPE *__restrict a, TYPE *__restrict b, TYPE *__restrict c)  \
  {                                                                            \
    for (int i = 0; i < NUM; ++i)                                              \
      a[i] = b[i] OP c[i];                                                     \
  }

DEF_OP_VV (plus, 16, int8_t, +)

Before this patch:

plus_int8_t16(signed char*, signed char*, signed char*):
        li      a5,16
        csrr    a4,vlenb
        bleu    a5,a4,.L2
        mv      a5,a4
.L2:
        vsetvli zero,a5,e8,m1,ta,ma
        vle8.v  v2,0(a1)
        vle8.v  v1,0(a2)
        vsetvli a4,zero,e8,m1,ta,ma
        vadd.vv v1,v1,v2
        vsetvli zero,a5,e8,m1,ta,ma
        vse8.v  v1,0(a0)
        ret

After this patch:

plus_int8_t16:
	vsetivli	zero,16,e8,m1,ta,ma
	vle8.v	v1,0(a2)
	vle8.v	v2,0(a1)
	vadd.vv	v1,v1,v2
	vse8.v	v1,0(a0)
	ret

gcc/ChangeLog:

	* config/riscv/autovec-vls.md (<optab><mode>3): Add VLS modes.
	* config/riscv/vector-iterators.md: Ditto.
	* config/riscv/vector.md: Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/vls/def.h: Add basic operations.
	* gcc.target/riscv/rvv/autovec/vls/and-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/and-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/and-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/div-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/ior-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/ior-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/ior-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/max-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/min-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/minus-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/minus-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/minus-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/mod-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/mult-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/plus-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/plus-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/plus-3.c: New test.
2023-08-08 07:06:05 +08:00
2023-06-23 00:16:38 +00:00
2023-07-14 00:16:43 +00:00
2023-04-26 00:17:46 +00:00
2022-08-31 00:16:45 +00:00
2023-08-07 22:59:38 +02:00
2023-08-07 22:59:40 +02:00
2023-06-16 00:17:18 +00:00
2023-08-07 22:59:40 +02:00
2023-06-16 00:17:18 +00:00
2023-07-08 00:16:53 +00:00
2022-07-19 17:07:04 +03:00
2023-08-03 00:17:10 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%