Closed tarcieri closed 3 years ago
I wonder if we could cross-compile to aarch64
on a (x86) macOS CI instance to test this...
I'm currently trying to install fil-ocl-core
and this seems to be throwing an error.
Any update on this or any way I could help make progress?
@lonnylot for now the asm
is incompatible with macOS/M4. If fil-ocl-core
is enabling it, they should probably gate it on e.g. Linux/ARM64 targets
Note that overall I think the best way forward here on the M1 is to use stdarch to leverage the ARMv8 Cryptography Extensions, although unfortunately due to a recent regression the necessary intrinsics are no longer exposed
The related issue is now this one and a PR is in the making to clean it up. I am hoping that this will provide the required intrinsics to eventually get fast SHA1 on M1's.
FWIW, here is the assembly generated by a Rust wrapper for the ARMv8 Cryptography Extensions:
https://godbolt.org/z/P8oje3EfK
See also my comment here:
https://github.com/RustCrypto/asm-hashes/issues/5#issuecomment-812890980
I opened a tracking issue for stdarch
-based intrinsic implementations of hash functions here, which is probably the best way to tackle this particular problem: https://github.com/RustCrypto/hashes/issues/257
Given that the intrinsic solution is still a little out there, could we add a second aarch64 implementation for M1 here?
Yeah, that's why I provided the assembly output above, unless someone knows of something better for this purpose.
As discovered on #27, the
aarch64
assembly for thesha1
and(edit: SHA-256 support added in #35) crates does not compile on macOS/M1:sha2