1

in the Intel® Intrinsics Guide it says Instruction: vpblendmd zmm {k}, zmm, zmm, I don't understand how to use the {k}, for example I write the following code:

vpblendmd   %zmm1,%zmm2,%zmm2{0xAAAA}

but it's wrong for compiling and the compiler reports the information Error: unknown vector operation: '{0xAAAA}' so how can I use this instruction?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
anna
  • 39
  • 3
  • `{k}` has to be one of `{k1}` through `{k7}`, a mask register name. In the machine code, it's a 3-bit field for the mask-register number, not a 16-bit immediate! Look at compiler output for the intrinsic (https://godbolt.org/) to see it `mov` + `kmov` a value into `k1`. You can't use immediate masks; AVX-512 doesn't have an instruction for immediate blends, unfortunately, even though there are only 8 qwords per ZMM vector so they could have included an instruction that took an `imm8` like in SSE4.1 / AVX1. But x86 SIMD has never had instructions with 16-bit or wider immediates. – Peter Cordes Nov 18 '22 at 10:10
  • Ok, I get it, thanks – anna Nov 19 '22 at 04:31

0 Answers0