Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -54,10 +54,11 @@ @property (class, readonly, nonatomic) bool supportsSSE42; @property (class, readonly, nonatomic) bool supportsAVX; @property (class, readonly, nonatomic) bool supportsAVX2; @property (class, readonly, nonatomic) bool supportsAESNI; @property (class, readonly, nonatomic) bool supportsSHAExtensions; +@property (class, readonly, nonatomic) bool supportsFusedMultiplyAdd; @property (class, readonly, nonatomic) bool supportsF16C; @property (class, readonly, nonatomic) bool supportsAVX512Foundation; @property (class, readonly, nonatomic) bool supportsAVX512ConflictDetectionInstructions; @property (class, readonly, nonatomic) @@ -340,10 +341,21 @@ * * @return Whether the CPU supports Intel SHA Extensions */ + (bool)supportsSHAExtensions; +/** + * @brief Returns whether the CPU supports fused multiply-add. + * + * @warning This method only checks CPU support and assumes OS support! + * + * @note This method is only available on AMD64 and x86. + * + * @return Whether the CPU supports fused multiply-add + */ ++ (bool)supportsFusedMultiplyAdd; + /** * @brief Returns whether the CPU supports F16C. * * @note This method is only available on AMD64 and x86. * Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -796,10 +796,15 @@ + (bool)supportsSHAExtensions { return (x86CPUID(0, 0).eax >= 7 && x86CPUID(7, 0).ebx & (1u << 29)); } + ++ (bool)supportsFusedMultiplyAdd +{ + return (x86CPUID(0, 0).eax >= 1 && x86CPUID(1, 0).ecx & (1u << 12)); +} + (bool)supportsF16C { return (x86CPUID(0, 0).eax >= 1 && x86CPUID(1, 0).ecx & (1u << 29)); } Index: tests/OFSystemInfoTests.m ================================================================== --- tests/OFSystemInfoTests.m +++ tests/OFSystemInfoTests.m @@ -121,10 +121,14 @@ [OFStdOut writeFormat: @"[OFSystemInfo] Supports AES-NI: %d\n", [OFSystemInfo supportsAESNI]]; [OFStdOut writeFormat: @"[OFSystemInfo] Supports SHA extensions: %d\n", [OFSystemInfo supportsSHAExtensions]]; + + [OFStdOut writeFormat: @"[OFSystemInfo] Supports fused multiply-add: " + @"%d\n", + [OFSystemInfo supportsFusedMultiplyAdd]]; [OFStdOut writeFormat: @"[OFSystemInfo] Supports F16C: %d\n", [OFSystemInfo supportsF16C]]; [OFStdOut writeFormat: