This intrinsic inserts an assembly language instruction of
the form LDR{size}T into the instruction stream generated
by the compiler. It enables you to load data from memory in your C
or C++ code using an LDRT instruction.
Syntax
unsigned int __ldrt(const volatile void *ptr)
where:
ptr
Points to the address of the data to be loaded from
memory. To specify the size of the data to be loaded, cast the parameter
to an appropriate integral type.
Table 17. Access widths supported by the __ldrt intrinsic
The __ldrt intrinsic returns the data
loaded from the memory address pointed to by ptr.
Errors
The compiler does not recognize the __ldrt intrinsic
when compiling for a target that does not support the LDRT instruction.
The compiler generates either a warning or an error in this case.
The __ldrt intrinsic does not support
access to doubleword data. The compiler generates an error if you
specify an access width that is not supported.
Example
int foo(void)
{
int loc = 0xff;
return __ldrt((const volatile int *)loc);
}
Compiling this code with the default options produces:
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.