Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armv7-M: Default to .w for better alignment #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkannwischer
Copy link
Collaborator

Currently, we maintain the instruction-width modifiers as they are in the input code (except for some exceptions). However, this can negatively impact performance as SLOTHY may break code-alignment.
This commit changes the Armv7-M instruction writer, to output .w for all instructions resulting in the best performance (modulo the size of the instruction cache).
Unfortunately, LLVM (in the selftest) stumbles over some of these .w modifiers in places where they do not have any effect. To work around that, we remove the modifiers for the selftest.

# SLOTHY is not sufficient.
# As currently, we don't have a model of the instruction encodings,
# there is no principled way to reason about it.
if thumb:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably Arch specific code should not go here. But also don't have a good quick fix in mind right now.

@mkannwischer mkannwischer marked this pull request as ready for review February 5, 2025 08:37
Currently, we maintain the instruction-width modifiers as they
are in the input code (except for some exceptions).
However, this can negatively impact performance as SLOTHY
may break code-alignment.
This commit changes the Armv7-M instruction writer, to output
.w for all instructions resulting in the best performance
(modulo the size of the instruction cache).
Unfortunately, LLVM (in the selftest) stumbles over some of these
.w modifiers in places where they do not have any effect.
To work around that, we remove the modifiers for the selftest.
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.

2 participants