Skip to content

Commit 57fc338

Browse files
committed
lib/arm/cpu_features: add fallback definition for DP_INSTRUCTIONS_AVAILABLE
This constant has a fixed and documented value, and IsProcessorFeaturePresent() behaves as expected when passed an unknown value, so it makes sense to provide a fallback definition.
1 parent dc76454 commit 57fc338

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/arm/cpu_features.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ static u32 query_arm_cpu_features(void)
170170

171171
#include <windows.h>
172172

173+
#ifndef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE /* added in Windows SDK 20348 */
174+
# define PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE 43
175+
#endif
176+
173177
static u32 query_arm_cpu_features(void)
174178
{
175179
u32 features = ARM_CPU_FEATURE_NEON;
@@ -178,11 +182,8 @@ static u32 query_arm_cpu_features(void)
178182
features |= ARM_CPU_FEATURE_PMULL;
179183
if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE))
180184
features |= ARM_CPU_FEATURE_CRC32;
181-
182-
#ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
183185
if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE))
184186
features |= ARM_CPU_FEATURE_DOTPROD;
185-
#endif
186187

187188
/* FIXME: detect SHA3 support too. */
188189

0 commit comments

Comments
 (0)