aboutsummaryrefslogtreecommitdiff
path: root/target/arm/cpu.h
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-09-07 13:35:00 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-09-08 13:08:52 +0300
commitded625e7aa6a7f3173a22657f7dc0e9ab3d8fa3b (patch)
tree21c63bb1e087b0a4aa1cc1e6c4e6f25ef84c68e4 /target/arm/cpu.h
parentd417e2214d3adfd862bdf7afb3392e7f9de7fc05 (diff)
downloadqemu-ded625e7aa6a7f3173a22657f7dc0e9ab3d8fa3b.zip
qemu-ded625e7aa6a7f3173a22657f7dc0e9ab3d8fa3b.tar.gz
qemu-ded625e7aa6a7f3173a22657f7dc0e9ab3d8fa3b.tar.bz2
trivial: Simplify the spots that use TARGET_BIG_ENDIAN as a numeric value
TARGET_BIG_ENDIAN is *always* defined, either as 0 for little endian targets or as 1 for big endian targets. So we can use this as a value directly in places that need such a 0 or 1 for some reason, instead of taking a detour through an additional local variable or something similar. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r--target/arm/cpu.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 278cc13..d50cd91 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3208,11 +3208,7 @@ static inline bool bswap_code(bool sctlr_b)
* The invalid combination SCTLR.B=1/CPSR.E=1/TARGET_BIG_ENDIAN=0
* would also end up as a mixed-endian mode with BE code, LE data.
*/
- return
-#if TARGET_BIG_ENDIAN
- 1 ^
-#endif
- sctlr_b;
+ return TARGET_BIG_ENDIAN ^ sctlr_b;
#else
/* All code access in ARM is little endian, and there are no loaders
* doing swaps that need to be reversed
@@ -3224,11 +3220,7 @@ static inline bool bswap_code(bool sctlr_b)
#ifdef CONFIG_USER_ONLY
static inline bool arm_cpu_bswap_data(CPUARMState *env)
{
- return
-#if TARGET_BIG_ENDIAN
- 1 ^
-#endif
- arm_cpu_data_is_big_endian(env);
+ return TARGET_BIG_ENDIAN ^ arm_cpu_data_is_big_endian(env);
}
#endif