native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
polyfill_lane_access.h
1// SPDX-FileCopyrightText: 2026 Edward Kmett <ekmett@gmail.com>
2// SPDX-License-Identifier: BSD-2-Clause OR Apache-2.0
3// Included in native half/BF16 classes under their actual feature target.
5 template<std::size_t I> requires(architecture.has(polyfill) && I<lanes)
6 [[nodiscard]] hint_inline constexpr value_type get() const noexcept {
7 std::array<std::uint16_t,lanes> words{}; store_bits(words.data()); return value_type::from_bits(words[I]);
8 }
10 template<std::size_t I> requires(architecture.has(polyfill) && I<lanes)
11 [[nodiscard]] hint_inline constexpr simd set(value_type value) const noexcept {
12 std::array<std::uint16_t,lanes> words{}; store_bits(words.data()); words[I]=value.to_bits(); return load_bits(words.data());
13 }
15 template<std::size_t I> requires(architecture.has(polyfill) && I<lanes)
16 [[nodiscard]] hint_inline constexpr simd replace(value_type value) const noexcept { return this->template set<I>(value); }
18 template<std::size_t I> requires(architecture.has(polyfill) && I<lanes)
19 [[nodiscard]] friend hint_inline constexpr simd broadcast(simd value,imm_t<I>) noexcept {
20 return simd(value.template get<I>());
21 }
architecture
Instruction-set families; an ISA value belongs to exactly one family.
Definition config.h:24