qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v2 12/14] target/riscv: Split out the vill from vtype


From: Richard Henderson
Subject: Re: [PATCH v2 12/14] target/riscv: Split out the vill from vtype
Date: Wed, 10 Nov 2021 16:01:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 11/10/21 3:26 PM, LIU Zhiwei wrote:
One question here. Even come before patch 6, we don't have a simple way to choose vill and reserved fields from s2 register in patch 6.

You can certainly split out vill before you create a new way to select it based on xlen. In fact, you *should* do that as a separate patch before extending helper_vsetvl to handle multiple xlen.

Note that vill is always at the msb, so it's easy to find without necessarily defining an XLEN32 field.

As for the reserved "field"... how about

    reserved = MAKE_64BIT_MASK(R_VTYPE_RESERVED_START,
                               xlen - 1 - R_VTYPE_RESERVED_START);
    reserved &= s2;

As env->vill will be used in read_vtype,  we still need to covert env->vill type to target_ulong there.

A cast in read_vtype will do. Explicit casts to uint32_t/uint64_t would remove the need for an ifdef in that function as well.

Is there any benefit to use bool instead of target_ulong?

Self-documentation?


r~



reply via email to

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