On Sun, 2025-11-16 at 12:44 +0800, Xi Ruoyao wrote:
/* snip */
> diff --git a/gcc/config/loongarch/loongarch.cc
> b/gcc/config/loongarch/loongarch.cc
> index fcca0ec8252..39a40674f62 100644
> --- a/gcc/config/loongarch/loongarch.cc
> +++ b/gcc/config/loongarch/loongarch.cc
> @@ -9098,57 +9098,15 @@ loongarch_expand_vec_perm_1 (rtx operands[])
> /* Number of elements in the vector. */
> w = GET_MODE_NUNITS (mode);
>
> - rtx round_data[MAX_VECT_LEN];
> - rtx round_reg, round_data_rtx;
/* snip */
> - default:
> - gcc_unreachable ();
> - break;
> - }
> + /* If we are using xvshuf.*, clamp the selector to avoid unpredictable
> + output. */
> + if (maskmode != V8SImode && maskmode != V4DImode)
> + {
> + rtx t = simplify_const_unary_operation (VEC_DUPLICATE, maskmode,
> + GEN_INT (0x1f),
> + GET_MODE_INNER (maskmode));
Should use gen_const_vec_duplicate here.
--
Xi Ruoyao <[email protected]>