1

I am currently looking into the SIMD optimization on different CPUs.

For different INTEL SIMD instruction sets, e.g. AVX512, AVX2, AVX, SSE4.1, SSE2, SSE Are there any dependencies?

By dependency, I mean the following:

(1) For example, if a CPU supports AVX512, does it have to support more basic version AVX or SSE?

(2) If I want to enable optimization for AVX512, does it mean I have to enable AVX or SSE?

If there exists dependency, is there a documentation about this? I was not able to find the information in "INTEL Intrinsics Guide" https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Thanks.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
knightyangpku
  • 75
  • 1
  • 4
  • 4
    Does this answer your question? [Do all CPUs which support AVX2 also support SSE4.2 and AVX?](https://stackoverflow.com/questions/53443249/do-all-cpus-which-support-avx2-also-support-sse4-2-and-avx) – Martheen Jul 22 '20 at 21:17
  • 1
    I'm not aware of Intel officially documenting the fact anywhere, it's just kind of a tacit assumption that all CPU vendors will build incrementally on existing features. But yes, compilers make that assumption for you, with `-mavx512f` implying AVX1 and 2, and FMA. (Except for AVX512, where different parts are named, not numbered, like AVX512DQ, so it's somewhat plausible that a new CPU might have some but not other pre-existing AVX-512 things). – Peter Cordes Jul 23 '20 at 04:50
  • Plus what Mr. Peter Cordes said. There is an unwritten rule. Intel (as well as AMD) cannot remove any instruction from mainstream CPU's once publicly added. Because they care about binary compatibility between generations. Unless of course there is a good opportunity like switching from 32bit to 64bit. Or maybe a long deprecation period like what AMD did (or trying to do). – the kamilz Jul 23 '20 at 07:26
  • Also answer is partially covered here: https://stackoverflow.com/questions/62215122/which-avx-and-march-should-be-specified-on-a-cluster-with-different-architecture/62224143#62224143 – zam Jul 23 '20 at 11:15
  • There is no required dependencies, nor should they be assumed. For any intel related SIMD instruction set, the only 100% certain way to know if it's supported is through calling the CPUID instruction and checking the respective set bits in registers – Josh Weinstein Jul 26 '20 at 20:05

0 Answers0