-
Notifications
You must be signed in to change notification settings - Fork 67
Add alpha support for SVE2.1 #257
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
rsandifo-arm
left a comment
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.
Some comments below, but LGTM otherwise. Once the SME2 stuff is in, I think we should consolidate the intrinsics that are common between SME2 and SVE2p1, rather than duplicating them. I agree the current form makes sense until then though.
main/acle.md
Outdated
| // _u64base_u8, _u64base_u16, _u64base_s16, _u64base_u32, _u64base_s32, | ||
| // _u64base _u64, _u64base_s64 | ||
| // _u64base_bf16, _u64base_f16, _u64base_f32, _u64base_f64 | ||
| svint8_t svld1q_gather[_u64base_s8](svbool_t pg, svint64_t zn, const void *rm); |
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 we should provide the same addressing modes as for LDNT1 gather:
svld1q_gather[_u64base]_xx(svbool_t pg, svuint64_t zn)(notesvuint64_trather thansvint64_t)svld1q_gather[_u64base]_offset_xx(svbool_t pg, svuint64_t zn, int64_t offset)svld1q_gather[_u64base]_index_xx(svbool_t pg, svuint64_t zn, int64_t index)svld1q_gather_[u64]offset[_xx](svbool_t pg, const xx_t *base, svuint64_t offset)svld1q_gather_[u64]index[_xx](svbool_t pg, const xx_t *base, svuint64_t index)for 16-bit, 32-bit and 64-bitxx
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 imagine we should do the same for the ST1Q scatter quadrword, correct?
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.
Yeah, same thing there.
main/acle.md
Outdated
| // Variants are also available for: | ||
| // _s8 _u16, _s16, _u32, _s32, _u64, _s64 | ||
| // _bf16, _f16, _f32, _f64 | ||
| void svst2q[_u8](svbool_t pg, uint8_t *rn, svuint8x2_t zt); |
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.
@CarolineConcatto Is there a reason why the pointers for the structured quad-word stores use uint8_t *, instead of the int8_t * for the svld2q, etc?
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.
The type is meant to vary with the suffix, so it's uint8_t * for the [_u8] function shown, and would be int8_t * for the [_s8] version.
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.
Doh! Of course, silly me. :)
main/acle.md
Outdated
|
|
||
| #### LD1Q | ||
|
|
||
| Gather Load Quadword. |
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.
There is only an unscaled variant of this instruction, so maybe don't have both offset and 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.
For the other SVE load and store intrinsics, we tried to provide a consistent interface and set of addressing modes. So the deciding factor wasn't so much whether the call mapped to a single instruction, but whether the underlying instruction could easily emulate the mode. “Single instruction” is a bit of nebulous concept anyway for loads and stores, since a single C address expression might need several operations to compute.
Since scaling is just a shift left, I think it's worth providing both index and offset variants.
main/acle.md
Outdated
|
|
||
| #### ST1Q | ||
|
|
||
| Scatter store quadwords. |
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.
There is only an unscaled version of this instruction? So maybe don't have both index and offset?
main/acle.md
Outdated
|
|
||
| // Variants are also available for: | ||
| // _s8, _u16, _s16, _u32, _s32, _u64, _s64 | ||
| svuint8_t svpmov_lane_u8_z(svbool_t pn); |
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.
s/ svuint8_t svpmov_lane_u8_z(svbool_t pn);/ svuint8_t svpmov_u8_z(svbool_t pn);/
ThomasBamelis
left a comment
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.
With the increased use of x4 vectors in 2.1, would it be the right time to introduce svreinterpret variants for x4 types as well?
With data rearranging, load/storing and element wise bit manipulation changing element size can come in quite handy.
main/acle.md
Outdated
| // _s8, _s16, _u16, _s32, _u32, _s64, _u64 | ||
| // _bf16, _f16, _f32, _f64 | ||
| svuint8_t svextq_lane[_u8](svuint8_t zdn, svuint8_t zm, uint64_t imm); | ||
| svuint8_t svextq[_u8](svuint8_t zdn, svuint8_t zm, uint64_t imm); |
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 we dropping the _lane part here?
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.
Richard pointed out that the other ext do not have lane in it.
// Variants are also available for:
// _s8, _s16, _u16, _s32, _u32, _s64, _u64
// _bf16, _f16, _f32, _f64
svuint8_t svextq_lane[_u8](svuint8_t zdn, svuint8_t zm, uint64_t imm);
Member
@rsandifo-arm rsandifo-arm 3 weeks ago
I'm not sure these should be lane intrinsics. The instructions are really a form of permutation. (FWIW, the corresponding non-Q intrinsics don't have the _lane suffix.)
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.
OK.
|
Hello @CarolineConcatto, You have forgotten DUPQ instruction for sve2p1 . Prototype will look like this : This is different to svdupq_lane intrinsic and they have different behaviour |
|
I merged SVE2.1 and SME2 intrinsics to 1 section. But I am not sure that is the best. |
This patch adds new intrinsics and types for supporting SVE2.1.
rsandifo-arm
left a comment
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.
This version seems to add the shared SVE2.1/SME intrinsics back into the SME section (with __arm_streaming attributes). Is that deliberate?
I think we should only document each intrinsic once, as in the previous version. It's just that the relationship between streaming/non-streaming/streaming-compatible and SME/SME2/SVE2/SVE2.1 can't be expressed directly using attributes (and so needs to be specified in words instead).
No, they should not be in the SME section with streaming attribute. |
rsandifo-arm
left a comment
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.
LGTM apart from the typo below.
main/acle.md
Outdated
| non-zero or __ARM_FEATURE_SME2 are non-zero. | ||
| For convenience, these the intrinsics for these instructions are listed in | ||
| the following section. | ||
| For convenience, the intrinsics fo these instructions are listed in the |
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.
| For convenience, the intrinsics fo these instructions are listed in the | |
| For convenience, the intrinsics for these instructions are listed in the |
sallyarmneale
left a comment
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.
One very minor comment.
This patch adds new intrinsics and types for supporting SVE2.1. This patch depends on Pull-Request#217
(#217),
because some intrinsic in this specification are also in Pull-Request#217.
Depends on: #217
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.