[PATCH] Implement low-level ARM ldrex/strex intrinsics

Tim Northover tnorthover at apple.com
Mon Jul 15 03:10:52 PDT 2013


Hi Manish,

On 15 Jul 2013, at 10:52, Manish Verma <manish.verma at arm.com> wrote:
> Your mention of RVCT in your first email caught my attention. The difference
> between the declaration of the intrinsics in the two compilers, is the
> missing "volatile" attribute on the input address argument.

That's a good point, that I hadn't considered. The patch actually doesn't check the qualifiers at all. Which is probably mostly harmless for the volatile case, though not ideal. But it also allows storing to a const pointer, which it probably shouldn't.

It should probably act as if the declarations were:
    __builtin_arm_ldrex(const volatile T *);
    __builtin_arm_strex(T, volatile T *);

Thanks for spotting that, I'll fix it before sending the patches again.

I think adding an implicit cast on the pointer expressions to the appropriately qualified type should be sufficient.

Tim.



More information about the llvm-commits mailing list