Implement peel loop for fvec_L2sqr, fvec_inner_product, and fvec_norm_L2sqr on aarch64 (#1878)
Implement peel loop for fvec_L2sqr, fvec_inner_product, and fvec_norm_L2sqr on aarch64 (#1878)

Summary:
In the current `faiss` implementation for x86, `fvec_L2sqr` , `fvec_inner_product` , and `fvec_norm_L2sqr` are [optimized for any dimensionality](https://github.com/facebookresearch/faiss/blob/e86bf8cae1a0ecdaee1503121421ed262ecee98c/faiss/utils/distances_simd.cpp#L404-L432).

On the other hand, the functions for aarch64 are optimized [**only** if `d` is multiple for 4](https://github.com/facebookresearch/faiss/blob/e86bf8cae1a0ecdaee1503121421ed262ecee98c/faiss/utils/distances_simd.cpp#L583-L584); thus, they are not much fast for vectors with `d % 4 != 0` .
This PR has accelerated the above three functions for any input size on aarch64.

Kind regards,

![peel-loop](https://user-images.githubusercontent.com/40021161/117810705-b36e7380-b29a-11eb-9096-91babc27a03d.png)
- Evaluated on an AWS EC2 ARM instance (c6g.4xlarge)
- sift1m127 is the dataset with dropped trailing elements of sift1m
    - Therefore, the vector length of sift1m127 is 127 that is not multiple of 4
    - "optimized" runs 2.45-2.77 times faster than "original" with sift1m127
- Two methods, "original" and "optimized", are expected to achieve the same level of performance for sift1m
    - And actually there is almost no significant difference

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1878

Reviewed By: beauby

Differential Revision: D28376329

Pulled By: mdouze

fbshipit-source-id: c68f13b4c426e56681d81efd8a27bd7bead819de

facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss