Do all CPUs which support AVX2 also support SSE4.2 and AVX?

后端 未结 3 1722
孤街浪徒
孤街浪徒 2021-01-12 05:24

I am planning to implement runtime detection of SIMD extensions. Is it such that if I find out that the processor has AVX2 support, it is also guaranteed to have SSE4.2 and

3条回答
  •  渐次进展
    2021-01-12 05:49

    If we set compiler option -mavx2 that GCC doesn't give an error when we use AVX or SSE intrinsics. So GCC supposes that existing of AVX2 flag is enough to run AVX and SSE code. Of course it does not garante that someone won't create CPU with AVX2 and without SSE.

提交回复
热议问题