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

◆ exponentmask

auto eve::exponentmask = functor<exponentmask_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr eve::as_integer_t<T> exponentmask(as<T> t) noexcept;
}
constexpr auto exponentmask
Computes the the exponent bit mask of IEEE float or double.
Definition exponentmask.hpp:71
EVE Main Namespace.
Definition abi.hpp:18
Lightweight type-wrapper.
Definition as.hpp:29

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::exponentmask(as<T>()) returns elementwise, the integral mask to extract the exponent bits of an ieee floating value. The element values are:

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
template<typename T>
consteval auto constexpr_exponentmask() { return eve::exponentmask(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> exponentmask(as<wide_ft>()) = " << eve::exponentmask(eve::as<wide_ft>()) << std::endl
<< "-> exponentmask(as(wxf)) = " << eve::exponentmask(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> exponentmask(as<float>()) = " << eve::exponentmask(eve::as(float())) << std::endl
<< "-> exponentmask(as<xf)) = " << eve::exponentmask(eve::as(xf)) << std::endl;
std::cout << "-> constexpr exponentmask = " << constexpr_exponentmask<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86