-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSVC support #17
Comments
Hm, I am not familiar with the MSVC build system, but I would expect it should be able to compile |
@newpavlov it might be good to move this repo over to GitHub Actions and test on the |
After doing a GitHub Actions conversion, I opened this PR to test Windows w\ MSVC: #19 It appears to have reproduced the issue: https://github.com/RustCrypto/asm-hashes/pull/19/checks?check_run_id=1281176873 |
We merged #19 which adds Windows 64-bit tests for MinGW. If anyone would like to work on MSVC support, it should be easy to modify to test on that as well. |
I looked into this a bit while investigating the best approach for RustCrypto/hashes#315. My understanding is that there are two reasons MSVC builds are currently failing:
|
Based on the I don't have a windows or MSVC machine to test this on. I suppose I can try testing it on GitHub Actions. |
Sadly, this still doesn't work because the assembler on MSVC accepts an assembly file using MASM syntax rather than GAS syntax, so it's necessary to rewrite the whole assembly file to convert it to the other syntax. I think I got maybe 70% of the way there manually, for the sha1 implementation, but there are still some assembler errors and I'm out of time to work on this for now. It's also possible that there are other alternatives than rewriting all of the assembly, such as using a different assembler or auto-converting things, but I'm not sure. |
One of the main alternatives we're looking at here is Rust intrinsics: It seems like intrinsics can provide mostly equivalent performance but in a much more portable way. It'd be great if MSVC users could chime in with reports about how the new intrinsics implementation is working out for them. |
That sounds great, although IIUC the portability of the intrinsics will also be limited because the relevant x64 intrinsics are only present on intel processors manufactured in the last five years or so. |
We do runtime detection to detect if CPUs are compatible, and fall back on a portable reference implementaton |
@not-an-aardvark |
RustCrypto/hashes#312 added an AVX2-based backend using stdarch intrinsics. It doesn't rely on "SHA-NI" and is as fast as the assembly version. |
Requires Build Tools for Visual Studio for compilation https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 See RustCrypto#17
Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 See RustCrypto#17
Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixes RustCrypto#17
Hashes implented in MASM inspired by Project Nayuki Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixes RustCrypto#17
Hashes implented in MASM inspired by Project Nayuki Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixes RustCrypto#17
Hashes implented in MASM inspired by Project Nayuki Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixes RustCrypto#17
Hashes implented in MASM inspired by Project Nayuki Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixes RustCrypto#17
Hashes implented in MASM inspired by Project Nayuki Requires Build Tools for Visual Studio to cargo build https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=17 Fixex RustCrypto#17
Output of
cargo run --release
in a project using md5-asm via md-5:Based on the .S files I don't think this project intends to support Windows. In that case it'd be nice if the project just gave a compile error saying Windows isn't supported rather than a confusing MSVC failure log.
The text was updated successfully, but these errors were encountered: