[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 22/60] target/riscv: vector integer merge and move instruc
From: |
Richard Henderson |
Subject: |
Re: [PATCH v5 22/60] target/riscv: vector integer merge and move instructions |
Date: |
Sun, 15 Mar 2020 22:32:53 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/15/20 7:57 PM, LIU Zhiwei wrote:
>> You definitely want to use tcg_gen_gvec_mov (vv), tcg_gen_gvec_dup_i{32,64}
>> (vx) and tcg_gen_gvec_dup{8,16,32,64}i (vi).
> I have a question here.
>
> Are these GVEC IRsĀ proper for any vl, or just when vl equals vlmax?
> I see there are some align assert in these GVEC IR.
Only vl_eq_vlmax. I should have been more precise.
But I expect this boolean to be true quite often.
>
> Now the code is like
>
> static bool trans_vmv_v_v(DisasContext *s, arg_r *a)
> {
> if (vext_check_isa_ill(s, RVV) &&
> vext_check_reg(s, a->rd, false) &&
> vext_check_reg(s, a->rs1, false)) {
>
> if (s->vl_eq_vlmax) {
> tcg_gen_gvec_mov(s->sew, vreg_ofs(s, a->rd),
> vreg_ofs(s, a->rs1),
> MAXSZ(s), MAXSZ(s));
> } else {
> uint32_t data = FIELD_DP32(0, VDATA, LMUL, s->lmul);
> static gen_helper_gvec_2_ptr * const fns[4] = {
> gen_helper_vmv_v_v_b, gen_helper_vmv_v_v_h,
> gen_helper_vmv_v_v_w, gen_helper_vmv_v_v_d,
> };
>
> tcg_gen_gvec_2_ptr(vreg_ofs(s, a->rd), vreg_ofs(s, a->rs1),
> cpu_env, 0, s->vlen / 8, data, fns[s->sew]);
> }
> return true;
> }
> return false;
> }
>
> Is it right?
Yes, that looks fine.
r~
- Re: [PATCH v5 18/60] target/riscv: vector integer divide instructions, (continued)
- [PATCH v5 23/60] target/riscv: vector single-width saturating add and subtract, LIU Zhiwei, 2020/03/12
- [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, LIU Zhiwei, 2020/03/12
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, Richard Henderson, 2020/03/14
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, Richard Henderson, 2020/03/14
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, LIU Zhiwei, 2020/03/14
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, Richard Henderson, 2020/03/14
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, LIU Zhiwei, 2020/03/15
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, Richard Henderson, 2020/03/15
[PATCH v5 25/60] target/riscv: vector single-width fractional multiply with rounding and saturation, LIU Zhiwei, 2020/03/12