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

Alp Toker alp at nuanti.com
Thu Jun 19 01:44:12 PDT 2014


On 19/06/2014 10:58, James Molloy wrote:
>
> Hi,
>
> The ability to use vector initializer lists is a GNU vector extension 
> and is unrelated to the NEON intrinsics in arm_neon.h. On little 
> endian machines it works fine, however on big endian machines it 
> exhibits surprising behaviour:
>
> uint32x2_t x = {42, 64};
>
> return vget_lane_u32(x, 0); // Will return 64.
>
> Because of this, explicitly call out that it is unsupported on big 
> endian machines.
>
> This patch will emit the following warning in big-endian mode:
>
> test.c:3:15: warning: Vector initializers are part of the GNU vector 
> extensions and are not compatible with NEON intrinsics on big endian 
> ARM targets [-Wgnu]
>
> int32x4_t x = {0, 1, 2, 3};
>
> ^
>
> test.c:3:15: note: Consider using vld1q_s32() to initialize a vector 
> from memory, or vcombine_s32(vcreate_s32(), vcreate_s32()) to 
> initialize from integer constants
>
> 1 warning generated.
>
> It’s fairly simple, is it OK to commit?
>

Hi James,

Would it be a big step to generate FixIts instead of describing the 
possible fixes in words?

I think as a rule of thumb, if it's worth describing code changes in 
diagnostics, it's worth attempting a FixIt.

Alp.


> Cheers,
>
> James
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list