[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 29/39] target/i386: introduce helper-based co
From: |
Jan Bobek |
Subject: |
[Qemu-devel] [RFC PATCH v2 29/39] target/i386: introduce helper-based code generator macros |
Date: |
Sat, 10 Aug 2019 00:12:45 -0400 |
Code generators defined using these macros rely on a helper function
(as emitted by gen_helper_*).
Signed-off-by: Jan Bobek <address@hidden>
---
target/i386/translate.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 19b92d61f6..d721bb5142 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -4856,6 +4856,32 @@ INSNOP_LDST_UNIFY(Qq, Nq, NqMq)
#define gen_insn_wrrr(mnem, opW1, opR1, opR2, opR3) \
gen_ ## mnem ## _ ## opW1 ## opR1 ## opR2 ## opR3
+#define GEN_INSN_HELPER(mnem, helper) \
+ static void gen_insn(mnem)( \
+ CPUX86State *env, DisasContext *s) \
+ { \
+ gen_helper_ ## helper(cpu_env); \
+ }
+#define GEN_INSN_WR_HELPER(mnem, helper, opW1, opR1) \
+ static void gen_insn_wr(mnem, opW1, opR1)( \
+ CPUX86State *env, DisasContext *s, insnop_t(opW1) ret, \
+ insnop_t(opR1) arg1) \
+ { \
+ tcg_gen_addi_ptr(s->ptr0, cpu_env, ret); \
+ tcg_gen_addi_ptr(s->ptr1, cpu_env, arg1); \
+ gen_helper_ ## helper(cpu_env, s->ptr0, s->ptr1); \
+ }
+#define GEN_INSN_WRR_HELPER(mnem, helper, opW1, opR1, opR2) \
+ static void gen_insn_wrr(mnem, opW1, opR1, opR2)( \
+ CPUX86State *env, DisasContext *s, insnop_t(opW1) ret, \
+ insnop_t(opR1) arg1, insnop_t(opR2) arg2) \
+ { \
+ assert(ret == arg1); \
+ tcg_gen_addi_ptr(s->ptr0, cpu_env, ret); \
+ tcg_gen_addi_ptr(s->ptr1, cpu_env, arg2); \
+ gen_helper_ ## helper(cpu_env, s->ptr0, s->ptr1); \
+ }
+
/*
* Instruction translators
*/
--
2.20.1
- [Qemu-devel] [RFC PATCH v2 21/39] target/i386: introduce insn.h, (continued)
- [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
- [Qemu-devel] [RFC PATCH v2 26/39] target/i386: introduce G*, R*, E* (general register) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 27/39] target/i386: introduce RdMw operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 29/39] target/i386: introduce helper-based code generator macros,
Jan Bobek <=
- [Qemu-devel] [RFC PATCH v2 28/39] target/i386: introduce P*, N*, Q* (MMX) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 30/39] target/i386: introduce gvec-based code generator macros, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 31/39] target/i386: introduce MMX translators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 32/39] target/i386: introduce MMX code generators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 33/39] target/i386: introduce MMX instructions to insn.h, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 34/39] target/i386: introduce V*, U*, W* (SSE/AVX) operands, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 35/39] target/i386: introduce UdqMq operand, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 36/39] target/i386: introduce SSE translators, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 39/39] target/i386: introduce memory-pointer operand read/write workarounds, Jan Bobek, 2019/08/10
- [Qemu-devel] [RFC PATCH v2 37/39] target/i386: introduce SSE code generators, Jan Bobek, 2019/08/10