aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-17 10:40:29 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-25 17:09:58 +0200
commit770f2e64b6a6ae13c00cd1cc083eaf9728c0f934 (patch)
treeec5840182bda028a9bca67e1ec9adf5e0d08d08e
parent33fa8f02a91986c6c3e7de748964a312c14a5a0d (diff)
downloadqemu-770f2e64b6a6ae13c00cd1cc083eaf9728c0f934.zip
qemu-770f2e64b6a6ae13c00cd1cc083eaf9728c0f934.tar.gz
qemu-770f2e64b6a6ae13c00cd1cc083eaf9728c0f934.tar.bz2
target/xtensa: Evaluate TARGET_BIG_ENDIAN at compile time
Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250417131004.47205-6-philmd@linaro.org>
-rw-r--r--target/xtensa/translate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 5ebd4a5..2af83c0 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1395,11 +1395,11 @@ static void translate_bbi(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
TCGv_i32 tmp = tcg_temp_new_i32();
-#if TARGET_BIG_ENDIAN
- tcg_gen_andi_i32(tmp, arg[0].in, 0x80000000u >> arg[1].imm);
-#else
- tcg_gen_andi_i32(tmp, arg[0].in, 0x00000001u << arg[1].imm);
-#endif
+ if (TARGET_BIG_ENDIAN) {
+ tcg_gen_andi_i32(tmp, arg[0].in, 0x80000000u >> arg[1].imm);
+ } else {
+ tcg_gen_andi_i32(tmp, arg[0].in, 0x00000001u << arg[1].imm);
+ }
gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
}