Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reinterpreting int ⇔ float with SSE
#include <xmmintrin.h>
inline int as_int_bitwise(float a)
{
return _mm_cvtsi128_si32(_mm_set_ss(a));
}
inline float as_float_bitwise(int a)
{
return _mm_cvtss_f32(_mm_cvtsi32_si128(a));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.