-
-
Notifications
You must be signed in to change notification settings - Fork 11k
rsa: use portable intrinsic for 64x64bit multiplication on Win ARM64 #20244
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
Conversation
|
"Fixes" is a relative term in the case of software. A fix for one problem can unexpectedly break something else. Does the code once again compile and produce binaries for the VC-WIN64-ARM target? Yes. Do the binaries load and run on Windows ARM64 hardware? Yes. Tested on Win10 ARM64. openssl.exe loads and runs. I also ran a few select items from the test suite: Is it still functionally correct across all platforms, especially supported platforms? I don't know. Win + ARM64 is largely unsupported. Looking at what Microsoft says about |
|
@slproweb Thanks, I was asking about the compilation error specifically. I'm the original author of the buggy code so I'm aware of the additional requirements of it. But good point about checking if the code is optimal; it's indeed not if the |
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64
2055d23 to
377d3e8
Compare
beldmit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
The buildbot/master:windows-win10-x86_64 failure looks like a problem with the machine, not the PR |
|
My preference is for this version of the fix to go in. |
|
Nitpick: The most recent change that was introduced here makes the assumption that Microsoft will never experiment with other 64-bit architectures other than Intel x64 or ARM64. https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types Only lists a fraction of the hardware architectures Microsoft and Microsoft partners have experimented with over the years. Granted, only a select few ever made it as far as full VS toolchain support with real hardware running the Windows OS. Everything non-Microsoft has the fallback position of the native C implementation. With the native C implementation, at least it'll compile but not run well. Throwing a warning about non-optimal code on all platforms that end up using the native C implementation seems better to me than just failing to compile altogether. But this has already been signed off on. /EndNitpick |
|
That was intentional. Once you have such a system you will be at the best position to decide which option you want to pursue: use one of the existing intrinsics, use a new intrinsic, or fallback to pure C option. The other platforms don't have the fallback not for new unexpected platforms, but rather for non-gcc, non-clang compilers that don't support 128 bit variables natively. So it will be used when it's both an uncommon platform and an uncommon compiler. |
|
Obviously a difference of opinion here but, IMO, code should aim to always compile successfully with the sole exception of security considerations, which I don't think applies here. OpenSSL also has a Side note: There doesn't appear to be a CI test for no-asm. The point is largely moot since this has already been accepted but not merged yet. |
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
|
Merged to all branches. Thank you for your contribution. |
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #20244) (cherry picked from commit 075652f)
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #20244) (cherry picked from commit 075652f)
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #20244)
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #20244) (cherry picked from commit 075652f)
@slproweb Any improvements are welcome. Please submit a PR if you have any changes you'd like to be merged. |
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#20244)
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl/openssl#20244)
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
PR-URL: #46566
Refs: openssl/openssl#20244
Refs: https://mta.openssl.org/pipermail/openssl-announce/2023-February/000251.html
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
PR-URL: #46568
Refs: openssl/openssl#20244
Refs: https://mta.openssl.org/pipermail/openssl-announce/2023-February/000251.html
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
Refs: openssl/openssl#20244
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
PR-URL: nodejs/node#46568
Refs: openssl/openssl#20244
Refs: https://mta.openssl.org/pipermail/openssl-announce/2023-February/000251.html
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
PR-URL: nodejs/node#46568
Refs: openssl/openssl#20244
Refs: https://mta.openssl.org/pipermail/openssl-announce/2023-February/000251.html
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Original commit message:
rsa: add msvc intrinsic for non x64 platforms
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but
doesn't generate optimal code on x64
PR-URL: nodejs/node#46573
Refs: openssl/openssl#20244
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
_umul128() is x86_64 (x64) only, while __umulh() works everywhere, but doesn't generate optimal code on x64 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#20244) (cherry picked from commit 075652f)
_umul128() is x86_64 (x64) only, while __umulh() works both on x64 and ARM64
fixes #20234
Checklist