Is there an x86 intrinsic that generates the AVX512 broadcast operation from a 32 bit floating point value in memory to a 512 bit register?

瘦欲@ 提交于 2020-02-24 11:03:53

问题


The instruction exists (vbroadcastss zmm/m32) but there seems to be no intrinsic to generate it.

I can code it as

static inline  __m512 mybroadcast(float *x) {
    __m512 v;
    asm inline ( "vbroadcastss %1,%0 "
                 : "=v" (v)
                 : "m" (*x)
                 );
    return v;
}

Is there a way to do this without inline asm?


回答1:


I think _mm512_set1_ps is what you want.

https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_set1_ps&expand=5236,4980



来源:https://stackoverflow.com/questions/59128802/is-there-an-x86-intrinsic-that-generates-the-avx512-broadcast-operation-from-a-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!