gpt4 book ai didi

assembly - 将英特尔寄存器用于其 "intended purpose"是否会提高效率?

转载 作者:行者123 更新时间:2023-12-04 14:21:00 26 4
gpt4 key购买 nike

This article声称每个寄存器都有一个预期的目的,更重要的是,

When the engineers at Intel designed the original 8086 processor, they had a special purpose in mind for each register. As they designed the instruction set, they created many optimizations and special instructions based on the function they expected each register to perform. Using registers according to Intel's original plan allows the code to take full advantage of these optimizations. Unfortunately, this seems to be a lost art. Few coders are aware of Intel's overall design, and most compilers are too the simplistic or focused on execution speed to use the registers properly. Understanding how the registers and instruction set fit together, however, is an important step on the road to effortless size-coding.



有没有其他来源可以证实这篇文章?如果是这样,我真的很想检查一下。

请注意,我不是在谈论像 STOS 这样的快速操作的情况。用途 edi - 我只是想知道如果我使用 eax 是否有任何性能下降和 esi作为计数器而不是 ecx还是只是为了可读性?

最佳答案

指令集中的指令使用特定寄存器,这些指令比针对任何寄存器的等效函数更小(而且通常更快)。

关于assembly - 将英特尔寄存器用于其 "intended purpose"是否会提高效率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1903047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com