简体   繁体   English

为什么在AMD64中删除了BCD指令?

[英]Why BCD instructions were removed in AMD64?

Binary Coded Decimal Instructions are part of the x86 architecture at least from the i8086. 二进制编码的十进制指令至少在i8086中是x86体系结构的一部分。 They are like AAA, DAA, AAS, DAS, and help to work with arithmetic operations on BCD numbers. 它们类似于AAA,DAA,AAS,DAS,并有助于对BCD编号进行算术运算。

Here is some reference of them: 这里是它们的一些参考:

https://en.wikipedia.org/wiki/Intel_BCD_opcode https://zh.wikipedia.org/wiki/英特尔_BCD_opcode

According to Intel's Software Developer's Manual. 根据英特尔软件开发人员手册。 Those instructions are not available in long (64 bits) mode. 这些指令在长(64位)模式下不可用。 I'm know maybe the only people that actually know why are the designers of the architecture, but why do you think they remove them? 我知道也许唯一真正知道为什么架构设计师的人,但是您为什么认为他们将其删除?

The answer is in your link: 答案在您的链接中:

Adding BCD numbers using these opcodes is a complex task, and requires many instructions to add even modest numbers. 使用这些操作码添加BCD号码是一项复杂的任务,需要很多指令才能添加适度的号码。 It can also require a large amount of memory. 它还可能需要大量内存。

All integer calculations are exact, so the radix of the number representation is not important for accuracy. 所有整数计算都是精确的,因此数字表示的基数对于准确性并不重要。 Therefore, even financial software today usually stores values in binary representation and only converts to decimal for input and output. 因此,即使是当今的财务软件,通常也以二进制表示形式存储值,并且只能将其转换为输入和输出的小数。

On an x86 processor calculations with binary numbers are usually a lot faster than the same calculations with BCD numbers. 在x86处理器上,使用二进制数进行计算通常比使用BCD数进行相同计算要快得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM