*.c: Check for ARM64 SIMD before using the accelerated code.
[catacomb] / math / mpmont.c
index 6109c85..b4bf982 100644 (file)
@@ -125,7 +125,8 @@ static redccore__functype *pick_redccore(void)
                     cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
 #if CPUFAM_ARM64
-  DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm64_simd, 1);
+  DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm64_simd,
+                    cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
   DISPATCH_PICK_FALLBACK(mpmont_reduce, simple_redccore);
 }
@@ -246,7 +247,8 @@ static mulcore__functype *pick_mulcore(void)
                     cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
 #if CPUFAM_ARM64
-  DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm64_simd, 1);
+  DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm64_simd,
+                    cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
   DISPATCH_PICK_FALLBACK(mpmont_mul, simple_mulcore);
 }