From 2bc7f5f97e0264bcec03201ea311fb77e75ef0e7 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 27 Jun 2024 17:01:21 +0100 Subject: [PATCH] Merge pull request #514 from gmlueck/gmlueck/vec-swizzle Clarify __swizzled_vec__ class --- adoc/chapters/programming_interface.adoc | 2506 ++++++++++++++-------- adoc/code/swizzle-example.cpp | 16 + adoc/headers/swizzled-vec.h | 30 + adoc/headers/vec.h | 37 +- 4 files changed, 1679 insertions(+), 910 deletions(-) create mode 100644 adoc/code/swizzle-example.cpp create mode 100644 adoc/headers/swizzled-vec.h diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 6fa97c75..270f79f6 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -17123,18 +17123,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 @@ -17147,20 +17159,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 @@ -17177,11 +17196,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#, @@ -17193,11 +17215,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#. @@ -17205,42 +17230,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@ @@ -17657,18 +17702,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. @@ -17679,40 +17723,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 @@ -20881,6 +21564,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# @@ -20902,15 +21592,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#. ''' @@ -20933,16 +21623,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#. ''' @@ -20965,15 +21655,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#. ''' @@ -20996,15 +21686,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#. ''' @@ -21027,16 +21717,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#. ''' @@ -21059,15 +21749,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#. ''' @@ -21090,15 +21780,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#. ''' @@ -21125,7 +21815,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 @@ -21135,8 +21825,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#. ''' @@ -21159,16 +21849,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#. ''' @@ -21191,15 +21881,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#. ''' @@ -21226,7 +21916,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 @@ -21236,8 +21926,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#. ''' @@ -21260,15 +21950,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#. ''' @@ -21292,16 +21982,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#. ''' @@ -21329,7 +22019,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 @@ -21339,8 +22029,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#. ''' @@ -21363,15 +22053,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#. ''' @@ -21394,15 +22084,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#. ''' @@ -21425,15 +22115,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#. ''' @@ -21456,16 +22146,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#. ''' @@ -21489,15 +22179,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#. ''' @@ -21520,16 +22210,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#. ''' @@ -21552,16 +22242,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#. ''' @@ -21584,16 +22274,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#. ''' @@ -21616,15 +22306,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#. ''' @@ -21647,15 +22337,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#. ''' @@ -21682,7 +22372,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 @@ -21692,8 +22382,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#. ''' @@ -21717,16 +22407,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#. ''' @@ -21757,7 +22447,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 @@ -21772,8 +22462,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#. ''' @@ -21805,7 +22495,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 @@ -21817,15 +22507,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] < @@ -21834,8 +22524,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#. ''' @@ -21867,7 +22557,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 @@ -21879,15 +22569,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 < @@ -21896,8 +22586,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#. ''' @@ -21924,7 +22614,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 @@ -21934,8 +22624,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#. ''' @@ -21973,16 +22663,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. @@ -21994,8 +22683,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#. ''' @@ -22036,22 +22725,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#. @@ -22065,8 +22753,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#. ''' @@ -22094,7 +22782,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 @@ -22104,8 +22792,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#. ''' @@ -22130,8 +22818,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 @@ -22141,7 +22829,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#. @@ -22170,28 +22858,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#. @@ -22199,8 +22887,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#. ''' @@ -22224,16 +22912,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#. ''' @@ -22270,22 +22958,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#. @@ -22296,8 +22983,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#. ''' @@ -22320,15 +23007,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#. ''' @@ -22351,15 +23038,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#. ''' @@ -22382,15 +23069,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#. ''' @@ -22413,15 +23100,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#. ''' @@ -22445,8 +23132,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]|, @@ -22454,8 +23141,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#. ''' @@ -22489,7 +23176,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 @@ -22501,8 +23188,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#. ''' @@ -22530,7 +23217,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 @@ -22541,8 +23228,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#. ''' @@ -22570,7 +23257,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 @@ -22581,8 +23268,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#. ''' @@ -22621,16 +23308,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. @@ -22644,8 +23330,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#. ''' @@ -22669,8 +23355,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#. @@ -22686,15 +23372,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# |==== @@ -22726,7 +23412,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 @@ -22736,8 +23422,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#. ''' @@ -22764,7 +23450,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 @@ -22774,8 +23460,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#. ''' @@ -22799,21 +23485,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#. ''' @@ -22842,7 +23528,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 @@ -22855,8 +23541,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#. ''' @@ -22887,7 +23573,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 @@ -22901,8 +23587,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#. ''' @@ -22950,23 +23636,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 @@ -22983,8 +23668,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#. ''' @@ -23010,8 +23695,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 @@ -23019,8 +23704,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#. ''' @@ -23044,21 +23729,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#. ''' @@ -23082,8 +23767,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 @@ -23091,8 +23776,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#. ''' @@ -23115,16 +23800,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#. ''' @@ -23147,15 +23832,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#. ''' @@ -23193,16 +23878,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. @@ -23213,8 +23897,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#. ''' @@ -23237,15 +23921,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#. ''' @@ -23268,15 +23952,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#. ''' @@ -23299,15 +23983,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#. ''' @@ -23330,15 +24014,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#. ''' @@ -23361,16 +24045,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#. ''' @@ -23393,15 +24077,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#. ''' @@ -23424,15 +24108,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#. ''' @@ -23456,16 +24140,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#. ''' @@ -23481,6 +24165,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# @@ -23500,15 +24191,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#. ''' @@ -23529,16 +24220,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#. ''' @@ -23559,16 +24250,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#. ''' @@ -23589,16 +24280,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#. ''' @@ -23619,16 +24310,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#. ''' @@ -23649,15 +24340,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#. ''' @@ -23678,15 +24369,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#. ''' @@ -23707,15 +24398,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#. ''' @@ -23738,8 +24429,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 @@ -23749,8 +24440,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#. ''' @@ -23771,15 +24462,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#. ''' @@ -23800,16 +24491,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#. ''' @@ -23830,15 +24521,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#. ''' @@ -23859,15 +24550,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#. ''' @@ -23888,15 +24579,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#. ''' @@ -23911,6 +24602,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# @@ -23932,8 +24630,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 @@ -23942,8 +24640,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#. ''' @@ -23964,16 +24662,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#. ''' @@ -23994,16 +24692,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#. ''' @@ -24024,16 +24722,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#. ''' @@ -24054,16 +24752,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#. ''' @@ -24084,15 +24782,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#. ''' @@ -24113,15 +24811,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#. ''' @@ -24142,15 +24840,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#. ''' @@ -24173,8 +24871,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 @@ -24184,8 +24882,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#. ''' @@ -24206,15 +24904,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#. ''' @@ -24235,16 +24933,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#. ''' @@ -24267,8 +24965,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 @@ -24277,8 +24975,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#. ''' @@ -24299,15 +24997,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#. ''' @@ -24330,8 +25028,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 @@ -24340,8 +25038,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#. ''' @@ -24352,8 +25050,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# @@ -24385,14 +25090,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# ''' @@ -24412,8 +25117,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#. ''' @@ -24427,12 +25132,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#. @@ -24441,8 +25145,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#. ''' @@ -24456,12 +25160,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 @@ -24469,8 +25172,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#. ''' @@ -24484,12 +25187,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 @@ -24497,8 +25199,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#. ''' @@ -24512,12 +25214,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# @@ -24525,8 +25226,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#. ''' @@ -24546,13 +25247,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#. @@ -24565,14 +25265,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#. @@ -24580,8 +25280,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#. ''' @@ -24601,8 +25301,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#. ''' @@ -24622,8 +25322,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#. ''' @@ -24637,21 +25337,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#. ''' @@ -24665,13 +25364,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#, @@ -24679,8 +25377,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#. ''' @@ -24699,12 +25397,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#. @@ -24712,21 +25409,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#. ''' @@ -24745,12 +25442,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#. @@ -24758,21 +25454,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#. ''' @@ -24786,12 +25482,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#. @@ -24802,8 +25497,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#. ''' @@ -24817,12 +25512,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 @@ -24837,8 +25531,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#. ''' @@ -24852,12 +25546,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 @@ -24865,8 +25558,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#. ''' @@ -24883,8 +25576,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#. @@ -24912,10 +25605,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 @@ -24942,8 +25635,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#. @@ -24971,10 +25664,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#. @@ -25002,8 +25695,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#. @@ -25031,10 +25724,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#. @@ -25065,8 +25758,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#. ''' @@ -25086,15 +25779,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]. @@ -25108,8 +25801,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#. ''' @@ -25129,14 +25822,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]. @@ -25150,8 +25842,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#. ''' @@ -25161,8 +25853,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# @@ -25173,9 +25872,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# ''' @@ -25195,13 +25894,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#. @@ -25214,14 +25913,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#. @@ -25230,8 +25929,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#. ''' @@ -25252,8 +25951,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#. ''' @@ -25272,12 +25971,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. @@ -25290,14 +25988,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. @@ -25306,8 +26004,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#. ''' @@ -25326,12 +26024,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. @@ -25344,14 +26041,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. @@ -25360,8 +26057,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#. ''' @@ -25380,13 +26077,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]. @@ -25399,14 +26096,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]. @@ -25414,8 +26111,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#. ''' @@ -25436,8 +26133,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#. ''' @@ -25456,12 +26153,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#. @@ -25469,21 +26165,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#. ''' @@ -25503,13 +26199,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. @@ -25542,14 +26238,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. @@ -25565,8 +26261,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#. ''' @@ -25587,8 +26283,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#. ''' @@ -25599,8 +26295,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# @@ -25612,11 +26315,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: @@ -25624,7 +26327,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 ''' @@ -25651,25 +26354,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#. ''' @@ -25683,12 +26386,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#. @@ -25707,12 +26409,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)#. @@ -25753,8 +26454,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#. ''' @@ -25768,12 +26469,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)#. @@ -25834,8 +26534,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#. ''' @@ -25854,8 +26554,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# @@ -25912,16 +26619,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#: @@ -25934,15 +26641,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# |==== @@ -25971,16 +26678,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#: @@ -25993,15 +26700,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# |==== @@ -26030,16 +26737,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#: @@ -26052,15 +26759,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# |==== @@ -26089,16 +26796,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#: @@ -26111,15 +26818,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# |==== @@ -26148,16 +26855,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#: @@ -26170,15 +26877,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# |==== @@ -26207,16 +26914,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#: @@ -26229,15 +26936,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# |==== @@ -26266,16 +26973,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#: @@ -26288,15 +26995,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# |==== @@ -26321,15 +27028,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#: @@ -26342,15 +27049,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# |==== @@ -26376,15 +27083,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#: @@ -26397,15 +27104,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# |==== @@ -26430,15 +27137,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#: @@ -26451,15 +27158,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# |==== @@ -26484,15 +27191,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#: @@ -26505,15 +27212,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# |==== @@ -26544,7 +27251,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#. @@ -26554,9 +27261,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#: @@ -26569,15 +27276,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# |==== @@ -26608,7 +27315,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#. @@ -26617,9 +27324,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#: @@ -26632,15 +27339,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# |==== @@ -26665,15 +27372,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#: @@ -26686,15 +27393,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# |==== @@ -26719,16 +27426,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#. @@ -26776,15 +27483,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#. @@ -26828,15 +27535,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 @@ -26849,8 +27556,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#. ''' @@ -26880,19 +27587,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#. @@ -26900,13 +27606,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