[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/60] AArch64: Add STP instruction emulation
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 11/60] AArch64: Add STP instruction emulation |
Date: |
Fri, 27 Sep 2013 10:38:29 -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:
> +static int get_reg(uint32_t inst)
> +{
> + return get_bits(inst, 0, 5);
> +}
Surely get_rt or some such related to the actual field name, not something
so generic as "reg" which applies equally to any of several fields.
> +static void ldst_do_vec(DisasContext *s, int dest, TCGv_i64 tcg_addr_real,
> + int size, bool is_store)
> +{
> + TCGv_i64 tcg_addr = tcg_temp_new_i64();
> + int freg_offs = offsetof(CPUARMState, vfp.regs[dest * 2]);
> +
> + /* we don't want to modify the caller's tcg_addr */
> + tcg_gen_mov_i64(tcg_addr, tcg_addr_real);
Surely merge with ldst_do_vec_int, for the single case of 16 byte size?
> +
> + if (!is_store) {
> + /* normal ldst clears non-loaded bits */
> + clear_fpreg(dest);
> + }
Surely merge with ldst_do_vec_int, to avoid redundant stores into the
vfp register set?
> +static void handle_stp(DisasContext *s, uint32_t insn)
> +{
This handles both ldp and stp though, right?
> + ldst_do(s, rt, tcg_addr, size, is_store, is_signed, is_vector);
> + tcg_gen_addi_i64(tcg_addr, tcg_addr, 1 << size);
> + ldst_do(s, rt2, tcg_addr, size, is_store, is_signed, is_vector);
> + tcg_gen_subi_i64(tcg_addr, tcg_addr, 1 << size);
Why subtract instead of using another temporary?
> + /* Typical major opcode encoding */
> switch ((insn >> 24) & 0x1f) {
> + case 0x08:
> + case 0x09:
> + if (get_bits(insn, 29, 1)) {
> + handle_stp(s, insn);
> + } else {
> + unallocated_encoding(s);
> + }
> + break;
> + case 0x0c:
> + if (get_bits(insn, 29, 1)) {
> + handle_stp(s, insn);
> + } else {
> + unallocated_encoding(s);
> + }
> + break;
> + case 0x0d:
> + if (get_bits(insn, 29, 1)) {
> + handle_stp(s, insn);
> + } else {
> + unallocated_encoding(s);
> + }
> + break;
This leads me to believe that this isn't the best arrangement of the decoder.
I would expect the structure to look more like the arrangement in chapter C3,
especially the major encoding groups in table C3-1.
r~
- [Qemu-devel] [PATCH 10/60] AArch64: Add handling for br instructions, (continued)
- [Qemu-devel] [PATCH 10/60] AArch64: Add handling for br instructions, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 05/60] softfloat: Add stubs for int16 conversion, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 12/60] AArch64: Add ldarx style instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 09/60] AArch64: Add b and bl handling, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 08/60] AArch64: Add support to print VFP registers in CPU, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 22/60] AArch64: Add AdvSIMD scalar three same group handling, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 11/60] AArch64: Add STP instruction emulation, Alexander Graf, 2013/09/26
- Re: [Qemu-devel] [PATCH 11/60] AArch64: Add STP instruction emulation,
Richard Henderson <=
- [Qemu-devel] [PATCH 04/60] arm: Add AArch64 disassembler stub, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 19/60] AArch64: Add ins GPR->Vec instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 07/60] ARM: Add 64bit VFP handling, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 06/60] AArch64: Add set_pc cpu method, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 15/60] AArch64: Add add instruction family emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 17/60] AArch64: Add dup GPR->Vec instruction emulation, Alexander Graf, 2013/09/26
- [Qemu-devel] [PATCH 24/60] AArch64: Add SIMD ushll instruction emulation, Alexander Graf, 2013/09/26