Files
2025-10-25 03:02:53 +03:00

66 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[simd.mask.cond]
# 29 Numerics library [[numerics]](./#numerics)
## 29.10 Data-parallel types [[simd]](simd#mask.cond)
### 29.10.10 basic_mask non-member operations [[simd.mask.nonmembers]](simd.mask.nonmembers#simd.mask.cond)
#### 29.10.10.4 basic_mask exposition only conditional operators [simd.mask.cond]
[🔗](#itemdecl:1)
`friend constexpr basic_mask simd-select-impl(
const basic_mask& mask, const basic_mask& a, const basic_mask& b) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20441)
*Returns*: A basic_mask object where the ith element equalsmask[i] ? a[i] : b[i] for all i in the range of
[0, size())[.](#1.sentence-1)
[🔗](#itemdecl:2)
`friend constexpr basic_mask
simd-select-impl(const basic_mask& mask, [same_as](concept.same#concept:same_as "18.4.2Concept same_­as[concept.same]")<bool> auto a, [same_as](concept.same#concept:same_as "18.4.2Concept same_­as[concept.same]")<bool> auto b) noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20454)
*Returns*: A basic_mask object where the ith element equalsmask[i] ? a : b for all i in the range of [0, size())[.](#2.sentence-1)
[🔗](#itemdecl:3)
`template<class T0, class T1>
friend constexpr vec<see below, size()>
simd-select-impl(const basic_mask& mask, const T0& a, const T1& b) noexcept;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20467)
*Constraints*:
- [(3.1)](#3.1)
same_as<T0, T1> is true,
- [(3.2)](#3.2)
T0 is a vectorizable type, and
- [(3.3)](#3.3)
sizeof(T0) == Bytes[.](#3.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20478)
*Returns*: A vec<T0, size()> object where the ith element equalsmask[i] ? a : b for all i in the range of [0, size())[.](#4.sentence-1)