[PATCH v2 23/26] target/arm/tcg: Inline 'exec/helper-gen.h'

Philippe Mathieu-Daudé posted 26 patches 2 years, 8 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[PATCH v2 23/26] target/arm/tcg: Inline 'exec/helper-gen.h'
Posted by Philippe Mathieu-Daudé 2 years, 8 months ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
CHECK: By extracting some inlined (FP) helpers from translate.h,
we could reduce 'helper-gen.h.inc' to helper.c.
---
 target/arm/tcg/translate.h | 4 +++-
 target/arm/helper.c        | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
index 3d7c55d3b6..fc6357eae8 100644
--- a/target/arm/tcg/translate.h
+++ b/target/arm/tcg/translate.h
@@ -6,9 +6,11 @@
 #include "tcg/tcg-op-gvec.h"
 #include "exec/exec-all.h"
 #include "exec/translator.h"
-#include "exec/helper-gen.h"
 #include "internals.h"
 
+#define HELPER_H "helper.h"
+#include "exec/helper-gen.h.inc"
+#undef  HELPER_H
 
 /* internal defines */
 
diff --git a/target/arm/helper.c b/target/arm/helper.c
index d4bee43bd0..89ee68893f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -26,6 +26,11 @@
 #include "qapi/error.h"
 #include "qemu/guest-random.h"
 #ifdef CONFIG_TCG
+
+#define HELPER_H "helper.h"
+#include "exec/helper-gen.h.inc"
+#undef  HELPER_H
+
 #include "semihosting/common-semi.h"
 #endif
 #include "cpregs.h"
-- 
2.38.1


Re: [PATCH v2 23/26] target/arm/tcg: Inline 'exec/helper-gen.h'
Posted by Richard Henderson 2 years, 8 months ago
On 6/11/23 10:58, Philippe Mathieu-Daudé wrote:
> +++ b/target/arm/helper.c
> @@ -26,6 +26,11 @@
>   #include "qapi/error.h"
>   #include "qemu/guest-random.h"
>   #ifdef CONFIG_TCG
> +
> +#define HELPER_H "helper.h"
> +#include "exec/helper-gen.h.inc"
> +#undef  HELPER_H


Why is this here?  helper-gen is for tcg code generation, which should not be required at 
all in this file.  I can't see how the modification to translate.h affects this.


r~

Re: [PATCH v2 23/26] target/arm/tcg: Inline 'exec/helper-gen.h'
Posted by Philippe Mathieu-Daudé 2 years, 8 months ago
On 14/6/23 07:01, Richard Henderson wrote:
> On 6/11/23 10:58, Philippe Mathieu-Daudé wrote:
>> +++ b/target/arm/helper.c
>> @@ -26,6 +26,11 @@
>>   #include "qapi/error.h"
>>   #include "qemu/guest-random.h"
>>   #ifdef CONFIG_TCG
>> +
>> +#define HELPER_H "helper.h"
>> +#include "exec/helper-gen.h.inc"
>> +#undef  HELPER_H
> 
> 
> Why is this here?  helper-gen is for tcg code generation, which should 
> not be required at all in this file.  I can't see how the modification 
> to translate.h affects this.

Indeed this is not needed.