-
Notifications
You must be signed in to change notification settings - Fork 65
Add intrinsic support for the SVE multi-vector Advanced Encryption Standard (AES) instructions #411
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
base: main
Are you sure you want to change the base?
Conversation
a23e878 to
12b0669
Compare
main/acle.md
Outdated
| svuint8x2_t svaesemc[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesemc[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x2_t svaesdimc[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesdimc[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these instructions are destructive encodings (the output register is also an input register), so we should have an additional parameter for all of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand what you mean about one more parameter:
NAME: Zd, Zd, Zm[index]
Zd = op1
Zm = op2
index=index.
Op1 is input and output.
AESE: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESE--indexed---Multi-vector-AES-single-round-encryption-
AESD: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESD--indexed---Multi-vector-AES-single-round-decryption-
AESEMC: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESEMC--Multi-vector-AES-single-round-encryption-and-mix-columns-
AESDIMC: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESDIMC--Multi-vector-AES-single-round-decryption-and-inverse-mix-columns-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I had misread that the Zdn register parameters were duplicated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything I should do for this or can this be resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should use SSVE_AES instead of SSVE_AES2
I believe the two FEATs here are FEAT_SSVE_AES and FEAT_SVE_AES2. FEAT_SSVE_AES2 doesn't exist from what I can see.
main/acle.md
Outdated
| svuint8x2_t svaesemc[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesemc[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x2_t svaesdimc[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesdimc[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand what you mean about one more parameter:
NAME: Zd, Zd, Zm[index]
Zd = op1
Zm = op2
index=index.
Op1 is input and output.
AESE: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESE--indexed---Multi-vector-AES-single-round-encryption-
AESD: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESD--indexed---Multi-vector-AES-single-round-decryption-
AESEMC: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESEMC--Multi-vector-AES-single-round-encryption-and-mix-columns-
AESDIMC: https://developer.arm.com/documentation/ddi0602/2025-06/SVE-Instructions/AESDIMC--Multi-vector-AES-single-round-decryption-and-inverse-mix-columns-
dca98df to
83378b8
Compare
…pISA FEAT_SVE_AES2 adds 1) SVE multi-vector Advanced Encryption Standard (AES) instructions Instructions added: AESE, AESD, AESEMC and AESDIMC For each instruction there are two variants a) Two registers variant b) Four registers variant 2) SVE multi-vector 128-bit polynomial multiply long instructions Instructions added: PMULL and PMLAL FEAT_SSVE_AES implements the same instructions but when in streaming mode.
2716761 to
e8fb4e7
Compare
1.__ARM_FEATURE_SSVE_AES2 -> __ARM_FEATURE_SSVE_AES 2. Move the intrinsics to their own section under SVE2
- __ARM_FEATURE_SVE2_AES2 -> __ARM_FEATURE_SVE_AES2 - Add _lane prefix
main/acle.md
Outdated
| and `__ARM_FEATURE_SVE2` are both nonzero. | ||
|
|
||
| In addition, `__ARM_FEATURE_SVE_AES2` is defined to `1` if there is hardware | ||
| support for the SVE2 AES2 (FEAT_SVE_AES2) instructions and if the associated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you saying it is support for SVE2?
I believe it should be SVE AES2.
The description for the instruction does not have sve2, does it?
https://developer.arm.com/documentation/ddi0602/2025-09/SVE-Instructions/AESD--indexed---Multi-vector-AES-single-round-decryption-?lang=en
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos. Fixed here and some other places as well. Thanks.
| svuint8x2_t svaesemc_lane[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesemc_lane[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x2_t svaesdimc_lane[_u8_x2] (svuint8x2_t op1, svuint64_t op2, uint64_t index); | ||
| svuint8x4_t svaesdimc_lane[_u8_x4] (svuint8x4_t op1, svuint64_t op2, uint64_t index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the parameter names match the symbol names? e.g.
svuint8x4_t svaesdimc_lane[_u8_x4] (svuint8x4_t zdn, svuint64_t zm, uint64_t index);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make it easier to map the parameters to the respective register names in the ISA doc. However existing AES intrinsics follow the current convention.
https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=aes
@CarolineConcatto , @Lukacma what do you think?
name: Pull request
about: Technical issues, document format problems, bugs in scripts or feature proposal.
Thank you for submitting a pull request!
If this PR is about a bugfix:
Please use the bugfix label and make sure to go through the checklist below.
If this PR is about a proposal:
We are looking forward to evaluate your proposal, and if possible to
make it part of the Arm C Language Extension (ACLE) specifications.
We would like to encourage you reading through the contribution
guidelines, in particular the section on submitting
a proposal.
Please use the proposal label.
As for any pull request, please make sure to go through the below
checklist.
Checklist: (mark with
Xthose which apply)PR (do not bother creating the issue if all you want to do is
fixing the bug yourself).
SPDX-FileCopyrightTextlines on topof any file I have edited. Format is
SPDX-FileCopyrightText: Copyright {year} {entity or name} <{contact informations}>(Please update existing copyright lines if applicable. You can
specify year ranges with hyphen , as in
2017-2019, and usecommas to separate gaps, as in
2018-2020, 2022).Copyrightsection of the sources of thespecification I have edited (this will show up in the text
rendered in the PDF and other output format supported). The
format is the same described in the previous item.
tricky to set up on non-*nix machines). The sequence can be
found in the contribution
guidelines. Don't
worry if you cannot run these scripts on your machine, your
patch will be automatically checked in the Actions of the pull
request.
introduced in this PR in the section Changes for next
release of the section Change Control/Document history
of the document. Create Changes for next release if it does
not exist. Notice that changes that are not modifying the
content and rendering of the specifications (both HTML and PDF)
do not need to be listed.
correctness of the result in the PDF output (please refer to the
instructions on how to build the PDFs
locally).
draftversionis set totruein the YAML headerof the sources of the specifications I have modified.
in the README page of the project.