https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119114

--- Comment #19 from Li Pan <pan2.li at intel dot com> ---
> No you got it wrong.
> _121 will either be -1 or 0. _11 should be -1 or 0 too.
> So the question is what was the VEC_EXTRACT doing the right thing? Is it 0/-1 
> or 0/1? 

Oh, I see. Let me revisit the dump code.

> diff --git a/gcc/config/riscv/autovec.md b/gcc/config/riscv/autovec.md
> index 92e6942b523..c484e9f3c70 100644
> --- a/gcc/config/riscv/autovec.md
> +++ b/gcc/config/riscv/autovec.md
> @@ -1451,14 +1451,16 @@ (define_expand "vec_extract<mode>qi"
> 
>  ;; Same for a BImode but still return a QImode.
>  (define_expand "vec_extract<mode>bi"
> -  [(set (match_operand:QI        0 "register_operand")
> -     (vec_select:QI
> +  [(set (match_operand:BI        0 "register_operand")
> +     (vec_select:BI
>         (match_operand:VB_VLS     1 "register_operand")
>         (parallel
>          [(match_operand          2 "nonmemory_operand")])))]
>    "TARGET_VECTOR"
>  {
> -  emit_insn (gen_vec_extract<mode>qi (operands[0], operands[1], 
> operands[2]));
> +  rtl qir = gen_reg (QImode);
> +  emit_insn (gen_vec_extract<mode>qi (qir, operands[1], operands[2]));
> +  emit_move_insn (operands[0], gen_lowpart (BImode, qir));
>    DONE;
>  })

Have a quick try as above change, seems still fail here.

Reply via email to