]> git.proxmox.com Git - mirror_qemu.git/blame - include/exec/helper-gen.h
tcg: Remove sizemask and flags arguments to tcg_gen_callN
[mirror_qemu.git] / include / exec / helper-gen.h
CommitLineData
2ef6175a
RH
1/* Helper file for declaring TCG helper functions.
2 This one expands generation functions for tcg opcodes. */
3
4#ifndef HELPER_GEN_H
5#define HELPER_GEN_H 1
6
7#include <exec/helper-head.h>
8
9#define DEF_HELPER_FLAGS_0(name, flags, ret) \
10static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret)) \
11{ \
bbb8a1b4 12 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 0, NULL); \
2ef6175a
RH
13}
14
15#define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \
16static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1)) \
17{ \
18 TCGArg args[1]; \
2ef6175a 19 dh_arg(t1, 1); \
bbb8a1b4 20 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 1, args); \
2ef6175a
RH
21}
22
23#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \
24static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \
25 dh_arg_decl(t2, 2)) \
26{ \
27 TCGArg args[2]; \
2ef6175a
RH
28 dh_arg(t1, 1); \
29 dh_arg(t2, 2); \
bbb8a1b4 30 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 2, args); \
2ef6175a
RH
31}
32
33#define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \
34static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \
35 dh_arg_decl(t2, 2), dh_arg_decl(t3, 3)) \
36{ \
37 TCGArg args[3]; \
2ef6175a
RH
38 dh_arg(t1, 1); \
39 dh_arg(t2, 2); \
40 dh_arg(t3, 3); \
bbb8a1b4 41 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 3, args); \
2ef6175a
RH
42}
43
44#define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \
45static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \
46 dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), dh_arg_decl(t4, 4)) \
47{ \
48 TCGArg args[4]; \
2ef6175a
RH
49 dh_arg(t1, 1); \
50 dh_arg(t2, 2); \
51 dh_arg(t3, 3); \
52 dh_arg(t4, 4); \
bbb8a1b4 53 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 4, args); \
2ef6175a
RH
54}
55
56#define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \
57static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
58 dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), \
59 dh_arg_decl(t4, 4), dh_arg_decl(t5, 5)) \
60{ \
61 TCGArg args[5]; \
2ef6175a
RH
62 dh_arg(t1, 1); \
63 dh_arg(t2, 2); \
64 dh_arg(t3, 3); \
65 dh_arg(t4, 4); \
66 dh_arg(t5, 5); \
bbb8a1b4 67 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 5, args); \
2ef6175a
RH
68}
69
70#include "helper.h"
944eea96 71#include "tcg-runtime.h"
2ef6175a
RH
72
73#undef DEF_HELPER_FLAGS_0
74#undef DEF_HELPER_FLAGS_1
75#undef DEF_HELPER_FLAGS_2
76#undef DEF_HELPER_FLAGS_3
77#undef DEF_HELPER_FLAGS_4
78#undef DEF_HELPER_FLAGS_5
79#undef GEN_HELPER
80
81#endif /* HELPER_GEN_H */