TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Montgomery Multiplication (2012) [pdf]

17 pointsby Cieplakover 7 years ago

1 comment

crispweedover 7 years ago
&gt; The computation [...] is multiplying two 64-bit unsigned integers, giving a 128-bit product. Some machines have an instruction for that.<p>And compilers often let you call these instructions fairly directly, with compiler intrinsics.<p>With Visual Studio on Windows x64, for example, you can implement the mulul64() function with _umul128: <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;cpp&#x2F;intrinsics&#x2F;umul128" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;cpp&#x2F;intrinsics&#x2F;umul128</a> (and expect quite a good speedup)