Patchwork [ARM] Fix NEON vset_lane for D registers

login
register
mail settings
Submitter Julian Brown
Date May 3, 2011, 12:49 p.m.
Message ID <20110503134936.0ecc6f81@rex.config>
Download mbox | patch
Permalink /patch/93783/
State New
Headers show

Comments

Julian Brown - May 3, 2011, 12:49 p.m.
Hi,

This patch fixes vset_lane intrinsic variants for D-register sized
variables. A typo meant that the wrong lane would be set in many
circumstances.

Tested manually only. OK to apply?

Thanks,

Julian

ChangeLog

    gcc/
    * config/arm/neon.md (vec_set<mode>_internal): Fix misplaced
    parenthesis in D-register case.
Ramana Radhakrishnan - May 3, 2011, 1:58 p.m.
On 03/05/11 13:49, Julian Brown wrote:
> Hi,
>
> This patch fixes vset_lane intrinsic variants for D-register sized
> variables. A typo meant that the wrong lane would be set in many
> circumstances.
>
> Tested manually only. OK to apply?

Ok - yes this looks almost obvious but please do a sanity regression run.

Thanks,
Ramana
Richard Earnshaw - May 3, 2011, 2:49 p.m.
On Tue, 2011-05-03 at 13:49 +0100, Julian Brown wrote:
> Hi,
> 
> This patch fixes vset_lane intrinsic variants for D-register sized
> variables. A typo meant that the wrong lane would be set in many
> circumstances.
> 
> Tested manually only. OK to apply?
> 
> Thanks,
> 
> Julian
> 
> ChangeLog
> 
>     gcc/
>     * config/arm/neon.md (vec_set<mode>_internal): Fix misplaced
>     parenthesis in D-register case.

Presumably this is a silent 'wrong-code' bug.  If so, what about
released compilers?

R.
Joseph S. Myers - May 3, 2011, 3:18 p.m.
On Tue, 3 May 2011, Richard Earnshaw wrote:

> >     gcc/
> >     * config/arm/neon.md (vec_set<mode>_internal): Fix misplaced
> >     parenthesis in D-register case.
> 
> Presumably this is a silent 'wrong-code' bug.  If so, what about
> released compilers?

And what about an execution testcase that fails before and passes after 
the patch?  Is it hard to add one for some reason?

Patch

Index: gcc/config/arm/neon.md
===================================================================
--- gcc/config/arm/neon.md	(revision 173299)
+++ gcc/config/arm/neon.md	(working copy)
@@ -426,7 +426,7 @@ 
           (match_operand:SI 2 "immediate_operand" "i")))]
   "TARGET_NEON"
 {
-  int elt = ffs ((int) INTVAL (operands[2]) - 1);
+  int elt = ffs ((int) INTVAL (operands[2])) - 1;
   if (BYTES_BIG_ENDIAN)
     elt = GET_MODE_NUNITS (<MODE>mode) - 1 - elt;
   operands[2] = GEN_INT (elt);