Re: [PATCH v3 26/60] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h

2022-04-30 Thread Richard Henderson
On 4/22/22 08:36, Alex Bennée wrote: +#define define_arm_cp_regs_with_opaque(CPU, REGS, OPAQUE) \ +do {\ +QEMU_BUILD_BUG_ON(ARRAY_SIZE(REGS) == 0); \ +if (ARRAY_SIZE(REGS) == 1)

Re: [PATCH v3 26/60] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h

2022-04-22 Thread Alex Bennée
Richard Henderson writes: > On 4/22/22 02:37, Peter Maydell wrote: >> On Sun, 17 Apr 2022 at 19:08, Richard Henderson >> wrote: >>> >>> Remove a possible source of error by removing REGINFO_SENTINEL >>> and using ARRAY_SIZE (convinently hidden inside a macro) to >>> find the end of the set of

Re: [PATCH v3 26/60] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h

2022-04-22 Thread Richard Henderson
On 4/22/22 02:37, Peter Maydell wrote: On Sun, 17 Apr 2022 at 19:08, Richard Henderson wrote: Remove a possible source of error by removing REGINFO_SENTINEL and using ARRAY_SIZE (convinently hidden inside a macro) to find the end of the set of regs being registered or modified. The space save

Re: [PATCH v3 26/60] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h

2022-04-22 Thread Peter Maydell
On Sun, 17 Apr 2022 at 19:08, Richard Henderson wrote: > > Remove a possible source of error by removing REGINFO_SENTINEL > and using ARRAY_SIZE (convinently hidden inside a macro) to > find the end of the set of regs being registered or modified. > > The space saved by not having the extra array

[PATCH v3 26/60] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h

2022-04-17 Thread Richard Henderson
Remove a possible source of error by removing REGINFO_SENTINEL and using ARRAY_SIZE (convinently hidden inside a macro) to find the end of the set of regs being registered or modified. The space saved by not having the extra array element reduces the executable's .data.rel.ro section by about 9k.