[PATCH] Warn on use of vector initializers in ARM BE mode

Renato Golin renato.golin at linaro.org
Thu Jun 19 06:22:10 PDT 2014


On 19 June 2014 13:34, James Molloy <james.molloy at arm.com> wrote:
>   2. The warning is only emitted in big-endian mode (Alp doesn't like this) - this would reduce the noise down to the set of users who should at least take note of it.

I don't see anything wrong with this, since it's only pertinent to BE
users. Warnings already take into account platform specific things, I
can't see how would this be different.


>   3. Rewrite the patch to try and instead look at *uses* of vectors inside NEON intrinsic functions. The idea being that it would fire if a global or local vector which has a vector initializer is used in a NEON intrinsic.
>      I don't really like this one, because it's trivially easy to break it by even adding a temporary:
>        Uint32x2_t x = {1, 2}; auto y = x; vadd...(y,y);

That's not going to work... :(


>   4. Abandon patch, all ye who enter here.

I still think it's a good warning, but I'm ok if Tim thinks it could
be misleading enough to not have it. I understand the arm_neon.h issue
and it's not an easy one to fix (especially because different
compilers have different headers and it's not ideal to interpret each
one's style in here), but I think that people writing C code on ARM
using NEON and not having the arm_neon.h header will be pretty limited
in numbers.

Tim, do you have any use case for the lack of the header, or is it
just theoretical?

cheers,
--renato



More information about the cfe-commits mailing list