https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65770

            Bug ID: 65770
           Summary: [AArch64] vst2_lane broken on bigendian
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alalaw01 at gcc dot gnu.org
            Target: aarch64_be

Testcase:

void
test_vst2_lane_s32 (int32x2x2_t vals)
{
  int32_t buf[2];
  vst2_lane_s32 (buf, vals, 0);
  for (int i = 0; i < 2; i++)
    if (buf[i] != vget_lane_s32 (vals.val[i], 0))
      abort();
}

int
main (int argc, char **argv)
{
  int32_t load[4] = { 11, 12, 21, 22 };
  test_vst2_lane_s32 (vld2_s32 (load));
}

Passes on aarch64-none-elf, but fails on aarch64_be-none-elf: the generated
assembly, contains

st2     {v0.s - v1.s}[3], [x1]

Which (1) has flipped endianness, and (2) has flipped endianness relative to a
Q register (int32x4_t) not a D register (int32x2_t).

A similar testcase for int32x4x2_t, also flips endianness, although at least
relative to the right vector length ;).

Reply via email to