Module org.elasticsearch.simdvec
The native code is contained in C++ files, with implementations for ARM and two generations of x86, using significant amounts of CPU intrinsics to utilise specific SIMD operations. The method handles are loaded using FFI, and made available through a series of wrapper classes to be called from Elasticsearch-defined vector formats.
Because the APIs used to perform SIMD operations from Java
and call native code changes between JVM versions,
there are different implementations of the wrapper classes for different JVM versions.
This is handled using multi-release jars, with the JVM-specific implementations
contained in the mainXX source sets.
As a result, some of the implementations in the main source set are not actually
called at runtime, and only exist to be compiled against. The correct implementation to use
at runtime is selected by the multi-release classloader.