]>
git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Implement the vector dot product operation with quadruple width.
The logic for the vector dot product operation, where the destination
elements are quadruple the width of the source elements, is as
follows (Take sdot_prodv4siv16qi as an example.):
v16i8 src1, src2;
v4i32 src3, dest;
dest[0] = src1[0] * src2[0] + src1[1] * src2[1]
+ src1[2] * src2[2] + src1[3] * src2[3]
+ src3[0]
dest[1] = src1[4] * src2[4] + src1[5] * src2[5]
+ src1[6] * src2[6] + src1[7] * src2[7]
+ src3[1]
dest[2] = src1[8] * src2[8] + src1[9] * src2[9]
+ src1[10] * src2[10] + src1[11] * src2[11]
+ src3[2]
dest[3] = src1[12] * src2[12] + src1[13] * src2[13]
+ src1[14] * src2[14] + src1[15] * src2[15]
+ src3[3]
gcc/ChangeLog:
* config/loongarch/lasx.md (ILASX_HB): Move to ...
* config/loongarch/lsx.md (ILSX_HB): Move to ...
* config/loongarch/simd.md (ILSX_HB): ... here.
(ILASX_HB): ... here.
(IVEC_HB): New iterator.
(WVEC_QUARTER): New attr.
(wvec_quarter): Likewise.
(simdfmt_qw): Likewise.
(<su>dot_prod<wvec_quarter><mode>): New template.