]>
Commit | Line | Data |
---|---|---|
2ef6175a RH |
1 | /* Helper file for declaring TCG helper functions. |
2 | This one expands prototypes for the helper functions. */ | |
3 | ||
4 | #ifndef HELPER_PROTO_H | |
175de524 | 5 | #define HELPER_PROTO_H |
2ef6175a | 6 | |
a9c94277 | 7 | #include "exec/helper-head.h" |
2ef6175a | 8 | |
6aa89be5 RH |
9 | /* |
10 | * Work around an issue with --enable-lto, in which GCC's ipa-split pass | |
11 | * decides to split out the noreturn code paths that raise an exception, | |
12 | * taking the __builtin_return_address() along into the new function, | |
13 | * where it no longer computes a value that returns to TCG generated code. | |
14 | * Despite the name, the noinline attribute affects splitter, so this | |
15 | * prevents the optimization in question. Given that helpers should not | |
16 | * otherwise be called directly, this should have any other visible effect. | |
17 | * | |
18 | * See https://gitlab.com/qemu-project/qemu/-/issues/1454 | |
19 | */ | |
20 | #define DEF_HELPER_ATTR __attribute__((noinline)) | |
21 | ||
2ef6175a | 22 | #define DEF_HELPER_FLAGS_0(name, flags, ret) \ |
6aa89be5 | 23 | dh_ctype(ret) HELPER(name) (void) DEF_HELPER_ATTR; |
2ef6175a RH |
24 | |
25 | #define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \ | |
6aa89be5 | 26 | dh_ctype(ret) HELPER(name) (dh_ctype(t1)) DEF_HELPER_ATTR; |
2ef6175a RH |
27 | |
28 | #define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \ | |
6aa89be5 | 29 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2)) DEF_HELPER_ATTR; |
2ef6175a RH |
30 | |
31 | #define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \ | |
6aa89be5 RH |
32 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), \ |
33 | dh_ctype(t3)) DEF_HELPER_ATTR; | |
2ef6175a RH |
34 | |
35 | #define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \ | |
36 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | |
6aa89be5 | 37 | dh_ctype(t4)) DEF_HELPER_ATTR; |
2ef6175a RH |
38 | |
39 | #define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \ | |
40 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | |
6aa89be5 | 41 | dh_ctype(t4), dh_ctype(t5)) DEF_HELPER_ATTR; |
2ef6175a | 42 | |
1df3caa9 RH |
43 | #define DEF_HELPER_FLAGS_6(name, flags, ret, t1, t2, t3, t4, t5, t6) \ |
44 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | |
6aa89be5 RH |
45 | dh_ctype(t4), dh_ctype(t5), \ |
46 | dh_ctype(t6)) DEF_HELPER_ATTR; | |
1df3caa9 | 47 | |
e6cadf49 TS |
48 | #define DEF_HELPER_FLAGS_7(name, flags, ret, t1, t2, t3, t4, t5, t6, t7) \ |
49 | dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | |
50 | dh_ctype(t4), dh_ctype(t5), dh_ctype(t6), \ | |
6aa89be5 | 51 | dh_ctype(t7)) DEF_HELPER_ATTR; |
e6cadf49 | 52 | |
6d3ef048 RH |
53 | #define IN_HELPER_PROTO |
54 | ||
2ef6175a | 55 | #include "helper.h" |
db647703 PMD |
56 | #include "accel/tcg/tcg-runtime.h" |
57 | #include "accel/tcg/plugin-helpers.h" | |
2ef6175a | 58 | |
6d3ef048 RH |
59 | #undef IN_HELPER_PROTO |
60 | ||
2ef6175a RH |
61 | #undef DEF_HELPER_FLAGS_0 |
62 | #undef DEF_HELPER_FLAGS_1 | |
63 | #undef DEF_HELPER_FLAGS_2 | |
64 | #undef DEF_HELPER_FLAGS_3 | |
65 | #undef DEF_HELPER_FLAGS_4 | |
66 | #undef DEF_HELPER_FLAGS_5 | |
1df3caa9 | 67 | #undef DEF_HELPER_FLAGS_6 |
e6cadf49 | 68 | #undef DEF_HELPER_FLAGS_7 |
6aa89be5 | 69 | #undef DEF_HELPER_ATTR |
2ef6175a RH |
70 | |
71 | #endif /* HELPER_PROTO_H */ |