1

I have code in assembly which takes single floats, stores them in zmm registers. Then, it loads them, makes them into 32bit integers.

"vbroadcastss (%0), %%zmm2\n\t" 
"vbroadcastss (%1), %%zmm1\n\t"
"vpmovzxbd (%2,%3), %%zmm0\n\t"

I want to convert this into intrinsics using this:

 __m512 _mm512_broadcastss_ps (__m128 a)

and

__m512i _mm512_cvtepu8_epi32 (__m128i a)

I'm not sure how to use registers in intrinsics. How can I express (%0), (%1), (%2) elements in intrinsics?

Hoepless
  • 49
  • 1
  • 5
  • 3
    Try `_mm512_set1_ps()` for the broadcasts. As for the third one, what are `%2` and `%3`? Possibly, you need a `_mm_loadu_si128` to load the operand from memory first. – fuz Oct 01 '20 at 10:45
  • There are no memory-source intrinsics for `pmovzx`; it's up to the compiler to fold a load into the `__m128i` source operand. This often works when it's a 128-bit load, but most compilers fail at it when it's only a 64-bit or 32-bit load, emitting a braindead `vmovd` + `vpmovzx` sequence or whatever. [Loading 8 chars from memory into an \_\_m256 variable as packed single precision floats](https://stackoverflow.com/q/34279513) / [and this](//stackoverflow.com/questions/39318496) – Peter Cordes Oct 01 '20 at 11:15

0 Answers0