LoongArch: Fix selector error in lasx_xvexth_h/w/d* patterns

The xvexth related instructions operate SEPARATELY according to
the high and low 128 bits, and sign/zero extend the upper half
of every 128 bits in src to the corresponding 128 bits in dest.

For xvexth.d.w, the rule for the first element of dest should be:
    dest.D[0] = sign_extend (src.W[2] ,64);
instead of:
    dest.D[0] = sign_extend (src.W[4] ,64);

gcc/ChangeLog:

	* config/loongarch/lasx.md: Fix selector index.
This commit is contained in:
Guo Jie 2024-12-30 10:37:18 +08:00 committed by Lulu Cheng
parent 429d08fbfb
commit 693a5e6ae8

View file

@ -4183,10 +4183,10 @@
(any_extend:V16HI
(vec_select:V16QI
(match_operand:V32QI 1 "register_operand" "f")
(parallel [(const_int 16) (const_int 17)
(const_int 18) (const_int 19)
(const_int 20) (const_int 21)
(const_int 22) (const_int 23)
(parallel [(const_int 8) (const_int 9)
(const_int 10) (const_int 11)
(const_int 12) (const_int 13)
(const_int 14) (const_int 15)
(const_int 24) (const_int 25)
(const_int 26) (const_int 27)
(const_int 28) (const_int 29)
@ -4201,8 +4201,8 @@
(any_extend:V8SI
(vec_select:V8HI
(match_operand:V16HI 1 "register_operand" "f")
(parallel [(const_int 8) (const_int 9)
(const_int 10) (const_int 11)
(parallel [(const_int 4) (const_int 5)
(const_int 6) (const_int 7)
(const_int 12) (const_int 13)
(const_int 14) (const_int 15)]))))]
"ISA_HAS_LASX"
@ -4215,7 +4215,7 @@
(any_extend:V4DI
(vec_select:V4SI
(match_operand:V8SI 1 "register_operand" "f")
(parallel [(const_int 4) (const_int 5)
(parallel [(const_int 2) (const_int 3)
(const_int 6) (const_int 7)]))))]
"ISA_HAS_LASX"
"xvexth.d<u>.w<u>\t%u0,%u1"