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

◆ bitincrement

auto eve::bitincrement = functor<bitincrement_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::plain_value T > constexpr T bitincrement(as<T> x) noexcept;
}
constexpr auto bitincrement
Computes a constant with only the least significant bit set.
Definition bitincrement.hpp:68
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::bitincrement(as<T>()) returns a value of type T with only the least significant bit 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_bitincrement() { return eve::bitincrement(eve::as<T>{}); }
int main()
{
wide_ft wxf;
wide_it wxi;
std::cout << "---- simd" << '\n'
<< "-> bitincrement(as<wide_ft>()) = " << eve::bitincrement(eve::as<wide_ft>()) << '\n'
<< "-> bitincrement(as<wide_it>()) = " << eve::bitincrement(eve::as<wide_it>()) << '\n'
<< "-> bitincrement(as(wxf)) = " << eve::bitincrement(eve::as(wxf)) << '\n'
<< "-> bitincrement(as(wxi)) = " << eve::bitincrement(eve::as(wxi)) << '\n';
float xf;
std::int16_t xi;
std::cout << "---- scalar" << '\n'
<< "-> bitincrement(as<float>()) = " << eve::bitincrement(eve::as<float>()) << '\n'
<< "-> bitincrement(as<std::int16_t>()) = " << eve::bitincrement(eve::as<std::int16_t>()) << '\n'
<< "-> bitincrement(as<xf)) = " << eve::bitincrement(eve::as(xf)) << '\n'
<< "-> bitincrement(as<xi)) = " << eve::bitincrement(eve::as(xi)) << '\n';
std::cout << "-> constexpr bitincrement = " << constexpr_bitincrement<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86