Agar Logo by @eightbit

Agar 1.7 Manual

(Printable Version)
AG_CPUInfo(3)

SYNOPSIS

#include <agar/core.h>

DESCRIPTION

The agar AG_CPUInfo interface provides some information about the current architecture and architecture extensions.

INTERFACE


void AG_GetCPUInfo (AG_CPUInfo *info)


The AG_GetCPUInfo() function returns CPU information into an existing info structure.

STRUCTURE DATA

For the AG_CPUInfo structure:
const char *archA string describing the architecture (e.g., "alpha", "i386", etc).
char vendorID[13]A vendor ID string (architecture-specific).
Uint32 extA list of architecture extensions that have some relevance to user applications (see ARCHITECTURE EXTENSIONS below).

ARCHITECTURE EXTENSIONS

The ext field can contain the following flags:
AG_EXT_CPUIDThe i386 CPUID instruction is supported.
AG_EXT_MMXMMX instructions are available.
AG_EXT_MMX_EXTAMD extensions to MMX are available.
AG_EXT_3DNOW3dNow! is supported.
AG_EXT_3DNOW_EXTExtended 3dNow! is supported.
AG_EXT_ALTIVECAltiVec instructions are supported.
AG_EXT_SSEStreaming SIMD extensions are supported.
AG_EXT_SSE2SSE2 extensions are supported.
AG_EXT_SSE3SSE3 (PNI) extensions are supported.
AG_EXT_LONG_MODELong mode is available.
AG_EXT_RDTSCPThe RDTSCP instruction exists.
AG_EXT_FXSRFast FXSAVE/FXSTOR is available.
AG_EXT_PAGE_NXThe per-page no-execute bit (W^X) is supported.
AG_EXT_SSE5ASSE5A extensions are available.
AG_EXT_3DNOW_PREFETCHThe PREFETCH and PREFETCHW instructions for 3dNow! are available.
AG_EXT_SSE_MISALIGNEDMisaligned SSE mode is supported.
AG_EXT_SSE4ASSE4A extensions are available.
AG_EXT_ONCHIP_FPUThe floating point unit is on-chip.
AG_EXT_TSCThe Time Stamp Counter is available.
AG_EXT_CMOVThe CMOV (Conditional Move) instruction exists.
AG_EXT_CLFLUSHThe CLFLUSH (Cache Line Flush) instruction exists.
AG_EXT_HTTHyper-Threading technology is supported.
AG_EXT_MONMONITOR and MWAIT instructions exist.
AG_EXT_VMXVirtual Machine Extensions are available.
AG_EXT_SSSE3SSSE3 extensions are available.
AG_EXT_SSE41SSE4.1 extensions are available.
AG_EXT_SSE42SSE4.2 extensions are available.

EXAMPLES

The following code prints architecture information:
AG_CPUInfo cpu;

AG_GetCPUInfo(&cpu);
AG_Verbose("Architecture: %s\n", cpu.arch);
AG_Verbose("Vendor ID: %s\n", cpu.vendorID);
AG_Verbose("AltiVec: %s\n", (cpu.ext & AG_EXT_ALTIVEC) ? "Yes" : "No");
AG_Verbose("SSE: %s\n", (cpu.ext & AG_EXT_SSE) ? "Yes" : "No");

SEE ALSO


HISTORY

The AG_CPUInfo interface first appeared in Agar 1.3.4.

Csoft.net ElectronTubeStore