cpu_capabilities.h [plain text]
#ifndef _PPC_CPU_CAPABILITIES_H
#define _PPC_CPU_CAPABILITIES_H
#ifdef _APPLE_API_PRIVATE
#ifndef __APPLE_API_PRIVATE
#define __APPLE_API_PRIVATE
#endif
#endif
#ifndef __APPLE_API_PRIVATE
#error cpu_capabilities.h is for Apple Internal use only
#else
#ifndef __ASSEMBLER__
extern int _cpu_capabilities;
#endif
#define kHasAltivec 0x00000001
#define k64Bit 0x00000002 // 64-bit GPRs
#define kCache32 0x00000004 // cache line size is 32 bytes
#define kCache64 0x00000008
#define kCache128 0x00000010
#define kDcbaRecommended 0x00000020 // PPC: dcba is available and recommended
#define kDcbaAvailable 0x00000040 // PPC: dcba is available but is not recommended
#define kDataStreamsRecommended 0x00000080 // PPC: dst, dstt, dstst, dss, and dssall instructions available and recommended
#define kDataStreamsAvailable 0x00000100 // PPC: dst, dstt, dstst, dss, and dssall instructions available but not recommended
#define kDcbtStreamsRecommended 0x00000200 // PPC: enhanced dcbt instruction available and recommended
#define kDcbtStreamsAvailable 0x00000400 // PPC: enhanced dcbt instruction available and recommended
#define kUP 0x00008000 // set if (kNumCPUs == 1)
#define kNumCPUs 0x00FF0000 // number of CPUs (see _NumCPUs() below)
#define kNumCPUsShift 16 // see _NumCPUs() below
#define kHasGraphicsOps 0x08000000 // PPC: has fres, frsqrte, and fsel instructions
#define kHasStfiwx 0x10000000 // PPC: has stfiwx instruction
#define kHasFsqrt 0x20000000 // PPC: has fsqrt and fsqrts instructions
#ifndef __ASSEMBLER__
static __inline__ int _NumCPUs( void ) { return (_cpu_capabilities & kNumCPUs) >> kNumCPUsShift; }
#endif
#endif
#endif