-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tcg: Invert the inclusion of helper.h
Rather than include helper.h with N values of GEN_HELPER, include a secondary file that sets up the macros to include helper.h. This minimizes the files that must be rebuilt when changing the macros for file N. Reviewed-by: Alex Bennée <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
- Loading branch information
Showing
100 changed files
with
265 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* Helper file for declaring TCG helper functions. | ||
This one expands generation functions for tcg opcodes. */ | ||
|
||
#ifndef HELPER_GEN_H | ||
#define HELPER_GEN_H 1 | ||
|
||
#include <exec/helper-head.h> | ||
|
||
#define DEF_HELPER_FLAGS_0(name, flags, ret) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl0(ret)) \ | ||
{ \ | ||
int sizemask; \ | ||
sizemask = dh_is_64bit(ret); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 0, NULL); \ | ||
} | ||
|
||
#define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1)) \ | ||
{ \ | ||
TCGArg args[1]; \ | ||
int sizemask = 0; \ | ||
dh_sizemask(ret, 0); \ | ||
dh_arg(t1, 1); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 1, args); \ | ||
} | ||
|
||
#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \ | ||
dh_arg_decl(t2, 2)) \ | ||
{ \ | ||
TCGArg args[2]; \ | ||
int sizemask = 0; \ | ||
dh_sizemask(ret, 0); \ | ||
dh_arg(t1, 1); \ | ||
dh_arg(t2, 2); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 2, args); \ | ||
} | ||
|
||
#define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \ | ||
dh_arg_decl(t2, 2), dh_arg_decl(t3, 3)) \ | ||
{ \ | ||
TCGArg args[3]; \ | ||
int sizemask = 0; \ | ||
dh_sizemask(ret, 0); \ | ||
dh_arg(t1, 1); \ | ||
dh_arg(t2, 2); \ | ||
dh_arg(t3, 3); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 3, args); \ | ||
} | ||
|
||
#define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) dh_arg_decl(t1, 1), \ | ||
dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), dh_arg_decl(t4, 4)) \ | ||
{ \ | ||
TCGArg args[4]; \ | ||
int sizemask = 0; \ | ||
dh_sizemask(ret, 0); \ | ||
dh_arg(t1, 1); \ | ||
dh_arg(t2, 2); \ | ||
dh_arg(t3, 3); \ | ||
dh_arg(t4, 4); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 4, args); \ | ||
} | ||
|
||
#define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \ | ||
static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \ | ||
dh_arg_decl(t1, 1), dh_arg_decl(t2, 2), dh_arg_decl(t3, 3), \ | ||
dh_arg_decl(t4, 4), dh_arg_decl(t5, 5)) \ | ||
{ \ | ||
TCGArg args[5]; \ | ||
int sizemask = 0; \ | ||
dh_sizemask(ret, 0); \ | ||
dh_arg(t1, 1); \ | ||
dh_arg(t2, 2); \ | ||
dh_arg(t3, 3); \ | ||
dh_arg(t4, 4); \ | ||
dh_arg(t5, 5); \ | ||
tcg_gen_helperN(HELPER(name), flags, sizemask, dh_retvar(ret), 5, args); \ | ||
} | ||
|
||
#include "helper.h" | ||
|
||
#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 GEN_HELPER | ||
|
||
#endif /* HELPER_GEN_H */ |
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,38 @@ | ||
/* Helper file for declaring TCG helper functions. | ||
This one expands prototypes for the helper functions. */ | ||
|
||
#ifndef HELPER_PROTO_H | ||
#define HELPER_PROTO_H 1 | ||
|
||
#include <exec/helper-head.h> | ||
|
||
#define DEF_HELPER_FLAGS_0(name, flags, ret) \ | ||
dh_ctype(ret) HELPER(name) (void); | ||
|
||
#define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \ | ||
dh_ctype(ret) HELPER(name) (dh_ctype(t1)); | ||
|
||
#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \ | ||
dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2)); | ||
|
||
#define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \ | ||
dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3)); | ||
|
||
#define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \ | ||
dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | ||
dh_ctype(t4)); | ||
|
||
#define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \ | ||
dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ | ||
dh_ctype(t4), dh_ctype(t5)); | ||
|
||
#include "helper.h" | ||
|
||
#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 | ||
|
||
#endif /* HELPER_PROTO_H */ |
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,35 @@ | ||
/* Helper file for declaring TCG helper functions. | ||
This one defines data structures private to tcg.c. */ | ||
|
||
#ifndef HELPER_TCG_H | ||
#define HELPER_TCG_H 1 | ||
|
||
#include <exec/helper-head.h> | ||
|
||
#define DEF_HELPER_FLAGS_0(name, flags, ret) { HELPER(name), #name }, | ||
|
||
#define DEF_HELPER_FLAGS_1(name, flags, ret, t1) \ | ||
DEF_HELPER_FLAGS_0(name, flags, ret) | ||
|
||
#define DEF_HELPER_FLAGS_2(name, flags, ret, t1, t2) \ | ||
DEF_HELPER_FLAGS_0(name, flags, ret) | ||
|
||
#define DEF_HELPER_FLAGS_3(name, flags, ret, t1, t2, t3) \ | ||
DEF_HELPER_FLAGS_0(name, flags, ret) | ||
|
||
#define DEF_HELPER_FLAGS_4(name, flags, ret, t1, t2, t3, t4) \ | ||
DEF_HELPER_FLAGS_0(name, flags, ret) | ||
|
||
#define DEF_HELPER_FLAGS_5(name, flags, ret, t1, t2, t3, t4, t5) \ | ||
DEF_HELPER_FLAGS_0(name, flags, ret) | ||
|
||
#include "helper.h" | ||
|
||
#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 | ||
|
||
#endif /* HELPER_TCG_H */ |
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
*/ | ||
|
||
#include "cpu.h" | ||
#include "helper.h" | ||
#include "exec/helper-proto.h" | ||
#include "qemu/host-utils.h" | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
*/ | ||
|
||
#include "cpu.h" | ||
#include "helper.h" | ||
#include "exec/helper-proto.h" | ||
|
||
|
||
/* Softmmu support */ | ||
|
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.