◆ sbits()

as_integer_t<Value> boost::simd::sbits ( Value const &  x)

This function object returns the signed integer value which has the bit pattern of the input.

Header <boost/simd/function/sbits.hpp>
Example:
#include <boost/simd/bitwise.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack<float, 4>;
int main() {
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::sbits(pf) = " << bs::sbits(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::sbits(xf) = " << bs::sbits(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::sbits(pf) = (1065353216, 1073741824, -1082130432, 1056964608)
---- scalar
<- xf = 2
-> bs::sbits(xf) = 1073741824