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

Renato Golin renato.golin at linaro.org
Thu Jun 19 02:02:44 PDT 2014


Hi James,

The idea is sound and the code looks correct, but I don't know if
that's the best place. I'll let Clang devs to comment on that.

cheers,
--renato

On 19 June 2014 08:58, James Molloy <james.molloy at arm.com> 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?
>
>
>
> Cheers,
>
>
>
> James
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list