-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LangRef] Update the semantic of experimental.get.vector.length
#104475
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
Changes from all commits
2cd78f2
7f74ada
911fdcd
70fc039
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -19634,7 +19634,7 @@ vectorization factor should be multiplied by vscale. | |||||||
Semantics: | ||||||||
"""""""""" | ||||||||
|
||||||||
Returns a positive i32 value (explicit vector length) that is unknown at compile | ||||||||
Returns a non-negative i32 value (explicit vector length) that is unknown at compile | ||||||||
time and depends on the hardware specification. | ||||||||
If the result value does not fit in the result type, then the result is | ||||||||
a :ref:`poison value <poisonvalues>`. | ||||||||
|
@@ -19644,13 +19644,23 @@ in order to get the number of elements to process on each loop iteration. The | |||||||
result should be used to decrease the count for the next iteration until the | ||||||||
count reaches zero. | ||||||||
|
||||||||
If the count is larger than the number of lanes in the type described by the | ||||||||
last 2 arguments, this intrinsic may return a value less than the number of | ||||||||
lanes implied by the type. The result will be at least as large as the result | ||||||||
will be on any later loop iteration. | ||||||||
Let ``%max_lanes`` be the number of lanes in the type described by ``%vf`` and | ||||||||
``%scalable``, here are the constraints on the returned value: | ||||||||
|
||||||||
This intrinsic will only return 0 if the input count is also 0. A non-zero input | ||||||||
count will produce a non-zero result. | ||||||||
- If ``%cnt`` equals to 0, returns 0. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd probably say "less than or equal to" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fixed now. |
||||||||
- The returned value is always less than or equal to ``%max_lanes``. | ||||||||
frasercrmck marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
- The returned value is always greater than or equal to ``ceil(%cnt / ceil(%cnt / %max_lanes))``, | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
if ``%cnt`` is non-zero. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
- The returned values are monotonically non-increasing in each loop iteration. That is, | ||||||||
frasercrmck marked this conversation as resolved.
Show resolved
Hide resolved
frasercrmck marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
the returned value of an iteration is at least as large as that of any later | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
iteration. | ||||||||
|
||||||||
Note that it has the following implications: | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, though since the |
||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
- For a loop that uses this intrinsic, the number of iterations is equal to | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||||
``ceil(%C / %max_lanes)`` where ``%C`` is the initial ``%cnt`` value. | ||||||||
- If ``%cnt`` is non-zero, the return value is non-zero as well. | ||||||||
- If ``%cnt`` is less than or equal to ``%max_lanes``, the return value is equal to ``%cnt``. | ||||||||
|
||||||||
'``llvm.experimental.vector.partial.reduce.add.*``' Intrinsic | ||||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||||||
|
Uh oh!
There was an error while loading. Please reload this page.