*.c: Check for ARM64 SIMD before using the accelerated code.
[catacomb] / symm / salsa20.c
index ff6efe3..f424b74 100644 (file)
@@ -78,6 +78,10 @@ extern core__functype salsa20_core_x86ish_sse2;
 extern core__functype salsa20_core_arm_neon;
 #endif
 
+#if CPUFAM_ARM64
+extern core__functype salsa20_core_arm64;
+#endif
+
 static core__functype *pick_core(void)
 {
 #if CPUFAM_X86 || CPUFAM_AMD64
@@ -88,6 +92,10 @@ static core__functype *pick_core(void)
   DISPATCH_PICK_COND(salsa20_core, salsa20_core_arm_neon,
                     cpu_feature_p(CPUFEAT_ARM_NEON));
 #endif
+#if CPUFAM_ARM64
+  DISPATCH_PICK_COND(salsa20_core, salsa20_core_arm64,
+                    cpu_feature_p(CPUFEAT_ARM_NEON));
+#endif
   DISPATCH_PICK_FALLBACK(salsa20_core, simple_core);
 }