target/riscv: rvv: Add tail agnostic for vector integer shift instructions
Signed-off-by: eop Chen <eop.chen@sifive.com> Reviewed-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <165449614532.19704.7000832880482980398-8@git.sr.ht> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
5c19fc156e
commit
7b1bff41c1
|
@ -1831,7 +1831,7 @@ do_opivx_gvec_shift(DisasContext *s, arg_rmrr *a, GVecGen2sFn32 *gvec_fn,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (a->vm && s->vl_eq_vlmax) {
|
||||
if (a->vm && s->vl_eq_vlmax && !(s->vta && s->lmul < 0)) {
|
||||
TCGv_i32 src1 = tcg_temp_new_i32();
|
||||
|
||||
tcg_gen_trunc_tl_i32(src1, get_gpr(s, a->rs1, EXT_NONE));
|
||||
|
@ -1890,6 +1890,7 @@ static bool trans_##NAME(DisasContext *s, arg_rmrr *a) \
|
|||
\
|
||||
data = FIELD_DP32(data, VDATA, VM, a->vm); \
|
||||
data = FIELD_DP32(data, VDATA, LMUL, s->lmul); \
|
||||
data = FIELD_DP32(data, VDATA, VTA, s->vta); \
|
||||
tcg_gen_gvec_4_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, 0), \
|
||||
vreg_ofs(s, a->rs1), \
|
||||
vreg_ofs(s, a->rs2), cpu_env, \
|
||||
|
|
|
@ -1271,6 +1271,9 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, \
|
|||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t esz = sizeof(TS1); \
|
||||
uint32_t total_elems = vext_get_total_elems(env, desc, esz); \
|
||||
uint32_t vta = vext_vta(desc); \
|
||||
uint32_t i; \
|
||||
\
|
||||
for (i = env->vstart; i < vl; i++) { \
|
||||
|
@ -1282,6 +1285,8 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, \
|
|||
*((TS1 *)vd + HS1(i)) = OP(s2, s1 & MASK); \
|
||||
} \
|
||||
env->vstart = 0; \
|
||||
/* set tail elements to 1s */ \
|
||||
vext_set_elems_1s(vd, vta, vl * esz, total_elems * esz); \
|
||||
}
|
||||
|
||||
GEN_VEXT_SHIFT_VV(vsll_vv_b, uint8_t, uint8_t, H1, H1, DO_SLL, 0x7)
|
||||
|
@ -1306,6 +1311,10 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, \
|
|||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t esz = sizeof(TD); \
|
||||
uint32_t total_elems = \
|
||||
vext_get_total_elems(env, desc, esz); \
|
||||
uint32_t vta = vext_vta(desc); \
|
||||
uint32_t i; \
|
||||
\
|
||||
for (i = env->vstart; i < vl; i++) { \
|
||||
|
@ -1316,6 +1325,8 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, \
|
|||
*((TD *)vd + HD(i)) = OP(s2, s1 & MASK); \
|
||||
} \
|
||||
env->vstart = 0; \
|
||||
/* set tail elements to 1s */ \
|
||||
vext_set_elems_1s(vd, vta, vl * esz, total_elems * esz);\
|
||||
}
|
||||
|
||||
GEN_VEXT_SHIFT_VX(vsll_vx_b, uint8_t, int8_t, H1, H1, DO_SLL, 0x7)
|
||||
|
|
Loading…
Reference in New Issue