It turns out it is useful to be able to declare operand name
aliases. Introduce a macro to capture this functionality.

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

diff --git a/target/i386/translate.c b/target/i386/translate.c
index 0bee7288e6..cd2467e6a5 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4610,6 +4610,15 @@ static int ck_cpuid(CPUX86State *env, DisasContext *s, 
int ck_cpuid_feat)
         }                                               \
     } while (0)
 
+/*
+ * "Alias" operand helper
+ */
+#define INSNOP_ALIAS(opT, opT2)                               \
+    INSNOP(opT, insnop_t(opT2),                               \
+           return insnop_init(opT2)(env, s, modrm, op),       \
+           insnop_prepare(opT2)(env, s, modrm, op),           \
+           insnop_finalize(opT2)(env, s, modrm, op))
+
 static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b)
 {
     enum {
-- 
2.20.1


Reply via email to