diff options
author | Alexander Monakov <amonakov@ispras.ru> | 2023-05-24 15:48:29 +0300 |
---|---|---|
committer | Alexander Monakov <amonakov@ispras.ru> | 2023-06-02 15:17:30 +0300 |
commit | 9f926f3a0c8dee7edb6807323a1fe2a92b33bfaa (patch) | |
tree | 4bc44b20c5fc2b0d52da58c5b9db35fb1805b5a8 /gcc | |
parent | bffc52838e393a775e13dc48162669b0f43ebe09 (diff) | |
download | gcc-9f926f3a0c8dee7edb6807323a1fe2a92b33bfaa.zip gcc-9f926f3a0c8dee7edb6807323a1fe2a92b33bfaa.tar.gz gcc-9f926f3a0c8dee7edb6807323a1fe2a92b33bfaa.tar.bz2 |
doc: clarify semantics of vector bitwise shifts
Explicitly say that attempted shift past element bit width is UB for
vector types. Mention that integer promotions do not happen.
gcc/ChangeLog:
* doc/extend.texi (Vector Extensions): Clarify bitwise shift
semantics.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/doc/extend.texi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index f9d13b4..cdbd4b3 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12026,7 +12026,14 @@ elements in the operand. It is possible to use shifting operators @code{<<}, @code{>>} on integer-type vectors. The operation is defined as following: @code{@{a0, a1, @dots{}, an@} >> @{b0, b1, @dots{}, bn@} == @{a0 >> b0, a1 >> b1, -@dots{}, an >> bn@}}@. Vector operands must have the same number of +@dots{}, an >> bn@}}@. Unlike OpenCL, values of @code{b} are not +implicitly taken modulo bit width of the base type @code{B}, and the behavior +is undefined if any @code{bi} is greater than or equal to @code{B}. + +In contrast to scalar operations in C and C++, operands of integer vector +operations do not undergo integer promotions. + +Operands of binary vector operations must have the same number of elements. For convenience, it is allowed to use a binary vector operation |