Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
tcg: Pass TCGHelperInfo to tcg_gen_callN
In preparation for compiling tcg/ only once, eliminate the all_helpers array. Instantiate the info structs for the generic helpers in accel/tcg/, and the structs for the target-specific helpers in each translate.c. Since we don't see all of the info structs at startup, initialize at first use, using g_once_init_* to make sure we don't race while doing so. Reviewed-by: Anton Johansson <anjo@rev.ng> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
- Loading branch information
Showing
31 changed files
with
284 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
| /* | ||
| * Helper file for declaring TCG helper functions. | ||
| * This one expands info structures for tcg helpers. | ||
| * Define HELPER_H for the header file to be expanded. | ||
| */ | ||
|
|
||
| #include "tcg/tcg.h" | ||
| #include "tcg/helper-info.h" | ||
| #include "exec/helper-head.h" | ||
|
|
||
| /* | ||
| * Need one more level of indirection before stringification | ||
| * to get all the macros expanded first. | ||
| */ | ||
| #define str(s) #s | ||
|
|
||
| #define DEF_HELPER_FLAGS_0(NAME, FLAGS, RET) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_1(NAME, FLAGS, RET, T1) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_2(NAME, FLAGS, RET, T1, T2) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_3(NAME, FLAGS, RET, T1, T2, T3) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) | dh_typemask(T3, 3) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_4(NAME, FLAGS, RET, T1, T2, T3, T4) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) | dh_typemask(T3, 3) \ | ||
| | dh_typemask(T4, 4) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_5(NAME, FLAGS, RET, T1, T2, T3, T4, T5) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) | dh_typemask(T3, 3) \ | ||
| | dh_typemask(T4, 4) | dh_typemask(T5, 5) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_6(NAME, FLAGS, RET, T1, T2, T3, T4, T5, T6) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) | dh_typemask(T3, 3) \ | ||
| | dh_typemask(T4, 4) | dh_typemask(T5, 5) \ | ||
| | dh_typemask(T6, 6) \ | ||
| }; | ||
|
|
||
| #define DEF_HELPER_FLAGS_7(NAME, FLAGS, RET, T1, T2, T3, T4, T5, T6, T7) \ | ||
| TCGHelperInfo glue(helper_info_, NAME) = { \ | ||
| .func = HELPER(NAME), .name = str(NAME), \ | ||
| .flags = FLAGS | dh_callflag(RET), \ | ||
| .typemask = dh_typemask(RET, 0) | dh_typemask(T1, 1) \ | ||
| | dh_typemask(T2, 2) | dh_typemask(T3, 3) \ | ||
| | dh_typemask(T4, 4) | dh_typemask(T5, 5) \ | ||
| | dh_typemask(T6, 6) | dh_typemask(T7, 7) \ | ||
| }; | ||
|
|
||
| #include HELPER_H | ||
|
|
||
| #undef str | ||
| #undef DEF_HELPER_FLAGS_0 | ||
| #undef DEF_HELPER_FLAGS_1 | ||
| #undef DEF_HELPER_FLAGS_2 | ||
| #undef DEF_HELPER_FLAGS_3 | ||
| #undef DEF_HELPER_FLAGS_4 | ||
| #undef DEF_HELPER_FLAGS_5 | ||
| #undef DEF_HELPER_FLAGS_6 | ||
| #undef DEF_HELPER_FLAGS_7 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.