ARM 指令 ldrex/strex 是否必须对缓存对齐的数据进行操作? [英] Do the ARM instructions ldrex/strex have to operate on cache aligned data?

查看:36
本文介绍了ARM 指令 ldrex/strex 是否必须对缓存对齐的数据进行操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Intel 上,CMPXCHG 的参数必须与缓存行对齐(因为 Intel 使用 MESI 来实现 CAS).

On Intel, the arguments to CMPXCHG must be cache line aligned (since Intel uses MESI to implement CAS).

在 ARM 上,ldrex 和 strex 在独占保留粒度上运行.

On ARM, ldrex and strex operate on exclusive reservation granuales.

需要明确的是,这是否意味着在 ARM 上操作的数据不必与缓存行对齐?

To be clear, does this then mean on ARM the data being operated upon does not have to be cache line aligned?

推荐答案

ARM 架构参考手册 A.3.2.1未对齐的数据访问"中说得很对.LDREXSTREX 需要字对齐.这是有道理的,因为未对齐的数据访问可以跨越独占预留粒度.

It says so right in the ARM Architecture Reference Manual A.3.2.1 "Unaligned data access". LDREX and STREX require word alignment. Which makes sense, because an unaligned data access can span exclusive reservation granules.

这篇关于ARM 指令 ldrex/strex 是否必须对缓存对齐的数据进行操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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