| |||
| Home > Compiler-specific Features > Instruction intrinsics > __ldrexd intrinsic | |||
This intrinsic inserts an LDREXD instruction
into the instruction stream generated by the compiler. It enables
you to load data from memory in your C or C++ code using an LDREXD instruction.
It supports access to doubleword data.
unsigned long long __ldrexd(volatile void *ptr)
Where:
ptrpoints to the address of the data to be loaded from memory. To specify the type of the data to be loaded, cast the parameter to an appropriate pointer type.
Table 15. Access widths supported by the __ldrex intrinsic
| Instruction | Size of data loaded | C cast |
|---|---|---|
LDREXD | unsigned long long | (unsigned long long *) |
LDREXD | signed long long | (signed long long *) |
The __ldrexd intrinsic returns the data
loaded from the memory address pointed to by .ptr
The compiler does not recognize the __ldrexd intrinsic
when compiling for a target that does not support the LDREXD instruction.
The compiler generates either a warning or an error in this case.
The __ldrexd intrinsic only supports
access to doubleword data. The compiler generates an error if you
specify an access width that is not supported.
LDREX and STREX in the Assembler Reference.