Skip to content

Commit

Permalink
Merge pull request KhronosGroup#664 from gmlueck/gmlueck/vec-shift-co…
Browse files Browse the repository at this point in the history
…nstraint

Add constraint to vec <<, >> operators
  • Loading branch information
tomdeakin authored Jan 16, 2025
2 parents dea8c1d + 64f4769 commit 83b07fa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18377,15 +18377,17 @@ a@
----
vec operatorOP(const DataT& lhs, const vec& rhs)
----
a@ Construct a new instance of the SYCL [code]#vec# class template with
the same template parameters as the [code]#rhs# SYCL [code]#vec#
with each element of the new SYCL [code]#vec# instance the result of
an element-wise [code]#OP# bitshift operation between the [code]#lhs# scalar and each element of the [code]#rhs# SYCL [code]#vec#.
If [code]#OP# is [code]#>>#, [code]#DataT# is a signed type
and this SYCL [code]#vec# has a negative value any vacated bits viewed
as an unsigned integer must be assigned the value [code]#1#, otherwise
any vacated bits viewed as an unsigned integer must be assigned the value
[code]#0#.
a@ Available only when: [code]#DataT != float && DataT != double && DataT != half#.

Construct a new instance of the SYCL [code]#vec# class template with
the same template parameters as the [code]#rhs# SYCL [code]#vec#
with each element of the new SYCL [code]#vec# instance the result of
an element-wise [code]#OP# bitshift operation between the [code]#lhs# scalar and each element of the [code]#rhs# SYCL [code]#vec#.
If [code]#OP# is [code]#>>#, [code]#DataT# is a signed type
and this SYCL [code]#vec# has a negative value any vacated bits viewed
as an unsigned integer must be assigned the value [code]#1#, otherwise
any vacated bits viewed as an unsigned integer must be assigned the value
[code]#0#.

Where [code]#OP# is: [code]#<<#, [code]#>>#.

Expand Down

0 comments on commit 83b07fa

Please sign in to comment.