aarch64: Add Windows runtime detection of the dotprod instructions

For Windows, there's no publicly defined constant for checking for
the i8mm extension yet.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2023-05-26 14:05:30 +03:00
parent 9b0052200a
commit c76643021e
1 changed files with 12 additions and 0 deletions

View File

@ -83,6 +83,18 @@ static int detect_flags(void)
return flags; return flags;
} }
#elif defined(_WIN32)
#include <windows.h>
static int detect_flags(void)
{
int flags = 0;
#ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE))
flags |= AV_CPU_FLAG_DOTPROD;
#endif
return flags;
}
#else #else
static int detect_flags(void) static int detect_flags(void)