浏览代码

Adding ARM/NEON detection for non-Linux targets

Vincent Milum Jr 6 年之前
父节点
当前提交
cffb992ae8
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      ext/arm32-neon-salsa2012-asm/salsa2012.h

+ 3 - 1
ext/arm32-neon-salsa2012-asm/salsa2012.h

@@ -5,8 +5,10 @@
 #include <sys/auxv.h>
 #include <sys/auxv.h>
 #include <asm/hwcap.h>
 #include <asm/hwcap.h>
 #define zt_arm_has_neon() ((getauxval(AT_HWCAP) & HWCAP_NEON) != 0)
 #define zt_arm_has_neon() ((getauxval(AT_HWCAP) & HWCAP_NEON) != 0)
-#else
+#elif defined(__ARM_NEON__) || defined(__ARM_NEON)
 #define zt_arm_has_neon() (true)
 #define zt_arm_has_neon() (true)
+#else
+#define zt_arm_has_neon() (false)
 #endif
 #endif
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus