1 DEF_HELPER_FLAGS_2(div_i32
, TCG_CALL_NO_RWG_SE
, s32
, s32
, s32
)
2 DEF_HELPER_FLAGS_2(rem_i32
, TCG_CALL_NO_RWG_SE
, s32
, s32
, s32
)
3 DEF_HELPER_FLAGS_2(divu_i32
, TCG_CALL_NO_RWG_SE
, i32
, i32
, i32
)
4 DEF_HELPER_FLAGS_2(remu_i32
, TCG_CALL_NO_RWG_SE
, i32
, i32
, i32
)
6 DEF_HELPER_FLAGS_2(div_i64
, TCG_CALL_NO_RWG_SE
, s64
, s64
, s64
)
7 DEF_HELPER_FLAGS_2(rem_i64
, TCG_CALL_NO_RWG_SE
, s64
, s64
, s64
)
8 DEF_HELPER_FLAGS_2(divu_i64
, TCG_CALL_NO_RWG_SE
, i64
, i64
, i64
)
9 DEF_HELPER_FLAGS_2(remu_i64
, TCG_CALL_NO_RWG_SE
, i64
, i64
, i64
)
11 DEF_HELPER_FLAGS_2(shl_i64
, TCG_CALL_NO_RWG_SE
, i64
, i64
, i64
)
12 DEF_HELPER_FLAGS_2(shr_i64
, TCG_CALL_NO_RWG_SE
, i64
, i64
, i64
)
13 DEF_HELPER_FLAGS_2(sar_i64
, TCG_CALL_NO_RWG_SE
, s64
, s64
, s64
)
15 DEF_HELPER_FLAGS_2(mulsh_i64
, TCG_CALL_NO_RWG_SE
, s64
, s64
, s64
)
16 DEF_HELPER_FLAGS_2(muluh_i64
, TCG_CALL_NO_RWG_SE
, i64
, i64
, i64
)
18 DEF_HELPER_FLAGS_1(exit_atomic
, TCG_CALL_NO_WG
, noreturn
, env
)
22 DEF_HELPER_FLAGS_5(atomic_cmpxchgb
, TCG_CALL_NO_WG
,
23 i32
, env
, tl
, i32
, i32
, i32
)
24 DEF_HELPER_FLAGS_5(atomic_cmpxchgw_be
, TCG_CALL_NO_WG
,
25 i32
, env
, tl
, i32
, i32
, i32
)
26 DEF_HELPER_FLAGS_5(atomic_cmpxchgw_le
, TCG_CALL_NO_WG
,
27 i32
, env
, tl
, i32
, i32
, i32
)
28 DEF_HELPER_FLAGS_5(atomic_cmpxchgl_be
, TCG_CALL_NO_WG
,
29 i32
, env
, tl
, i32
, i32
, i32
)
30 DEF_HELPER_FLAGS_5(atomic_cmpxchgl_le
, TCG_CALL_NO_WG
,
31 i32
, env
, tl
, i32
, i32
, i32
)
32 #ifdef CONFIG_ATOMIC64
33 DEF_HELPER_FLAGS_5(atomic_cmpxchgq_be
, TCG_CALL_NO_WG
,
34 i64
, env
, tl
, i64
, i64
, i32
)
35 DEF_HELPER_FLAGS_5(atomic_cmpxchgq_le
, TCG_CALL_NO_WG
,
36 i64
, env
, tl
, i64
, i64
, i32
)
39 #ifdef CONFIG_ATOMIC64
40 #define GEN_ATOMIC_HELPERS(NAME) \
41 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), b), \
42 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
43 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), w_le), \
44 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
45 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), w_be), \
46 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
47 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), l_le), \
48 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
49 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), l_be), \
50 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
51 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), q_le), \
52 TCG_CALL_NO_WG, i64, env, tl, i64, i32) \
53 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), q_be), \
54 TCG_CALL_NO_WG, i64, env, tl, i64, i32)
56 #define GEN_ATOMIC_HELPERS(NAME) \
57 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), b), \
58 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
59 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), w_le), \
60 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
61 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), w_be), \
62 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
63 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), l_le), \
64 TCG_CALL_NO_WG, i32, env, tl, i32, i32) \
65 DEF_HELPER_FLAGS_4(glue(glue(atomic_, NAME), l_be), \
66 TCG_CALL_NO_WG, i32, env, tl, i32, i32)
67 #endif /* CONFIG_ATOMIC64 */
71 DEF_HELPER_FLAGS_4(atomic_cmpxchgb
, TCG_CALL_NO_WG
, i32
, env
, tl
, i32
, i32
)
72 DEF_HELPER_FLAGS_4(atomic_cmpxchgw_be
, TCG_CALL_NO_WG
, i32
, env
, tl
, i32
, i32
)
73 DEF_HELPER_FLAGS_4(atomic_cmpxchgw_le
, TCG_CALL_NO_WG
, i32
, env
, tl
, i32
, i32
)
74 DEF_HELPER_FLAGS_4(atomic_cmpxchgl_be
, TCG_CALL_NO_WG
, i32
, env
, tl
, i32
, i32
)
75 DEF_HELPER_FLAGS_4(atomic_cmpxchgl_le
, TCG_CALL_NO_WG
, i32
, env
, tl
, i32
, i32
)
76 #ifdef CONFIG_ATOMIC64
77 DEF_HELPER_FLAGS_4(atomic_cmpxchgq_be
, TCG_CALL_NO_WG
, i64
, env
, tl
, i64
, i64
)
78 DEF_HELPER_FLAGS_4(atomic_cmpxchgq_le
, TCG_CALL_NO_WG
, i64
, env
, tl
, i64
, i64
)
81 #ifdef CONFIG_ATOMIC64
82 #define GEN_ATOMIC_HELPERS(NAME) \
83 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), b), \
84 TCG_CALL_NO_WG, i32, env, tl, i32) \
85 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), w_le), \
86 TCG_CALL_NO_WG, i32, env, tl, i32) \
87 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), w_be), \
88 TCG_CALL_NO_WG, i32, env, tl, i32) \
89 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), l_le), \
90 TCG_CALL_NO_WG, i32, env, tl, i32) \
91 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), l_be), \
92 TCG_CALL_NO_WG, i32, env, tl, i32) \
93 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), q_le), \
94 TCG_CALL_NO_WG, i64, env, tl, i64) \
95 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), q_be), \
96 TCG_CALL_NO_WG, i64, env, tl, i64)
98 #define GEN_ATOMIC_HELPERS(NAME) \
99 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), b), \
100 TCG_CALL_NO_WG, i32, env, tl, i32) \
101 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), w_le), \
102 TCG_CALL_NO_WG, i32, env, tl, i32) \
103 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), w_be), \
104 TCG_CALL_NO_WG, i32, env, tl, i32) \
105 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), l_le), \
106 TCG_CALL_NO_WG, i32, env, tl, i32) \
107 DEF_HELPER_FLAGS_3(glue(glue(atomic_, NAME), l_be), \
108 TCG_CALL_NO_WG, i32, env, tl, i32)
109 #endif /* CONFIG_ATOMIC64 */
111 #endif /* CONFIG_SOFTMMU */
113 GEN_ATOMIC_HELPERS(fetch_add
)
114 GEN_ATOMIC_HELPERS(fetch_and
)
115 GEN_ATOMIC_HELPERS(fetch_or
)
116 GEN_ATOMIC_HELPERS(fetch_xor
)
118 GEN_ATOMIC_HELPERS(add_fetch
)
119 GEN_ATOMIC_HELPERS(and_fetch
)
120 GEN_ATOMIC_HELPERS(or_fetch
)
121 GEN_ATOMIC_HELPERS(xor_fetch
)
123 GEN_ATOMIC_HELPERS(xchg
)
125 #undef GEN_ATOMIC_HELPERS