diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 4d8d22f3c..2944e596c 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -80,6 +80,7 @@ enum ProcessorProperties CPU_PROP_MP = (1<<11), ///< This is a multi-processor system. CPU_PROP_LE = (1<<12), ///< This processor is LITTLE ENDIAN. CPU_PROP_64bit = (1<<13), ///< This processor is 64-bit capable + CPU_PROP_NEON = (1<<14), ///< Supports the Arm Neon instruction set extension. }; /// Processor info manager. diff --git a/Engine/source/platformMac/macCPU.mm b/Engine/source/platformMac/macCPU.mm index 8987cff75..e961542e9 100644 --- a/Engine/source/platformMac/macCPU.mm +++ b/Engine/source/platformMac/macCPU.mm @@ -94,6 +94,11 @@ static void detectCpuFeatures(U32 &procflags) int err; U32 lraw; + // All Cpus have fpu + procflags = CPU_PROP_FPU; + +#if defined(TORQUE_CPU_X86) || defined(TORQUE_CPU_X64) + // List of chip-specific features err = _getSysCTLvalue("hw.optional.mmx", &lraw); if ((err==0)&&(lraw==1)) @@ -119,6 +124,12 @@ static void detectCpuFeatures(U32 &procflags) err = _getSysCTLvalue("hw.optional.avx1_0", &lraw); if ((err==0)&&(lraw==1)) procflags |= CPU_PROP_AVX; + +#elif defined(TORQUE_CPU_ARM64) + // All Apple Cpus have Neon + procflags |= CPU_PROP_NEON; + +#endif err = _getSysCTLvalue("hw.ncpu", &lraw); if ((err==0)&&(lraw>1)) @@ -129,12 +140,11 @@ static void detectCpuFeatures(U32 &procflags) err = _getSysCTLvalue("hw.byteorder", &lraw); if ((err==0)&&(lraw==1234)) procflags |= CPU_PROP_LE; - } void Processor::init() { - U32 procflags; + U32 procflags = 0; int err, cpufam, cputype, cpusub; char buf[255]; U32 lraw; @@ -170,7 +180,6 @@ void Processor::init() } Platform::SystemInfo.processor.mhz = (unsigned int)llraw; - procflags = CPU_PROP_FPU; detectCpuFeatures(procflags); Platform::SystemInfo.processor.properties = procflags; @@ -197,7 +206,9 @@ void Processor::init() Con::printf(" SSE4.2 detected"); if (Platform::SystemInfo.processor.properties & CPU_PROP_AVX) Con::printf(" AVX detected"); - + if (Platform::SystemInfo.processor.properties & CPU_PROP_NEON) + Con::printf(" Neon detected"); + Con::printf( "" ); // Trigger the signal