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

Add alpha-level support for SME #123

Merged
merged 5 commits into from
Oct 18, 2022
Merged

Conversation

rsandifo-arm
Copy link
Contributor

This patch adds support for SME (Scalable Matrix Extension).
At this stage it is still alpha quality.

The request also includes #122

@stuij stuij added this to the 2022Q1 milestone Feb 25, 2022
@stuij stuij removed this from the 2022Q1 milestone Mar 16, 2022
aapcs64/aapcs64.rst Outdated Show resolved Hide resolved
@rsandifo-arm
Copy link
Contributor Author

@paulwalker-arm pointed out that the __arm_tpidr2_save spec was contradictory: it said that the function must clear TPIDR2_EL0 after saving ZA, but it also said that the function left ZA dormant.

It would have been possible to fix that by saying that the function leaves ZA active if ZA was previously dormant. This would make the function's interface incompatible with both the private-ZA and shared-ZA specs. However, it didn't seem worth adding a third type of ZA interface for this one function.

The new version therefore makes it the caller's responsibility to clear TPIDR2_EL0 instead. __arm_tpidr2_save is then a normal private-ZA function.

@rsandifo-arm
Copy link
Contributor Author

I've updated the definition of streaming-compatible function interfaces so that they no longer have the extra PSTATE argument. There is instead a new __arm_sme_state that returns whether the function has access to SME and (if so) what the current values of TPIDR2_EL0, PSTATE.SM and PSTATE.ZA are.

The man advantage of this is that an object file could define a streaming-compatible function symbol to be an alias of a non-streaming function symbol, if the non-streaming function is known to be naturally streaming-compatible. The main disadvantage is that it's now more expensive to read PSTATE.SM in a “safe” way (that is, in a way that works even on non-SME targets). However, it seems relatively unlikely that performance-critical paths of a streaming-compatible function would call (say) a non-streaming function; such a function should probably not be streaming-compatible.

This patch adds support for SME (Scalable Matrix Extension).
At this stage it is still alpha quality.
The spec for __arm_tpidr2_save said that it should clear TPIDR2_EL0
after saving ZA to the ZA save buffer, but that doesn't meet the
rquirements for a private-ZA function.  This patch makes it the
caller's responsibility to clear TPIDR2_EL0 instead.
Copy link
Member

@stuij stuij left a comment

Choose a reason for hiding this comment

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

We agreed that this has had enough reviews during drafting that it can be released as alpha.

@stuij stuij merged commit 00c54b7 into ARM-software:main Oct 18, 2022
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.

None yet

5 participants