Loading [MathJax]/extensions/tex2jax.js
E.V.E
v2023.02.15
•
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Friends
Modules
Pages
Concepts
Loading...
Searching...
No Matches
◆
bit_unset
eve::bit_unset =
functor
<bit_unset_t>
inline
constexpr
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
}
eve::conditional_expr
Specifies that a type is a Conditional Expression.
Definition:
conditional.hpp:28
eve::integral_value
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition:
value.hpp:51
eve::logical_value
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition:
value.hpp:132
eve::bit_unset
constexpr auto bit_unset
strict_elementwise_callable object setting to 01 the ith bit of each element.
Definition:
bit_unset.hpp:68
eve
EVE Main Namespace.
Definition:
abi.hpp:18
Parameters
x
:
argument
.
i
: index to unset
c
:
Conditional expression
masking the operation.
m
:
Logical value
masking the operation.
Return value
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.
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'
;
}
eve::pi
constexpr auto pi
Callable object computing the constant .
Definition:
pi.hpp:77
eve::wide
Wrapper for SIMD registers.
Definition:
wide.hpp:93
eve