为什么存在指令/数据对齐? [英] Why does instruction/data alignment exist?

查看:88
本文介绍了为什么存在指令/数据对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常看到有关体系结构指令的信息,并且数据必须与字,半字等边界对齐。尽管遵循这些规则并不难,但我只是想知道是否有人可以说出为什么(通常)存在此要求?

I frequently see information about architecturally instructions and data must be aligned to word, half-word, etc. boundaries. While it is not difficult to follow these rules, I am just wondering if someone can tell why (generally) this requirement exists?

编辑:基本上在这里找到了我的答案:<一个href = https://stackoverflow.com/questions/2006216/why-is-data-structure-alignment-important-for-performance>为什么数据结构对齐对性能很重要?

basically found my answer here: why is data structure alignment important for performance?

推荐答案

这是由于高效的数据总线设计问题。通过对齐的备注地址,数据可以有效地放入数据总线中。

this is because of high efficient data bus design issue. With aligned memoey address, the data can fit in the data bus efficiently.

对于32位字负载,如果对齐,则连接CPU和DRAM内存的所有32位数据总线都必须对齐,否则计算机必须使用下部

For a 32 bit word load, if it is aligned, all the 32bit data bus which connect the CPU and DRAM MEMORY.Otherwise, the computer have to use the lower part of the data bus once, and then load again using the higher part of the data bus.

此外,当前的缓存体系结构设计还利用了对齐约束

What is more, the current cache architecture design also take advantage of align constraint

这篇关于为什么存在指令/数据对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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