diff mbox series

[RFC,v2,24/39] target/i386: introduce Ib (immediate) operand

Message ID 20190810041255.6820-25-jan.bobek@gmail.com (mailing list archive)
State New, archived
Headers show
Series rewrite MMX/SSE instruction translation | expand

Commit Message

Jan Bobek Aug. 10, 2019, 4:12 a.m. UTC
Introduce the immediate-byte operand, which loads a byte from the
instruction stream and passes its value as the operand.

Signed-off-by: Jan Bobek <jan.bobek@gmail.com>
---
 target/i386/translate.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/target/i386/translate.c b/target/i386/translate.c
index 0da064d5fd..b8e6eaebb4 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4697,6 +4697,14 @@  static int ck_cpuid(CPUX86State *env, DisasContext *s, int ck_cpuid_feat)
             insnop_finalize(opTrm)(env, s, modrm, &rm);                 \
         } while (0))
 
+/*
+ * Immediate operand
+ */
+INSNOP(Ib, int8_t,                              \
+       INSNOP_INIT_OK(*op),                     \
+       (*op = x86_ldub_code(env, s)),           \
+       INSNOP_FINALIZE_INVALID)
+
 /*
  * Code generators
  */