Skip to content

Conversation

@vhscampos
Copy link
Member

@vhscampos vhscampos commented Dec 18, 2024

This patch adds AArch32 base variants with -mno-unaligned-access.

Base variants are the set of libraries that provide the most compatible
functionality. As a consequence, they are built with strict alignment in
order to work nicely with client code that is compiled with or without
strict alignment.

Copy link
Collaborator

@pratlucas pratlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nolange
Copy link

nolange commented Dec 19, 2024

As a consequence, they are built with strict alignment in order to work nicely with client code that is compiled with or without strict alignment.

I doubt that's the case, the code should work nicely without strict alignment, unless you explicitly disable unaligned load/store via some special register (Can't think of many reasons why you would).

The only observable effect would be some slower routines.

can you describe some usecases where strict alignment is necessary (on cores that don't use it by default)?
AFAIU Code should be compatible anyway, whatever your client code does unless you disable some bits in CP15.

in the cases where you absolutely need it, you could replace the few problematic functions or link the libraries from a "lower" arch like ARMv6.
That would be better than hurting everything by default.

@vhscampos
Copy link
Member Author

We have some internal customers that rely on strict alignment.

Bear in mind this is not the final picture. As this is an incremental work, in the near future we will add library variants with more optimised code generation, including unaligned access.

These base variants are a fallback option when no better option is available.

@nolange
Copy link

nolange commented Dec 20, 2024

These base variants are a fallback option when no better option is available.

Maybe i misunderstand something, this patch builds every armv7 target with strict alignment?

My expectation when using multilib is that code is explicitly optimized for each arch.

This patch adds AArch32 base variants with `-mno-unaligned-access`.

Base variants are the set of libraries that provide the most compatible
functionality. As a consequence, they are built with strict alignment in
order to work nicely with client code that is compiled with or without
strict alignment.
@vhscampos vhscampos force-pushed the strict-base-variants-aarch32 branch from 36a9e24 to f07508c Compare January 7, 2025 13:53
@vhscampos vhscampos changed the title Build AArch32 base variants with strict alignment Add AArch32 base variants with strict alignment Jan 7, 2025
@vhscampos
Copy link
Member Author

vhscampos commented Jan 7, 2025

@nolange I've ended up doing the work that was meant to be done later, so now we have the strict aligned variants alongside the unaligned variants.

I believe this should be enough. There is no change in library selection for the preexisting cases.

@vhscampos vhscampos merged commit 20bce42 into ARM-software:main Jan 9, 2025
1 check passed
@vhscampos vhscampos deleted the strict-base-variants-aarch32 branch January 9, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants