Cortex-M4:uint64_t的原子读写

问题描述 投票:0回答:1

我读了好几遍,Cortex-M4 不支持

LDRD
/
STRD
指令。但是当我尝试使用
gcc
13.2 时,我得到了这些说明。例如。
x3 = x1
对于
uint64_t
给出:

ldrd    r2, [r0]        @ x1.0_1, x1
strd    r2, [r1]        @ x1.0_1, x3

编译器选项:

-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -march=armv7e-m+fp -O3 -std=c++23 -fno-exceptions -fno-unwind-tables -fno -rtti -fno-threadsafe-statics -funsigned-char -funsigned-bitfields -fshort-enums -ffunction-sections -fdata-sections -fconcepts -ftemplate-depth=2048 -fstrict-aliasing

c++ atomic cortex-m
1个回答
0
投票

https://developer.arm.com/documentation/ddi0403/latest/ 的 A3.5.3 节中 它明确指出,

LDRD
/
STRD
VLDR.64
不是单副本原子

© www.soinside.com 2019 - 2024. All rights reserved.