diff mbox

[ARM] Fix NEON vset_lane for D registers

Message ID 20110503134936.0ecc6f81@rex.config
State New
Headers show

Commit Message

Julian Brown May 3, 2011, 12:49 p.m. UTC
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.

Comments

Ramana Radhakrishnan May 3, 2011, 1:58 p.m. UTC | #1
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. UTC | #2
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 Myers May 3, 2011, 3:18 p.m. UTC | #3
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?
diff mbox

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);