Bug 65770 - [AArch64] vst2_lane broken on bigendian
Summary: [AArch64] vst2_lane broken on bigendian
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Alan Lawrence
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2015-04-15 10:52 UTC by Alan Lawrence
Modified: 2016-01-11 10:36 UTC (History)
0 users

See Also:
Host:
Target: aarch64_be
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Lawrence 2015-04-15 10:52:40 UTC
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 ;).
Comment 1 James Greenhalgh 2016-01-11 10:34:45 UTC
Looks to be fixed.
Comment 2 James Greenhalgh 2016-01-11 10:36:16 UTC
r222582 for reference.