Skip to content

Commit

Permalink
Add constraint to vec <<, >> operators
Browse files Browse the repository at this point in the history
Cherry pick KhronosGroup#664 from main
(cherry picked from commit 83b07fa)
  • Loading branch information
tomdeakin authored and gmlueck committed Jan 22, 2025
1 parent df9e192 commit 756788d
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 @@ -18372,15 +18372,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 756788d

Please sign in to comment.