gets the number of the highest valid extended ID. Calling _cpuid with 0x80000000 as the function_id argument load bitset with flags for function 0x00000007 load bitset with flags for function 0x00000001 gets the number of the highest valid function ID.įor (int i = 0 i (vendor) = data_ Calling _cpuid with 0x0 as the function_id argument Static const InstructionSet_Internal CPU_Rep Uses the _cpuid intrinsic to get information about Compile by using: cl /EHsc /W4 InstructionSet.cpp The output shows a possible result for a particular processor. The app lists the instruction set extensions supported by the current processor. This example shows some of the information available through the _cpuid and _cpuidex intrinsics. The maximum value of function_id supported for extended functions will be written to cpuInfo. To determine the maximum meaningful value allowed, set function_id to 0x80000000. When it's supported, function_id values from 0x80000000 might be used to return information. Some processors support Extended Function CPUID information. For more information, see the manuals linked above, and the following example code. Support for specific instruction set extensions and CPU features is encoded in the cpuInfo results returned for higher function_id values. The processor manufacturer is encoded in cpuInfo, cpuInfo, and cpuInfo. When the function_id argument is 0, cpuInfo returns the highest available non-extended function_id value supported by the processor. AMD documentation uses the terms "function number" and "subfunction number" for the function_id and subfunction_id parameters passed in EAX and ECX. For links to these documents and other information, see the AMD Developer Guides, Manuals & ISA Documents page. Intel documentation uses the terms "leaf" and "subleaf" for the function_id and subfunction_id parameters passed in EAX and ECX.įor more information about the specific parameters to use and the values returned by these intrinsics on AMD processors, see the documentation for the cpuid instruction in AMD64 Architecture Programmer's Manual Volume 3: General-Purpose and System Instructions, and in the Revision Guides for specific processor families. It enables you to gather additional information about the processor.įor more information about the specific parameters to use and the values returned by these intrinsics on Intel processors, see the documentation for the cpuid instruction in Intel 64 and IA-32 Architectures Software Developers Manual Volume 2: Instruction Set Reference and Intel Architecture Instruction Set Extensions Programming Reference. The _cpuidex intrinsic sets the value of the ECX register to subfunction_id before it generates the cpuid instruction. The _cpuid intrinsic clears the ECX register before calling the cpuid instruction. The information returned with various values of function_id is processor-dependent. The information returned has a different meaning depending on the value passed as the function_id parameter. This intrinsic stores the supported features and CPU information returned by the cpuid instruction in cpuInfo, an array of four 32-bit integers that's filled with the values of the EAX, EBX, ECX, and EDX registers (in that order). An additional code that specifies information to retrieve, passed in ECX. A code that specifies the information to retrieve, passed in EAX. An array of four integers that contains the information returned in EAX, EBX, ECX, and EDX about supported features of the CPU. This instruction queries the processor for information about supported features and the CPU type. Generates the cpuid instruction that is available on x86 and 圆4.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |