OpenTTD Source 20241224-master-gee860a5c8e
|
Functions related to CPU specific instructions. More...
Go to the source code of this file.
Functions | |
void | ottd_cpuid (int info[4], int type) |
Get the CPUID information from the CPU. | |
bool | HasCPUIDFlag (uint type, uint index, uint bit) |
Check whether the current CPU has the given flag. | |
Functions related to CPU specific instructions.
Definition in file cpu.h.
bool HasCPUIDFlag | ( | uint | type, |
uint | index, | ||
uint | bit | ||
) |
Check whether the current CPU has the given flag.
type | The type to be passing to cpuid (usually 1). |
index | The index in the returned info array. |
bit | The bit index that needs to be set. |
Definition at line 84 of file cpu.cpp.
References HasBit(), and ottd_cpuid().
void ottd_cpuid | ( | int | info[4], |
int | type | ||
) |
Get the CPUID information from the CPU.
info | The retrieved info. All zeros on architectures without CPUID. |
type | The information this instruction should retrieve. |
Get the CPUID information from the CPU.
MSVC offers cpu information while gcc only implements in gcc 4.8 __builtin_cpu_supports and friends http://msdn.microsoft.com/library/vstudio/hskdteyh%28v=vs.100%29.aspx http://gcc.gnu.org/onlinedocs/gcc/X86-Built-in-Functions.html
Other platforms/architectures don't have CPUID, so zero the info and then most (if not all) of the features are set as if they do not exist.
Definition at line 78 of file cpu.cpp.
Referenced by HasCPUIDFlag().