[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 28/39] target/i386: introduce P*, N*, Q* (MMX
From: |
Jan Bobek |
Subject: |
[Qemu-devel] [RFC PATCH v2 28/39] target/i386: introduce P*, N*, Q* (MMX) operands |
Date: |
Sat, 10 Aug 2019 00:12:44 -0400 |
These address the MMX-technology register file; the corresponding
cpu_env offset is passed as the operand value. Notably, offset of the
entire register is pased at all times, regardless of the operand-size
suffix.
Signed-off-by: Jan Bobek <address@hidden>
---
target/i386/translate.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 9896f1c99e..19b92d61f6 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4801,6 +4801,43 @@ INSNOP_LDST(RqMq, Rq, Mq, NULL,
INSNOP_LDST_UNIFY(Ed, Rd, RdMd)
INSNOP_LDST_UNIFY(Eq, Rq, RqMq)
+/*
+ * MMX registers
+ */
+#define INSNOP_INIT_MM(mmid_fp) \
+ do { \
+ const int mmid = mmid_fp(env, s, modrm); \
+ INSNOP_INIT_OK(offsetof(CPUX86State, fpregs[mmid].mmx)); \
+ } while (0)
+
+#define INSNOP_MM(opT, init_stmt) \
+ INSNOP(opT, uint32_t, \
+ init_stmt, \
+ INSNOP_PREPARE_NOOP, \
+ INSNOP_FINALIZE_NOOP)
+
+INSNOP_MM(P, INSNOP_INIT_MM(decode_modrm_reg_norexr))
+INSNOP_ALIAS(Pd, P)
+INSNOP_ALIAS(Pq, P)
+
+INSNOP_MM(N, INSNOP_INIT_DIRECT_ONLY(INSNOP_INIT_MM(decode_modrm_rm_norexb)))
+INSNOP_ALIAS(Nd, N)
+INSNOP_ALIAS(Nq, N)
+
+INSNOP_LDST(NdMd, Nd, Md, offsetof(CPUX86State, mmx_t0),
+ (assert(ptr == s->A0),
+ gen_ldd_env_A0(s, reg + offsetof(MMXReg, MMX_L(0)))),
+ (assert(ptr == s->A0),
+ gen_std_env_A0(s, reg + offsetof(MMXReg, MMX_L(0)))))
+INSNOP_LDST(NqMq, Nq, Mq, offsetof(CPUX86State, mmx_t0),
+ (assert(ptr == s->A0),
+ gen_ldq_env_A0(s, reg + offsetof(MMXReg, MMX_Q(0)))),
+ (assert(ptr == s->A0),
+ gen_stq_env_A0(s, reg + offsetof(MMXReg, MMX_Q(0)))))
+
+INSNOP_LDST_UNIFY(Qd, Nd, NdMd)
+INSNOP_LDST_UNIFY(Qq, Nq, NqMq)
+
/*
* Code generators
*/
--
2.20.1
- Re: [Qemu-devel] [RFC PATCH v2 21/39] target/i386: introduce insn.h, (continued)
- [Qemu-devel] [RFC PATCH v2 24/39] target/i386: introduce Ib (immediate) operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 25/39] target/i386: introduce M* (memptr) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 23/39] target/i386: introduce instruction translator macros, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 26/39] target/i386: introduce G*, R*, E* (general register) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 27/39] target/i386: introduce RdMw operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 29/39] target/i386: introduce helper-based code generator macros, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 28/39] target/i386: introduce P*, N*, Q* (MMX) operands,
Jan Bobek <=
- [Qemu-devel] [RFC PATCH v2 30/39] target/i386: introduce gvec-based code generator macros, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 31/39] target/i386: introduce MMX translators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 32/39] target/i386: introduce MMX code generators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 33/39] target/i386: introduce MMX instructions to insn.h, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 34/39] target/i386: introduce V*, U*, W* (SSE/AVX) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 35/39] target/i386: introduce UdqMq operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 36/39] target/i386: introduce SSE translators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 39/39] target/i386: introduce memory-pointer operand read/write workarounds, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 37/39] target/i386: introduce SSE code generators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 38/39] target/i386: introduce SSE instructions to insn.h, Jan Bobek, 2019/08/10