-
Notifications
You must be signed in to change notification settings - Fork 61
Add Alpha support for SME2 #217
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
Conversation
This patch adds new intrinsics and types for supporting SME2.
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.
Looks great. I haven't looked in detail at each individual intrinsic — the actual implementation seems like the best way of doing that — but I've added some comments based on a comparison with SVE.
* Addressed suggestions in descriptions * Removed unnecessary newlines * Merged optional suffixes e.g. `[_single][_u16][_x2]` -> `[_single_u16_x2]` * Renamed svuqrshr -> svqrshr (the signedness can be deduced form the operands and there wasn't a svsqrshr either for SQRSHR) * Replaced `enum sv_vgkind` by `uint64_t` immediate. * Generalised `imm_1_8` into `imm` since this immediate wasn't correct for all types.
The C and C++ Language Extensions for AArch64 SME2 [1] adds a new type called `svcount_t` which describes a predicate. This is not a predicate vector mask, but rather a description of a predicate vector mask that can be expanded into a mask using explicit instructions. The type is a scalable opaque type. To implement `svcount_t` type this patch uses the existing Target Extension Type mechanism, but adds further support so that this type can be a scalable type. AArch64 CodeGen support will follow in a separate patch. [1] ARM-software/acle#217 Reviewed By: jcranmer-intel, nikic Differential Revision: https://reviews.llvm.org/D136861
The 'l' is redundant because of the `_za32` or `_za64` suffixes already present in the function prototype, from which the 'long' or 'long long' can be deduced.
This avoids a name clash with SVE intrinsics for svmlslb_f32/svmlslt_f32, and also aligns with what was done with bfmlalb/bfmlalt for SVE.
For _za8, the tile can only be '0', hence the reason why the tile wasn't explicitly passed in. But there are overloaded forms for _za16, _za32, _za64 and _za128 that do require a tile, so this change adds the tile operand to all intrinsics. For _za8, it is up to the compiler to ensure that no value other than '0' can be passed.
The return type cannot be deduced from one of the operands, so must be explicitly specified in the name of the intrinsic.
The following SME2 intrinsic: svint32_t svdot[_s32](svint32_t, svint8_t, svint8_t); clashes with the one we defined for SME2: svint32_t svdot[_s32](svint32_t, svint16_t, svint16_t); This patch renames these to: svint32_t svdot[_s32_s16_s16]((svint32_t, svint16_t, svint16_t); which is unambiguous and allows for the possibility of retroactively updating the SVE intrinsics to have a similar name (svdot[_s32_s8_s8]).
The PSEL and PFALSE instructions have aliases to accept a predicate-as-counter register. It makes sense to add corresponding ACLE intrinsics for user convenience.
Also fixed a use of `svread_hor_za8` in the description of _vg2/_vg4 where it was missing the newly added tile operand.
Adds the following SME2 builtins: - svmop(a|s)_za32, - svbmop(a|s)_za32 See ARM-software/acle#217
) Adds the following SME2 builtins: - svmop(a|s)_za32, - svbmop(a|s)_za32 See ARM-software/acle#217
See ARM-software/acle#217 Patch by: Kerry McLaughlin [email protected]
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
Adds builtins for: - FCVT - BFCVT - FCVTZS - FCVTZU - SCVTF - UCVTF - BFCVTN - FCVTN - SQCVT - SQCVTU - UQCVT - SQCVTN - SQCVTUN - UQCVTN See ARM-software/acle#217
Adds the following SME2 builtins: - svread_hor/ver, - svwrite_hor/ver, - svread_za64, - svwrite_za64 See ARM-software/acle#217
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
This patch adds new intrinsics and types for supporting SME2.
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
Adds builtins for: - FCVT - BFCVT - FCVTZS - FCVTZU - SCVTF - UCVTF - BFCVTN - FCVTN - SQCVT - SQCVTU - UQCVT - SQCVTN - SQCVTUN - UQCVTN See ARM-software/acle#217
See ARM-software/acle#217 Patch by: Hassnaa Hamdi <[email protected]>
Extend pfalse and ptrue builtins with svcount_t return types to be enabled for sve2p1 and sme2 See ARM-software/acle#217
Adds the following SME2 builtins: - svread_hor/ver, - svwrite_hor/ver, - svread_za64, - svwrite_za64 See ARM-software/acle#217
ZA array vectors. The intrinsics model this in the following way: | ||
|
||
* Multi-vector operands are groups of SVE data vectors, that use the same | ||
tuple types as defined in the [SVE ACLE](#sve-vector-types), e.g. |
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.
Avoid Latin contractions.
e.g. -> for example.
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.
Avoid all latin contractions:
e.g. -> For example
i.e. -> that is
etc. -> and so on
Adds the following SME2 builtins: - svread_hor/ver, - svwrite_hor/ver, - svread_za64, - svwrite_za64 See ARM-software/acle#217
These intrinsics are used to implement the sel intrinsics that selects a tuple of 2 or 4 values based on a predicate-as-counter operand, e.g. __attribute__((arm_streaming)) svuint8x2_t svsel[_u8_x2](svcount_t png, svuint8x2_t zn, svuint8x2_t zm); __attribute__((arm_streaming)) svuint8x4_t svsel[_u8_x4](svcount_t png, svuint8x4_t zn, svuint8x4_t zm); As described in ARM-software/acle#217 Reviewed By: CarolineConcatto Differential Revision: https://reviews.llvm.org/D150951
…nt1/st1/stnt1 These intrinsics are used to implement multi-vector load/store intrinsics that loads or stores a tuple of 2 or 4 values, based on a predicate-as-counter operand, e.g. __attribute__((arm_streaming)) svuint8x2_t svld1[_u8]_x2(svcount_t png, const uint8_t *rn); __attribute__((arm_streaming)) void svst1[_u8_x2](svcount_t png, uint8_t *rn, svuint8x2_t zt); As described in ARM-software/acle#217 Reviewed By: CarolineConcatto Differential Revision: https://reviews.llvm.org/D150956
This patch adds new intrinsics and types for supporting SME2.
name: Pull request
about: 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
X
those which apply)PR (do not bother creating the issue if all you want to do is
fixing the bug yourself).
SPDX-FileCopyrightText
lines 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
).Copyright
section 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).
draftversion
is set totrue
in the YAML headerof the sources of the specifications I have modified.
in the README page of the project.