问题描述
我需要用"1"填充zmm1以便能够快速地在循环中填充内存中的大数据字段.如何在Intel汇编中通过mov rax,0FFFFFFFFFFFFFFFFFFh之类的"1"设置zmm1?我对{k1} {z}参数没有任何经验.
I need to fill zmm1 with "1" to be able quickly fill large data field in a memory in a loop. How to set zmm1 by "1" like mov rax, 0FFFFFFFFFFFFFFFFh in Intel assembly? I don't have any experience with {k1}{z} parameters.
请参见下面的代码.
PCMPEQD zmm1, zmm1
我收到错误代码无效的指令操作数"
I got an error code "invalid instruction operands"
推荐答案
clang ++和g ++使用vpternlogd zmm0, zmm0, zmm0, 255
.我使用 https://godbolt.org 和 https://software.intel.com/sites/landingpage/IntrinsicsGuide
clang++ and g++ use vpternlogd zmm0, zmm0, zmm0, 255
. I found this using https://godbolt.org and https://software.intel.com/sites/landingpage/IntrinsicsGuide
这篇关于如何在zmm1中加载"1" (AVX-512)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!