Does NEON support aliasing of the vector data types with their scalar components?
E.g.(Intel SSE)
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
The above will allow me to do:
__m128i* somePtr;
somePtr++;//advance to the next block
Aliasing a la Intel it will allow to advance my pointer to the next block I want to process without managing extra counts and indexes.
The __may_alias__
attribute on __m128i
should be viewed as a work-around which makes it possible to write strict-aliasing-correct code even though Intel completely screwed up the signatures of some of the SEE load/store intrinsics. (The 8-byte loading _mm_loadl_epi64(const __m128i*)
is the most hilarious example, but there are others). ARM got their intrinsics right, so __may_alias__
isn't needed.
Just use pointers to the element type, and use explicit loads and stores. In my experience that leads to better code being generated, and is probably also more portable. (Does the ARM C language spec even allow pointers to NEON types? I wouldn't be surprised if they didn't).
NEON intrinsics implementation does NOT support aliasing of the vector data types with their scalar components.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With