You copied the Doc URL to your clipboard.

__strexd intrinsic

This intrinsic inserts an STREXD instruction into the instruction stream generated by the compiler. It enables you to use an STREXD instruction in your C or C++ code to store data to memory. It supports exclusive stores of doubleword data to memory.

Syntax

int __strexd(unsigned long long val, volatile void *ptr)

Where:

val

is the value to be written to memory.

ptr

points to the address of the data to be written to in memory. To specify the size of the data to be written, cast the parameter to an appropriate integral type.

Table 19. Access widths that the __strexd intrinsic supports
InstructionSize of data storedC cast
STREXDunsigned long long(unsigned long long *)
STREXDsigned long long(signed long long *)

Return value

The __strexd intrinsic returns:

0

if the STREXD instruction succeeds

1

if the STREXD instruction is locked out.

Errors

The compiler does not recognize the __strexd intrinsic when compiling for a target that does not support the STREXD instruction. The compiler generates either a warning or an error in this case.

The __strexd intrinsic only supports access to doubleword data. The compiler generates an error if you specify an access width that is not supported.