[PATCH v2 0/2] aarch64: extend the number of supported feature bits

Alice Carlotti alice.carlotti@arm.com
Fri Jun 6 14:51:11 GMT 2025


On Fri, Jun 06, 2025 at 03:25:16PM +0100, Richard Earnshaw wrote:
> This is an alternative approach to the patch Ezra posted in
> https://sourceware.org/pipermail/binutils/2025-May/141183.html but
> attempts to address to make future changes more straight forward.  It
> works by using some macro trickery to replicate the necessary
> statements so that in future we only need to change the replication
> macro itself plus the number of feature bits we want to support.
> 
> A static assert further validates at compile time that there is enough
> space to accommodate all the required feature bits.  Note that we
> no-longer need to add dummy padding features to keep the macros and C
> code in sync.
> 
> The series is divided into two patches.  The first makes all the
> necessary changes to the macros.  The second is the patch that extends
> the number of feature bits.  This is what would also need to change in
> future if/when we need to move to 4 feature words.
> 
> Changes since v1:
> 
> o  Eliminate the need for AARCH64_MAX_FEATURES by synthesizing it from the number
>    of replications.
> o  Improve the assertion by validating the replication count.
> o  Use aarch64_feature_word as the type for the flags field instead of
>    directly using uint64_t.
> 
> I'll hold off committing this change until next week, just to allow
> some time for comments.

Looks good to me.  For extra validation, I tested the series with 26 extra
padding features inserted near the beginning of the list, to ensure that the
third element works correctly for both virtual and non-virtual feature bits.

Alice

> 
> Richard Earnshaw (2):
>   aarch64: use macro trickery to automate feature array size replication
>   aarch64: Increase the number of feature words to 3
> 
>  include/opcode/aarch64.h | 118 +++++++++++++++++++++++++++------------
>  1 file changed, 82 insertions(+), 36 deletions(-)
> 
> -- 
> 2.43.0
> 


More information about the Binutils mailing list