1cpu_capabilities(3) Allegro manual cpu_capabilities(3)
2
3
4
6 cpu_capabilities - Contains the capability flags of the CPU. Allegro
7 game programming library.
8
10 #include <allegro.h>
11
12
13 extern int cpu_capabilities;
14
16 Contains CPU flags indicating what features are available on the cur‐
17 rent CPU. The flags can be any combination of these:
18
19 CPU_ID - Indicates that the "cpuid" instruction is
20 available. If this is set, then all Allegro CPU
21 variables are 100% reliable, otherwise there
22 may be some mistakes.
23 CPU_FPU - An FPU is available.
24 CPU_IA64 - Running on Intel 64 bit CPU
25 CPU_AMD64 - Running on AMD 64 bit CPU
26 CPU_MMX - Intel MMX instruction set is available.
27 CPU_MMXPLUS - Intel MMX+ instruction set is available.
28 CPU_SSE - Intel SSE instruction set is available.
29 CPU_SSE2 - Intel SSE2 instruction set is available.
30 CPU_SSE3 - Intel SSE3 instruction set is available.
31 CPU_3DNOW - AMD 3DNow! instruction set is available.
32 CPU_ENH3DNOW - AMD Enhanced 3DNow! instruction set is
33 available.
34 CPU_CMOV - Pentium Pro "cmov" instruction is available.
35
36 You can check for multiple features by OR-ing the flags together. For
37 example, to check if the CPU has an FPU and MMX instructions available,
38 you'd do:
39
40 if ((cpu_capabilities & (CPU_FPU | CPU_MMX)) ==
41 (CPU_FPU | CPU_MMX)) {
42 printf("CPU has both an FPU and MMX instructions!\n");
43 }
44
45 You can read this variable after you have called check_cpu() (which is
46 automatically called by allegro_init()).
47
48
49
50
52 check_cpu(3), cpu_vendor(3), cpu_family(3), cpu_model(3), cpu_capabili‐
53 ties(3), allegro_init(3)
54
55
56
57Allegro version 4.4.3 cpu_capabilities(3)