diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 0730736d..fa486fa5 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17111,18 +17111,30 @@ template asT as() const a@ [source] ---- -template __swizzled_vec__ swizzle() const +template __writeable_swizzle__ swizzle() +template __const_swizzle__ swizzle() const ---- - a@ Return an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. + a@ Available only when: The number of [code]#swizzleIndexes# template + parameters is 1, 2, 3, 4, 8, or 16. + Available only when: Each of the [code]#swizzleIndexes# template + parameters is greater or equal to 0 and less than [code]#NumElements#. + +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. +The [code]#swizzleIndexes# argument pack specifies the elements in the swizzle. a@ [source] ---- -__swizzled_vec__ XYZW_ACCESS() const +__writeable_swizzle__ XYZW_ACCESS() +__const_swizzle__ XYZW_ACCESS() const ---- a@ Available only when: [code]#+NumElements <= 4+#. -Returns an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. Where [code]#XYZW_ACCESS# is: [code]#x# for [code]#NumElements == 1#, [code]#x, y# for @@ -17135,20 +17147,27 @@ Where [code]#XYZW_ACCESS# is: [code]#x# for [code]#NumElements == 1#, a@ [source] ---- -__swizzled_vec__ RGBA_ACCESS() const +__writeable_swizzle__ RGBA_ACCESS() +__const_swizzle__ RGBA_ACCESS() const ---- a@ Available only when: [code]#NumElements == 4#. -Returns an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. Where [code]#RGBA_ACCESS# is: [code]#r, g, b, a#. a@ [source] ---- -__swizzled_vec__ INDEX_ACCESS() const +__writeable_swizzle__ INDEX_ACCESS() +__const_swizzle__ INDEX_ACCESS() const ---- - a@ Returns an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. + a@ Return an instance of the implementation-defined + [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# class + representing a swizzled view of the vector as described in + <>. Where [code]#INDEX_ACCESS# is: [code]#s0# for [code]#NumElements == 1#, [code]#s0, s1# for @@ -17165,11 +17184,14 @@ Where [code]#INDEX_ACCESS# is: [code]#s0# for [code]#NumElements == 1#, a@ [source] ---- -__swizzled_vec__ XYZW_SWIZZLE() const +__writeable_swizzle__ XYZW_SWIZZLE() +__const_swizzle__ XYZW_SWIZZLE() const ---- a@ Available only when: [code]#+NumElements <= 4+#, and when the macro [code]#SYCL_SIMPLE_SWIZZLES# is defined before including [code]##. -Returns an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. Where XYZW_SWIZZLE is all permutations with repetition, of any subset with length greater than [code]#1#, of [code]#x, y# for [code]#NumElements == 2#, @@ -17181,11 +17203,14 @@ Where XYZW_SWIZZLE is all permutations with repetition, of any subset with lengt a@ [source] ---- -__swizzled_vec__ RGBA_SWIZZLE() const +__writeable_swizzle__ RGBA_SWIZZLE() +__const_swizzle__ RGBA_SWIZZLE() const ---- a@ Available only when: [code]#NumElements == 4#, and when the macro [code]#SYCL_SIMPLE_SWIZZLES# is defined before including [code]##. -Returns an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence which can be used to apply the swizzle in a valid expression as described in <>. +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. Where RGBA_SWIZZLE is all permutations with repetition, of any subset with length greater than [code]#1#, of [code]#r, g, b, a#. For example a four element [code]#vec# provides permutations including [code]#rbga#, [code]#rggg# and [code]#rb#. @@ -17193,42 +17218,62 @@ For example a four element [code]#vec# provides permutations including [code]#rb a@ [source] ---- -__swizzled_vec__ lo() const +__writeable_swizzle__ lo() +__const_swizzle__ lo() const ---- a@ Available only when: [code]#NumElements > 1#. -Return an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence made up of the lower half of this SYCL vec which can be used to apply the swizzle in a valid expression as described in <>. When [code]#NumElements == 3#, this SYCL [code]#vec# is treated as though +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. +The swizzle consists of the lower half of the elements in the vector. +When [code]#NumElements == 3#, the vector is treated as though [code]#NumElements == 4# with the fourth element undefined. a@ [source] ---- -__swizzled_vec__ hi() const +__writeable_swizzle__ hi() +__const_swizzle__ hi() const ---- a@ Available only when: [code]#NumElements > 1#. -Return an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence made up of the upper half of this SYCL vec which can be used to apply the swizzle in a valid expression as described in <>. When [code]#NumElements == 3#, this SYCL [code]#vec# is treated as though +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. +The swizzle consists of the upper half of the elements in the vector. +When [code]#NumElements == 3#, the vector is treated as though [code]#NumElements == 4# with the fourth element undefined. a@ [source] ---- -__swizzled_vec__ odd() const +__writeable_swizzle__ odd() +__const_swizzle__ odd() const ---- a@ Available only when: [code]#NumElements > 1#. -Return an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence made up of the odd indexes of this SYCL vec which can be used to apply the swizzle in a valid expression as described in <>. When [code]#NumElements == 3#, this SYCL [code]#vec# is treated as though +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. +The swizzle consists of the elements in the vector with an odd numbered index. +When [code]#NumElements == 3#, the vector is treated as though [code]#NumElements == 4# with the fourth element undefined. a@ [source] ---- -__swizzled_vec__ even() const +__writeable_swizzle__ even() +__const_swizzle__ even() const ---- a@ Available only when: [code]#NumElements > 1#. -Return an instance of the implementation-defined intermediate class template [code]#+__swizzled_vec__+# representing an index sequence made up of the even indexes of this SYCL vec which can be used to apply the swizzle in a valid expression as described in <>. When [code]#NumElements == 3#, this SYCL [code]#vec# is treated as though +Return an instance of the implementation-defined [code]#+__writeable_swizzle__+# +or [code]#+__const_swizzle__+# class representing a swizzled view of the vector +as described in <>. +The swizzle consists of the elements in the vector with an even numbered index. +When [code]#NumElements == 3#, the vector is treated as though [code]#NumElements == 4# with the fourth element undefined. a@ @@ -17645,18 +17690,17 @@ Note that the simple swizzle functions are only available for up to 4 element vectors and are only available when the macro [code]#SYCL_SIMPLE_SWIZZLES# is defined before including [code]##. -In both cases the return type is always an instance of -[code]#+__swizzled_vec__+#, an implementation-defined temporary class -representing the result of the swizzle operation on the original [code]#vec# -instance. -Since the swizzle operation may result in a different number of elements, the -[code]#+__swizzled_vec__+# instance may represent a different number of elements -than the original [code]#vec#. -Both kinds of swizzle member functions must not perform the swizzle operation -themselves, instead the swizzle operation must be performed by the returned -instance of [code]#+__swizzled_vec__+# when used within an expression, meaning -if the returned [code]#+__swizzled_vec__+# is never used in an expression no -swizzle operation is performed. +In both cases the return value is an instance of either the +[code]#+__writeable_swizzle__+# or the [code]#+__const_swizzle__+# class +template. +These classes have an implementation-defined name, and they represent a view of +the original [code]#vec# object with the swizzle operation applied. +The [code]#+__writeable_swizzle__+# class represents a writeable view of the +[code]#vec# object, while the [code]#+__const_swizzle__+# class represents a +read-only view. +Since the swizzle operation may result in a different number of elements, these +views may represent a different number of elements than the original [code]#vec# +object. Both the [code]#swizzle# member function template and the simple swizzle member functions allow swizzle indexes to be repeated. @@ -17667,40 +17711,679 @@ member function template. [[swizzled-vec-class]] -==== Swizzled [code]#vec# class - -The [code]#+__swizzled_vec__+# class must define an unspecified temporary which -provides the entire interface of the SYCL [code]#vec# class template, including -swizzled member functions, with the additions and alterations described below. -The member functions of the [code]#+__swizzled_vec__+# class behave as though -they operate on a [code]#vec# that is the result of the swizzle operation. - - * The [code]#+__swizzled_vec__+# class template must be readable as an r-value - reference on the RHS of an expression. - In this case the swizzle operation is performed on the RHS of the expression - and then the result is applied to the LHS of the expression. - * The [code]#+__swizzled_vec__+# class template must be assignable as an - l-value reference on the LHS of an expression. - In this case the RHS of the expression is applied to the original SYCL - [code]#vec# which the [code]#+__swizzled_vec__+# represents via the swizzle - operation. - Note that a [code]#+__swizzled_vec__+# that is used in an l-value expression - may not contain any repeated element indexes. -+ -For example: [code]#f4.xxxx() = fx.wzyx()# would not be valid. - * The [code]#+__swizzled_vec__+# class template must be convertible to an - instance of SYCL [code]#vec# with the type [code]#DataT# and number of - elements specified by the swizzle member function, if [code]#NumElements > - 1#, and must be convertible to an instance of type [code]#DataT#, if - [code]#NumElements == 1#. - * The [code]#+__swizzled_vec__+# class template must be non-copyable, - non-moveable, non-user constructible and may not be bound to a l-value or - escape the expression it was constructed in. - For example [code]#auto x = f4.x()# would not be valid. - * The [code]#+__swizzled_vec__+# class template should return - [code]#+__swizzled_vec__&+# for each operator inherited from the [code]#vec# - class template interface which would return [code]#vec&#. +==== The swizzled vector classes + +The [code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+# classes are +each views over a [code]#vec# object which captures the effects of a swizzle +operation without actually performing that operation. +The tables below define the interfaces to these classes, but in general +[code]#+__writeable_swizzle__+# supports the same interface as [code]#vec#, +while [code]#+__const_swizzle__+# supports only the non-mutating operations of +[code]#vec#. +Member functions and operators that read elements from these views return +elements from the underlying [code]#vec# as translated by the captured swizzle +operation. +Member functions and operators that modify elements of these views modify +corresponding elements of the underlying [code]#vec# as translated by the +captured swizzle operation. +The following example illustrates this behavior: + +[source,,linenums] +---- +include::{code_dir}/swizzle-example.cpp[lines=4..-1] +---- + +Synopses of the [code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+# +classes are shown below. +The member type aliases are described in <>, the +constructors are described in <>, the member +functions are described in <>, and the hidden friend +functions are described in <>. + +The [code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+# classes are +not user constructible. + +The [code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+# types are +class templates, but the template parameters are unspecified. +The description below describes the member functions and hidden friend functions +using two exposition-only private members named [code]#DataT# and +[code]#NumElements#. +The type alias [code]#DataT# represents the element type of the underlying +[code]#vec#. +The constant [code]#NumElements# represents the number of elements in the result +of the swizzle operation, which could be different from the number of elements +in the underlying [code]#vec#. + +When the string [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# +is used inside the class definition in the synopses below, it refers to the +instantiation with the same set of template parameters as the enclosing class. +This is consistent with {cpp} syntax. +When the string [code]#+__writeable_swizzle__+# or +[code]#+__const_swizzle__+# is used inside the class +definition, it refers to a possibly different instantiation of the +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# class. + +Although the synopses below illustrate [code]#+__writeable_swizzle__+# and +[code]#+__const_swizzle__+# as two separate classes, this is exposition only. +An implementation could instead implement a single combined class with +additional constraints on the member functions. + +[source,,linenums] +---- +include::{header_dir}/swizzled-vec.h[lines=4..-1] +---- + +[[sec:types.swizzled-vec]] +===== Member type aliases for the swizzled vector class templates + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +using element_type = DataT +using value_type = DataT +---- +|==== +Each of these type aliases tells the type of an element in the underlying +[code]#vec#. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +#ifdef __SYCL_DEVICE_ONLY__ +using vector_t = /*unspecified*/ +#endif +---- +|==== +This type alias is available only in device code. +The [code]#vector_t# type represents a native vector type of [code]#NumElements# +elements where each element's type is [code]#DataT#. + +[[sec:constructors.swizzled-vec]] +===== Constructors for the swizzled vector class templates + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +__writeable_swizzle__() = delete +__writeable_swizzle__(const __writeable_swizzle__&) = delete + +__const_swizzle__() = delete +__const_swizzle__(const __const_swizzle__&) = delete + +__const_swizzle__& operator=(const __const_swizzle__&) = delete +---- +|==== +The default constructor and copy constructor are deleted. + +The copy assignment operator for [code]#+__const_swizzle__+# is deleted. + +===== Destructors for the swizzled vector class templates + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +~__writeable_swizzle__() +~__const_swizzle__() +---- +|==== +The destructors have no visible effect. + +[[sec:members.swizzled-vec]] +===== Member functions for the swizzled vector class templates + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +#ifdef __SYCL_DEVICE_ONLY__ +operator vector_t() const +#endif + +operator DataT() const +static constexpr size_t byte_size() noexcept +static constexpr size_t size() noexcept + +size_t get_size() const // Deprecated +size_t get_count() const // Deprecated + +template +vec convert() const + +template asT as() const + +template +void store(size_t offset, multi_ptr ptr) const +---- +|==== +_Availability:_ These functions are available in both +[code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+#. + +_Constraints:_ These functions have the same constraints as the equivalent +member functions of the [code]#vec# class. + +_Effects:_ The effect of these functions is the same as if they were called on a +temporary [code]#vec# object that contains the result of the captured swizzle +operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +operator vec() const +---- +|==== +_Availability:_ These functions are available in both +[code]#+__writeable_swizzle__+# and [code]#+__const_swizzle__+#. + +_Constraints:_ Available only when [code]#NumElements > 1#. + +_Returns:_ A new [code]#vec# object that contains the result of the captured +swizzle operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template __writeable_swizzle__ swizzle() const (1) + +__writeable_swizzle__ XYZW_ACCESS() const (2) +__writeable_swizzle__ RGBA_ACCESS() const (3) +__writeable_swizzle__ INDEX_ACCESS() const (4) + +#ifdef SYCL_SIMPLE_SWIZZLES +__writeable_swizzle__ XYZW_SWIZZLE() const (5) +__writeable_swizzle__ RGBA_SWIZZLE() const (6) +#endif + +__writeable_swizzle__ lo() const (7) +__writeable_swizzle__ hi() const (8) +__writeable_swizzle__ odd() const (9) +__writeable_swizzle__ even() const (10) + + +template __const_swizzle__ swizzle() const (11) + +__const_swizzle__ XYZW_ACCESS() const (12) +__const_swizzle__ RGBA_ACCESS() const (13) +__const_swizzle__ INDEX_ACCESS() const (14) + +#ifdef SYCL_SIMPLE_SWIZZLES +__const_swizzle__ XYZW_SWIZZLE() const (15) +__const_swizzle__ RGBA_SWIZZLE() const (16) +#endif + +__const_swizzle__ lo() const (17) +__const_swizzle__ hi() const (18) +__const_swizzle__ odd() const (19) +__const_swizzle__ even() const (20) +---- +|==== +_Availability:_ Functions (1) - (10) are available only in +[code]#+__writeable_swizzle__+#. +Functions (11) - (20) are available only in [code]#+__const_swizzle__+#. + +_Constraints:_ These functions have the same constraints as the equivalent +member functions of the [code]#vec# class. + +_Returns:_ A new view of the underlying [code]#vec# object, where the view +represents the composition of two swizzle operations. +The first is the swizzle operation represented by the +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# view. +The second is the swizzle operation defined by the member function. +The indices used by the second swizzle are the indices produced by the first +swizzle. +For example, if the second swizzle references the first element, this means the +element of the underlying [code]#vec# that corresponds to the first element +produced by the first swizzle. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template +void load(size_t offset, multi_ptr ptr) const +---- +|==== +_Availability:_ Available only in [code]#+__writeable_swizzle__+#. + +_Effects:_ Loads values from memory into elements of the underlying [code]#vec# +object. +A total of [code]#NumElements# values are loaded from memory, starting at the +the address [code]#ptr + offset*sizeof(DataT)#. +The first value from memory is written to the element in [code]#vec# that +corresponds to the first element of the swizzle operation. +The second value from memory is written to the element in [code]#vec# that +corresponds to the second element of the swizzle operation, etc. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +DataT& operator[](int index) const (1) +const DataT& operator[](int index) const (2) +---- +|==== +_Availability:_ Functions (1) is available only in +[code]#+__writeable_swizzle__+#. +Functions (2) is available only in [code]#+__const_swizzle__+#. + +_Returns:_ A reference to the element of the underlying [code]#vec# object that +corresponds to the position [code]#index# of the swizzle operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template +const __writeable_swizzle__& +operator=(const __writeable_swizzle__& rhs) const + +template +const __writeable_swizzle__& +operator=(const __const_swizzle__& rhs) const +---- +|==== +_Availability:_ Available only in [code]#+__writeable_swizzle__+#. + +_Constraints:_ Available only when all of the following conditions are met: + +* The element data type of [code]#rhs# is the same as [code]#DataT#; +* The number of elements in the [code]#rhs# view is equal to + [code]#NumElements#; and +* The [code]#+__writeable_swizzle__+# view (i.e. the left hand side of the + assignment) does not contain any repeated elements. + +_Effects:_ Assigns elements from the right hand side +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# view to elements +of the left hand side [code]#+__writeable_swizzle__+# view. +The value corresponding to the first element of the [code]#rhs# swizzle +operation is assigned to the element of the underlying [code]#vec# object that +corresponds to the first element of the left hand side swizzle operation, etc. + +_Returns:_ A reference to the left hand side [code]#+__writeable_swizzle__+# +view. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +const __writeable_swizzle__& operator=(const DataT& rhs) const +---- +|==== +_Availability:_ Available only in [code]#+__writeable_swizzle__+#. + +_Constraints:_ Available only when the [code]#+__writeable_swizzle__+# view does +not contain any repeated elements. + +_Effects:_ Assigns the value [code]#rhs# to those elements of the underlying +[code]#vec# object that have corresponding elements in the +[code]#+__writeable_swizzle__+# view. +Elements in the underlying [code]#vec# object that do not have elements in the +[code]#+__writeable_swizzle__+# view are not assigned. + +_Returns:_ A reference to the [code]#+__writeable_swizzle__+# view. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +const __writeable_swizzle__& operator=(const vec& rhs) const +---- +|==== +_Availability:_ Available only in [code]#+__writeable_swizzle__+#. + +_Constraints:_ Available only when the [code]#+__writeable_swizzle__+# view does +not contain any repeated elements. + +_Effects:_ Assigns elements from [code]#rhs# to elements of the [code]#vec# +object that underlies this [code]#+__writeable_swizzle__+# view. +The first element of [code]#rhs# is assigned to the element of the underlying +[code]#vec# object that corresponds to the first element of the swizzle +operation, etc. + +_Returns:_ A reference to the [code]#+__writeable_swizzle__+# view. + +[[sec:functions.swizzled-vec]] +===== Hidden friend functions of the swizzled vector class templates + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template (1) +friend vec +operatorOP(const __writeable_swizzle__& lhs, + const __writeable_swizzle__& rhs) + +template (2) +friend vec +operatorOP(const __writeable_swizzle__& lhs, + const __const_swizzle__& rhs) + +template (3) +friend vec +operatorOP(const __const_swizzle__& lhs, + const __writeable_swizzle__& rhs) + +template (4) +friend vec +operatorOP(const __const_swizzle__& lhs, const __const_swizzle__& rhs) + +friend vec (5) +operatorOP(const vec& lhs, const __writeable_swizzle__& rhs) + +friend vec (6) +operatorOP(const vec& lhs, const __const_swizzle__& rhs) + +friend vec (7) +operatorOP(const __writeable_swizzle__& lhs, const vec& rhs) + +friend vec (8) +operatorOP(const __const_swizzle__& lhs, const vec& rhs) + +friend vec (9) +operatorOP(const __writeable_swizzle__& lhs, const DataT& rhs) + +friend vec (10) +operatorOP(const __const_swizzle__& lhs, const DataT& rhs) + +friend vec (11) +operatorOP(const DataT& lhs, const __writeable_swizzle__& rhs) + +friend vec (12) +operatorOP(const DataT& lhs, const __const_swizzle__& rhs) +---- +|==== +Where [code]#OP# is: [code]#pass:[+]#, [code]#-#, [code]#*#, [code]#/#, +[code]#%#, [code]#&#, [code]#|#, [code]#^#, [code]#<<#, [code]#>>#. + +_Availability:_ Overloads (1), (2), (3), (5), (7), (9), and (11) are hidden +friends of [code]#+__writeable_swizzle__+#. +Overloads (4), (6), (8), (10), and (12) are hidden friends of +[code]#+__const_swizzle__+#. + +_Constraints:_ If [code]#OP# is one of the following: [code]#%#, [code]#&#, +[code]#|#, [code]#^#, [code]#<<#, [code]#>>#; available only when: [code]#DataT +!= float && DataT != double && DataT != half#. + +In addition, overloads (1) - (4) are available only when the element data type +of [code]#lhs# is the same as the element data type of [code]#rhs# and when the +number of elements in the [code]#lhs# view is equal to the number of elements in +the [code]#rhs# view. + +_Effects:_ These functions behave as though the swizzle operation represented by +each [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# parameter +was first evaluated into a temporary [code]#vec# object, and then +[code]#operatorOP# was called with the temporary [code]#vec# object. + +_Returns:_ A new [code]#vec# object that represents the result of the operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template (1) +friend const __writeable_swizzle__& +operatorOP(const __writeable_swizzle__& lhs, + const __writeable_swizzle__& rhs) + +template (2) +friend const __writeable_swizzle__& +operatorOP(const __writeable_swizzle__& lhs, + const __const_swizzle__& rhs) + +friend const __writeable_swizzle__& (3) +operatorOP(const __writeable_swizzle__& lhs, const vec& rhs) + +friend const __writeable_swizzle__& (4) +operatorOP(const __writeable_swizzle__& lhs, const DataT& rhs) +---- +|==== +Where [code]#OP# is: [code]#pass:[+=]#, [code]#-=#, [code]#*=#, [code]#/=#, +[code]#%=#, [code]#&=#, [code]#|=#, [code]#^=#, [code]#+<<=+#, [code]#>>=#. + +_Availability:_ These are hidden friend functions only in +[code]#+__writeable_swizzle__+#. + +_Constraints:_ If [code]#OP# is one of the following: [code]#%=#, [code]#&=#, +[code]#|=#, [code]#^=#, [code]#+<<=+#, [code]#>>=#; available only when: +[code]#DataT != float && DataT != double && DataT != half#. + +In addition, overloads (1) and (2) are available only when the element data type +of [code]#lhs# is the same as the element data type of [code]#rhs# and when the +number of elements in the [code]#lhs# view is equal to the number of elements in +the [code]#rhs# view. + +_Effects:_ These functions operate as follow. + +A left hand side value is computed from [code]#lhs# by applying the swizzle +operation on the underlying [code]#vec# object. +If the [code]#rhs# is a [code]#+__writeable_swizzle__+# view, the right hand +side value is computed the same way. +Otherwise, the right hand side value is the same as [code]#rhs#. + +The non-assignment part of the operation is performed on these two values, +producing a result. +This result is assigned to [code]#lhs# as follows. + +The first element of the result is assigned to the [code]#vec# element that +corresponds to the first element of the left-hand-side swizzle. +The second element of the result is assigned to the [code]#vec# element that +corresponds to the second element of the left-hand-side swizzle, etc. + +_Returns:_ A reference to the [code]#lhs#. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +friend const __writeable_swizzle__& operatorOP(const __writeable_swizzle__& sv) +---- +|==== +Where [code]#OP# is: [code]#pass:[++]#, [code]#--#. + +_Availability:_ These are hidden friend functions only in +[code]#+__writeable_swizzle__+#. + +_Constraints:_ Available only when [code]#DataT# is not [code]#bool#. + +_Effects:_ Perform an in-place element-wise [code]#OP# prefix arithmetic +operation on those elements of the [code]#vec# object that have corresponding +elements in the [code]#sv# view. +Elements in the underlying [code]#vec# object that do not have elements in the +[code]#sv# view are not modified. + +_Returns:_ A reference to the [code]#sv# view. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +friend vec operatorOP(const __writeable_swizzle__& sv, int) +---- +|==== +Where [code]#OP# is: [code]#pass:[++]#, [code]#--#. + +_Availability:_ These are hidden friend functions only in +[code]#+__writeable_swizzle__+#. + +_Constraints:_ Available only when [code]#DataT# is not [code]#bool#. + +_Effects:_ Perform an in-place element-wise [code]#OP# postfix arithmetic +operation on those elements of the [code]#vec# object that have corresponding +elements in the [code]#sv# view. +Elements in the underlying [code]#vec# object that do not have elements in the +[code]#sv# view are not modified. + +_Returns:_ A new [code]#vec# object that represents the elements of [code]#sv# +after the swizzle operation is applied and before the postfix arithmetic +operation is applied. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +friend vec operatorOP(const __writeable_swizzle__& sv) (1) +friend vec operatorOP(const __const_swizzle__& sv) (2) +---- +|==== +Where [code]#OP# is: [code]#pass:[+]#, [code]#-#. + +_Availability:_ Functions (1) are hidden friends in +[code]#+__writeable_swizzle__+#. +Functions (2) are hidden friends in [code]#+__const_swizzle__+#. + +_Effects:_ These functions behave as though the swizzle operation represented by +the [code]#sv# parameter was first evaluated into a temporary [code]#vec# +object, and then [code]#operatorOP# was applied to the temporary [code]#vec# +object. + +_Returns:_ A [code]#vec# object that represents the result of the operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +template (1) +friend vec +operatorOP(const __writeable_swizzle__& lhs, + const __writeable_swizzle__& rhs) + +template (2) +friend vec +operatorOP(const __writeable_swizzle__& lhs, + const __const_swizzle__& rhs) + +template (3) +friend vec +operatorOP(const __const_swizzle__& lhs, + const __writeable_swizzle__& rhs) + +template (4) +friend vec +operatorOP(const __const_swizzle__& lhs, const __const_swizzle__& rhs) + +friend vec (5) +operatorOP(const vec& lhs, const __writeable_swizzle__& rhs) + +friend vec (6) +operatorOP(const vec& lhs, const __const_swizzle__& rhs) + +friend vec (7) +operatorOP(const __writeable_swizzle__& lhs, const vec& rhs) + +friend vec (8) +operatorOP(const __const_swizzle__& lhs, const vec& rhs) + +friend vec (9) +operatorOP(const __writeable_swizzle__& lhs, const DataT& rhs) + +friend vec (10) +operatorOP(const __const_swizzle__& lhs, const DataT& rhs) + +friend vec (11) +operatorOP(const DataT& lhs, const __writeable_swizzle__& rhs) + +friend vec (12) +operatorOP(const DataT& lhs, const __const_swizzle__& rhs) +---- +|==== +Where [code]#OP# is: [code]#&&#, [code]#||#, [code]#==#, [code]#!=#, [code]#<#, +[code]#>#, [code]#+<=+#, [code]#>=#. + +_Availability:_ Overloads (1), (2), (3), (5), (7), (9), and (11) are hidden +friends of [code]#+__writeable_swizzle__+#. +Overloads (4), (6), (8), (10), and (12) are hidden friends of +[code]#+__const_swizzle__+#. + +_Constraints:_ Overloads (1) - (4) are available only when the element data type +of [code]#lhs# is the same as the element data type of [code]#rhs# and when the +number of elements in the [code]#lhs# view is equal to the number of elements in +the [code]#rhs# view. + +_Effects:_ These functions behave as though the swizzle operation represented by +each [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# parameter +was first evaluated into a temporary [code]#vec# object, and then +[code]#operatorOP# was called with the temporary [code]#vec# object. + +_Returns:_ A [code]#vec# object that represents the result of the operation. + +''' + +[frame=all,grid=none,separator="@"] +|==== +a@ +[source] +---- +friend vec operator~(const __writeable_swizzle__& sv) (1) +friend vec operator~(const __const_swizzle__& sv) (2) + +friend vec operator!(const __writeable_swizzle__& sv) (3) +friend vec operator!(const __const_swizzle__& sv) (4) +---- +|==== +_Availability:_ Overloads (1) and (3) are hidden friends of +[code]#+__writeable_swizzle__+#. +Overloads (2) and (4) are hidden friends of [code]#+__const_swizzle__+#. + +_Constraints:_ Overloads (1) - (2) are available only when: [code]#DataT != +float && DataT != double && DataT != half#. + +_Effects:_ These functions behave as though the swizzle operation represented by +the [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# parameter was +first evaluated into a temporary [code]#vec# object, and then the bitwise or +logical NOT operation was applied to the temporary [code]#vec# object. + +_Returns:_ A [code]#vec# object that represents the result of the operation. ==== Rounding modes @@ -20869,6 +21552,13 @@ to represent the following address spaces: * [code]#access::address_space::private_space# * [code]#access::address_space::generic_space# +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + ''' .[apidef]#acos# @@ -20890,15 +21580,15 @@ _Returns:_ The inverse cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the inverse cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -20921,16 +21611,16 @@ _Returns:_ The inverse hyperbolic cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the inverse hyperbolic cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -20953,15 +21643,15 @@ _Returns:_ The value [code]#acos(x) / {pi}#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#acos(x[i]) / {pi}#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -20984,15 +21674,15 @@ _Returns:_ The inverse sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the inverse sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21015,16 +21705,16 @@ _Returns:_ The inverse hyperbolic sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the inverse hyperbolic sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21047,15 +21737,15 @@ _Returns:_ The value [code]#asin(x) / {pi}#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#asin(x[i]) / {pi}#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21078,15 +21768,15 @@ _Returns:_ The inverse tangent of the input. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of the input, the inverse tangent of the element. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21113,7 +21803,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21123,8 +21813,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the arc tangent of [code]#y[i] / x[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21147,16 +21837,16 @@ _Returns:_ The hyperbolic inverse tangent of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the hyperbolic inverse tangent of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21179,15 +21869,15 @@ _Returns:_ The value [code]#atan(x) / {pi}#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#atan(x[i]) / {pi}#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21214,7 +21904,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21224,8 +21914,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#atan2(y[i], x[i]) / {pi}#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21248,15 +21938,15 @@ _Returns:_ The cube-root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the cube-root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21280,16 +21970,16 @@ positive infinity rounding mode. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#x[i]# rounded to an integral value using the round to positive infinity rounding mode. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21317,7 +22007,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21327,8 +22017,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# with its sign changed to match the sign of [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21351,15 +22041,15 @@ _Returns:_ The cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21382,15 +22072,15 @@ _Returns:_ The hyperbolic cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the hyperbolic cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21413,15 +22103,15 @@ _Returns:_ The value [code]#cos({pi} * x)#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#cos({pi} * x[i])#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21444,16 +22134,16 @@ _Returns:_ The complementary error function of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the complementary error function of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21477,15 +22167,15 @@ normal distribution). _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the error function of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21508,16 +22198,16 @@ _Returns:_ The base-_e_ exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the base-_e_ exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21540,16 +22230,16 @@ _Returns:_ The base-2 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the base-2 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21572,16 +22262,16 @@ _Returns:_ The base-10 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the base-10 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21604,15 +22294,15 @@ _Returns:_ The value [code]#e^x^-1.0#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#e^x[i]^-1.0#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21635,15 +22325,15 @@ _Returns:_ The absolute value of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the absolute value of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21670,7 +22360,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21680,8 +22370,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] - y[i]# if [code]#x[i] > y[i]#, otherwise +0. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21705,16 +22395,16 @@ negative infinity rounding mode. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#x[i]# rounded to an integral value using the round to negative infinity rounding mode. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21745,7 +22435,7 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# are each [code]#marray#; or ** [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# are any - combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; + combination of [code]#vec# and the [code]#+__swizzle__+# type; * [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# have the same number of elements; * [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# have the same @@ -21760,8 +22450,8 @@ Rounding of intermediate products shall not occur. Edge case behavior is per the IEEE 754-2008 standard. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21793,7 +22483,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21805,15 +22495,15 @@ If one element is a NaN, the result is the other element. If both elements are NaNs, the result is NaN. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (5):* _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#y# if [code]#x[i] < @@ -21822,8 +22512,8 @@ If one value is a NaN, the result is the other value. If both value are NaNs, the result is a NaN. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21855,7 +22545,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21867,15 +22557,15 @@ If one element is a NaN, the result is the other element. If both elements are NaNs, the result is NaN. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (5):* _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#y# if [code]#y < @@ -21884,8 +22574,8 @@ If one value is a NaN, the result is the other value. If both value are NaNs, the result is a NaN. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21912,7 +22602,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -21922,8 +22612,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] - y[i] * trunc(x[i]/y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -21961,16 +22651,15 @@ where [code]#T# is the type of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type with element type [code]#float#, - [code]#double#, or [code]#half#; +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is one of the following: ** A {cpp} cv-unqualified pointer to [code]#NonScalar#, unless [code]#NonScalar# - is the [code]#+__swizzled_vec__+# type, in which case it is a cv-unqualified + is the [code]#+__swizzle__+# type, in which case it is a cv-unqualified pointer to the corresponding [code]#vec#; or ** A [code]#multi_ptr# where: *** The [code]#ElementType# is equal to [code]#NonScalar#, unless - [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the + [code]#NonScalar# is the [code]#+__swizzle__+# type, in which case the [code]#ElementType# is the corresponding [code]#vec#; and *** The [code]#Space# is equal to one of the _writeable address spaces_ as defined above. @@ -21982,8 +22671,8 @@ floor(x[i]), nextafter(T{1.0}, T{0.0}) )#, where [code]#T# is the element type of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22024,22 +22713,21 @@ _Returns:_ The mantissa of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type with element type [code]#float#, - [code]#double#, or [code]#half#; +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is one of the following: ** (If [code]#NonScalar# is [code]#marray#): A {cpp} cv-unqualified pointer to [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar#; or -** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type): - A {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with the - same number of elements as [code]#NonScalar#; or +** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type): A + {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with the same + number of elements as [code]#NonScalar#; or ** (If [code]#NonScalar# is [code]#marray#): A [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable address spaces_ as defined above and whose [code]#ElementType# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar#; or -** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type): - A [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable +** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type): A + [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable address spaces_ as defined above and whose [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number of elements as [code]#NonScalar#. @@ -22053,8 +22741,8 @@ The exponent of each element of [code]#x# is written to [code]#exp#. _Returns:_ For each element of [code]#x#, the mantissa of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22082,7 +22770,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22092,8 +22780,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of the square root of +x[i]+^2^ + +y[i]+^2^ without undue overflow or underflow. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22118,8 +22806,8 @@ integer, where r is the value returned by _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, compute the integral part of @@ -22129,7 +22817,7 @@ by [code]#std::numeric_limits::radix#. The return type depends on [code]#NonScalar#. If [code]#NonScalar# is [code]#marray#, the return type is [code]#marray# of [code]#int# with the same number of element as [code]#NonScalar#. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, the +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, the return type is [code]#vec# of [code]#int32_t# with the same number of elements as [code]#NonScalar#. @@ -22158,28 +22846,28 @@ _Returns:_ The value [code]#x# multiplied by 2^k^. _Constraints:_ Available only if all of the following conditions are met: * [code]#NonScalar1# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; + [code]#+__swizzle__+# type; * The element type of [code]#NonScalar1# is [code]#float#, [code]#double#, or [code]#half#; * If [code]#NonScalar1# is [code]#marray#, [code]#NonScalar2# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; and -* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzled_vec__+# type of +* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, + [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzle__+# type of [code]#int32_t# with the same number of elements as [code]#NonScalar1#. _Returns:_ For each element of [code]#x# and [code]#k#, the value [code]#x[i]# multiplied by 2^k[i]^. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (5):* _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type of [code]#NonScalar# is [code]#float#, [code]#double#, or [code]#half#. @@ -22187,8 +22875,8 @@ _Returns:_ For each element of [code]#x#, the value [code]#x[i]# multiplied by 2^k^. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22212,16 +22900,16 @@ _Returns:_ The natural logarithm of the absolute value of the gamma function of _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the natural logarithm of the absolute value of the gamma function of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22258,22 +22946,21 @@ _Returns:_ The natural logarithm of the absolute value of the gamma function of _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type with element type [code]#float#, - [code]#double#, or [code]#half#; +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is one of the following: ** (If [code]#NonScalar# is [code]#marray#): A {cpp} cv-unqualified pointer to [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar#; or -** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type): - A {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with the - same number of elements as [code]#NonScalar#; or +** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type): A + {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with the same + number of elements as [code]#NonScalar#; or ** (If [code]#NonScalar# is [code]#marray#): A [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable address spaces_ as defined above and whose [code]#ElementType# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar#; or -** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type): - A [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable +** (If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type): A + [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable address spaces_ as defined above and whose [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number of elements as [code]#NonScalar#. @@ -22284,8 +22971,8 @@ _Returns:_ For each element of [code]#x#, the natural logarithm of the absolute value of the gamma function of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22308,15 +22995,15 @@ _Returns:_ The natural logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22339,15 +23026,15 @@ _Returns:_ The base 2 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the base 2 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22370,15 +23057,15 @@ _Returns:_ The base 10 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22401,15 +23088,15 @@ _Returns:_ The value [code]#log(1.0 + x)#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#log(1.0 + x[i])#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22433,8 +23120,8 @@ _Returns:_ The integral part of log~r~|x|, where r is the value returned by _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the integral part of log~r~|x[i]|, @@ -22442,8 +23129,8 @@ where r is the value returned by [code]#std::numeric_limits::radix#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22477,7 +23164,7 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# are each [code]#marray#; or ** [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# are any - combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; + combination of [code]#vec# and the [code]#+__swizzle__+# type; * [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# have the same number of elements; * [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# have the same @@ -22489,8 +23176,8 @@ _Returns:_ For each element of [code]#a#, [code]#b#, and [ode]#c#; the The approximate value of [code]#a[i] * b[i] + c[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22518,7 +23205,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22529,8 +23216,8 @@ if |x[i]| > |y[i]|, [code]#y[i]# if |y[i]| > |x[i]|, otherwise [code]#fmax(x[i], y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22558,7 +23245,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22569,8 +23256,8 @@ if |x[i]| < |y[i]|, [code]#y[i]# if |y[i]| < |x[i]|, otherwise [code]#fmin(x[i], y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22609,16 +23296,15 @@ _Returns:_ The fractional part of the argument [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type with element type [code]#float#, - [code]#double#, or [code]#half#; +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is one of the following: ** A {cpp} cv-unqualified pointer to [code]#NonScalar#, unless [code]#NonScalar# - is the [code]#+__swizzled_vec__+# type, in which case it is a cv-unqualified + is the [code]#+__swizzle__+# type, in which case it is a cv-unqualified pointer to the corresponding [code]#vec#; or ** A [code]#multi_ptr# where: *** The [code]#ElementType# is equal to [code]#NonScalar#, unless - [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the + [code]#NonScalar# is the [code]#+__swizzle__+# type, in which case the [code]#ElementType# is the corresponding [code]#vec#; and *** The [code]#Space# is equal to one of the _writeable address spaces_ as defined above. @@ -22632,8 +23318,8 @@ It stores the integral parts of each element to the object pointed to by _Returns:_ The fractional parts of each element of the argument [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22657,8 +23343,8 @@ The [code]#nancode# may be placed in the significand of the resulting NaN. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#uint32_t#, [code]#uint64_t#, or [code]#uint16_t#. _Returns:_ A quiet NaN for each element of [code]#nancode#. @@ -22674,15 +23360,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -22714,7 +23400,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22724,8 +23410,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the next representable floating-point value following [code]#x[i]# in the direction of [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22752,7 +23438,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22762,8 +23448,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22787,21 +23473,21 @@ _Returns:_ The value of [code]#x# raised to the power [code]#y#. _Constraints:_ Available only if all of the following conditions are met: * [code]#NonScalar1# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; + [code]#+__swizzle__+# type; * The element type of [code]#NonScalar1# is [code]#float#, [code]#double#, or [code]#half#; * If [code]#NonScalar1# is [code]#marray#, [code]#NonScalar2# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; and -* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzled_vec__+# type of +* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, + [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzle__+# type of [code]#int32_t# with the same number of elements as [code]#NonScalar1#. _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22830,7 +23516,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22843,8 +23529,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22875,7 +23561,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements; * [code]#NonScalar1# and [code]#NonScalar2# have the same element type; and * The element type of [code]#NonScalar1# and [code]#NonScalar2# is @@ -22889,8 +23575,8 @@ even one. If [code]#r# is zero, it is given the same sign as [code]#x[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22938,23 +23624,22 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#Ptr# is one of the following: ** (If [code]#NonScalar1# is [code]#marray#): A {cpp} cv-unqualified pointer to [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; or -** (If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type): A {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with - the same number of elements as [code]#NonScalar1#; or +** (If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type): A + {cpp} cv-unqualified pointer to [code]#vec# of [code]#int32_t# with the same + number of elements as [code]#NonScalar1#; or ** (If [code]#NonScalar1# is [code]#marray#): A [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable address spaces_ as defined above and whose [code]#ElementType# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; or -** (If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type): A [code]#multi_ptr# whose [code]#Space# is equal to one of the - _writeable address spaces_ as defined above and whose [code]#ElementType# is - [code]#vec# of [code]#int32_t# with the same number of elements as - [code]#NonScalar1#. +** (If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type): A + [code]#multi_ptr# whose [code]#Space# is equal to one of the _writeable + address spaces_ as defined above and whose [code]#ElementType# is [code]#vec# + of [code]#int32_t# with the same number of elements as [code]#NonScalar1#. _Effects:_ Computes the value [code]#r# for each element of [code]#x# and [code]#y# such that [code]#r = x[i] - k*y[i]#, where [code]#k# is the integer @@ -22971,8 +23656,8 @@ It stores these signed values to the object pointed to by [code]#quo#. _Returns:_ The values of [code]#r# defined above. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -22998,8 +23683,8 @@ a description of the rounding modes. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#x[i]# rounded to an @@ -23007,8 +23692,8 @@ integral value (using round to nearest even rounding mode) in floating-point format. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23032,21 +23717,21 @@ _Returns:_ The value of [code]#x# raised to the power [code]#1/y#. _Constraints:_ Available only if all of the following conditions are met: * [code]#NonScalar1# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; + [code]#+__swizzle__+# type; * The element type of [code]#NonScalar1# is [code]#float#, [code]#double#, or [code]#half#; * If [code]#NonScalar1# is [code]#marray#, [code]#NonScalar2# is [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; and -* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzled_vec__+# type of +* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, + [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzle__+# type of [code]#int32_t# with the same number of elements as [code]#NonScalar1#. _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#1/y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23070,8 +23755,8 @@ from zero, regardless of the current rounding direction. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the integral value nearest to @@ -23079,8 +23764,8 @@ _Returns:_ For each element of [code]#x#, the integral value nearest to rounding direction. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23103,16 +23788,16 @@ _Returns:_ The inverse square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the inverse square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23135,15 +23820,15 @@ _Returns:_ The sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23181,16 +23866,15 @@ _Returns:_ The sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type with element type [code]#float#, - [code]#double#, or [code]#half#; +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is one of the following: ** A {cpp} cv-unqualified pointer to [code]#NonScalar#, unless [code]#NonScalar# - is the [code]#+__swizzled_vec__+# type, in which case it is a cv-unqualified + is the [code]#+__swizzle__+# type, in which case it is a cv-unqualified pointer to the corresponding [code]#vec#; or ** A [code]#multi_ptr# where: *** The [code]#ElementType# is equal to [code]#NonScalar#, unless - [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the + [code]#NonScalar# is the [code]#+__swizzle__+# type, in which case the [code]#ElementType# is the corresponding [code]#vec#; and *** The [code]#Space# is equal to one of the _writeable address spaces_ as defined above. @@ -23201,8 +23885,8 @@ The computed cosine values are written to [code]#cosval#. _Returns:_ The sine of each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23225,15 +23909,15 @@ _Returns:_ The hyperbolic sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the hyperbolic sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23256,15 +23940,15 @@ _Returns:_ The value [code]#sin({pi} * x)#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#sin({pi} * x[i])#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23287,15 +23971,15 @@ _Returns:_ The square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23318,15 +24002,15 @@ _Returns:_ The tangent of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the tangent of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23349,16 +24033,16 @@ _Returns:_ The hyperbolic tangent of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the hyperbolic tangent of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23381,15 +24065,15 @@ _Returns:_ The value [code]#tan({pi} * x)#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#tan({pi} * x[i])#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23412,15 +24096,15 @@ _Returns:_ The gamma function of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the gamma function of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23444,16 +24128,16 @@ zero rounding mode. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x#, the value [code]#x[i]# rounded to an integral value using the round to zero rounding mode. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23469,6 +24153,13 @@ The intent is that these functions might make use of native device functionality which has better performance than their counterparts in <>, but they may sacrifice accuracy or limit the set of legal input values. +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + ''' .[apidef]#native::cos# @@ -23488,15 +24179,15 @@ _Returns:_ The cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23517,16 +24208,16 @@ _Returns:_ The value [code]#x / y#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] / y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23547,16 +24238,16 @@ _Returns:_ The base-_e_ exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-_e_ exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23577,16 +24268,16 @@ _Returns:_ The base-2 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-2 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23607,16 +24298,16 @@ _Returns:_ The base-10 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-10 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23637,15 +24328,15 @@ _Returns:_ The natural logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23666,15 +24357,15 @@ _Returns:_ The base 2 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base 2 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23695,15 +24386,15 @@ _Returns:_ The base 10 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23726,8 +24417,8 @@ _Returns:_ The value of [code]#x# raised to the power [code]#y#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Preconditions:_ Each element of [code]#x# must be greater than or equal to @@ -23737,8 +24428,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23759,15 +24450,15 @@ _Returns:_ The reciprocal of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the reciprocal of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23788,16 +24479,16 @@ _Returns:_ The inverse square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the inverse square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23818,15 +24509,15 @@ _Returns:_ The sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23847,15 +24538,15 @@ _Returns:_ The square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23876,15 +24567,15 @@ _Returns:_ The tangent of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the tangent of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23899,6 +24590,13 @@ specification. The intent is that these functions have higher performance than their counterparts in <>, but they have lower accuracy. +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + ''' .[apidef]#half_precision::cos# @@ -23920,8 +24618,8 @@ _Returns:_ The cosine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Preconditions:_ The value of each element of [code]#x# must be in the range @@ -23930,8 +24628,8 @@ _Preconditions:_ The value of each element of [code]#x# must be in the range _Returns:_ For each element of [code]#x#, the cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23952,16 +24650,16 @@ _Returns:_ The value [code]#x / y#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] / y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -23982,16 +24680,16 @@ _Returns:_ The base-_e_ exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-_e_ exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24012,16 +24710,16 @@ _Returns:_ The base-2 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-2 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24042,16 +24740,16 @@ _Returns:_ The base-10 exponential of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base-10 exponential of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24072,15 +24770,15 @@ _Returns:_ The natural logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24101,15 +24799,15 @@ _Returns:_ The base 2 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base 2 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24130,15 +24828,15 @@ _Returns:_ The base 10 logarithm of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24161,8 +24859,8 @@ _Returns:_ The value of [code]#x# raised to the power [code]#y#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Preconditions:_ Each element of [code]#x# must be greater than or equal to @@ -24172,8 +24870,8 @@ _Returns:_ For each element of [code]#x# and [code]#y#, the value of [code]#x[i]# raised to the power [code]#y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24194,15 +24892,15 @@ _Returns:_ The reciprocal of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the reciprocal of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24223,16 +24921,16 @@ _Returns:_ The inverse square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the inverse square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24255,8 +24953,8 @@ _Returns:_ The sine of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Preconditions:_ The value of each element of [code]#x# must be in the range @@ -24265,8 +24963,8 @@ _Preconditions:_ The value of each element of [code]#x# must be in the range _Returns:_ For each element of [code]#x#, the sine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24287,15 +24985,15 @@ _Returns:_ The square root of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Returns:_ For each element of [code]#x#, the square root of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24318,8 +25016,8 @@ _Returns:_ The tangent of [code]#x#. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#. _Preconditions:_ The value of each element of [code]#x# must be in the range @@ -24328,8 +25026,8 @@ _Preconditions:_ The value of each element of [code]#x# must be in the range _Returns:_ For each element of [code]#x#, the tangent of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24340,8 +25038,15 @@ corresponding [code]#vec#. This section describes the integer math functions that are available in the [code]#sycl# namespace in both host and device code. -The function descriptions in this section use the term _generic integer type_ to -represent the following types: +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + +The function descriptions in this section also use the term _generic integer +type_ to represent the following types: * [code]#char# * [code]#signed char# @@ -24373,14 +25078,14 @@ represent the following types: * [code]#vec# * [code]#vec# * [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# ''' @@ -24400,8 +25105,8 @@ The behavior is undefined if the result cannot be represented by the return type. The return type is [code]#GenInt# unless [code]#GenInt# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24415,12 +25120,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns |x - y|. Otherwise, returns |x[i] - y[i]| for each element of [code]#x# and [code]#y#. @@ -24429,8 +25133,8 @@ The behavior is undefined if the result cannot be represented by the return type. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24444,12 +25148,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#x + y#. Otherwise, returns [code]#x[i] + y[i]# for each element of [code]#x# and @@ -24457,8 +25160,8 @@ Otherwise, returns [code]#x[i] + y[i]# for each element of [code]#x# and The addition operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24472,12 +25175,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#(x + y) >> 1#. Otherwise, returns [code]#(x[i] + y[i]) >> 1# for each element of [code]#x# and @@ -24485,8 +25187,8 @@ Otherwise, returns [code]#(x[i] + y[i]) >> 1# for each element of [code]#x# and The intermediate sum does not modulo overflow. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24500,12 +25202,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#(x + y + 1) >> 1#. Otherwise, returns [code]#(x[i] + y[i] + 1) >> 1# for each element of [code]#x# @@ -24513,8 +25214,8 @@ and [code]#y#. The intermediate sum does not modulo overflow. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24534,13 +25235,12 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; - and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Preconditions:_ If the inputs are scalars, the value of [code]#minval# must be less than or equal to the value of [code]#maxval#. @@ -24553,14 +25253,14 @@ Otherwise, returns [code]#min(max(x[i], minval[i]), maxval[i])# for each element of [code]#x#, [code]#minval#, and [code]#maxval#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic integer -type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic integer type_ +as defined above. _Preconditions:_ The value of [code]#minval# must be less than or equal to the value of [code]#maxval#. @@ -24568,8 +25268,8 @@ value of [code]#maxval#. _Returns:_ [code]#min(max(x[i], minval), maxval)# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24589,8 +25289,8 @@ Otherwise, returns the number of leading 0-bits in each element of [code]#x#. When a value is 0, the computed count is the size in bits of that value. The return type is [code]#GenInt# unless [code]#GenInt# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24610,8 +25310,8 @@ Otherwise, returns the number of trailing 0-bits in each element of [code]#x#. When a value is 0, the computed count is the size in bits of that value. The return type is [code]#GenInt# unless [code]#GenInt# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24625,21 +25325,20 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; - and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#mul_hi(a, b)+c#. Otherwise, returns [code]#mul_hi(a[i], b[i])+c[i]# for each element of [code]#a#, [code]#b#, and [code]#c#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24653,13 +25352,12 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; - and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#a * b + c#. Otherwise, returns [code]#a[i] * b[i] + c[i]# for each element of [code]#a#, @@ -24667,8 +25365,8 @@ Otherwise, returns [code]#a[i] * b[i] + c[i]# for each element of [code]#a#, The operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24687,12 +25385,11 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#x < y# otherwise [code]#x#. @@ -24700,21 +25397,21 @@ When the inputs are not scalars, returns [code]#y[i]# if [code]#x[i] < y[i]# otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic integer -type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic integer type_ +as defined above. _Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24733,12 +25430,11 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#y < x# otherwise [code]#x#. @@ -24746,21 +25442,21 @@ When the inputs are not scalars, returns [code]#y[i]# if [code]#y[i] < x[i]# otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic integer -type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic integer type_ +as defined above. _Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24774,12 +25470,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Effects:_ Computes [code]#x * y# and returns the high half of the product of [code]#x# and [code]#y#. @@ -24790,8 +25485,8 @@ Otherwise, returns the high half of the product of [code]#x[i] * y[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24805,12 +25500,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Effects:_ For each element in [code]#v#, the bits are shifted left by the number of bits given by the corresponding element in [code]#count# (subject to @@ -24825,8 +25519,8 @@ Otherwise, the result of rotating [code]#v[i]# by [code]#count[i]# for each element of [code]#v# and [code]#count#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24840,12 +25534,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; -* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then - [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# - type, and both must have the same element type and the same number of - elements. +* If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must be the same as [code]#GenInt1#; and +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#x - y#. Otherwise, returns [code]#x[i] - y[i]# for each element of [code]#x# and @@ -24853,8 +25546,8 @@ Otherwise, returns [code]#x[i] - y[i]# for each element of [code]#x# and The subtraction operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -24871,8 +25564,8 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#UInt8Bit1# and [code]#UInt8Bit2# are both [code]#marray# with element type [code]#uint8_t# and the same number of elements; or * [code]#UInt8Bit1# and [code]#UInt8Bit2# are any combination of [code]#vec# or - the [code]#+__swizzled_vec__+# type with element type [code]#uint8_t# and the - same number of elements. + the [code]#+__swizzle__+# type with element type [code]#uint8_t# and the same + number of elements. _Returns:_ When the inputs are scalars, returns [code]#((uint16_t)hi << 8) | lo#. @@ -24900,10 +25593,10 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#Int8Bit# is [code]#marray# with element type [code]#int8_t# and [code]#UInt8Bit# is [code]#marray# with element type [code]#uint8_t# and both have the same number of elements; or -* [code]#Int8Bit# is [code]#vec# or the [code]#+__swizzled_vec__+# type with - element type [code]#int8_t# and [code]#UInt8Bit# is [code]#vec# or the - [code]#+__swizzled_vec__+# type with element type [code]#uint8_t# and both - have the same number of elements. +* [code]#Int8Bit# is [code]#vec# or the [code]#+__swizzle__+# type with element + type [code]#int8_t# and [code]#UInt8Bit# is [code]#vec# or the + [code]#+__swizzle__+# type with element type [code]#uint8_t# and both have the + same number of elements. _Returns:_ When the inputs are scalars, returns [code]#((int16_t)hi << 8) | lo#. Otherwise, returns [code]#((int16_t)hi[i] << 8) | lo[i]# for each element of @@ -24930,8 +25623,8 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#UInt16Bit1# and [code]#UInt16Bit2# are both [code]#marray# with element type [code]#uint16_t# and the same number of elements; or * [code]#UInt16Bit1# and [code]#UInt16Bit2# are any combination of [code]#vec# - or the [code]#+__swizzled_vec__+# type with element type [code]#uint16_t# and - the same number of elements. + or the [code]#+__swizzle__+# type with element type [code]#uint16_t# and the + same number of elements. _Returns:_ When the inputs are scalars, returns [code]#((uint32_t)hi << 16) | lo#. @@ -24959,10 +25652,10 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#Int16Bit# is [code]#marray# with element type [code]#int16_t# and [code]#UInt16Bit# is [code]#marray# with element type [code]#uint16_t# and both have the same number of elements; or -* [code]#Int16Bit# is [code]#vec# or the [code]#+__swizzled_vec__+# type with - element type [code]#int16_t# and [code]#UInt16Bit# is [code]#vec# or the - [code]#+__swizzled_vec__+# type with element type [code]#uint16_t# and both - have the same number of elements. +* [code]#Int16Bit# is [code]#vec# or the [code]#+__swizzle__+# type with element + type [code]#int16_t# and [code]#UInt16Bit# is [code]#vec# or the + [code]#+__swizzle__+# type with element type [code]#uint16_t# and both have + the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#((int32_t)hi << 16) | lo#. @@ -24990,8 +25683,8 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#UInt32Bit1# and [code]#UInt32Bit2# are both [code]#marray# with element type [code]#uint32_t# and the same number of elements; or * [code]#UInt32Bit1# and [code]#UInt32Bit2# are any combination of [code]#vec# - or the [code]#+__swizzled_vec__+# type with element type [code]#uint32_t# and - the same number of elements. + or the [code]#+__swizzle__+# type with element type [code]#uint32_t# and the + same number of elements. _Returns:_ When the inputs are scalars, returns [code]#((uint64_t)hi << 32) | lo#. @@ -25019,10 +25712,10 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#Int32Bit# is [code]#marray# with element type [code]#int32_t# and [code]#UInt32Bit# is [code]#marray# with element type [code]#uint32_t# and both have the same number of elements; or -* [code]#Int32Bit# is [code]#vec# or the [code]#+__swizzled_vec__+# type with - element type [code]#int32_t# and [code]#UInt32Bit# is [code]#vec# or the - [code]#+__swizzled_vec__+# type with element type [code]#uint32_t# and both - have the same number of elements. +* [code]#Int32Bit# is [code]#vec# or the [code]#+__swizzle__+# type with element + type [code]#int32_t# and [code]#UInt32Bit# is [code]#vec# or the + [code]#+__swizzle__+# type with element type [code]#uint32_t# and both have + the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#((int64_t)hi << 32) | lo#. @@ -25053,8 +25746,8 @@ Otherwise, returns the number of non-zero bits in [code]#x[i]# for each element of [code]#x#. The return type is [code]#GenInt# unless [code]#GenInt# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25074,15 +25767,15 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#marray# ** [code]#vec# ** [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* If [code]#Int32Bit1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#Int32Bit2# and [code]#Int32Bit# must be the same as +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +* If [code]#Int32Bit1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#Int32Bit2# and [code]#Int32Bit# must be the same as [code]#Int32Bit1#; and -* If [code]#Int32Bit1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#Int32Bit2# and [code]#Int32Bit3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. +* If [code]#Int32Bit1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#Int32Bit2# and [code]#Int32Bit3# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and [code]#y# must be in the range [-2^23^, 2^23^-1]. @@ -25096,8 +25789,8 @@ Otherwise, returns [code]#x[i] * y[i] + z[i]# for each element of [code]#x#, [code]#y#, and [code]#z#. The return type is [code]#Int32Bit1# unless [code]#Int32Bit1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25117,14 +25810,13 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#marray# ** [code]#vec# ** [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* If [code]#Int32Bit1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#Int32Bit2# must be the same as [code]#Int32Bit1#; and -* If [code]#Int32Bit1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#Int32Bit2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +* If [code]#Int32Bit1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#Int32Bit2# must be the same as [code]#Int32Bit1#; and +* If [code]#Int32Bit1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#Int32Bit2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and [code]#y# must be in the range [-2^23^, 2^23^-1]. @@ -25138,8 +25830,8 @@ Otherwise, returns [code]#x[i] * y[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#Int32Bit1# unless [code]#Int32Bit1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25149,8 +25841,15 @@ corresponding [code]#vec#. This section describes the common functions that are available in the [code]#sycl# namespace in both host and device code. -The function descriptions in this section use the term _generic floating point -type_ to represent the following types: +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + +The function descriptions in this section also use the term _generic floating +point type_ to represent the following types: * [code]#float# * [code]#double# @@ -25161,9 +25860,9 @@ type_ to represent the following types: * [code]#vec# * [code]#vec# * [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# ''' @@ -25183,13 +25882,13 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# and [code]#GenFloat3# must be the same as +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# and [code]#GenFloat3# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Preconditions:_ If the inputs are scalars, the value of [code]#minval# must be less than or equal to the value of [code]#maxval#. @@ -25202,14 +25901,14 @@ Otherwise, returns [code]#fmin(fmax(x[i], minval[i]), maxval[i])# for each element of [code]#x#, [code]#minval#, and [code]#maxval#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Preconditions:_ The value of [code]#minval# must be less than or equal to the value of [code]#maxval#. @@ -25218,8 +25917,8 @@ _Returns:_ [code]#fmin(fmax(x[i], minval), maxval)# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25240,8 +25939,8 @@ Otherwise, returns [code]#(180 / {pi}) * radians[i]# for each element of [code]#radians#. The return type is [code]#GenFloat# unless [code]#GenFloat# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25260,12 +25959,11 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Preconditions:_ When the inputs are scalars, [code]#x# and [code]#y# must not be infinite or NaN. @@ -25278,14 +25976,14 @@ When the inputs are not scalars, returns [code]#y[i]# if [code]#x[i] < y[i]# otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Preconditions:_ No element of [code]#x# may be infinite or NaN. The value of [code]#y# must not be infinite or NaN. @@ -25294,8 +25992,8 @@ _Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25314,12 +26012,11 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Preconditions:_ When the inputs are scalars, [code]#x# and [code]#y# must not be infinite or NaN. @@ -25332,14 +26029,14 @@ When the inputs are not scalars, returns [code]#y[i]# if [code]#y[i] < x[i]# otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Preconditions:_ No element of [code]#x# may be infinite or NaN. The value of [code]#y# must not be infinite or NaN. @@ -25348,8 +26045,8 @@ _Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25368,13 +26065,13 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# and [code]#GenFloat3# must be the same as +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# and [code]#GenFloat3# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Preconditions:_ If the inputs are scalars, the value of [code]#a# must be in the range [0.0, 1.0]. @@ -25387,14 +26084,14 @@ Otherwise, returns [code]#x[i] + (y[i] - x[i]) * a[i]# for each element of [code]#x#, [code]#y#, and [code]#a#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Preconditions:_ The value of [code]#a# must be in the range [0.0, 1.0]. @@ -25402,8 +26099,8 @@ _Returns:_ The linear blend of [code]#x# and [code]#y#, computed as [code]#x[i] + (y[i] - x[i]) * a# for each element of [code]#x# and [code]#y#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25424,8 +26121,8 @@ Otherwise, returns [code]#({pi} / 180) * degrees[i]# for each element of [code]#degrees#. The return type is [code]#GenFloat# unless [code]#GenFloat# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25444,12 +26141,11 @@ template (2) _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# must be the same as [code]#GenFloat1#; and +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ When the inputs are scalars, returns the value [code]#(x < edge) ? 0.0 : 1.0#. @@ -25457,21 +26153,21 @@ When the inputs are not scalars, returns the value [code]#(x[i] < edge[i]) ? 0.0 : 1.0# for each element of [code]#x# and [code]#edge#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Returns:_ The value [code]#(x[i] < edge) ? 0.0 : 1.0# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25491,13 +26187,13 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GenFloat1# is a _generic floating point type_ as defined above; -* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenFloat2# and [code]#GenFloat3# must be the same as +* If [code]#GenFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GenFloat2# and [code]#GenFloat3# must be the same as [code]#GenFloat1#; and -* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. +* If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Preconditions:_ If the inputs are scalar, [code]#edge0# must be less than [code]#edge1# and none of [code]#edge0#, [code]#edge1#, or [code]#x# may be NaN. @@ -25530,14 +26226,14 @@ return t * t * (3 - 2 * t); ---- The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. *Overload (2):* _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, -[code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating -point type_ as defined above. +[code]#vec#, or the [code]#+__swizzle__+# type and is a _generic floating point +type_ as defined above. _Preconditions:_ The value of [code]#edge0# must be less than [code]#edge1# and neither [code]#edge0# nor [code]#edge1# may be NaN. @@ -25553,8 +26249,8 @@ return t * t * (3 - 2 * t); ---- The return type is [code]#NonScalar# unless [code]#NonScalar# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25575,8 +26271,8 @@ When the input is not scalar, returns these values for each element of [code]#x#. The return type is [code]#GenFloat# unless [code]#GenFloat# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25587,8 +26283,15 @@ corresponding [code]#vec#. This section describes the geometric functions that are available in the [code]#sycl# namespace in both host and device code. -The function descriptions in this section use two terms that refer to a specific -list of types. +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + +The function descriptions in this section also use two terms that refer to a +specific list of types. The term _generic geometric type_ represents the following types: * [code]#float# @@ -25600,11 +26303,11 @@ The term _generic geometric type_ represents the following types: * [code]#vec#, where [code]#N# is 2, 3, or 4 * [code]#vec#, where [code]#N# is 2, 3, or 4 * [code]#vec#, where [code]#N# is 2, 3, or 4 -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where +* [code]#+__swizzle__+# that is convertible to [code]#vec#, where [code]#N# is 2, 3, or 4 -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, - where [code]#N# is 2, 3, or 4 -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where +* [code]#+__swizzle__+# that is convertible to [code]#vec#, where + [code]#N# is 2, 3, or 4 +* [code]#+__swizzle__+# that is convertible to [code]#vec#, where [code]#N# is 2, 3, or 4 The term _float geometric type_ represents these types: @@ -25612,7 +26315,7 @@ The term _float geometric type_ represents these types: * [code]#float# * [code]#marray#, where [code]#N# is 2, 3, or 4 * [code]#vec#, where [code]#N# is 2, 3, or 4 -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where +* [code]#+__swizzle__+# that is convertible to [code]#vec#, where [code]#N# is 2, 3, or 4 ''' @@ -25639,25 +26342,25 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#vec# ** [code]#vec# ** [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# +** [code]#+__swizzle__+# that is convertible to [code]#vec# * If [code]#Geo3or4Float1# is [code]#marray#, then [code]#Geo3or4Float2# must be the same as [code]#Geo3or4Float1#; and -* If [code]#Geo3or4Float1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#Geo3or4Float2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#Geo3or4Float1# is [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#Geo3or4Float2# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and both must have the same element type and the + same number of elements. _Returns:_ The cross product of first 3 components of [code]#p0# and [code]#p1#. When the inputs have 4 components, the 4th component of the result is 0.0. The return type is [code]#Geo3or4Float1# unless [code]#Geo3or4Float1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25671,12 +26374,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _generic geometric type_ as defined above; -* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GeoFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ The dot product of [code]#p0# and [code]#p1#. @@ -25695,12 +26397,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _generic geometric type_ as defined above; -* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GeoFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same element type and the same number of elements. _Returns:_ The distance between [code]#p0# and [code]#p1#. This is calculated as [code]#length(p0 - p1)#. @@ -25741,8 +26442,8 @@ as defined above. _Returns:_ A vector in the same direction as [code]#p# but with a length of 1. The return type is [code]#GeoFloat# unless [code]#GeoFloat# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25756,12 +26457,11 @@ template _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _float geometric type_ as defined above; -* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GeoFloat2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same number of - elements. +* If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzle__+# type, + then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzle__+# type, + and both must have the same number of elements. _Returns:_ The value [code]#fast_length(p0 - p1)#. @@ -25822,8 +26522,8 @@ with the following exceptions: -- The return type is [code]#GeoFloat# unless [code]#GeoFloat# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -25842,8 +26542,15 @@ The comparisons performed by [api]#isequal#, [api]#isgreater#, The comparison performed by [api]#isnotequal# is true when one or both operands are NaN. -The function descriptions in this section use two terms that refer to a specific -list of types. +The descriptions in this section use the type name [code]#+__swizzle__+# to +refer to the classes defined in <>. +This type can be any instantiation of the class templates named +[code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+# in that section, +so long as the instantiation satisfies the constraints listed in the function's +description. + +The function descriptions in this section also use two terms that refer to a +specific list of types. The term _generic scalar type_ represents the following types: * [code]#char# @@ -25900,16 +26607,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] == y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] == y[i]) ? -1 : 0)# for each element of -[code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] == y[i]) ? -1 : 0)# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -25922,15 +26629,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -25959,16 +26666,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] != y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] != y[i]) ? -1 : 0)# for each element of -[code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] != y[i]) ? -1 : 0)# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -25981,15 +26688,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26018,16 +26725,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] > y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] > y[i]) ? -1 : 0)# for each element of [code]#x# -and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] > y[i]) ? -1 : 0)# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -26040,15 +26747,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26077,16 +26784,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] >= y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] >= y[i]) ? -1 : 0)# for each element of -[code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] >= y[i]) ? -1 : 0)# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -26099,15 +26806,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26136,16 +26843,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] < y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] < y[i]) ? -1 : 0)# for each element of [code]#x# -and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] < y[i]) ? -1 : 0)# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -26158,15 +26865,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26195,16 +26902,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#+(x[i] <= y[i])+# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#+((x[i] <= y[i]) ? -1 : 0)+# for each element of -[code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#+((x[i] <= y[i]) ? -1 : 0)+# for each element of [code]#x# and +[code]#y#. The return type depends on [code]#NonScalar1#: @@ -26217,15 +26924,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26254,16 +26961,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] < y[i] || x[i] > y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] < y[i] || x[i] > y[i]) ? -1 : 0)# for each -element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((x[i] < y[i] || x[i] > y[i]) ? -1 : 0)# for each element of +[code]#x# and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -26276,15 +26983,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26309,15 +27016,15 @@ _Returns:_ The value [code]#true# only if [code]#x# has finite value. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element of [code]#x# only if [code]#x[i]# is a finite value. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if [code]#x[i]# is a finite value and -returns 0 otherwise. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, returns +-1 for each element of [code]#x# if [code]#x[i]# is a finite value and returns 0 +otherwise. The return type depends on [code]#NonScalar#: @@ -26330,15 +27037,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26364,15 +27071,15 @@ _Returns:_ The value [code]#true# only if [code]#x# has an infinity value _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element of [code]#x# only if [code]#x[i]# has an infinity value. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if [code]#x[i]# has an infinity value -and returns 0 otherwise. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, returns +-1 for each element of [code]#x# if [code]#x[i]# has an infinity value and +returns 0 otherwise. The return type depends on [code]#NonScalar#: @@ -26385,15 +27092,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26418,15 +27125,15 @@ _Returns:_ The value [code]#true# only if [code]#x# has a NaN value. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element of [code]#x# only if [code]#x[i]# has a NaN value. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if [code]#x[i]# has a NaN value and -returns 0 otherwise. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, returns +-1 for each element of [code]#x# if [code]#x[i]# has a NaN value and returns 0 +otherwise. The return type depends on [code]#NonScalar#: @@ -26439,15 +27146,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26472,15 +27179,15 @@ _Returns:_ The value [code]#true# only if [code]#x# has a normal value. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element of [code]#x# only if [code]#x[i]# has a normal value. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if [code]#x[i]# has a normal value and -returns 0 otherwise. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, returns +-1 for each element of [code]#x# if [code]#x[i]# has a normal value and returns +0 otherwise. The return type depends on [code]#NonScalar#: @@ -26493,15 +27200,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26532,7 +27239,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. @@ -26542,9 +27249,9 @@ _Effects:_ Tests if each element of [code]#x# and [code]#y# are ordered. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#isequal(x[i], x[i]) && isequal(y[i], y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((isequal(x[i], x[i]) && isequal(y[i], y[i]) ? -1 : 0)# -for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((isequal(x[i], x[i]) && isequal(y[i], y[i]) ? -1 : 0)# for +each element of [code]#x# and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -26557,15 +27264,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26596,7 +27303,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2#: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# - and the [code]#+__swizzled_vec__+# type; + and the [code]#+__swizzle__+# type; * [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. @@ -26605,9 +27312,9 @@ _Effects:_ Tests if each element of [code]#x# and [code]#y# are unordered. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#isnan(x[i]) || isnan(y[i])# for each element of [code]#x# and [code]#y#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((isnan(x[i]) || isnan(y[i]) ? -1 : 0)# for each -element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((isnan(x[i]) || isnan(y[i]) ? -1 : 0)# for each element of +[code]#x# and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -26620,15 +27327,15 @@ The return type depends on [code]#NonScalar1#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26653,15 +27360,15 @@ _Returns:_ The value [code]#true# only if the sign bit of [code]#x# is set. _Constraints:_ Available only if all of the following conditions are met: -* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the - [code]#+__swizzled_vec__+# type; and +* [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzle__+# + type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element of [code]#x# only if the sign bit of [code]#x[i]# is set. -If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if the sign bit of [code]#x[i]# is set -and returns 0 otherwise. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzle__+# type, returns +-1 for each element of [code]#x# if the sign bit of [code]#x[i]# is set and +returns 0 otherwise. The return type depends on [code]#NonScalar#: @@ -26674,15 +27381,15 @@ The return type depends on [code]#NonScalar#: @[code]#marray# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# @[code]#vec# + - [code]#+__swizzled_vec__+# that is convertible to [code]#vec# + [code]#+__swizzle__+# that is convertible to [code]#vec# @[code]#vec# |==== @@ -26707,16 +27414,16 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#vec# * [code]#vec# * [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# _Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether any element of [code]#x# is true. -When [code]#x# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -the value 1 if any element in [code]#x# has its most significant bit set, -otherwise returns the value 0. +When [code]#x# is [code]#vec# or the [code]#+__swizzle__+# type, returns the +value 1 if any element in [code]#x# has its most significant bit set, otherwise +returns the value 0. The return type is [code]#bool# if [code]#GenInt# is [code]#marray#. Otherwise, the return type is [code]#int#. @@ -26764,15 +27471,15 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#vec# * [code]#vec# * [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* [code]#+__swizzled_vec__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# +* [code]#+__swizzle__+# that is convertible to [code]#vec# _Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether all elements of [code]#x# are true. -When [code]#x# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -the value 1 if all elements in [code]#x# have their most significant bit set, +When [code]#x# is [code]#vec# or the [code]#+__swizzle__+# type, returns the +value 1 if all elements in [code]#x# have their most significant bit set, otherwise returns the value 0. The return type is [code]#bool# if [code]#GenInt# is [code]#marray#. @@ -26816,15 +27523,15 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#marray#, where [code]#T# is one of the _generic scalar types_; ** [code]#vec#, where [code]#T# is one of the _vector element types_ as defined above; or -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where +** [code]#+__swizzle__+# that is convertible to [code]#vec#, where [code]#T# is one of the _vector element types_; -* If [code]#GenType1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenType2# and [code]#GenType3# must be the same as - [code]#GenType1#; and -* If [code]#GenType1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenType2# and [code]#GenType3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element type - and the same number of elements. +* If [code]#GenType1# is not [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenType2# and [code]#GenType3# must be the same as [code]#GenType1#; + and +* If [code]#GenType1# is [code]#vec# or the [code]#+__swizzle__+# type, then + [code]#GenType2# and [code]#GenType3# must also be [code]#vec# or the + [code]#+__swizzle__+# type, and all three must have the same element type and + the same number of elements. _Returns:_ When the input parameters are scalars, returns a result where each bit of the result is the corresponding bit of [code]#a# if the corresponding bit @@ -26837,8 +27544,8 @@ where each bit of the result for element [code]#i# is the corresponding bit of Otherwise it is the corresponding bit of [code]#b[i]#. The return type is [code]#GenType1# unless [code]#GenType1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' @@ -26868,19 +27575,18 @@ _Constraints:_ Available only if all of the following conditions are met: defined above; ** [code]#vec#, where [code]#T# is one of the _vector element types_ as defined above; or -** [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where +** [code]#+__swizzle__+# that is convertible to [code]#vec#, where [code]#T# is one of the _vector element types_; * If [code]#NonScalar1# is [code]#marray#, then: ** [code]#NonScalar2# must be the same as [code]#NonScalar1#; and ** [code]#NonScalar3# must be [code]#marray# with element type [code]#bool# and the same number of elements as [code]#NonScalar1#; -* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then: -** [code]#NonScalar2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# +* If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, then: +** [code]#NonScalar2# must also be [code]#vec# or the [code]#+__swizzle__+# type, and both must have the same element type and the same number of elements; and -** [code]#NonScalar3# must be [code]#vec# or the [code]#+__swizzled_vec__+# type - with the same number of elements as [code]#NonScalar1#. +** [code]#NonScalar3# must be [code]#vec# or the [code]#+__swizzle__+# type with + the same number of elements as [code]#NonScalar1#. The element type of [code]#NonScalar3# must be a signed or unsigned integer with the same number of bits as the element type of [code]#NonScalar1#. @@ -26888,13 +27594,13 @@ _Returns:_ If [code]#NonScalar1# is [code]#marray#, return the value [code]#(c[i] ? b[i] : a[i])# for each element of [code]#a#, [code]#b#, and [code]#c#. -If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((MSB of c[i] is set) ? b[i] : a[i])# for each element -of [code]#a#, [code]#b#, and [code]#c#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzle__+# type, returns +the value [code]#((MSB of c[i] is set) ? b[i] : a[i])# for each element of +[code]#a#, [code]#b#, and [code]#c#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the -[code]#+__swizzled_vec__+# type, in which case the return type is the -corresponding [code]#vec#. +[code]#+__swizzle__+# type, in which case the return type is the corresponding +[code]#vec#. ''' diff --git a/adoc/code/swizzle-example.cpp b/adoc/code/swizzle-example.cpp new file mode 100644 index 00000000..8be04fe8 --- /dev/null +++ b/adoc/code/swizzle-example.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2011-2023 The Khronos Group, Inc. +// SPDX-License-Identifier: Apache-2.0 + +#include +using namespace sycl; // (optional) avoids need for "sycl::" before SYCL names + +int main() { + vec v{5, 6, 7, 8}; + vec slice = v.swizzle<2,1>(); // slice has the value {7,6} + slice = v.swizzle<2,2>(); // slice is now {7,7} + int i = v.swizzle<2,1>()[1]; // i has the value 6 + v.swizzle<2>() = 0; // v is now {5,6,0,8} + v.swizzle<1>()++; // v is now {5,7,0,8} + v.swizzle<2,3>(); // Has no effect because result of swizzle is + // neither read nor modified +} diff --git a/adoc/headers/swizzled-vec.h b/adoc/headers/swizzled-vec.h new file mode 100644 index 00000000..c3a8cf65 --- /dev/null +++ b/adoc/headers/swizzled-vec.h @@ -0,0 +1,30 @@ +// Copyright (c) 2011-2023 The Khronos Group, Inc. +// SPDX-License-Identifier: Apache-2.0 + +namespace /*unspecified*/ { + +template +class __writeable_swizzle__ { + private: + // The "DataT" and "NumElements" members are exposition-only + using DataT = /* element type of the underlying vec */; + static constexpr int NumElements = /* number of elements produced by the swizzle */; + + public: + // Public members as defined in the tables below + // Hidden friend functions as defined in the table below +}; + +template +class __const_swizzle__ { + private: + // The "DataT" and "NumElements" members are exposition-only + using DataT = /* element type of the underlying vec */; + static constexpr int NumElements = /* number of elements produced by the swizzle */; + + public: + // Public members as defined in the tables below + // Hidden friend functions as defined in the table below +}; + +} // namespace diff --git a/adoc/headers/vec.h b/adoc/headers/vec.h index 92e07aee..854294e2 100644 --- a/adoc/headers/vec.h +++ b/adoc/headers/vec.h @@ -74,37 +74,54 @@ template class vec { template AsT as() const; - template __swizzled_vec__ swizzle() const; + // Available on when the number of swizzleIndexes template parameters is + // 1, 2, 3, 4, 8, or 16. + // Available only when each of the swizzleIndexes template parameters is + // greater or equal to 0 and less than NumElements. + template __writeable_swizzle__ swizzle(); + template __const_swizzle__ swizzle() const; // Available only when NumElements <= 4. // XYZW_ACCESS is: x, y, z, w, subject to NumElements. - __swizzled_vec__ XYZW_ACCESS() const; + __writeable_swizzle__ XYZW_ACCESS(); + __const_swizzle__ XYZW_ACCESS() const; // Available only NumElements == 4. // RGBA_ACCESS is: r, g, b, a. - __swizzled_vec__ RGBA_ACCESS() const; + __writeable_swizzle__ RGBA_ACCESS(); + __const_swizzle__ RGBA_ACCESS() const; // INDEX_ACCESS is: s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, // sE, sF, subject to NumElements. - __swizzled_vec__ INDEX_ACCESS() const; + __writeable_swizzle__ INDEX_ACCESS(); + __const_swizzle__ INDEX_ACCESS() const; #ifdef SYCL_SIMPLE_SWIZZLES // Available only when NumElements <= 4. // XYZW_SWIZZLE is all permutations with repetition of: x, y, z, w, subject to // NumElements. - __swizzled_vec__ XYZW_SWIZZLE() const; + __writeable_swizzle__ XYZW_SWIZZLE(); + __const_swizzle__ XYZW_SWIZZLE() const; // Available only when NumElements == 4. // RGBA_SWIZZLE is all permutations with repetition of: r, g, b, a. - __swizzled_vec__ RGBA_SWIZZLE() const; + __writeable_swizzle__ RGBA_SWIZZLE(); + __const_swizzle__ RGBA_SWIZZLE() const; #endif // #ifdef SYCL_SIMPLE_SWIZZLES // Available only when: NumElements > 1. - __swizzled_vec__ lo() const; - __swizzled_vec__ hi() const; - __swizzled_vec__ odd() const; - __swizzled_vec__ even() const; + __writeable_swizzle__ lo(); + __const_swizzle__ lo() const; + + __writeable_swizzle__ hi(); + __const_swizzle__ hi() const; + + __writeable_swizzle__ odd(); + __const_swizzle__ odd() const; + + __writeable_swizzle__ even(); + __const_swizzle__ even() const; // load and store member functions template