[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~
- [Qemu-devel] [PATCH 32/60] AArch64: Add svc instruction emulation, (continued)
- [Qemu-devel] [PATCH 32/60] AArch64: Add svc instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 35/60] AArch64: Add mrs instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 33/60] AArch64: Add bc instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 38/60] AArch64: Add stub barrier instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 21/60] AArch64: Convert SIMD load/store to common function, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 36/60] AArch64: Add msr instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 37/60] AArch64: Add hint instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 39/60] AArch64: Add stub sys instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 34/60] AArch64: Add b.cond instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 43/60] AArch64: Add cinc instruction emulation, Alexander Graf, 2013/09/26
- Re: [Qemu-devel] [PATCH 43/60] AArch64: Add cinc instruction emulation,
Richard Henderson <=
- [Qemu-devel] [PATCH 45/60] AArch64: Add shift instruction family emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 47/60] AArch64: Add clz instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 40/60] AArch64: Add tbz instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 46/60] AArch64: Add rev instruction family emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 48/60] AArch64: Add 0x1a encoding of add instructions, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 44/60] AArch64: Add division instruction family emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 41/60] AArch64: Add ldr/str instruction family emulation, Alexander Graf, 2013/09/26