These functions are part of the ARM RTABI (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf).
Currently LLVM doesn't generate calls to them, but they could be useful for optimizing for size.
Differential D53177
[builtins] Implement __aeabi_uread4/8 and __aeabi_uwrite4/8. efriedma on Oct 11 2018, 3:31 PM. Authored by
Details
These functions are part of the ARM RTABI (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf). Currently LLVM doesn't generate calls to them, but they could be useful for optimizing for size.
Diff Detail
Event TimelineComment Actions Nice idea. The rtabi seems to says:
With signitures: int __aeabi_uread4(void *address); int __aeabi_uwrite4(int value, void *address); long long __aeabi_uread8(void *address); long long __aeabi_uwrite8(long long value, void *address); So writes also return values. Also, and I kind of trust you know what you are talking about here, but is this using a struct like this always valid? Does packed always means alignment of 1? And is the mayalias needed if the thing we are aliasing with is a char*? (It does make the intent clearer, and the IR looks OK to me.) Comment Actions The packed/may_alias struct pattern is the same pattern we use in the x86 immintrin.h for unaligned loads; should do the right thing in general.
Yes.
Well, if we're not doing LTO with compiler-rt (which isn't really something we support anyway), the may_alias does nothing because there aren't any other memory accesses. The type of the pointer isn't really relevant.
Oh, oops, will fix. |