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

◆ bit_unset

auto eve::bit_unset = functor<bit_unset_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto bit_unset(integral_value auto x, integral_value auto n) noexcept; // 1
// Lanes masking
constexpr auto bit_unset[conditional_expr auto c](integral_value, auto x integral_value auto n) noexcept; // 2
constexpr auto bit_unset[logical_value auto m](integral_value auto x, integral_value auto n) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:132
constexpr auto bit_unset
strict_elementwise_callable object setting to 01 the ith bit of each element.
Definition bit_unset.hpp:68
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of the parameter is returned with the ith bit set to 0 if the index is out of range the call will assert.
  2. The operation is performed conditionnaly.

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide pi = {1, 3, 7, 15, 31, 63, 127, 255};
std::cout << "<- pi = " << pi << '\n';
std::cout << "-> bit_unset(pi, 1) = " << eve::bit_unset(pi, 1) << '\n';
std::cout << "-> bit_unset(pi, 2) = " << eve::bit_unset(pi, 2) << '\n';
std::cout << "-> bit_unset(pi, 3) = " << eve::bit_unset(pi, 3) << '\n';
std::cout << "-> bit_unset(pi, 4) = " << eve::bit_unset(pi, 4) << '\n';
std::cout << "-> bit_unset(pi, 8) = " << eve::bit_unset(pi, 8) << '\n';
std::cout << "-> bit_unset[pi > 15](pi, 1) = " << eve::bit_unset[pi > 15](pi, 1) << '\n';
std::cout << "-> bit_unset[pi > 15](pi, 2) = " << eve::bit_unset[pi > 15](pi, 2) << '\n';
std::cout << "-> bit_unset[pi > 15](pi, 3) = " << eve::bit_unset[pi > 15](pi, 3) << '\n';
std::cout << "-> bit_unset[pi > 15](pi, 4) = " << eve::bit_unset[pi > 15](pi, 4) << '\n';
std::cout << "-> bit_unset[pi > 15](pi, 8) = " << eve::bit_unset[pi > 15](pi, 8) << '\n';
}
constexpr auto pi
Callable object computing the constant .
Definition pi.hpp:77
Wrapper for SIMD registers.
Definition wide.hpp:86