双精度运算:32 位与 64 位机器 [英] Double-precision operations: 32-bit vs 64-bit machines

查看:29
本文介绍了双精度运算:32 位与 64 位机器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与在 32 位机器上执行相比,在 64 位机器上执行 64 位操作(例如双精度操作)时,为什么我们看不到两倍的性能?

Why don't we see twice better performance when executing a 64-bit operations (e.g. double precision operation) on a 64-bit machine, compared to executing on a 32-bit machine?

在 32 位机器中,我们不需要从内存中获取两倍的数据吗?更重要的是,我们执行 64 位操作不需要两倍的周期吗?

In a 32-bit machine, don't we need to fetch from memory twice as much? More importantly, don't we need twice as much cycles to execute a 64-bit operation?

推荐答案

64 位机器"是一个含糊不清的术语,但通常意味着处理器的通用寄存器是 64 位宽的.比较 80868088,它们具有相同的指令集并且都可以称为在这个意义上的 16 位处理器.

"64-bit machine" is an ambiguous term but usually means that the processor's General-Purpose Registers are 64-bit wide. Compare 8086 and 8088, which have the same instruction set and can both be called 16-bit processors in this sense.

当这个词在这个意义上使用时,它与内存总线的宽度、CPU内部总线的宽度以及ALU在32-或64-上高效运行的能力无关位宽数据.

When the phrase is used in this sense, it has nothing to do with the width of the memory bus, the width of the internal buses inside the CPU, and the ability of the ALU to operate efficiently on 32- or 64-bit wide data.

您的问题还假设乘法中最难的部分是将操作数移动到处理器内部处理乘法的单元,即使操作数来自内存并且总线为 32-有点宽,因为延迟!= 吞吐量.此外,关于浮点乘法的数学,64 位乘法并不比 32 位乘法难两倍,它大约是 (53/24)2 难(但是,同样,无论通用寄存器的宽度如何,晶体管都可以有效地计算双精度乘法.

Your question also assumes that the hardest part of a multiplication is moving the operands to the unit that takes care of multiplication inside the processor, which wouldn't be quite true even if the operands came from memory and the bus was 32-bit wide, because latency != throughput. Also, regarding the mathematics of floating-point multiplication, a 64-bit multiplication is not twice as hard as a 32-bit one, it is roughly (53/24)2 times as hard (but, again, the transistors can be there to compute the double-precision multiplication efficiently regardless of the width of the General-Purpose Registers).

这篇关于双精度运算:32 位与 64 位机器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆