E.V.E
v2023.02.15

◆ lohi

eve::lohi = {}
inlineconstexpr

Computes the the lohi pair of values.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
auto lohi(T x) noexcept;
}
constexpr callable_lohi_ lohi
Computes the the lohi pair of values.
Definition: lohi.hpp:51
Definition: abi.hpp:18

Parameters

Return value

  • Computes the elementwise the lower and higher parts of the input values, as a pair of unsigned integers
  • The call lohi(x) is_semantically equivalent to [eve::lo(x), eve::hi(x)]

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_uit i32 = {0, 1, 2, 3, 65536+1, 65536+8, 65536+16, 65536+32};
wide_ui8t i8 = {0, 1, 2, 3, 16+0, 16+2, 16+4, 16+8};
auto m = eve::lo(i32);
auto m8 = eve::lo(i8);
std::cout << "---- simd (hexadecimal output)" << '\n'
<< std::hex
<< "<- i32 = " << i32 << '\n'
<< "-> lo(i32) = " << m << '\n'
<< std::hex << "<- i8 = " << i8 << '\n'
<< "-> lo(i8 ) = " << m8 << '\n';
std::int32_t x = 100000;
std::int8_t y = 100;
std::cout << "---- scalar (hexadecimal output)" << '\n'
<< std::hex << "<- x = " << x << '\n'
<< "-> lo(x) = " << eve::lo(x) << '\n'
<< "<- y = " << y << '\n'
<< "-> lo(y) = " << int(eve::lo(y)) << '\n' ;
return 0;
}
constexpr callable_lo_ lo
Computes the least significant half of each lane.
Definition: lo.hpp:54
Wrapper for SIMD registers.
Definition: wide.hpp:65