ARM neon vld1q_lane_u8 & co. don't accept lanes >= 8

Bug #710652 reported by Richard Sandiford
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Low
Richard Sandiford
Linaro GCC Tracking
Fix Released
Undecided
Richard Sandiford
gcc
Fix Released
Medium
gcc-4.5 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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.

Tags: 46merge

Related branches

Revision history for this message
In , Richard Sandiford (rsandifo) wrote :

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.

Changed in gcc-linaro:
assignee: nobody → Richard Sandiford (rsandifo)
status: New → In Progress
Michael Hope (michaelh1)
Changed in gcc-linaro:
importance: Undecided → Low
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

Richard's patch has been committed to both Linaro GCC 4.5 and 4.6.

Changed in gcc-linaro:
milestone: none → 4.5-2011.03-0
status: In Progress → Fix Committed
Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

This patch needs to go upstream.

Related: lp:gcc-linaro/4.5,revno=99481
Related: lp:gcc-linaro/4.6,revno=106724

Changed in gcc-linaro-tracking:
assignee: nobody → Richard Sandiford (rsandifo)
milestone: none → 4.7.0
status: New → In Progress
Changed in gcc:
importance: Unknown → Medium
status: Unknown → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.5 - 4.5.2-5ubuntu1

---------------
gcc-4.5 (4.5.2-5ubuntu1) natty; urgency=low

  * For the natty release, do not pass --as-needed by default to the linker.
    The --as-needed flag will be default again for the o-series.

gcc-4.5 (4.5.2-5) unstable; urgency=low

  * Update to SVN 20110305 (r170696) from the gcc-4_5-branch.
    - Fix PR target/43810, PR fortran/47886, PR tree-optimization/47615,
      PR middle-end/47639, PR tree-optimization/47890, PR libfortran/47830,
      PR tree-optimization/46723, PR target/45261, PR target/45808,
      PR c++/46159, PR c++/47904, PR fortran/47886, PR libstdc++/47433,
      PR target/42240, PR fortran/47878, PR libfortran/47694.
  * Update the Linaro support to the 4.5-2011.03-0 release.
    - Fix LP: #705689, LP: #695302, LP: #710652, LP: #710623, LP: #721021,
      LP: #721021, LP: #709453.

gcc-4.5 (4.5.2-4) unstable; urgency=low

  * Update to SVN 20110222 (r170382) from the gcc-4_5-branch.
    - Fix PR target/43653, PR fortran/47775, PR target/47840,
      PR libfortran/47830.

  [ Matthias Klose ]
  * Don't apply a patch twice.
  * Build libgcc_s with -fno-stack-protector, when not building from the
    Linaro branch.
  * Backport proposed fix for PR tree-optimization/46723 from the trunk.

  [ Steve Langasek ]
  * debian/control.m4: add missing Multi-Arch: same for libgcc4; make sure
    Multi-Arch: same doesn't get set for libmudflap when building an
    Architecture: all cross-compiler package.
  * debian/rules2: use $libdir for libiberty.a.
  * debian/patches/gcc-multiarch-*.diff: make sure we're using the same
    set_multiarch_path definition for all variants.

  [ Sebastian Andrzej Siewior ]
  * PR target/44364
  * Remove -many on powerpcspe (__SPE__)
  * Remove classic FPU opcodes from libgcc if target has no support for them
    (powerpcspe)
 -- Matthias Klose <email address hidden> Sun, 06 Mar 2011 12:22:47 +0100

Changed in gcc-4.5 (Ubuntu):
status: New → Fix Released
Michael Hope (michaelh1)
Changed in gcc-linaro:
status: Fix Committed → Fix Released
Revision history for this message
In , Rsandifo-gcc (rsandifo-gcc) wrote :

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

Revision history for this message
In , Rsandifo-gcc (rsandifo-gcc) wrote :

Fixed on trunk. Will backport to 4.6.1 and 4.5 once 4.6.0 is released.

Revision history for this message
In , Rsandifo-gcc (rsandifo-gcc) wrote :

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

Revision history for this message
In , Rsandifo-gcc (rsandifo-gcc) wrote :

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

Revision history for this message
In , Rsandifo-gcc (rsandifo-gcc) wrote :

Fixed in 4.5, 4.6 and trunk.

Changed in gcc-linaro-tracking:
status: In Progress → Fix Released
Changed in gcc:
status: In Progress → Fix Released
tags: added: 46merge
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.