Bug 47553 - ARM neon vld1q_lane_u8 & co. don't accept lanes >= 8
Summary: ARM neon vld1q_lane_u8 & co. don't accept lanes >= 8
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: rsandifo@gcc.gnu.org
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-31 13:18 UTC by Richard Sandiford (Linaro)
Modified: 2011-03-28 10:49 UTC (History)
2 users (show)

See Also:
Host:
Target: arm
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-02-02 09:18:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Sandiford (Linaro) 2011-01-31 13:18:33 UTC
The testcase:

#include <arm_neon.h>

uint8x16_t
foo (uint8_t *a, uint8x16_t b)
{
  vst1q_lane_u8 (a, b, 14);
  return vld1q_lane_u8 (a + 0x100, b, 15);
}

fails with:

error: argument must be a constant

The v{ld,st}1q_lane_{u,s,p}8 intrinsic functions are supposed to take a range between 0 and 15.  The function is then converted to a vld1 or vst1 of one half of the quad value.  The problem is that the lane predicate doesn't account for this, and only accepts the 0..7 range that are supported by vld1 and vst1.

The error could be a bit friendlier too; maybe "argument out of range" or something.  That's a problem in a separate piece of code though, so I'm not treating it as part of this bug.
Comment 1 rsandifo@gcc.gnu.org 2011-03-23 09:57:50 UTC
Author: rsandifo
Date: Wed Mar 23 09:57:26 2011
New Revision: 171344

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171344
Log:
gcc/
	PR target/47553
	* config/arm/predicates.md (neon_lane_number): Accept 0..15.

gcc/testsuite/
	PR target/47553
	* gcc.target/arm/neon-vld-1.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/arm/neon-vld-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/predicates.md
    trunk/gcc/testsuite/ChangeLog
Comment 2 rsandifo@gcc.gnu.org 2011-03-23 10:17:13 UTC
Fixed on trunk.  Will backport to 4.6.1 and 4.5 once 4.6.0 is released.
Comment 3 rsandifo@gcc.gnu.org 2011-03-28 10:23:03 UTC
Author: rsandifo
Date: Mon Mar 28 10:22:57 2011
New Revision: 171596

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171596
Log:
gcc/
	PR target/47553
	* config/arm/predicates.md (neon_lane_number): Accept 0..15.

gcc/testsuite/
	PR target/47553
	* gcc.target/arm/neon-vld-1.c: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.target/arm/neon-vld-1.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/arm/predicates.md
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 4 rsandifo@gcc.gnu.org 2011-03-28 10:32:12 UTC
Author: rsandifo
Date: Mon Mar 28 10:32:09 2011
New Revision: 171597

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171597
Log:
gcc/
	PR target/47553
	* config/arm/predicates.md (neon_lane_number): Accept 0..15.

gcc/testsuite/
	PR target/47553
	* gcc.target/arm/neon-vld-1.c: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.target/arm/neon-vld-1.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/arm/predicates.md
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Comment 5 rsandifo@gcc.gnu.org 2011-03-28 10:49:10 UTC
Fixed in 4.5, 4.6 and trunk.