Intrinsics for CPUID like informations?

后端 未结 5 1710
夕颜
夕颜 2020-11-29 10:12

Considering that I\'m coding in C++, if possible, I would like to use an Intrinsics-like solution to read useful informations about the hardware, my concerns/considerations

5条回答
  •  我在风中等你
    2020-11-29 10:45

    Intrinsics such as this are also generally compiler specific.

    MS VC++ has a __cpuid (and a __cpuidex) to generate a CPUID op code.

    At least as far as I know, gcc/g++ doesn't provide an equivalent to that though. Inline assembly seems to be the only option available.

提交回复
热议问题