[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v4 26/75] target/i386: introduce M* (memptr) ope
From: |
Jan Bobek |
Subject: |
[Qemu-devel] [RFC PATCH v4 26/75] target/i386: introduce M* (memptr) operands |
Date: |
Wed, 21 Aug 2019 13:29:02 -0400 |
The memory-pointer operand decodes the indirect form of ModR/M byte,
loads the effective address into a register and passes that register
as the operand.
Signed-off-by: Jan Bobek <address@hidden>
---
target/i386/translate.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 9f02ea58d1..46c41cc3be 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4908,6 +4908,42 @@ INSNOP_FINALIZE(Ib)
{
}
+/*
+ * Memory-pointer operand
+ */
+typedef TCGv insnop_arg_t(M);
+typedef struct {} insnop_ctxt_t(M);
+
+INSNOP_INIT(M)
+{
+ bool ret;
+ insnop_ctxt_t(modrm_mod) modctxt;
+
+ ret = insnop_init(modrm_mod)(&modctxt, env, s, modrm, is_write);
+ if (ret) {
+ const int mod =
+ insnop_prepare(modrm_mod)(&modctxt, env, s, modrm, is_write);
+ ret = (mod != 3);
+ insnop_finalize(modrm_mod)(&modctxt, env, s, modrm, is_write, mod);
+ }
+ return ret;
+}
+INSNOP_PREPARE(M)
+{
+ gen_lea_modrm(env, s, modrm);
+ return s->A0;
+}
+INSNOP_FINALIZE(M)
+{
+}
+
+DEF_INSNOP_ALIAS(Mb, M)
+DEF_INSNOP_ALIAS(Mw, M)
+DEF_INSNOP_ALIAS(Md, M)
+DEF_INSNOP_ALIAS(Mq, M)
+DEF_INSNOP_ALIAS(Mdq, M)
+DEF_INSNOP_ALIAS(Mqq, M)
+
static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b)
{
enum {
--
2.20.1
- [Qemu-devel] [RFC PATCH v4 19/75] target/i386: introduce generic either-or operand, (continued)
- [Qemu-devel] [RFC PATCH v4 19/75] target/i386: introduce generic either-or operand, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 22/75] target/i386: introduce modrm operand, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 24/75] target/i386: introduce operand for direct-only r/m field, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 18/75] target/i386: introduce generic operand alias, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 20/75] target/i386: introduce generic load-store operand, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 21/75] target/i386: introduce tcg register operands, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 17/75] target/i386: introduce instruction operand infrastructure, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 27/75] target/i386: introduce G*, R*, E* (general register) operands, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 23/75] target/i386: introduce operands for decoding modrm fields, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 25/75] target/i386: introduce Ib (immediate) operand, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 26/75] target/i386: introduce M* (memptr) operands,
Jan Bobek <=
- [Qemu-devel] [RFC PATCH v4 28/75] target/i386: introduce P*, N*, Q* (MMX) operands, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 30/75] target/i386: alias H* operands with the V* operands, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 29/75] target/i386: introduce H*, L*, V*, U*, W* (SSE/AVX) operands, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 31/75] target/i386: introduce code generators, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 34/75] target/i386: introduce sse-opcode.inc.h, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 32/75] target/i386: introduce helper-based code generator macros, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 33/75] target/i386: introduce gvec-based code generator macros, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 39/75] target/i386: introduce SSE translators, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 35/75] target/i386: introduce instruction translator macros, Jan Bobek, 2019/08/21