Repository navigation
[SYCL] Common Reference Semantics for accessor class - #63
Conversation
Signed-off-by: Vyacheslav N Klochkov <[email protected]>
| // ... first descriptor (translated to pointer kernel parameter): | ||
| // The parameter is a SYCL accessor object. | ||
| // The Info field of the parameter descriptor for accessor contains | ||
| // two template parameters packed into thid integer field: |
There was a problem hiding this comment.
I do not understand this sentence.
But great to have all this new documentation. I love reading a lot of comments while reading some code. :-)
By the way @vladimirlaz can you wait a little bit longer before merging the commits? Because of the different timezones we do not have time to just look at the commits before merging...
One more day should be enough.
There was a problem hiding this comment.
Agree to wait till next working day to let everybody provide comments
There was a problem hiding this comment.
I tried to make the comment better than it was before (it though had some misprint at L714: thid -> this).
It is sad that it causes questions and needs some rephrasing/rewriting.
Would this one be better? (I could update this place sometime in future when fix this file again).
The 2nd argument of the call H.addParamDesc() below defines what is written
to the accessor parameter descriptor and its int field 'Info'.
For the template class accessor<Type, Dimensions, Mode, Target, IsPlaceHolder>
it keeps both 'Target' and 'Dimensions' packed into that int field 'Info' as:
(Target | (Dimensions << 11)).
We are about to add enum attributes with AttrKind numbers >= 63. This means we cannot use AttrKind #63 to test for an invalid attribute number in the RAW format anymore. This patch changes the number of an invalid attribute to #255. There is no change to the character of the tests. Differential Revision: https://reviews.llvm.org/D64531 llvm-svn: 365722
CONFLICT (content): Merge conflict in clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaLookup.cpp
…SHL (#207628)
`select(icmp ult(amt, EltSize), shl(x, amt), 0)`, where EltSize is the
{8, 16, 32, 64} lane size, is the usual way to guard a variable vector
shift against shl poison. On AArch64 the guard is unnecessary because
USHL already returns zero once the shift amount reaches the lane size.
For v4i32:
Before:
```
movi v2.4s, #63
movi v3.4s, #32
and v1.16b, v1.16b, v2.16b
ushl v0.4s, v0.4s, v1.4s
cmhi v1.4s, v3.4s, v1.4s
and v0.16b, v1.16b, v0.16b
```
After:
```
movi v2.4s, #63
and v1.16b, v1.16b, v2.16b
ushl v0.4s, v0.4s, v1.4s
```
USHL reads each lane's shift amount as a signed value from its low byte
so amounts above 127 would be misread. The fold applies directly when
known bits can prove the amounts are at most 127 and otherwise the
amounts are clamped to EltSize with umin first, which is still one
instruction cheaper than the select.
NEON has no umin for 64-bit lanes so unbounded v2i64 amounts use the SVE
umin when available and otherwise keep the select.
lshr gets the same fold since it already lowers to ushl with a negated
amount.
This is the AArch64 counterpart of #86922, which added the same folds
for AVX2's variable shifts. This does the select(shift) half; the
shift(select) form will be a follow-up.
Closes #200698.
Signed-off-by: Vyacheslav N Klochkov [email protected]