qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC v4 22/70] target/riscv: rvv-1.0: amo operations


From: Richard Henderson
Subject: Re: [RFC v4 22/70] target/riscv: rvv-1.0: amo operations
Date: Sat, 29 Aug 2020 11:50:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 8/17/20 1:49 AM, frank.chang@sifive.com wrote:
> +static bool vext_check_amo(DisasContext *s, int vd, int vs2,
> +                           int wd, int vm, uint8_t eew)
> +{
> +    int8_t emul = ctzl(eew) - (s->sew + 3) + s->lmul;
> +    bool ret = has_ext(s, RVA) &&
> +               (1 << s->sew >= 4) &&
> +               (1 << s->sew <= sizeof(target_ulong)) &&
> +               (eew <= (sizeof(target_ulong) << 3))  &&
> +               require_align(vd, 1 << s->lmul) &&
> +               require_align(vs2, 1 << emul) &&
> +               (emul >= -3 && emul <= 3);
> +    if (wd) {
> +        ret &= require_vm(vm, vd);
> +        if (eew > (1 << (s->sew + 3))) {
> +            if (vd != vs2) {
> +                ret &= require_noover(vd, 1 << s->lmul, vs2, 1 << emul);
> +            }
> +        } else if (eew < (1 << (s->sew + 3))) {
> +            if (emul < 0) {
> +                ret &= require_noover(vd, 1 << s->lmul, vs2, 1 << emul);
> +            } else {
> +                ret &= require_noover_widen(vd, 1 << s->lmul, vs2, 1 << 
> emul);
> +            }
> +        }
> +    }
> +    return ret;
> +}

Same comments for EEW and require_noover.

r~



reply via email to

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