This permits the ModR/M byte to be passed raw into the code generator, effectively allowing to short-circuit the operand decoding mechanism and do the decoding work manually in the code generator.
Signed-off-by: Jan Bobek <jan.bo...@gmail.com> --- target/i386/translate.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 7fc5149d29..25c25a30fb 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4740,6 +4740,26 @@ INSNOP_FINALIZE(tcg_temp_i64) tcg_temp_free_i64(arg); } +/* + * modrm + * + * Operand whose value is the ModR/M byte. + */ +typedef int insnop_arg_t(modrm); +typedef struct {} insnop_ctxt_t(modrm); + +INSNOP_INIT(modrm) +{ + return 0; +} +INSNOP_PREPARE(modrm) +{ + return modrm; +} +INSNOP_FINALIZE(modrm) +{ +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { -- 2.20.1