]> git.proxmox.com Git - mirror_qemu.git/blame - include/exec/helper-gen.h
Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-20140915-1' into staging
[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
011209e1
RH
9#define DEF_HELPER_FLAGS_0(name, flags, ret) \
10static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret)) \
11{ \
12 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 0, NULL); \
2ef6175a
RH
13}
14
011209e1
RH
15#define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \
16static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
17 dh_arg_decl(t1, 1)) \
18{ \
19 TCGArg args[1] = { dh_arg(t1, 1) }; \
20 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 1, args); \
2ef6175a
RH
21}
22
011209e1
RH
23#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \
24static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
25 dh_arg_decl(t1, 1), dh_arg_decl(t2, 2)) \
26{ \
27 TCGArg args[2] = { dh_arg(t1, 1), dh_arg(t2, 2) }; \
28 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 2, args); \
2ef6175a
RH
29}
30
011209e1
RH
31#define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \
32static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
33 dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3)) \
34{ \
35 TCGArg args[3] = { dh_arg(t1, 1), dh_arg(t2, 2), dh_arg(t3, 3) }; \
36 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 3, args); \
2ef6175a
RH
37}
38
011209e1
RH
39#define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \
40static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
41 dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), \
42 dh_arg_decl(t3, 3), dh_arg_decl(t4, 4)) \
43{ \
44 TCGArg args[4] = { dh_arg(t1, 1), dh_arg(t2, 2), \
45 dh_arg(t3, 3), dh_arg(t4, 4) }; \
46 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 4, args); \
2ef6175a
RH
47}
48
011209e1
RH
49#define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \
50static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
51 dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), \
52 dh_arg_decl(t4, 4), dh_arg_decl(t5, 5)) \
53{ \
54 TCGArg args[5] = { dh_arg(t1, 1), dh_arg(t2, 2), dh_arg(t3, 3), \
55 dh_arg(t4, 4), dh_arg(t5, 5) }; \
56 tcg_gen_callN(&tcg_ctx, HELPER(name), dh_retvar(ret), 5, args); \
2ef6175a
RH
57}
58
59#include "helper.h"
76b53aa3
LV
60#include "trace/generated-helpers.h"
61#include "trace/generated-helpers-wrappers.h"
944eea96 62#include "tcg-runtime.h"
2ef6175a
RH
63
64#undef DEF_HELPER_FLAGS_0
65#undef DEF_HELPER_FLAGS_1
66#undef DEF_HELPER_FLAGS_2
67#undef DEF_HELPER_FLAGS_3
68#undef DEF_HELPER_FLAGS_4
69#undef DEF_HELPER_FLAGS_5
70#undef GEN_HELPER
71
72#endif /* HELPER_GEN_H */