1 /* Helper file for declaring TCG helper functions.
2 This one defines data structures private to tcg.c. */
7 #include "exec/helper-head.h"
9 /* Need one more level of indirection before stringification
10 to get all the macros expanded first. */
13 #define DEF_HELPER_FLAGS_0(NAME, FLAGS, ret) \
14 { .func = HELPER(NAME), .name = str(NAME), \
15 .flags = FLAGS | dh_callflag(ret), \
16 .typemask = dh_typemask(ret, 0) },
18 #define DEF_HELPER_FLAGS_1(NAME, FLAGS, ret, t1) \
19 { .func = HELPER(NAME), .name = str(NAME), \
20 .flags = FLAGS | dh_callflag(ret), \
21 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) },
23 #define DEF_HELPER_FLAGS_2(NAME, FLAGS, ret, t1, t2) \
24 { .func = HELPER(NAME), .name = str(NAME), \
25 .flags = FLAGS | dh_callflag(ret), \
26 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
27 | dh_typemask(t2, 2) },
29 #define DEF_HELPER_FLAGS_3(NAME, FLAGS, ret, t1, t2, t3) \
30 { .func = HELPER(NAME), .name = str(NAME), \
31 .flags = FLAGS | dh_callflag(ret), \
32 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
33 | dh_typemask(t2, 2) | dh_typemask(t3, 3) },
35 #define DEF_HELPER_FLAGS_4(NAME, FLAGS, ret, t1, t2, t3, t4) \
36 { .func = HELPER(NAME), .name = str(NAME), \
37 .flags = FLAGS | dh_callflag(ret), \
38 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
39 | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) },
41 #define DEF_HELPER_FLAGS_5(NAME, FLAGS, ret, t1, t2, t3, t4, t5) \
42 { .func = HELPER(NAME), .name = str(NAME), \
43 .flags = FLAGS | dh_callflag(ret), \
44 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
45 | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
46 | dh_typemask(t5, 5) },
48 #define DEF_HELPER_FLAGS_6(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6) \
49 { .func = HELPER(NAME), .name = str(NAME), \
50 .flags = FLAGS | dh_callflag(ret), \
51 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
52 | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
53 | dh_typemask(t5, 5) | dh_typemask(t6, 6) },
55 #define DEF_HELPER_FLAGS_7(NAME, FLAGS, ret, t1, t2, t3, t4, t5, t6, t7) \
56 { .func = HELPER(NAME), .name = str(NAME), .flags = FLAGS, \
57 .typemask = dh_typemask(ret, 0) | dh_typemask(t1, 1) \
58 | dh_typemask(t2, 2) | dh_typemask(t3, 3) | dh_typemask(t4, 4) \
59 | dh_typemask(t5, 5) | dh_typemask(t6, 6) | dh_typemask(t7, 7) },
62 #include "accel/tcg/tcg-runtime.h"
63 #include "accel/tcg/plugin-helpers.h"
66 #undef DEF_HELPER_FLAGS_0
67 #undef DEF_HELPER_FLAGS_1
68 #undef DEF_HELPER_FLAGS_2
69 #undef DEF_HELPER_FLAGS_3
70 #undef DEF_HELPER_FLAGS_4
71 #undef DEF_HELPER_FLAGS_5
72 #undef DEF_HELPER_FLAGS_6
73 #undef DEF_HELPER_FLAGS_7
75 #endif /* HELPER_TCG_H */