Saturday, January 8, 2022

How to convert float to int or short

http://stereopsis.com/FPU.html
https://stackoverflow.com/questions/78619/what-is-the-fastest-way-to-convert-float-to-int-on-x86


SIMD
32 bit integer to 16 bit integer
__m256i _mm512_cvtepi32_epi16 (__m512i a)

floating point to 32 bit integer
__m512i _mm512_cvtps_epi32 (__m512 a)


unsigned short _cvtss_sh (float aint rounding)




No comments: