tmp/tmpx50vbk76/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="simd.mask.overview">[[simd.mask.overview]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::simd {
|
| 5 |
+
template<size_t Bytes, class Abi> class basic_mask {
|
| 6 |
+
public:
|
| 7 |
+
using value_type = bool;
|
| 8 |
+
using abi_type = Abi;
|
| 9 |
+
using iterator = simd-iterator<basic_mask>;
|
| 10 |
+
using const_iterator = simd-iterator<const basic_mask>;
|
| 11 |
+
|
| 12 |
+
constexpr iterator begin() noexcept { return {*this, 0}; }
|
| 13 |
+
constexpr const_iterator begin() const noexcept { return {*this, 0}; }
|
| 14 |
+
constexpr const_iterator cbegin() const noexcept { return {*this, 0}; }
|
| 15 |
+
constexpr default_sentinel_t end() const noexcept { return {}; }
|
| 16 |
+
constexpr default_sentinel_t cend() const noexcept { return {}; }
|
| 17 |
+
|
| 18 |
+
static constexpr integral_constant<simd-size-type, simd-size-v<integer-from<Bytes>, Abi>>
|
| 19 |
+
size {};
|
| 20 |
+
|
| 21 |
+
constexpr basic_mask() noexcept = default;
|
| 22 |
+
|
| 23 |
+
// [simd.mask.ctor], basic_mask constructors
|
| 24 |
+
constexpr explicit basic_mask(value_type) noexcept;
|
| 25 |
+
template<size_t UBytes, class UAbi>
|
| 26 |
+
constexpr explicit basic_mask(const basic_mask<UBytes, UAbi>&) noexcept;
|
| 27 |
+
template<class G>
|
| 28 |
+
constexpr explicit basic_mask(G&& gen);
|
| 29 |
+
constexpr basic_mask(const bitset<size()>& b) noexcept;
|
| 30 |
+
constexpr explicit basic_mask(unsigned_integral auto val) noexcept;
|
| 31 |
+
|
| 32 |
+
// [simd.mask.subscr], basic_mask subscript operators
|
| 33 |
+
constexpr value_type operator[](simd-size-type) const;
|
| 34 |
+
template<simd-integral I>
|
| 35 |
+
constexpr resize_t<I::size(), basic_mask> operator[](const I& indices) const;
|
| 36 |
+
|
| 37 |
+
// [simd.mask.unary], basic_mask unary operators
|
| 38 |
+
constexpr basic_mask operator!() const noexcept;
|
| 39 |
+
constexpr basic_vec<integer-from<Bytes>, Abi> operator+() const noexcept;
|
| 40 |
+
constexpr basic_vec<integer-from<Bytes>, Abi> operator-() const noexcept;
|
| 41 |
+
constexpr basic_vec<integer-from<Bytes>, Abi> operator~() const noexcept;
|
| 42 |
+
|
| 43 |
+
// [simd.mask.conv], basic_mask conversions
|
| 44 |
+
template<class U, class A>
|
| 45 |
+
constexpr explicit(sizeof(U) != Bytes) operator basic_vec<U, A>() const noexcept;
|
| 46 |
+
constexpr bitset<size()> to_bitset() const noexcept;
|
| 47 |
+
constexpr unsigned long long to_ullong() const;
|
| 48 |
+
|
| 49 |
+
// [simd.mask.binary], basic_mask binary operators
|
| 50 |
+
friend constexpr basic_mask
|
| 51 |
+
operator&&(const basic_mask&, const basic_mask&) noexcept;
|
| 52 |
+
friend constexpr basic_mask
|
| 53 |
+
operator||(const basic_mask&, const basic_mask&) noexcept;
|
| 54 |
+
friend constexpr basic_mask
|
| 55 |
+
operator&(const basic_mask&, const basic_mask&) noexcept;
|
| 56 |
+
friend constexpr basic_mask
|
| 57 |
+
operator|(const basic_mask&, const basic_mask&) noexcept;
|
| 58 |
+
friend constexpr basic_mask
|
| 59 |
+
operator^(const basic_mask&, const basic_mask&) noexcept;
|
| 60 |
+
|
| 61 |
+
// [simd.mask.cassign], basic_mask compound assignment
|
| 62 |
+
friend constexpr basic_mask&
|
| 63 |
+
operator&=(basic_mask&, const basic_mask&) noexcept;
|
| 64 |
+
friend constexpr basic_mask&
|
| 65 |
+
operator|=(basic_mask&, const basic_mask&) noexcept;
|
| 66 |
+
friend constexpr basic_mask&
|
| 67 |
+
operator^=(basic_mask&, const basic_mask&) noexcept;
|
| 68 |
+
|
| 69 |
+
// [simd.mask.comparison], basic_mask comparisons
|
| 70 |
+
friend constexpr basic_mask
|
| 71 |
+
operator==(const basic_mask&, const basic_mask&) noexcept;
|
| 72 |
+
friend constexpr basic_mask
|
| 73 |
+
operator!=(const basic_mask&, const basic_mask&) noexcept;
|
| 74 |
+
friend constexpr basic_mask
|
| 75 |
+
operator>=(const basic_mask&, const basic_mask&) noexcept;
|
| 76 |
+
friend constexpr basic_mask
|
| 77 |
+
operator<=(const basic_mask&, const basic_mask&) noexcept;
|
| 78 |
+
friend constexpr basic_mask
|
| 79 |
+
operator>(const basic_mask&, const basic_mask&) noexcept;
|
| 80 |
+
friend constexpr basic_mask
|
| 81 |
+
operator<(const basic_mask&, const basic_mask&) noexcept;
|
| 82 |
+
|
| 83 |
+
// [simd.mask.cond], basic_mask exposition only conditional operators
|
| 84 |
+
friend constexpr basic_mask simd-select-impl( // exposition only
|
| 85 |
+
const basic_mask&, const basic_mask&, const basic_mask&) noexcept;
|
| 86 |
+
friend constexpr basic_mask simd-select-impl( // exposition only
|
| 87 |
+
const basic_mask&, same_as<bool> auto, same_as<bool> auto) noexcept;
|
| 88 |
+
template<class T0, class T1>
|
| 89 |
+
friend constexpr vec<see below, size()>
|
| 90 |
+
simd-select-impl(const basic_mask&, const T0&, const T1&) noexcept; // exposition only
|
| 91 |
+
};
|
| 92 |
+
}
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
Every specialization of `basic_mask` is a complete type. The
|
| 96 |
+
specialization of `basic_mask<Bytes, Abi>` is:
|
| 97 |
+
|
| 98 |
+
- disabled, if there is no vectorizable type `T` such that `Bytes` is
|
| 99 |
+
equal to `sizeof(T)`,
|
| 100 |
+
- otherwise, enabled, if there exists a vectorizable type `T` and a
|
| 101 |
+
value `N` in the range \[`1`, `64`\] such that `Bytes` is equal to
|
| 102 |
+
`sizeof(T)` and `Abi` is `deduce-abi-t<T,
|
| 103 |
+
N>`,
|
| 104 |
+
- otherwise, it is *implementation-defined* if such a specialization is
|
| 105 |
+
enabled.
|
| 106 |
+
|
| 107 |
+
If `basic_mask<Bytes, Abi>` is disabled, the specialization has a
|
| 108 |
+
deleted default constructor, deleted destructor, deleted copy
|
| 109 |
+
constructor, and deleted copy assignment. In addition only the
|
| 110 |
+
`value_type` and `abi_type` members are present.
|
| 111 |
+
|
| 112 |
+
If `basic_mask<Bytes, Abi>` is enabled, `basic_mask<Bytes, Abi>` is
|
| 113 |
+
trivially copyable.
|
| 114 |
+
|
| 115 |
+
*Recommended practice:* Implementations should support implicit
|
| 116 |
+
conversions between specializations of `basic_mask` and appropriate
|
| 117 |
+
*implementation-defined* types.
|
| 118 |
+
|
| 119 |
+
[*Note 1*: Appropriate types are non-standard vector types which are
|
| 120 |
+
available in the implementation. — *end note*]
|
| 121 |
+
|