qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v5 06/68] target/riscv: rvv-1.0: add translation-time vector co


From: Richard Henderson
Subject: Re: [RFC v5 06/68] target/riscv: rvv-1.0: add translation-time vector context status
Date: Mon, 5 Oct 2020 09:00:01 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 10/5/20 2:12 AM, Frank Chang wrote:
>     I think you want to be sharing the code between vsetvl and vsetvli now.  
> Just
>     pass in a TCGv value to a common helper.
> 
> 
> The only difference now between vsetvl and vsetvli is the format of zimm and 
> s2
> fields.
> But they have different formats and are queried by different functions,
> i.e. s2 = tcg_const_tl(a->zimm); and gen_get_gpr(s2, a->rs2);
> 
> Is there any elegant way to retrieve the values of zimm and s2 by shared 
> common
> codes?

Yes, like I (too briefly) described:

static bool do_vsetvl(DisasContext *ctx,
                      int rd, int rs1, TCGv s2)
{
    // existing contents of trans_vsetvl
    // do continue to free s2.
}

static bool trans_vsetvl(DisasContext *ctx, arg_vsetvl *a)
{
    TCGv s2 = tcg_temp_new();
    gen_get_gpr(s2, a->rs2);
    return do_vsetvl(ctx, a->rd, a->rs1, s2);
}

static bool trans_vsetvli(DisasContext *ctx, arg_vsetvli *a)
{
    TCGv s2 = tcg_const_tl(a->zimm);
    return do_vsetvl(ctx, a->rd, a->rs1, s2);
}


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]