Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (1.1 kB)

1
#define DEF_HELPER(name, ret, args) ret helper_##name args;
2

    
3
#ifdef GEN_HELPER
4
#define DEF_HELPER_1_1(name, ret, args) \
5
DEF_HELPER(name, ret, args) \
6
static inline void gen_helper_##name(TCGv ret, TCGv arg1) \
7
{ \
8
    tcg_gen_helper_1_1(helper_##name, ret, arg1); \
9
}
10
#define DEF_HELPER_1_2(name, ret, args) \
11
DEF_HELPER(name, ret, args) \
12
static inline void gen_helper_##name(TCGv ret, TCGv arg1, TCGv arg2) \
13
{ \
14
    tcg_gen_helper_1_2(helper_##name, ret, arg1, arg2); \
15
}
16
#else /* !GEN_HELPER */
17
#define DEF_HELPER_1_1 DEF_HELPER
18
#define DEF_HELPER_1_2 DEF_HELPER
19
#define HELPER(x) helper_##x
20
#endif
21

    
22
DEF_HELPER_1_1(clz, uint32_t, (uint32_t))
23
DEF_HELPER_1_1(sxtb16, uint32_t, (uint32_t))
24
DEF_HELPER_1_1(uxtb16, uint32_t, (uint32_t))
25

    
26
DEF_HELPER_1_2(add_setq, uint32_t, (uint32_t, uint32_t))
27
DEF_HELPER_1_2(add_saturate, uint32_t, (uint32_t, uint32_t))
28
DEF_HELPER_1_2(sub_saturate, uint32_t, (uint32_t, uint32_t))
29
DEF_HELPER_1_2(add_usaturate, uint32_t, (uint32_t, uint32_t))
30
DEF_HELPER_1_2(sub_usaturate, uint32_t, (uint32_t, uint32_t))
31
DEF_HELPER_1_1(double_saturate, uint32_t, (int32_t))
32

    
33
#undef DEF_HELPER
34
#undef DEF_HELPER_1_1
35
#undef DEF_HELPER_1_2
36
#undef GEN_HELPER