Skip to content
Snippets Groups Projects
user avatar
Pan Li authored
This patch would like to add the VLS support vec_set, both INT
and FP are included.

Give sample code as below:

typedef long long vl_t \
  __attribute__((vector_size(2 * sizeof (long long))));

vl_t init_vl (vl_t v, unsigned index, unsigned value)
{
  v[index] = value;

  return v;
}

Before this patch:
init_vl:
  addi     sp,sp,-16
  vsetivli zero,2,e64,m1,ta,ma
  vle64.v  v1,0(a1)
  vse64.v  v1,0(sp)
  slli     a4,a2,32
  srli     a2,a4,29
  add      a2,sp,a2
  slli     a3,a3,32
  srli     a3,a3,32
  sd       a3,0(a2)
  vle64.v  v1,0(sp)
  vse64.v  v1,0(a0)
  addi     sp,sp,16
  jr       ra

After this patch:
init_vl:
  vsetivli    zero,2,e64,m1,ta,ma
  vle64.v     v1,0(a1)
  slli        a3,a3,32
  srli        a3,a3,32
  addi        a5,a2,1
  vsetvli     zero,a5,e64,m1,tu,ma
  vmv.v.x     v2,a3
  vslideup.vx v1,v2,a2
  vsetivli    zero,2,e64,m1,ta,ma
  vse64.v     v1,0(a0)
  ret

Please note this patch depends the RVV SCALAR_MOVE_MERGED_OP bugfix.

gcc/ChangeLog:

	* config/riscv/autovec.md: Extend to vls mode.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/vls/def.h: New macros.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-10.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-11.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-12.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-13.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-14.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-15.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-16.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-17.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-18.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-19.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-20.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-21.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-22.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-4.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-5.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-6.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-7.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-8.c: New test.
	* gcc.target/riscv/rvv/autovec/vls/vec-set-9.c: New test.

Signed-off-by: default avatarPan Li <pan2.li@intel.com>
aad0c3e1
History
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.