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

◆ mantissamask

auto eve::mantissamask = functor<mantissamask_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr eve::as_uinteger_t<T> mantissamask(as<T> x);
}
constexpr auto mantissamask
Computes the mask to extract the mantissa bits of an ieee floating value.
Definition mantissamask.hpp:72
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::mantissamask(as<T>()) returns elementwise, the integral mask to extract the mantissa 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_mantissamask() { return eve::mantissamask(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> mantissamask(as<wide_ft>()) = " << eve::mantissamask(eve::as<wide_ft>()) << std::endl
<< "-> mantissamask(as(wxf)) = " << eve::mantissamask(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> mantissamask(as<float>()) = " << eve::mantissamask(eve::as(float())) << std::endl
<< "-> mantissamask(as<xf)) = " << eve::mantissamask(eve::as(xf)) << std::endl;
std::cout << "-> constexpr mantissamask = " << constexpr_mantissamask<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86