simdpp::to_uint16
From libsimdpp-docs
< conv
template<unsigned N, class E>
uint16<N, _DETAIL_> to_uint16( Vec<N,E> a ); |
||
Converts elements within a vector to 16-bit unsigned values.
The implementation behaves as if the following set of overloads is provided:
Vec
|
---|
int8 |
uint8 |
int16 |
uint16 |
int32 |
uint32 |
int64 |
uint64 |
float32 |
float64 |
The return type is a vector expression.
The conversion rules are as follows:
- 8-bit signed integers are sign-extended to 16 bits.
- 8-bit unsigned integers are zero-extended to 16 bits.
- 32-bit and wider integers are truncated.
- floating-point numbers are converted to integer values and truncated.
- if floating-point value can not be represented in 16-bit unsigned integer, the behavior depends on the instruction set used.
Parameters[edit]
a | - | vector to convert |
Return value[edit]
A vector expression evaluating to vector with values converted to 16-bit unsigned integers.
Equivalent operation[edit]
r0 = uint16_t(a0) ... rN = uint16_t(aN)
See also[edit]
converts vector elements to 16-bit signed integers (function template) |