> -----Original Message-----
> From: Andrea Corallo <andrea.cora...@arm.com>
> Sent: Thursday, November 17, 2022 4:38 PM
> To: gcc-patches@gcc.gnu.org
> Cc: Kyrylo Tkachov <kyrylo.tkac...@arm.com>; Richard Earnshaw
> <richard.earns...@arm.com>; Andrea Corallo <andrea.cora...@arm.com>
> Subject: [PATCH 21/35] arm: improve tests for vhaddq_m*
> 
> gcc/testsuite/ChangeLog:
> 
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_s16.c: Improve test.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_n_u8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_s16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_m_u8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_s16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_n_u8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_s16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_u8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_s16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_n_u8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_s16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_s32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_s8.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_u16.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_u32.c: Likewise.
>       * gcc.target/arm/mve/intrinsics/vhaddq_x_u8.c: Likewise.

Ok.
Thanks,
Kyrill

> ---
>  .../arm/mve/intrinsics/vhaddq_m_n_s16.c       | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_n_s32.c       | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_n_s8.c        | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_n_u16.c       | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_n_u32.c       | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_n_u8.c        | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_s16.c         | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_s32.c         | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_s8.c          | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_u16.c         | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_u32.c         | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_m_u8.c          | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_n_s16.c         | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_n_s32.c         | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_n_s8.c          | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_n_u16.c         | 28 ++++++++++++-
>  .../arm/mve/intrinsics/vhaddq_n_u32.c         | 28 ++++++++++++-
>  .../arm/mve/intrinsics/vhaddq_n_u8.c          | 28 ++++++++++++-
>  .../arm/mve/intrinsics/vhaddq_s16.c           | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_s32.c           | 16 ++++++-
>  .../gcc.target/arm/mve/intrinsics/vhaddq_s8.c | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_u16.c           | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_u32.c           | 16 ++++++-
>  .../gcc.target/arm/mve/intrinsics/vhaddq_u8.c | 16 ++++++-
>  .../arm/mve/intrinsics/vhaddq_x_n_s16.c       | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_n_s32.c       | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_n_s8.c        | 26 ++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_n_u16.c       | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_n_u32.c       | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_n_u8.c        | 42 +++++++++++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_s16.c         | 25 +++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_s32.c         | 25 +++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_s8.c          | 25 +++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_u16.c         | 25 +++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_u32.c         | 25 +++++++++--
>  .../arm/mve/intrinsics/vhaddq_x_u8.c          | 25 +++++++++--
>  36 files changed, 828 insertions(+), 114 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s16.c
> index e90af963697..0bd03832ff5 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s16.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t inactive, int16x8_t a, int16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_s16 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t inactive, int16x8_t a, int16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s32.c
> index fcce85fd1bd..42fe35dc746 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s32.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t inactive, int32x4_t a, int32_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_s32 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t inactive, int32x4_t a, int32_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s8.c
> index 56558b7033a..1f4a4016c74 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_s8.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t inactive, int8x16_t a, int8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_s8 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t inactive, int8x16_t a, int8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u16.c
> index d7ee0febab9..7d7ebebd638 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u16.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t inactive, uint16x8_t a, uint16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_u16 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t inactive, uint16x8_t a, uint16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint16x8_t
> +foo2 (uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
> +{
> +  return vhaddq_m (inactive, a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u32.c
> index 1117b9813ce..31f7ee2fa54 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u32.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t inactive, uint32x4_t a, uint32_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_u32 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t inactive, uint32x4_t a, uint32_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint32x4_t
> +foo2 (uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
> +{
> +  return vhaddq_m (inactive, a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u8.c
> index 90c66595d3f..2120472af46 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_n_u8.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t inactive, uint8x16_t a, uint8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_n_u8 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t inactive, uint8x16_t a, uint8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint8x16_t
> +foo2 (uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
> +{
> +  return vhaddq_m (inactive, a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s16.c
> index e8b87283a73..4b4ce40efb8 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s16.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_s16 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s32.c
> index ddcfd11198e..e532055c675 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s32.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_s32 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t inactive, int32x4_t a, int32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s8.c
> index ef5fcd02cc5..25b81629ec3 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_s8.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_s8 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u16.c
> index d7b9aaab62c..4a9e9f3f438 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u16.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_u16 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u32.c
> index c8d7f6c4cf3..1e68099ebf2 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u32.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t inactive, uint32x4_t a, uint32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_u32 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t inactive, uint32x4_t a, uint32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u8.c
> index 9792941b091..6dd75d7336e 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_m_u8.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m_u8 (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t inactive, uint8x16_t a, uint8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_m (inactive, a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s16.c
> index d0d77f5a7fd..20a999da1d2 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s16.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s16       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t a, int16_t b)
>  {
>    return vhaddq_n_s16 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s16       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t a, int16_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s32.c
> index a8b4f3415a1..986cb8d3ba5 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s32.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s32       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t a, int32_t b)
>  {
>    return vhaddq_n_s32 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s32       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t a, int32_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s8.c
> index 2459ba0a7ab..57a4b36f5fe 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_s8.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s8        q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t a, int8_t b)
>  {
>    return vhaddq_n_s8 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s8        q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t a, int8_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u16.c
> index cd681e7a5f9..abed33b0e37 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u16.c
> @@ -1,21 +1,45 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u16       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t a, uint16_t b)
>  {
>    return vhaddq_n_u16 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u16       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t a, uint16_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u16"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vhadd.u16       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint16x8_t
> +foo2 (uint16x8_t a)
> +{
> +  return vhaddq (a, 1);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u32.c
> index d2cb7f6284e..5e5204fb3a7 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u32.c
> @@ -1,21 +1,45 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u32       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t a, uint32_t b)
>  {
>    return vhaddq_n_u32 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u32       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t a, uint32_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u32"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vhadd.u32       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint32x4_t
> +foo2 (uint32x4_t a)
> +{
> +  return vhaddq (a, 1);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u8.c
> index 509e1746259..b35221ef81b 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_n_u8.c
> @@ -1,21 +1,45 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u8        q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t a, uint8_t b)
>  {
>    return vhaddq_n_u8 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u8        q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t a, uint8_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u8"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vhadd.u8        q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint8x16_t
> +foo2 (uint8x16_t a)
> +{
> +  return vhaddq (a, 1);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s16.c
> index 47afc591cdb..310964f3440 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s16.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s16       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t a, int16x8_t b)
>  {
>    return vhaddq_s16 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s16       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t a, int16x8_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s32.c
> index fdc6476d0ee..d8222645c21 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s32.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s32       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t a, int32x4_t b)
>  {
>    return vhaddq_s32 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s32       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t a, int32x4_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s8.c
> index 3321765e909..85b2feee346 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_s8.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.s8        q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t a, int8x16_t b)
>  {
>    return vhaddq_s8 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.s8        q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t a, int8x16_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.s8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u16.c
> index ad46355feab..2da0aa053e5 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u16.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u16       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t a, uint16x8_t b)
>  {
>    return vhaddq_u16 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u16       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t a, uint16x8_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u32.c
> index 7477585fe55..49b865a123b 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u32.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u32       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t a, uint32x4_t b)
>  {
>    return vhaddq_u32 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u32       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t a, uint32x4_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u8.c
> index 9edf8e5eb90..5ecd3cbf6ec 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_u8.c
> @@ -1,21 +1,33 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vhadd.u8        q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t a, uint8x16_t b)
>  {
>    return vhaddq_u8 (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vhadd.u8        q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t a, uint8x16_t b)
>  {
>    return vhaddq (a, b);
>  }
> 
> -/* { dg-final { scan-assembler "vhadd.u8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s16.c
> index 5a9302129c7..a4e277d4e1f 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s16.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t a, int16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_s16 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t a, int16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s32.c
> index 0a4ef00afa1..c79b88d6ced 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s32.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t a, int32_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_s32 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t a, int32_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s8.c
> index ae6c27a8878..61893536231 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_s8.c
> @@ -1,23 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t a, int8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_s8 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t a, int8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u16.c
> index ddc99a82f79..146d226f36f 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u16.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t a, uint16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_u16 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t a, uint16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint16x8_t
> +foo2 (uint16x8_t a, mve_pred16_t p)
> +{
> +  return vhaddq_x (a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u32.c
> index dce9bc212e2..b70014fb6a5 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u32.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t a, uint32_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_u32 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t a, uint32_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint32x4_t
> +foo2 (uint32x4_t a, mve_pred16_t p)
> +{
> +  return vhaddq_x (a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u8.c
> index 262c5937a91..03978dfa28a 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_n_u8.c
> @@ -1,23 +1,57 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t a, uint8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_n_u8 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t a, uint8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> +/*
> +**foo2:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, (?:ip|fp|r[0-9]+)(?:  @.*|)
> +**   ...
> +*/
> +uint8x16_t
> +foo2 (uint8x16_t a, mve_pred16_t p)
> +{
> +  return vhaddq_x (a, 1, p);
> +}
> +
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s16.c
> index 65df0093401..c3c787583dd 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s16.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo (int16x8_t a, int16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_s16 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int16x8_t
>  foo1 (int16x8_t a, int16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s32.c
> index 7ff76e7170a..a1ab196d3d2 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s32.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo (int32x4_t a, int32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_s32 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int32x4_t
>  foo1 (int32x4_t a, int32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s8.c
> index 23f545c45cd..061ae89315e 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_s8.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo (int8x16_t a, int8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_s8 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.s8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.s8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  int8x16_t
>  foo1 (int8x16_t a, int8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u16.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u16.c
> index 97674c1f73c..0ee88520f8f 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u16.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u16.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo (uint16x8_t a, uint16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_u16 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u16"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u16      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint16x8_t
>  foo1 (uint16x8_t a, uint16x8_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u32.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u32.c
> index b6404ce9d17..0a0e512c5fc 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u32.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u32.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo (uint32x4_t a, uint32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_u32 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u32"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u32      q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint32x4_t
>  foo1 (uint32x4_t a, uint32x4_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u8.c
> b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u8.c
> index 7c2d74a2662..c495641c532 100644
> --- a/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u8.c
> +++ b/gcc/testsuite/gcc.target/arm/mve/intrinsics/vhaddq_x_u8.c
> @@ -1,22 +1,41 @@
>  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
>  /* { dg-add-options arm_v8_1m_mve } */
>  /* { dg-additional-options "-O2" } */
> +/* { dg-final { check-function-bodies "**" "" } } */
> 
>  #include "arm_mve.h"
> 
> +/*
> +**foo:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo (uint8x16_t a, uint8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x_u8 (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> -/* { dg-final { scan-assembler "vhaddt.u8"  }  } */
> 
> +/*
> +**foo1:
> +**   ...
> +**   vmsr    p0, (?:ip|fp|r[0-9]+)(?:        @.*|)
> +**   ...
> +**   vpst(?: @.*|)
> +**   ...
> +**   vhaddt.u8       q[0-9]+, q[0-9]+, q[0-9]+(?:    @.*|)
> +**   ...
> +*/
>  uint8x16_t
>  foo1 (uint8x16_t a, uint8x16_t b, mve_pred16_t p)
>  {
>    return vhaddq_x (a, b, p);
>  }
> 
> -/* { dg-final { scan-assembler "vpst" } } */
> +/* { dg-final { scan-assembler-not "__ARM_undef" } } */
> \ No newline at end of file
> --
> 2.25.1

Reply via email to