Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -41,10 +41,12 @@ @property (class, readonly, nullable, nonatomic) OFIRI *temporaryDirectoryIRI; @property (class, readonly, nullable, nonatomic) OFString *CPUVendor; @property (class, readonly, nullable, nonatomic) OFString *CPUModel; # if defined(OF_X86_64) || defined(OF_X86) || defined(DOXYGEN) @property (class, readonly, nonatomic) bool supportsMMX; +@property (class, readonly, nonatomic) bool supports3DNow; +@property (class, readonly, nonatomic) bool supportsEnhanced3DNow; @property (class, readonly, nonatomic) bool supportsSSE; @property (class, readonly, nonatomic) bool supportsSSE2; @property (class, readonly, nonatomic) bool supportsSSE3; @property (class, readonly, nonatomic) bool supportsSSSE3; @property (class, readonly, nonatomic) bool supportsSSE41; @@ -187,10 +189,28 @@ * * @return Whether the CPU supports MMX */ + (bool)supportsMMX; +/** + * @brief Returns whether the CPU supports 3DNow!. + * + * @note This method is only available on x86 and x86_64. + * + * @return Whether the CPU supports 3DNow! + */ ++ (bool)supports3DNow; + +/** + * @brief Returns whether the CPU supports enhanced 3DNow!. + * + * @note This method is only available on x86 and x86_64. + * + * @return Whether the CPU supports enhanced 3DNow! + */ ++ (bool)supportsEnhanced3DNow; + /** * @brief Returns whether the CPU supports SSE. * * @warning This method only checks CPU support and assumes OS support! * Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -703,10 +703,20 @@ #if defined(OF_X86_64) || defined(OF_X86) + (bool)supportsMMX { return (x86CPUID(1, 0).edx & (1u << 23)); } + ++ (bool)supports3DNow +{ + return (x86CPUID(0x80000001, 0).edx & (1u << 31)); +} + ++ (bool)supportsEnhanced3DNow +{ + return (x86CPUID(0x80000001, 0).edx & (1u << 30)); +} + (bool)supportsSSE { return (x86CPUID(1, 0).edx & (1u << 25)); } Index: tests/OFSystemInfoTests.m ================================================================== --- tests/OFSystemInfoTests.m +++ tests/OFSystemInfoTests.m @@ -62,10 +62,16 @@ [OFSystemInfo CPUModel]]; #if defined(OF_X86_64) || defined(OF_X86) [OFStdOut writeFormat: @"[OFSystemInfo] Supports MMX: %d\n", [OFSystemInfo supportsMMX]]; + + [OFStdOut writeFormat: @"[OFSystemInfo] Supports 3DNow!: %d\n", + [OFSystemInfo supports3DNow]]; + + [OFStdOut writeFormat: @"[OFSystemInfo] Supports enhanced 3DNow!: %d\n", + [OFSystemInfo supportsEnhanced3DNow]]; [OFStdOut writeFormat: @"[OFSystemInfo] Supports SSE: %d\n", [OFSystemInfo supportsSSE]]; [OFStdOut writeFormat: @"[OFSystemInfo] Supports SSE2: %d\n",