How can I round a __m128 vector of floats up/down or to the nearest integer, like these functions?
- Round -
roundf() - Ceil -
ceilf()or SSE4.1_mm_ceil_ps. - Floor -
floorf()or SSE4.1_mm_floor_ps.
I need to do this without SSE4.1 roundps (_mm_floor_ps / _mm_ceil_ps / _mm_round_ps(x, _MM_FROUND_TO_NEAREST_INT |_MM_FROUND_NO_EXC). roundps can also truncate toward zero, but I don't need that for this application.
I can use SSE3 and earlier. (No SSSE3 or SSE4)
So the function declaration would be something like:
__m128 RoundSse( __m128 x ), __m128 CeilSse( __m128 x ) and __m128 FloorSse( __m128 x ).