/相 发表于 2024-3-6 05:34:44

Large Integer Functions

Function
Description
Int32x32To64Multiplies two signed 32-bit integers, returning a signed 64-bit integer result.Int64ShllMod32Performs a left logical shift operation on an unsigned 64-bit integer value. The function provides improved shifting code for left logical shifts where the shift count is in the range 0-31.Int64ShraMod32Performs a right arithmetic shift operation on a signed 64-bit integer value. The function provides improved shifting code for right arithmetic shifts where the shift count is in the range 0-31.Int64ShrlMod32Performs a right logical shift operation on an unsigned 64-bit integer value. The function provides improved shifting code for right logical shifts where the shift count is in the range 0-31.MulDivMultiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value.Multiply128Multiplies two 64-bit integers to produce a 128-bit integer.MultiplyExtract128Multiplies two 64-bit integers to produce a 128-bit integer, shifts the product to the right by the specified number of bits, and returns the low 64 bits of the result.MultiplyHighMultiplies two 64-bit integers to produce a 128-bit integer and gets the high 64 bits.PopulationCount64Counts the number of one bits (population count) in a 64-bit unsigned integer.ShiftLeft128Shifts 128-bit left.ShiftRight128Shifts 128-bit right.UInt32x32To64Multiplies two unsigned 32-bit integers, returning an unsigned 64-bit integer result.UnsignedMultiply128Multiplies two unsigned 64-bit integers to produce an unsigned 128-bit integer.UnsignedMultiplyExtract128Multiplies two unsigned 64-bit integers to produce an unsigned 128-bit integer, shifts the product to the right by the specified number of bits, and returns the low 64 bits of the result.UnsignedMulitplyHighMultiplies two 64-bit integers to produce a 128-bit integer and gets the high unsigned 64 bits.

uzmedafacof 发表于 2024-3-6 05:35:44

最近在抽空阅读VS2012的文档,
发现VC2012里面添加了许多吸引人的新语法,
可以大大提升代码的优雅性,以及执行效率。

出于对大整数的计算比较关心,
偶尔在UInt32x32To64上按F1,
点开页面发现MS又新添了不少宏,
不过,很显然它们基本都是因为方便对应CPU新的指令集而出现的。
上面的表格来自:http://msdn.microsoft.com/zh-cn/ ... loads/aa383711.aspx
而奇怪的是,搜遍VS2012的本地帮助Mircosoft HelpViewer 2.0(与MSDN有什么区别?)也不曾有上述内容。

ahqhegudiz 发表于 2024-3-6 05:36:43

强!$128bit$都出来了!

看来这个问题只要用$1$条指令就可以解决了:

http://bbs.emath.ac.cn/thread-4468-1-1.html
页: [1]
查看完整版本: Large Integer Functions