diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-09-16 07:22:29 -0700 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2025-09-25 15:54:37 +0100 |
| commit | afe6ed3cfb4f19bf93632ad0c763610cef07637e (patch) | |
| tree | 0923050e29f7f0d95d7461dd233b980fce42862c | |
| parent | dde8637d283e71c6e9bef776e60df099013237e7 (diff) | |
| download | focaccia-qemu-afe6ed3cfb4f19bf93632ad0c763610cef07637e.tar.gz focaccia-qemu-afe6ed3cfb4f19bf93632ad0c763610cef07637e.zip | |
target/arm: Move alias setting for wildcards
Move this test from add_cpreg_to_hashtable to define_one_arm_cp_reg_with_opaque, where we can also simplify it based on the loop variables. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> [PMM: adjusted placement of comma in a comment] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| -rw-r--r-- | target/arm/helper.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index a199320f14..274b7b5808 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7448,20 +7448,12 @@ static void add_cpreg_to_hashtable(ARMCPU *cpu, ARMCPRegInfo *r, } /* - * By convention, for wildcarded registers only the first - * entry is used for migration; the others are marked as - * ALIAS so we don't try to transfer the register - * multiple times. Special registers (ie NOP/WFI) are - * never migratable and not even raw-accessible. + * Special registers (ie NOP/WFI) are never migratable and + * are not even raw-accessible. */ if (r->type & ARM_CP_SPECIAL_MASK) { r->type |= ARM_CP_NO_RAW; } - if (((r->crm == CP_ANY) && crm != 0) || - ((r->opc1 == CP_ANY) && opc1 != 0) || - ((r->opc2 == CP_ANY) && opc2 != 0)) { - r->type |= ARM_CP_ALIAS | ARM_CP_NO_GDB; - } /* * Update fields to match the instantiation, overwiting wildcards @@ -7765,6 +7757,16 @@ void define_one_arm_cp_reg(ARMCPU *cpu, const ARMCPRegInfo *r) ARMCPRegInfo *r2 = alloc_cpreg(r, NULL); ARMCPRegInfo *r3; + /* + * By convention, for wildcarded registers only the first + * entry is used for migration; the others are marked as + * ALIAS so we don't try to transfer the register + * multiple times. + */ + if (crm != crmmin || opc1 != opc1min || opc2 != opc2min) { + r2->type |= ARM_CP_ALIAS | ARM_CP_NO_GDB; + } + switch (r->state) { case ARM_CP_STATE_AA32: add_cpreg_to_hashtable_aa32(cpu, r2, cp, crm, opc1, opc2); |