rmuir commented on code in PR #13572:
URL: https://github.com/apache/lucene/pull/13572#discussion_r1697462600
##########
lucene/core/src/c/dotProduct.c:
##########
@@ -0,0 +1,143 @@
+// dotProduct.c
+
+#include <stdio.h>
+#include <arm_neon.h>
+
+#ifdef __ARM_ACLE
+#include <arm_acle.h>
+#endif
+
+#if (defined(__ARM_FEATURE_SVE) && !defined(__APPLE__))
+#include <arm_sve.h>
+/*
+ * Unrolled and vectorized int8 dotProduct implementation using SVE
instructions
+ * NOTE: Clang 15.0 compiler on Apple M3 Max compiles the code below
sucessfully
+ * with '-march=native+sve' option but throws "Illegal Hardware Instruction"
error
+ * Looks like Apple M3 does not implement SVE and Apple's official
documentation
+ * is not explicit about this or at least I could not find it.
+ *
+ */
+int32_t vdot8s_sve(int8_t *vec1, int8_t *vec2, int32_t limit) {
Review Comment:
purely cosmetic, but maybe change these all to array syntax, which will be
easier for java developers, and transform pointer arithmetic such as `vec1 + i
+ 2 * vec_length` into `vec1[i + 2 * vec_length]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]