Commit 16e41f5e87 for qemu.org

commit 16e41f5e878fa31db0d0d4f86ac2696521c0bd45
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Fri Sep 25 14:49:54 2026 -0700

    target/arm: Sort BE_DATA toward the top of rebuild_hflags_a64

    This is the last of the "ANY" class of flags.  Sort to the top
    with the other "ANY" flags.

    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-id: 20260925215004.456336-5-richard.henderson@linaro.org
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c
index 8da02ae1ec..cf7d49be90 100644
--- a/target/arm/tcg/hflags.c
+++ b/target/arm/tcg/hflags.c
@@ -412,6 +412,10 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,

     DP_TBFLAG_ANY(flags, AARCH64_STATE, 1);

+    if (arm_cpu_data_is_big_endian_a64(el, sctlr)) {
+        DP_TBFLAG_ANY(flags, BE_DATA, 1);
+    }
+
     /* Get control bits for tagged addresses.  */
     tcr = regime_tcr(env, mmu_idx);
     tbid = aa64_va_parameter_tbi(tcr, mmu_idx);
@@ -475,10 +479,6 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,
         }
     }

-    if (arm_cpu_data_is_big_endian_a64(el, sctlr)) {
-        DP_TBFLAG_ANY(flags, BE_DATA, 1);
-    }
-
     if (cpu_isar_feature(aa64_pauth, env_archcpu(env))) {
         /*
          * In order to save space in flags, we record only whether