1

I have four double-precision floating point numbers in a __m256d double-precision floating point register. I want to convert them to four 32-bit integers and have the result be in a __m128i single-precision integer register. I want the conversion to be the same as the C/C++ (int) casting:

int tmpInt = (int) tmpDouble;

What is the Intel SIMD instruction for this?

Paul R
  • 208,748
  • 37
  • 389
  • 560
JB_User
  • 3,117
  • 7
  • 31
  • 51
  • 3
    See [`_mm256_cvtpd_epi32`](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_cvtpd_epi32&expand=1672). – Paul R Dec 22 '19 at 16:49
  • 2
    Also https://stackoverflow.com/questions/37091422/avx-sse-round-floats-down-and-return-vector-of-ints – AKX Dec 22 '19 at 16:50
  • 1
    @PaulR For C/C++ style casting (i.e., truncating) of course `_mm256_cvttpd_epi32` – chtz Dec 22 '19 at 22:21

0 Answers0