Floating Point Rounding Intrinsics for Streaming SIMD Extensions 4

These rounding intrinsics cover scalar and packed single-precision and double precision floating-point operands.

The floor and ceil intrinsics correspond to the definitions of floor and ceil in the ISO 9899:1999 standard for the C programming language.

Intrinsic Name

Operation

Corresponding
SSE4 Instruction

__m128d _mm_round_pd(__m128d s1, int iRoundMode)

__m128d _mm_floor_pd(__m128d s1)

__m128d _mm_ceil_pd(__m128d s1)

Packed float double precision rounding

ROUNDPD

__m128 _mm_round_ps(__m128 s1, int iRoundMode)

__m128 _mm_floor_ps(__m128 s1)

__m128 _mm_ceil_ps(__m128 s1)

Packed float single precision rounding

ROUNDPS

__m128d _mm_round_sd(__m128d dst, __m128d s1, int iRoundMode)

__m128d _mm_floor_sd(__m128d dst, __m128d s1)

__m128d _mm_ceil_sd(__m128d dst, __m128d s1)

Single float double precision rounding

ROUNDSD

__m128 _mm_round_ss(__m128 dst, __m128d s1, int iRoundMode)

__m128 _mm_floor_ss(__m128d dst, __m128 s1)

__m128 _mm_ceil_ss(__m128d dst, __m128 s1)

Single float single precision rounding

ROUNDSS