Intel xvec
Experimental C++ simd class library
Loading...
Searching...
No Matches
std_utility.hpp
1//===----------------------------------------------------------------------===//
2//
3// Copyright (C) 2021 Intel Corporation
4//
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include <xvec/detail/config.hpp>
12
13#include <utility>
14#include <cstddef>
15
16namespace _XVEC_NAMESPACE::simd
17{
18
21
27template<typename _Tp, typename _Abi>
28requires (std::is_enum_v<_Tp>)
30
36template<std::integral _Tp, vec_of<std::byte> _Vp>
37constexpr rebind_t<_Tp, _Vp> to_integer(const _Vp& b) noexcept { return rebind_cast<_Tp>(b); }
38
40
41} // namespace _XVEC_NAMESPACE::simd
Vector of elements sharing an element type and ABI.
Definition simd:161
constexpr rebind_t< _Tp, _Vp > to_integer(const _Vp &b) noexcept
Convert each std::byte element to an integer type.
Definition std_utility.hpp:37
constexpr auto to_underlying(const basic_vec< _Tp, _Abi > &x)
Convert each enumeration element to its underlying type.
Definition std_utility.hpp:29
constexpr detail::RebindCast< _Up > rebind_cast
Rebinding CPO.
Definition std_rebind.hpp:55
constexpr auto simd_bit_cast(const _From &v) noexcept
A simd-generic version of simd_bit_cast which directly invokes std::bit_cast.
Definition core.hpp:585