4554
by pbrook
Convert m68k target to TCG. |
1 |
#ifndef DEF_HELPER
|
2 |
#define DEF_HELPER(name, ret, args) ret glue(helper_,name) args;
|
|
3 |
#endif
|
|
4 |
||
5 |
#ifdef GEN_HELPER
|
|
6 |
#define DEF_HELPER_0_0(name, ret, args) \
|
|
7 |
DEF_HELPER(name, ret, args) \
|
|
8 |
static inline void gen_helper_##name(void) \
|
|
9 |
{ \
|
|
10 |
tcg_gen_helper_0_0(helper_##name); \
|
|
11 |
}
|
|
12 |
#define DEF_HELPER_0_1(name, ret, args) \
|
|
13 |
DEF_HELPER(name, ret, args) \
|
|
14 |
static inline void gen_helper_##name(TCGv arg1) \
|
|
15 |
{ \
|
|
16 |
tcg_gen_helper_0_1(helper_##name, arg1); \
|
|
17 |
}
|
|
18 |
#define DEF_HELPER_0_2(name, ret, args) \
|
|
19 |
DEF_HELPER(name, ret, args) \
|
|
20 |
static inline void gen_helper_##name(TCGv arg1, TCGv arg2) \
|
|
21 |
{ \
|
|
22 |
tcg_gen_helper_0_2(helper_##name, arg1, arg2); \
|
|
23 |
}
|
|
24 |
#define DEF_HELPER_0_3(name, ret, args) \
|
|
25 |
DEF_HELPER(name, ret, args) \
|
|
26 |
static inline void gen_helper_##name( \
|
|
27 |
TCGv arg1, TCGv arg2, TCGv arg3) \
|
|
28 |
{ \
|
|
29 |
tcg_gen_helper_0_3(helper_##name, arg1, arg2, arg3); \
|
|
30 |
}
|
|
31 |
#define DEF_HELPER_1_0(name, ret, args) \
|
|
32 |
DEF_HELPER(name, ret, args) \
|
|
33 |
static inline void gen_helper_##name(TCGv ret) \
|
|
34 |
{ \
|
|
35 |
tcg_gen_helper_1_0(helper_##name, ret); \
|
|
36 |
}
|
|
37 |
#define DEF_HELPER_1_1(name, ret, args) \
|
|
38 |
DEF_HELPER(name, ret, args) \
|
|
39 |
static inline void gen_helper_##name(TCGv ret, TCGv arg1) \
|
|
40 |
{ \
|
|
41 |
tcg_gen_helper_1_1(helper_##name, ret, arg1); \
|
|
42 |
}
|
|
43 |
#define DEF_HELPER_1_2(name, ret, args) \
|
|
44 |
DEF_HELPER(name, ret, args) \
|
|
45 |
static inline void gen_helper_##name(TCGv ret, TCGv arg1, TCGv arg2) \
|
|
46 |
{ \
|
|
47 |
tcg_gen_helper_1_2(helper_##name, ret, arg1, arg2); \
|
|
48 |
}
|
|
49 |
#define DEF_HELPER_1_3(name, ret, args) \
|
|
50 |
DEF_HELPER(name, ret, args) \
|
|
51 |
static inline void gen_helper_##name(TCGv ret, \
|
|
52 |
TCGv arg1, TCGv arg2, TCGv arg3) \
|
|
53 |
{ \
|
|
54 |
tcg_gen_helper_1_3(helper_##name, ret, arg1, arg2, arg3); \
|
|
55 |
}
|
|
56 |
#define DEF_HELPER_1_4(name, ret, args) \
|
|
57 |
DEF_HELPER(name, ret, args) \
|
|
58 |
static inline void gen_helper_##name(TCGv ret, \
|
|
59 |
TCGv arg1, TCGv arg2, TCGv arg3, TCGv arg4) \
|
|
60 |
{ \
|
|
61 |
tcg_gen_helper_1_4(helper_##name, ret, arg1, arg2, arg3, arg4); \
|
|
62 |
}
|
|
63 |
#else /* !GEN_HELPER */ |
|
64 |
#define DEF_HELPER_0_0 DEF_HELPER
|
|
65 |
#define DEF_HELPER_0_1 DEF_HELPER
|
|
66 |
#define DEF_HELPER_0_2 DEF_HELPER
|
|
67 |
#define DEF_HELPER_0_3 DEF_HELPER
|
|
68 |
#define DEF_HELPER_1_0 DEF_HELPER
|
|
69 |
#define DEF_HELPER_1_1 DEF_HELPER
|
|
70 |
#define DEF_HELPER_1_2 DEF_HELPER
|
|
71 |
#define DEF_HELPER_1_3 DEF_HELPER
|
|
72 |
#define DEF_HELPER_1_4 DEF_HELPER
|
|
73 |
#define HELPER(x) glue(helper_,x)
|
|
74 |
#endif
|
|
75 |
||
76 |
DEF_HELPER_1_1(bitrev, uint32_t, (uint32_t)) |
|
77 |
DEF_HELPER_1_1(ff1, uint32_t, (uint32_t)) |
|
78 |
DEF_HELPER_1_2(sats, uint32_t, (uint32_t, uint32_t)) |
|
79 |
DEF_HELPER_0_2(divu, void, (CPUState *, uint32_t)) |
|
80 |
DEF_HELPER_0_2(divs, void, (CPUState *, uint32_t)) |
|
81 |
DEF_HELPER_1_3(addx_cc, uint32_t, (CPUState *, uint32_t, uint32_t)) |
|
82 |
DEF_HELPER_1_3(subx_cc, uint32_t, (CPUState *, uint32_t, uint32_t)) |
|
83 |
DEF_HELPER_1_3(shl_cc, uint32_t, (CPUState *, uint32_t, uint32_t)) |
|
84 |
DEF_HELPER_1_3(shr_cc, uint32_t, (CPUState *, uint32_t, uint32_t)) |
|
85 |
DEF_HELPER_1_3(sar_cc, uint32_t, (CPUState *, uint32_t, uint32_t)) |
|
86 |
DEF_HELPER_1_2(xflag_lt, uint32_t, (uint32_t, uint32_t)) |
|
87 |
DEF_HELPER_0_2(set_sr, void, (CPUState *, uint32_t)) |
|
88 |
DEF_HELPER_0_3(movec, void, (CPUState *, uint32_t, uint32_t)) |
|
89 |
||
90 |
DEF_HELPER_1_2(f64_to_i32, float32, (CPUState *, float64)) |
|
91 |
DEF_HELPER_1_2(f64_to_f32, float32, (CPUState *, float64)) |
|
92 |
DEF_HELPER_1_2(i32_to_f64, float64, (CPUState *, uint32_t)) |
|
93 |
DEF_HELPER_1_2(f32_to_f64, float64, (CPUState *, float32)) |
|
94 |
DEF_HELPER_1_2(iround_f64, float64, (CPUState *, float64)) |
|
95 |
DEF_HELPER_1_2(itrunc_f64, float64, (CPUState *, float64)) |
|
96 |
DEF_HELPER_1_2(sqrt_f64, float64, (CPUState *, float64)) |
|
97 |
DEF_HELPER_1_1(abs_f64, float64, (float64)) |
|
98 |
DEF_HELPER_1_1(chs_f64, float64, (float64)) |
|
99 |
DEF_HELPER_1_3(add_f64, float64, (CPUState *, float64, float64)) |
|
100 |
DEF_HELPER_1_3(sub_f64, float64, (CPUState *, float64, float64)) |
|
101 |
DEF_HELPER_1_3(mul_f64, float64, (CPUState *, float64, float64)) |
|
102 |
DEF_HELPER_1_3(div_f64, float64, (CPUState *, float64, float64)) |
|
103 |
DEF_HELPER_1_3(sub_cmp_f64, float64, (CPUState *, float64, float64)) |
|
104 |
DEF_HELPER_1_2(compare_f64, uint32_t, (CPUState *, float64)) |
|
105 |
||
106 |
DEF_HELPER_0_3(mac_move, void, (CPUState *, uint32_t, uint32_t)) |
|
107 |
DEF_HELPER_1_3(macmulf, uint64_t, (CPUState *, uint32_t, uint32_t)) |
|
108 |
DEF_HELPER_1_3(macmuls, uint64_t, (CPUState *, uint32_t, uint32_t)) |
|
109 |
DEF_HELPER_1_3(macmulu, uint64_t, (CPUState *, uint32_t, uint32_t)) |
|
110 |
DEF_HELPER_0_2(macsats, void, (CPUState *, uint32_t)) |
|
111 |
DEF_HELPER_0_2(macsatu, void, (CPUState *, uint32_t)) |
|
112 |
DEF_HELPER_0_2(macsatf, void, (CPUState *, uint32_t)) |
|
113 |
DEF_HELPER_0_2(mac_set_flags, void, (CPUState *, uint32_t)) |
|
114 |
DEF_HELPER_0_2(set_macsr, void, (CPUState *, uint32_t)) |
|
115 |
DEF_HELPER_1_2(get_macf, uint32_t, (CPUState *, uint64_t)) |
|
116 |
DEF_HELPER_1_1(get_macs, uint32_t, (uint64_t)) |
|
117 |
DEF_HELPER_1_1(get_macu, uint32_t, (uint64_t)) |
|
118 |
DEF_HELPER_1_2(get_mac_extf, uint32_t, (CPUState *, uint32_t)) |
|
119 |
DEF_HELPER_1_2(get_mac_exti, uint32_t, (CPUState *, uint32_t)) |
|
120 |
DEF_HELPER_0_3(set_mac_extf, void, (CPUState *, uint32_t, uint32_t)) |
|
121 |
DEF_HELPER_0_3(set_mac_exts, void, (CPUState *, uint32_t, uint32_t)) |
|
122 |
DEF_HELPER_0_3(set_mac_extu, void, (CPUState *, uint32_t, uint32_t)) |
|
123 |
||
124 |
DEF_HELPER_0_2(flush_flags, void, (CPUState *, uint32_t)) |
|
125 |
DEF_HELPER_0_1(raise_exception, void, (uint32_t)) |
|
126 |
||
127 |
#undef DEF_HELPER
|
|
128 |
#undef DEF_HELPER_0_0
|
|
129 |
#undef DEF_HELPER_0_1
|
|
130 |
#undef DEF_HELPER_0_2
|
|
131 |
#undef DEF_HELPER_0_3
|
|
132 |
#undef DEF_HELPER_1_0
|
|
133 |
#undef DEF_HELPER_1_1
|
|
134 |
#undef DEF_HELPER_1_2
|
|
135 |
#undef DEF_HELPER_1_3
|
|
136 |
#undef DEF_HELPER_1_4
|
|
137 |
#undef GEN_HELPER
|
|
138 |
#undef DEF_HELPER
|