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

查看:174
本文介绍了双精度运算: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, dont we need twice as much cycles to execute a 64-bit operation?

推荐答案

"64位计算机"是一个模糊的术语,但通常意味着处理器的通用寄存器为64位宽.比较 8086 8088 ,它们具有相同的指令集,因此在这种意义上都可以称为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天全站免登陆