machine_mode mask_mode = riscv_vector::get_vector_mode
(BImode, GET_MODE_NUNITS (info.vmode)).require ();
rtx mask = CONSTM1_RTX (mask_mode);
- if (!satisfies_constraint_K (cnt))
+ if (!satisfies_constraint_vl (cnt))
cnt= force_reg (Pmode, cnt);
rtx m_ops[] = {vec, mask, src};
emit_nonvlmax_insn (code_for_pred_mov (info.vmode),
}
else
{
- if (!satisfies_constraint_K (info.avl))
+ if (!satisfies_constraint_vl (info.avl))
info.avl = force_reg (Pmode, info.avl);
emit_nonvlmax_insn (code_for_pred_broadcast (info.vmode),
riscv_vector::UNARY_OP, broadcast_ops, info.avl);
}
else
{
- if (!satisfies_constraint_K (length_in))
+ if (!satisfies_constraint_vl (length_in))
length_in = force_reg (Pmode, length_in);
rtx memmask = CONSTM1_RTX (mask_mode);
static rtx
force_vector_length_operand (rtx vl)
{
- if (CONST_INT_P (vl) && !satisfies_constraint_K (vl))
+ if (CONST_INT_P (vl) && !satisfies_constraint_vl (vl))
return force_reg (Pmode, vl);
return vl;
}
}
else
{
- if (!satisfies_constraint_K (len))
+ if (!satisfies_constraint_vl (len))
len = force_reg (Pmode, len);
if (is_load)
{
emit_vlmax_insn (icode, BINARY_OP_TAMA, emit_ops);
else
{
- len = satisfies_constraint_K (len) ? len : force_reg (Pmode, len);
+ len = satisfies_constraint_vl (len) ? len : force_reg (Pmode, len);
emit_nonvlmax_insn (icode, BINARY_OP_TAMA, emit_ops, len);
}
}
}
else
{
- len = satisfies_constraint_K (len) ? len : force_reg (Pmode, len);
+ len = satisfies_constraint_vl (len) ? len : force_reg (Pmode, len);
vl_type = get_avl_type_rtx (NONVLMAX);
}
}
else
{
- if (!satisfies_constraint_K (len))
+ if (!satisfies_constraint_vl (len))
len = force_reg (Pmode, len);
if (is_load)
{
--- /dev/null
+/* { dg-do compile { target { { ! riscv_abi_e } && rv32 } } } */
+/* { dg-options "-march=rv32gc_xtheadvector -O2" } */
+/* { dg-final { check-function-bodies "**" "" } } */
+
+/*
+** foo0_1:
+** sb\tzero,0\([a-x0-9]+\)
+** ret
+*/
+void foo0_1 (void *p)
+{
+ __builtin_memset (p, 0, 1);
+}
+
+/*
+** foo0_7:
+** li\t[a-x0-9]+,7
+** th.vsetvli\tzero,[a-x0-9]+,e8,m1
+** th\.vmv\.v\.i\tv[0-9],0
+** th\.vse\.v\tv[0-9]+,0\([a-x0-9]+\)
+** ret
+*/
+void foo0_7 (void *p)
+{
+ __builtin_memset (p, 0, 7);
+}
+
+/*
+** foo1_1:
+** li\t[a-x0-9]+,1
+** sb\t[a-x0-9]+,0\([a-x0-9]+\)
+** ret
+*/
+void foo1_1 (void *p)
+{
+ __builtin_memset (p, 1, 1);
+}
+
+/*
+** foo1_5:
+** li\t[a-x0-9]+,5
+** th.vsetvli\tzero,[a-x0-9]+,e8,m1
+** th\.vmv\.v\.i\tv[0-9],1
+** th\.vse\.v\tv[0-9]+,0\([a-x0-9]+\)
+** ret
+*/
+
+void foo1_5 (void *p)
+{
+ __builtin_memset (p, 1, 5);
+}
-/* { dg-do compile { target { ! riscv_abi_e } } } */
-/* { dg-options "-march=rv32gc_xtheadvector -O2" { target { rv32 } } } */
-/* { dg-options "-march=rv64gc_xtheadvector -O2" { target { rv64 } } } */
+/* { dg-do compile { target { { ! riscv_abi_e } && rv64 } } } */
+/* { dg-options "-march=rv64gc_xtheadvector -O2" } */
/* { dg-final { check-function-bodies "**" "" } } */
/*
--- /dev/null
+/* { dg-do compile { target { ! riscv_abi_e } } } */
+/* { dg-options "-march=rv32gc_xtheadvector -O2" { target { rv32 } } } */
+/* { dg-options "-march=rv64gc_xtheadvector -O2" { target { rv64 } } } */
+/* { dg-final { check-function-bodies "**" "" } } */
+
+/*
+** foo1_16:
+** li\t[a-x0-9]+,16
+** th.vsetvli\tzero,[a-x0-9]+,e8,m1
+** th\.vmv\.v\.i\tv[0-9],1
+** th\.vse\.v\tv[0-9]+,0\([a-x0-9]+\)
+** ret
+*/
+
+void foo1_16 (void *p)
+{
+ __builtin_memset (p, 1, 16);
+}