E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ allbits

auto eve::allbits = functor<allbits_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::plain_value T> constexpr T allbits(as<T> x) noexcept;
}
constexpr auto allbits
Computes a constant with all bits set.
Definition allbits.hpp:67
EVE Main Namespace.
Definition abi.hpp:18
Lightweight type-wrapper.
Definition as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::allbits(as<T>()) returns a value of type T with all bits set.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
using wide_it = eve::wide<std::int16_t>;
template<typename T>
consteval auto constexpr_allbits() { return eve::allbits(eve::as<T>{}); }
int main()
{
wide_ft wxf;
wide_it wxi;
std::cout << "---- simd" << '\n'
<< "-> allbits(as<wide_ft>()) = " << eve::allbits(eve::as<wide_ft>()) << '\n'
<< "-> allbits(as<wide_it>()) = " << eve::allbits(eve::as<wide_it>()) << '\n'
<< "-> allbits(as(wxf)) = " << eve::allbits(eve::as(wxf)) << '\n'
<< "-> allbits(as(wxi)) = " << eve::allbits(eve::as(wxi)) << '\n';
float xf;
std::int16_t xi;
std::cout << "---- scalar" << '\n'
<< "-> allbits(as<float>()) = " << eve::allbits(eve::as<float>()) << '\n'
<< "-> allbits(as<std::int16_t>()) = " << eve::allbits(eve::as<std::int16_t>()) << '\n'
<< "-> allbits(as<xf)) = " << eve::allbits(eve::as(xf)) << '\n'
<< "-> allbits(as<xi)) = " << eve::allbits(eve::as(xi)) << '\n';
std::cout << "-> constexpr allbits = " << constexpr_allbits<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:70