Statistics
| Branch: | Revision:

root / target-arm / helpers.h @ 1497c961

History | View | Annotate | Download (1.1 kB)

1 b26eefb6 pbrook
#define DEF_HELPER(name, ret, args) ret helper_##name args;
2 1497c961 pbrook
3 1497c961 pbrook
#ifdef GEN_HELPER
4 1497c961 pbrook
#define DEF_HELPER_1_1(name, ret, args) \
5 1497c961 pbrook
DEF_HELPER(name, ret, args) \
6 1497c961 pbrook
static inline void gen_helper_##name(TCGv ret, TCGv arg1) \
7 1497c961 pbrook
{ \
8 1497c961 pbrook
    tcg_gen_helper_1_1(helper_##name, ret, arg1); \
9 1497c961 pbrook
}
10 1497c961 pbrook
#define DEF_HELPER_1_2(name, ret, args) \
11 1497c961 pbrook
DEF_HELPER(name, ret, args) \
12 1497c961 pbrook
static inline void gen_helper_##name(TCGv ret, TCGv arg1, TCGv arg2) \
13 1497c961 pbrook
{ \
14 1497c961 pbrook
    tcg_gen_helper_1_2(helper_##name, ret, arg1, arg2); \
15 1497c961 pbrook
}
16 1497c961 pbrook
#else /* !GEN_HELPER */
17 1497c961 pbrook
#define DEF_HELPER_1_1 DEF_HELPER
18 1497c961 pbrook
#define DEF_HELPER_1_2 DEF_HELPER
19 1497c961 pbrook
#define HELPER(x) helper_##x
20 b26eefb6 pbrook
#endif
21 b26eefb6 pbrook
22 1497c961 pbrook
DEF_HELPER_1_1(clz, uint32_t, (uint32_t))
23 1497c961 pbrook
DEF_HELPER_1_1(sxtb16, uint32_t, (uint32_t))
24 1497c961 pbrook
DEF_HELPER_1_1(uxtb16, uint32_t, (uint32_t))
25 1497c961 pbrook
26 1497c961 pbrook
DEF_HELPER_1_2(add_setq, uint32_t, (uint32_t, uint32_t))
27 1497c961 pbrook
DEF_HELPER_1_2(add_saturate, uint32_t, (uint32_t, uint32_t))
28 1497c961 pbrook
DEF_HELPER_1_2(sub_saturate, uint32_t, (uint32_t, uint32_t))
29 1497c961 pbrook
DEF_HELPER_1_2(add_usaturate, uint32_t, (uint32_t, uint32_t))
30 1497c961 pbrook
DEF_HELPER_1_2(sub_usaturate, uint32_t, (uint32_t, uint32_t))
31 1497c961 pbrook
DEF_HELPER_1_1(double_saturate, uint32_t, (int32_t))
32 1497c961 pbrook
33 1497c961 pbrook
#undef DEF_HELPER
34 1497c961 pbrook
#undef DEF_HELPER_1_1
35 1497c961 pbrook
#undef DEF_HELPER_1_2
36 1497c961 pbrook
#undef GEN_HELPER