gxqcn 发表于 2013-3-28 21:39:35

Large Integer Functions

FunctionDescriptionInt32x32To64 Multiplies two signed 32-bit integers, returning a signed 64-bit integer result.Int64ShllMod32 Performs 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.Int64ShraMod32 Performs 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.Int64ShrlMod32 Performs 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.MulDiv Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value.Multiply128 Multiplies two 64-bit integers to produce a 128-bit integer.MultiplyExtract128 Multiplies 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.MultiplyHigh Multiplies two 64-bit integers to produce a 128-bit integer and gets the high 64 bits.PopulationCount64 Counts the number of one bits (population count) in a 64-bit unsigned integer.ShiftLeft128 Shifts 128-bit left.ShiftRight128 Shifts 128-bit right.UInt32x32To64 Multiplies two unsigned 32-bit integers, returning an unsigned 64-bit integer result.UnsignedMultiply128 Multiplies two unsigned 64-bit integers to produce an unsigned 128-bit integer.UnsignedMultiplyExtract128 Multiplies 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.UnsignedMulitplyHigh Multiplies two 64-bit integers to produce a 128-bit integer and gets the high unsigned 64 bits.

gxqcn 发表于 2013-3-28 21:55:16

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

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

KeyTo9_Fans 发表于 2013-3-28 23:58:58

强!$128bit$都出来了!

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

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