diff mbox series

[09/22] target/arm/tcg: Reduce 'helper-iwmmxt.h.inc' inclusion

Message ID 20230609104717.95555-10-philmd@linaro.org
State Superseded
Headers show
Series target/arm/tcg: Remove inclusions of 'exec/helper-[proto/gen].h' | expand

Commit Message

Philippe Mathieu-Daudé June 9, 2023, 10:47 a.m. UTC
Instead of including helper-iwmmxt.h.inc via helper.h which
is included by all TCG files, restrict it to the few files
that require it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/helper.h               | 1 -
 target/arm/tcg/iwmmxt_helper.c    | 6 +++++-
 target/arm/tcg/translate-iwmmxt.c | 6 ++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

Comments

Richard Henderson June 9, 2023, 6:59 p.m. UTC | #1
On 6/9/23 03:47, Philippe Mathieu-Daudé wrote:
> Instead of including helper-iwmmxt.h.inc via helper.h which
> is included by all TCG files, restrict it to the few files
> that require it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/helper.h               | 1 -
>   target/arm/tcg/iwmmxt_helper.c    | 6 +++++-
>   target/arm/tcg/translate-iwmmxt.c | 6 ++++++
>   3 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/helper.h b/target/arm/helper.h
> index c4a321c0ea..dd12fee107 100644
> --- a/target/arm/helper.h
> +++ b/target/arm/helper.h
> @@ -949,5 +949,4 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,
>   #include "tcg/helper-sme.h.inc"
>   #endif
>   
> -#include "tcg/helper-iwmmxt.h.inc"
>   #include "tcg/helper-mve.h.inc"
> diff --git a/target/arm/tcg/iwmmxt_helper.c b/target/arm/tcg/iwmmxt_helper.c
> index 610b1b2103..fa84b5f672 100644
> --- a/target/arm/tcg/iwmmxt_helper.c
> +++ b/target/arm/tcg/iwmmxt_helper.c
> @@ -22,7 +22,11 @@
>   #include "qemu/osdep.h"
>   
>   #include "cpu.h"
> -#include "exec/helper-proto.h"
> +
> +#define HELPER_H "tcg/helper-iwmmxt.h.inc"
> +#include "exec/helper-proto.h.inc"
> +#include "exec/helper-gen.h.inc"
> +#undef  HELPER_H

You should only require helper-proto.h.inc here.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

This was exactly the sort of thing that I had in mind.


r~
Philippe Mathieu-Daudé June 11, 2023, 8:54 a.m. UTC | #2
On 9/6/23 20:59, Richard Henderson wrote:
> On 6/9/23 03:47, Philippe Mathieu-Daudé wrote:
>> Instead of including helper-iwmmxt.h.inc via helper.h which
>> is included by all TCG files, restrict it to the few files
>> that require it.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   target/arm/helper.h               | 1 -
>>   target/arm/tcg/iwmmxt_helper.c    | 6 +++++-
>>   target/arm/tcg/translate-iwmmxt.c | 6 ++++++
>>   3 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/target/arm/helper.h b/target/arm/helper.h
>> index c4a321c0ea..dd12fee107 100644
>> --- a/target/arm/helper.h
>> +++ b/target/arm/helper.h
>> @@ -949,5 +949,4 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,
>>   #include "tcg/helper-sme.h.inc"
>>   #endif
>> -#include "tcg/helper-iwmmxt.h.inc"
>>   #include "tcg/helper-mve.h.inc"
>> diff --git a/target/arm/tcg/iwmmxt_helper.c 
>> b/target/arm/tcg/iwmmxt_helper.c
>> index 610b1b2103..fa84b5f672 100644
>> --- a/target/arm/tcg/iwmmxt_helper.c
>> +++ b/target/arm/tcg/iwmmxt_helper.c
>> @@ -22,7 +22,11 @@
>>   #include "qemu/osdep.h"
>>   #include "cpu.h"
>> -#include "exec/helper-proto.h"
>> +
>> +#define HELPER_H "tcg/helper-iwmmxt.h.inc"
>> +#include "exec/helper-proto.h.inc"
>> +#include "exec/helper-gen.h.inc"
>> +#undef  HELPER_H
> 
> You should only require helper-proto.h.inc here.

Oh, good point.

> Otherwise,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> This was exactly the sort of thing that I had in mind.

Good :)
diff mbox series

Patch

diff --git a/target/arm/helper.h b/target/arm/helper.h
index c4a321c0ea..dd12fee107 100644
--- a/target/arm/helper.h
+++ b/target/arm/helper.h
@@ -949,5 +949,4 @@  DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,
 #include "tcg/helper-sme.h.inc"
 #endif
 
-#include "tcg/helper-iwmmxt.h.inc"
 #include "tcg/helper-mve.h.inc"
diff --git a/target/arm/tcg/iwmmxt_helper.c b/target/arm/tcg/iwmmxt_helper.c
index 610b1b2103..fa84b5f672 100644
--- a/target/arm/tcg/iwmmxt_helper.c
+++ b/target/arm/tcg/iwmmxt_helper.c
@@ -22,7 +22,11 @@ 
 #include "qemu/osdep.h"
 
 #include "cpu.h"
-#include "exec/helper-proto.h"
+
+#define HELPER_H "tcg/helper-iwmmxt.h.inc"
+#include "exec/helper-proto.h.inc"
+#include "exec/helper-gen.h.inc"
+#undef  HELPER_H
 
 /* iwMMXt macros extracted from GNU gdb.  */
 
diff --git a/target/arm/tcg/translate-iwmmxt.c b/target/arm/tcg/translate-iwmmxt.c
index a054064c98..d241f64835 100644
--- a/target/arm/tcg/translate-iwmmxt.c
+++ b/target/arm/tcg/translate-iwmmxt.c
@@ -21,6 +21,12 @@ 
 #include "translate.h"
 #include "translate-a32.h"
 
+#define HELPER_H "tcg/helper-iwmmxt.h.inc"
+#include "exec/helper-proto.h.inc"
+#include "exec/helper-gen.h.inc"
+#include "exec/helper-info.c.inc"
+#undef  HELPER_H
+
 #define ARM_CP_RW_BIT   (1 << 20)
 
 static inline void iwmmxt_load_reg(TCGv_i64 var, int reg)