diff mbox series

[v3,03/14] tcg/arm: Simplify use_armvt5_instructions

Message ID 20210818212912.396794-4-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg/arm: Unaligned access and other cleanup | expand

Commit Message

Richard Henderson Aug. 18, 2021, 9:29 p.m. UTC
According to the Arm ARM DDI 0406C, section A1.3, the valid variants
are ARMv5T, ARMv5TE, ARMv5TEJ -- there is no ARMv5 without Thumb.
Therefore simplify the test from preprocessor ifdefs to base
architecture revision.  Retain the "t" in the name to minimize churn.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/arm/tcg-target.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

-- 
2.25.1

Comments

Peter Maydell Aug. 20, 2021, 10:59 a.m. UTC | #1
On Wed, 18 Aug 2021 at 22:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> According to the Arm ARM DDI 0406C, section A1.3, the valid variants

> are ARMv5T, ARMv5TE, ARMv5TEJ -- there is no ARMv5 without Thumb.

> Therefore simplify the test from preprocessor ifdefs to base

> architecture revision.  Retain the "t" in the name to minimize churn.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  tcg/arm/tcg-target.h | 8 +-------

>  1 file changed, 1 insertion(+), 7 deletions(-)

>

> diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h

> index 18bb16c784..f41b809554 100644

> --- a/tcg/arm/tcg-target.h

> +++ b/tcg/arm/tcg-target.h

> @@ -28,13 +28,7 @@

>

>  extern int arm_arch;

>

> -#if defined(__ARM_ARCH_5T__) \

> -    || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)

> -# define use_armv5t_instructions 1

> -#else

> -# define use_armv5t_instructions use_armv6_instructions

> -#endif

> -

> +#define use_armv5t_instructions (__ARM_ARCH >= 5 || arm_arch >= 5)

>  #define use_armv6_instructions  (__ARM_ARCH >= 6 || arm_arch >= 6)

>  #define use_armv7_instructions  (__ARM_ARCH >= 7 || arm_arch >= 7)


Typo in subject: should be "armv5t". Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>


thanks
-- PMM
diff mbox series

Patch

diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 18bb16c784..f41b809554 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -28,13 +28,7 @@ 
 
 extern int arm_arch;
 
-#if defined(__ARM_ARCH_5T__) \
-    || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
-# define use_armv5t_instructions 1
-#else
-# define use_armv5t_instructions use_armv6_instructions
-#endif
-
+#define use_armv5t_instructions (__ARM_ARCH >= 5 || arm_arch >= 5)
 #define use_armv6_instructions  (__ARM_ARCH >= 6 || arm_arch >= 6)
 #define use_armv7_instructions  (__ARM_ARCH >= 7 || arm_arch >= 7)