[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 18/39] target/i386: introduce modifier for di
From: |
Jan Bobek |
Subject: |
[Qemu-devel] [RFC PATCH v2 18/39] target/i386: introduce modifier for direct-only operand decoding |
Date: |
Sat, 10 Aug 2019 00:12:34 -0400 |
Many operands can only decode successfully if the ModR/M byte has the
direct form (i.e. MOD=3). Capture this common aspect by introducing a
special operand-initialization statement wrapper.
Signed-off-by: Jan Bobek <address@hidden>
---
target/i386/translate.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 4a2dae6238..0bee7288e6 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4601,6 +4601,15 @@ static int ck_cpuid(CPUX86State *env, DisasContext *s,
int ck_cpuid_feat)
#define INSNOP_FINALIZE_NOOP /* no-op */
#define INSNOP_FINALIZE_INVALID g_assert_not_reached()
+#define INSNOP_INIT_DIRECT_ONLY(init_stmt) \
+ do { \
+ if (decode_modrm_mod(env, s, modrm) == 3) { \
+ init_stmt; \
+ } else { \
+ INSNOP_INIT_FAIL; \
+ } \
+ } while (0)
+
static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b)
{
enum {
--
2.20.1
- Re: [Qemu-devel] [RFC PATCH v2 14/39] target/i386: introduce mnemonic aliases for several gvec operations, (continued)
- [Qemu-devel] [RFC PATCH v2 17/39] target/i386: introduce helpers for decoding modrm fields, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 18/39] target/i386: introduce modifier for direct-only operand decoding,
Jan Bobek <=
- [Qemu-devel] [RFC PATCH v2 20/39] target/i386: introduce generic load-store operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 22/39] target/i386: introduce code generators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 19/39] target/i386: introduce generic operand alias, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 21/39] target/i386: introduce insn.h, Jan Bobek, 2019/08/10
- [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