Efficient SSE FP `floor()` / `ceil()` / `round()` Rounding Functions Without SSE4.1?
问题 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