◆ bit_select
Callable object computing the bit_select operation. Required header: Members Functions
template< value T, value U > auto operator()( T m, U x, U y ) const noexcept
requires compatible< T,U>;
Parameters
Return value The types T and U must be bit_compatible and the call r==bit_select(m,x,y)
constexpr callable_bit_select_ bit_select Callable object computing the bit_select operation. Definition: bit_select.hpp:81 is semantically equivalent to constexpr callable_bit_andnot_ bit_andnot Callable object computing the bitwise ANDNOT operation. Definition: bit_andnot.hpp:81 constexpr callable_bit_and_ bit_and Callable object computing the bitwise AND operation. Definition: bit_and.hpp:79 constexpr callable_bit_or_ bit_or Callable object computing the bitwise OR operation. Definition: bit_or.hpp:79 In a short way (omitting casting details to bring all bit sizes of the parameters equal), it means that the result is composed of the bits of If Supported decoratorsno decorators are supported ExampleSee it live on Compiler Explorer #include <eve/function/bit_select.hpp>
#include <eve/constant/eps.hpp>
#include <eve/constant/valmax.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_t = eve::wide<std::uint16_t, eve::fixed<4>>;
int main()
{
wide_t pi = {2, -3, 0, 1 << 10};
wide_t qi = {3, -2, 4, 2 };
wide_t mi = {0, -1, 1, ~0u << 8};
std::cout << "---- simd" << '\n'
<< " <- mi = " << mi << '\n'
<< " <- qi = " << qi << '\n'
std::cout << "---- scalar" << std::setprecision(10) << '\n'
return 0;
}
|