From d19eb6206237cc0627687a33a387c883a5139566 Mon Sep 17 00:00:00 2001 From: Julian Brown Date: Thu, 5 May 2011 15:41:25 +0000 Subject: [PATCH] neon.md (vec_set_internal): Fix misplaced parenthesis in D-register case. gcc/ * config/arm/neon.md (vec_set_internal): Fix misplaced parenthesis in D-register case. gcc/testsuite/ * gcc.target/arm/neon-vset_lanes8.c: New test. From-SVN: r173435 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/neon.md | 2 +- gcc/testsuite/ChangeLog | 4 ++++ .../gcc.target/arm/neon-vset_lanes8.c | 21 +++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f304ecc2b3..a2094b0c5d6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-05-05 Julian Brown + + * config/arm/neon.md (vec_set_internal): Fix misplaced + parenthesis in D-register case. + 2011-05-05 Joseph Myers * opt-functions.awk (var_type_struct): Handle Enum options. diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 7d3d285e147..cffd5243442 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -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) - 1 - elt; operands[2] = GEN_INT (elt); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 15e40388217..b17dceed78e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-05-05 Julian Brown + + * gcc.target/arm/neon-vset_lanes8.c: New test. + 2011-05-05 Jason Merrill * g++.dg/init/new32.C: New. diff --git a/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c b/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c new file mode 100644 index 00000000000..e87102edbe2 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c @@ -0,0 +1,21 @@ +/* Test the `vset_lane_s8' ARM Neon intrinsic. */ + +/* { dg-do run } */ +/* { dg-require-effective-target arm_neon_hw } */ +/* { dg-options "-O0" } */ +/* { dg-add-options arm_neon } */ + +#include "arm_neon.h" +#include +#include + +int8x8_t x = { 1, 2, 3, 4, 5, 6, 7, 8 }; +int8x8_t y = { 1, 2, 3, 16, 5, 6, 7, 8 }; + +int main (void) +{ + x = vset_lane_s8 (16, x, 3); + if (memcmp (&x, &y, sizeof (x)) != 0) + abort(); + return 0; +} -- 2.30.2