qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 43/60] AArch64: Add cinc instruction emulation


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 43/60] AArch64: Add cinc instruction emulation
Date: Fri, 27 Sep 2013 13:52:50 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

On 09/26/2013 05:48 PM, Alexander Graf wrote:
> +uint64_t HELPER(cinc)(uint32_t pstate, uint32_t insn, uint64_t n, uint64_t m)
> +{
> +    bool else_inc = get_bits(insn, 10, 1);
> +    int cond = get_bits(insn, 12, 4);
> +    bool else_inv = get_bits(insn, 30, 1);
> +    bool is_32bit = !get_bits(insn, 31, 1);
> +    uint64_t r;
> +
> +    if (helper_cond(pstate, cond)) {
> +        r = n;
> +        goto out;
> +    }
> +
> +    r = m;
> +    if (else_inv) {
> +        r = ~r;
> +    }
> +    if (else_inc) {
> +        r++;
> +    }
> +
> +out:
> +    if (is_32bit) {
> +        r = (uint32_t)r;
> +    }
> +
> +    return r;
> +}

Better to properly decode this during translate.  And it's easy to do
everything you need via setcond and movcond.


r~



reply via email to

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