-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL][ESIMD] Add test on simd bitwise not operator #850
Conversation
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.
Actually, I'm not quite sure it's safe to use bitwise operators over signed integral values in general.
The reasons behind are:
- general rule: INT13-C
- trap values and padding bits possibility: n2218 mentions all details
- possible existence of compiler optimizations relying on such restrictions (like the ones for arithmetical operations mentioned in cppcon 2018)
Tagging @kbobrovs for awareness
Looks like while there is possibility of trap values and compiler optimizations in general C++17, the llvm itself states that signed integer types are guaranteed to be two's complement: Given that information I would suggest to do the following:
@vasilytric Feel free to state any concerns for such solution. The other possible option is to make a two's complement representation a test precondition (run |
- Add comments about possible UB - Remove unnecessary comment - Remove Unnecessary field
Because we have possibility of trap values and compiler optimizations in general C++17.
- Update comment - use operators namespace
The test has been split in two in this commit: 66e0d60 |
SYCL/ESIMD/api/functional/operators/operator_bitwise_not_sint.cpp
Outdated
Show resolved
Hide resolved
- Make some variables const - Update log messages - Update some comments
@v-klochkov Would you mind to review this PR? |
No description provided.