8296638: RISC-V: NegVI node emits wrong code when vector element basic type is T_BYTE/T_SHORT

Reviewed-by: gcao, fyang, shade
This commit is contained in:
Dingli Zhang 2022-11-10 08:39:04 +00:00 committed by Aleksey Shipilev
parent bfc5816595
commit f2acdfdcbd

View File

@ -765,7 +765,9 @@ instruct vnegI(vReg dst, vReg src) %{
ins_cost(VEC_COST);
format %{ "vrsub.vx $dst, $src, $src\t#@vnegI" %}
ins_encode %{
__ vsetvli(t0, x0, Assembler::e32);
BasicType bt = Matcher::vector_element_basic_type(this);
Assembler::SEW sew = Assembler::elemtype_to_sew(bt);
__ vsetvli(t0, x0, sew);
__ vneg_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);