]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Prevent simd tests from being optimised away
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Jan 2023 17:04:28 +0000 (17:04 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 27 Jan 2023 17:04:28 +0000 (17:04 +0000)
The vqdml[as]l[hs]_laneq_* tests were folded at compile time, meaning
that we didn't have any Advanced SIMD instructions in the assembly.
Kyrill's preference was to use wrapper functions, so this patch does
that for the failing tests and for others that had scan-assemblers
with inline intrinsics calls.  (There were some tests that already
used wrapper functions, some that used volatile, some that used
inline asm barriers, and some that had no separation.)

Doing that for vqdmulhs_lane_s32.c meant that we generated the scalar
form of the instruction, rather than a vector instruction operating
on lane 0.  That seems fair enough, so the patch keeps that test but
adds a second one for lane 1.

gcc/testsuite/
* gcc.target/aarch64/simd/vfma_f64.c: Use a wrapper function
rather than an asm barrier.
* gcc.target/aarch64/simd/vfms_f64.c: Likewise.
* gcc.target/aarch64/simd/vmul_f64_1.c: Use a wrapper function
rather than volatile.
* gcc.target/aarch64/simd/vmul_n_f64_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlalh_laneq_s16_1.c: Use a wrapper
function.  Remove -fno-inline.
* gcc.target/aarch64/simd/vqdmlals_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlslh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmlsls_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhh_lane_s16.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhs_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhh_lane_s16.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhh_laneq_s16_1.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhs_lane_s32.c: Likewise.
* gcc.target/aarch64/simd/vqrdmulhs_laneq_s32_1.c: Likewise.
* gcc.target/aarch64/simd/vqdmulhs_lane_s32.c: Likewise.
Allow the scalar form to be used when operating on lane 0.
Add a test for lane 1.

16 files changed:
gcc/testsuite/gcc.target/aarch64/simd/vfma_f64.c
gcc/testsuite/gcc.target/aarch64/simd/vfms_f64.c
gcc/testsuite/gcc.target/aarch64/simd/vmul_f64_1.c
gcc/testsuite/gcc.target/aarch64/simd/vmul_n_f64_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmlalh_laneq_s16_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmlals_laneq_s32_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmlslh_laneq_s16_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmlsls_laneq_s32_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmulhh_lane_s16.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmulhh_laneq_s16_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmulhs_lane_s32.c
gcc/testsuite/gcc.target/aarch64/simd/vqdmulhs_laneq_s32_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqrdmulhh_lane_s16.c
gcc/testsuite/gcc.target/aarch64/simd/vqrdmulhh_laneq_s16_1.c
gcc/testsuite/gcc.target/aarch64/simd/vqrdmulhs_lane_s32.c
gcc/testsuite/gcc.target/aarch64/simd/vqrdmulhs_laneq_s32_1.c

index ef414f1b2fc2b37770567df853cb096aeefd015b..467c740ea12457699a9ff5fd0aae37ee85597b83 100644 (file)
@@ -7,33 +7,24 @@
 
 #define EPS 1.0e-15
 
-#define INHIB_OPT(x) asm volatile ("mov %d0, %1.d[0]"  \
-                                  : "=w"(x)            \
-                                  : "w"(x)             \
-                                  : /* No clobbers. */);
-
 extern void abort (void);
 
+float64_t __attribute__((noipa))
+test_vfma (float64x1_t arg1, float64x1_t arg2, float64x1_t arg3)
+{
+  return vget_lane_f64 (vfma_f64 (arg1, arg2, arg3), 0);
+}
+
 int
 main (void)
 {
-  float64x1_t arg1;
-  float64x1_t arg2;
-  float64x1_t arg3;
-
   float64_t expected;
   float64_t actual;
 
-  arg1 = vcreate_f64 (0x3fe3955382d35b0eULL);
-  arg2 = vcreate_f64 (0x3fa88480812d6670ULL);
-  arg3 = vcreate_f64 (0x3fd5791ae2a92572ULL);
-
-  INHIB_OPT (arg1);
-  INHIB_OPT (arg2);
-  INHIB_OPT (arg3);
-
   expected = 0.6280448184360076;
-  actual = vget_lane_f64 (vfma_f64 (arg1, arg2, arg3), 0);
+  actual = test_vfma (vcreate_f64 (0x3fe3955382d35b0eULL),
+                     vcreate_f64 (0x3fa88480812d6670ULL),
+                     vcreate_f64 (0x3fd5791ae2a92572ULL));
 
   if (__builtin_fabs (expected - actual) > EPS)
     abort ();
index afbb8a892c6aa9c671782c9592f8221797839971..af6ca6ff11e66a3bdf64366be60303a27d91b924 100644 (file)
@@ -7,33 +7,24 @@
 
 #define EPS 1.0e-15
 
-#define INHIB_OPT(x) asm volatile ("mov %d0, %1.d[0]"   \
-                                   : "=w"(x)           \
-                                   : "w"(x)            \
-                                   : /* No clobbers. */);
-
 extern void abort (void);
 
+float64_t __attribute__((noipa))
+test_vfms (float64x1_t arg1, float64x1_t arg2, float64x1_t arg3)
+{
+  return vget_lane_f64 (vfms_f64 (arg1, arg2, arg3), 0);
+}
+
 int
 main (void)
 {
-  float64x1_t arg1;
-  float64x1_t arg2;
-  float64x1_t arg3;
-
   float64_t expected;
   float64_t actual;
 
-  arg1 = vcreate_f64 (0x3fe730af8db9e6f7ULL);
-  arg2 = vcreate_f64 (0x3fe6b78680fa29ceULL);
-  arg3 = vcreate_f64 (0x3feea3cbf921fbe0ULL);
-
-  INHIB_OPT (arg1);
-  INHIB_OPT (arg2);
-  INHIB_OPT (arg3);
-
   expected = 4.4964705746355915e-2;
-  actual = vget_lane_f64 (vfms_f64 (arg1, arg2, arg3), 0);
+  actual = test_vfms (vcreate_f64 (0x3fe730af8db9e6f7ULL),
+                     vcreate_f64 (0x3fe6b78680fa29ceULL),
+                     vcreate_f64 (0x3feea3cbf921fbe0ULL));
 
   if (__builtin_fabs (expected - actual) > EPS)
     abort ();
index c855c8cdbf45d6c619b2409629f444367fe293ef..dfa808cb9c2659c788748ebcf7e145cf1a2fd4b6 100644 (file)
@@ -7,19 +7,23 @@
 
 extern void abort (void);
 
+float64_t __attribute__((noipa))
+test_vmul (float64x1_t arg1, float64x1_t arg2)
+{
+  return vget_lane_f64 (vmul_f64 (arg1, arg2), 0);
+}
+
 int
 main (void)
 {
-  volatile float64_t minus_e, pi;
+  float64_t minus_e, pi;
   float64_t expected, actual;
 
   pi = 3.14159265359;
   minus_e = -2.71828;
 
   expected = pi * minus_e;
-
-  actual = vget_lane_f64 (vmul_f64 ((float64x1_t) { pi },
-                                    (float64x1_t) { minus_e }), 0);
+  actual = test_vmul ((float64x1_t) { pi }, (float64x1_t) { minus_e });
   if (expected != actual)
     abort ();
 
index f8f3cd2ed91d1a8a58fd8c2ec82777d178bd2913..91c12bc9c82a75a5ddef4cdfafd7deb30fd6cd90 100644 (file)
@@ -7,19 +7,23 @@
 
 extern void abort (void);
 
+float64_t __attribute__((noipa))
+test_vmul (float64x1_t arg1, float64_t arg2)
+{
+  return vget_lane_f64 (vmul_n_f64 (arg1, arg2), 0);
+}
+
 int
 main (void)
 {
-  volatile float64_t minus_e, pi;
+  float64_t minus_e, pi;
   float64_t expected, actual;
 
   pi = 3.14159265359;
   minus_e = -2.71828;
 
   expected = pi * minus_e;
-
-  actual = vget_lane_f64 (vmul_n_f64 ((float64x1_t) { pi },
-                                       minus_e), 0);
+  actual = test_vmul ((float64x1_t) { pi }, minus_e);
   if (expected != actual)
     abort ();
 
index 9a9bd0dcf0536e7b4d9b39d19919335f4d28b648..aa6b89aaa5bde3df34394f4877acd4f3f31762c2 100644 (file)
@@ -1,27 +1,27 @@
 /* Test the vqdmlalh_laneq_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqdmlalh (int32_t arg1, int16_t arg2, int16x8_t arg3)
+{
+  return vqdmlalh_laneq_s16 (arg1, arg2, arg3, 7);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int16_t arg2;
-  int16x8_t arg3;
   int32_t actual;
   int32_t expected;
 
-  arg1 = 0x80000000;
-  arg2 = -24497;
-  arg3 = vcombine_s16 (vcreate_s16 (0x008a80007fff7fffULL),
-                       vcreate_s16 (0xfffffa797fff8000ULL));
-
-  actual = vqdmlalh_laneq_s16 (arg1, arg2, arg3, 7);
+  actual = test_vqdmlalh (0x80000000, -24497,
+                         vcombine_s16 (vcreate_s16 (0x008a80007fff7fffULL),
+                                       vcreate_s16 (0xfffffa797fff8000ULL)));
   expected = -2147434654;
 
   if (expected != actual)
index 0dbe3392a6a95fce7f598f07c01db81324e963fe..ea39595ae93679c6fa4c0ce37639305c00bd37f3 100644 (file)
@@ -1,27 +1,27 @@
 /* Test the vqdmlals_laneq_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int64_t __attribute__((noipa))
+test_vqdmlals (int64_t arg1, int32_t arg2, int32x4_t arg3)
+{
+  return vqdmlals_laneq_s32 (arg1, arg2, arg3, 3);
+}
+
 int
 main (void)
 {
-  int64_t arg1;
-  int32_t arg2;
-  int32x4_t arg3;
   int64_t actual;
   int64_t expected;
 
-  arg1 = -9223182289494545592LL;
-  arg2 = 32768;
-  arg3 = vcombine_s32 (vcreate_s32 (0xffff7fff8000ffffULL),
-                       vcreate_s32 (0x80000000ffff0000ULL));
-
-  actual = vqdmlals_laneq_s32 (arg1, arg2, arg3, 3);
+  actual = test_vqdmlals (-9223182289494545592LL, 32768,
+                         vcombine_s32 (vcreate_s32 (0xffff7fff8000ffffULL),
+                                       vcreate_s32 (0x80000000ffff0000ULL)));
   expected = -9223323026982900920LL;
 
   if (expected != actual)
index 2763e06127ff14d82dc41ec4a10b7d2468ecfe0c..0f1babca38d2865c6bac3c1b2f18b59c0b6a99a8 100644 (file)
@@ -1,27 +1,27 @@
 /* Test the vqdmlslh_laneq_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqdmlslh (int32_t arg1, int16_t arg2, int16x8_t arg3)
+{
+  return vqdmlslh_laneq_s16 (arg1, arg2, arg3, 4);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int16_t arg2;
-  int16x8_t arg3;
   int32_t actual;
   int32_t expected;
 
-  arg1 = -2147450881;
-  arg2 = 32767;
-  arg3 = vcombine_s16 (vcreate_s16 (0x359d7fff00007fffULL),
-                       vcreate_s16 (0xe678ffff00008000ULL));
-
-  actual = vqdmlslh_laneq_s16 (arg1, arg2, arg3, 4);
+  actual = test_vqdmlslh (-2147450881, 32767,
+                         vcombine_s16 (vcreate_s16 (0x359d7fff00007fffULL),
+                                       vcreate_s16 (0xe678ffff00008000ULL)));
   expected = -32769;
 
   if (expected != actual)
index e003adb7c9e0a15ffac3f5e0b06fc07c99beb9c1..ff922541f1a7a60227f9e416477d512280938242 100644 (file)
@@ -1,28 +1,27 @@
 /* Test the vqdmlsls_laneq_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int64_t __attribute__((noipa))
+test_vqdmlsls (int64_t arg1, int32_t arg2, int32x4_t arg3)
+{
+  return vqdmlsls_laneq_s32 (arg1, arg2, arg3, 3);
+}
+
 int
 main (void)
 {
-  int64_t arg1;
-  int32_t arg2;
-  int32x4_t arg3;
   int64_t actual;
   int64_t expected;
 
-  arg1 = 140733193453567LL;
-  arg2 = 25544;
-  arg3 = vcombine_s32 (vcreate_s32 (0x417b8000ffff8397LL),
-                       vcreate_s32 (0x7fffffff58488000LL));
-
-
-  actual = vqdmlsls_laneq_s32 (arg1, arg2, arg3, 3);
+  actual = test_vqdmlsls (140733193453567LL, 25544,
+                         vcombine_s32 (vcreate_s32 (0x417b8000ffff8397LL),
+                                       vcreate_s32 (0x7fffffff58488000LL)));
   expected = 31022548895631LL;
 
   if (expected != actual)
index 75f67702493943be94fbdd89deed9ed28ede04e9..12b79715b298d960311127ae738ed61a915d7e58 100644 (file)
@@ -1,25 +1,26 @@
 /* Test the vqdmulhh_lane_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 #include <stdio.h>
 
 extern void abort (void);
 
+int16_t __attribute__((noipa))
+test_vqdmulhh (int16_t arg1, int16x4_t arg2)
+{
+  return vqdmulhh_lane_s16 (arg1, arg2, 2);
+}
+
 int
 main (void)
 {
-  int16_t arg1;
-  int16x4_t arg2;
-  int16_t result;
   int16_t actual;
   int16_t expected;
 
-  arg1 = -32768;
-  arg2 = vcreate_s16 (0x0000ffff2489e398ULL);
-  actual = vqdmulhh_lane_s16 (arg1, arg2, 2);
+  actual = test_vqdmulhh (-32768, vcreate_s16 (0x0000ffff2489e398ULL));
   expected = 1;
 
   if (expected != actual)
index b3ae37c67bd7b109dc954f85c009711a54fc6211..1015c6878ed6a3c439889712908de45b49cb0d1b 100644 (file)
@@ -1,25 +1,27 @@
 /* Test the vqdmulhh_laneq_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int16_t __attribute__((noipa))
+test_vqdmulhh (int16_t arg1, int16x8_t arg2)
+{
+  return vqdmulhh_laneq_s16 (arg1, arg2, 7);
+}
+
 int
 main (void)
 {
-  int16_t arg1;
-  int16x8_t arg2;
   int16_t actual;
   int16_t expected;
 
-  arg1 = 268;
-  arg2 = vcombine_s16 (vcreate_s16 (0xffffffff00000000ULL),
-                       vcreate_s16 (0x0000800018410000ULL));
-
-  actual = vqdmulhh_laneq_s16 (arg1, arg2, 7);
+  actual = test_vqdmulhh (268,
+                         vcombine_s16 (vcreate_s16 (0xffffffff00000000ULL),
+                                       vcreate_s16 (0x0000800018410000ULL)));
   expected = 0;
 
   if (expected != actual)
index eef3ac0610a76c47ae3b0e07530926aa88d23d72..f3b297ecc460b031aa5d18541cc178aab118e1ae 100644 (file)
@@ -1,27 +1,43 @@
 /* Test the vqdmulhs_lane_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 #include <stdio.h>
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqdmulhs_0 (int32_t arg1, int32x2_t arg2)
+{
+  return vqdmulhs_lane_s32 (arg1, arg2, 0);
+}
+
+int32_t __attribute__((noipa))
+test_vqdmulhs_1 (int32_t arg1, int32x2_t arg2)
+{
+  return vqdmulhs_lane_s32 (arg1, arg2, 1);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int32x2_t arg2;
-  int32_t result;
   int32_t actual;
   int32_t expected;
 
-  arg1 = 57336;
-  arg2 = vcreate_s32 (0x55897fff7fff0000ULL);
-  actual = vqdmulhs_lane_s32 (arg1, arg2, 0);
+  actual = test_vqdmulhs_0 (57336, vcreate_s32 (0x55897fff7fff0000ULL));
   expected = 57334;
 
+  if (expected != actual)
+    {
+      fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual);
+      abort ();
+    }
+
+  actual = test_vqdmulhs_1 (57336, vcreate_s32 (0x55897fff7fff0000ULL));
+  expected = 38315;
+
   if (expected != actual)
     {
       fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual);
@@ -30,4 +46,5 @@ main (void)
 
   return 0;
 }
-/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */
+/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?(?:\[sS\]\[0-9\]+|\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\])\n" 1 } } */
+/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[1\\\]\n" 1 } } */
index 71b260015ecca06cb514a1ab83b8ea58261f14c4..fd63bf9a4e9da9713e04705dbd68643a5a4adf4a 100644 (file)
@@ -1,25 +1,27 @@
 /* Test the vqdmulhs_laneq_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqdmulhs (int32_t arg1, int32x4_t arg2)
+{
+  return vqdmulhs_laneq_s32 (arg1, arg2, 3);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int32x4_t arg2;
   int32_t actual;
   int32_t expected;
 
-  arg1 = 0x80000000;
-  arg2 = vcombine_s32 (vcreate_s32 (0x950dffffc4f40000ULL),
-                       vcreate_s32 (0x7fff8000274a8000ULL));
-
-  actual = vqdmulhs_laneq_s32 (arg1, arg2, 3);
+  actual = test_vqdmulhs (0x80000000,
+                         vcombine_s32 (vcreate_s32 (0x950dffffc4f40000ULL),
+                                       vcreate_s32 (0x7fff8000274a8000ULL)));
   expected = -2147450880;
 
   if (expected != actual)
index aca96d1fd6a1594168590ef854ebadca5a46a6ff..7dddb7550c48c7002de2c8ec1a2bc5babe0bd031 100644 (file)
@@ -1,25 +1,26 @@
 /* Test the vqrdmulhh_lane_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 #include <stdio.h>
 
 extern void abort (void);
 
+int16_t __attribute__((noipa))
+test_vqrdmulhh (int16_t arg1, int16x4_t arg2)
+{
+  return vqrdmulhh_lane_s16 (arg1, arg2, 3);
+}
+
 int
 main (void)
 {
-  int16_t arg1;
-  int16x4_t arg2;
-  int16_t result;
   int16_t actual;
   int16_t expected;
 
-  arg1 = -32768;
-  arg2 = vcreate_s16 (0xd78e000005d78000ULL);
-  actual = vqrdmulhh_lane_s16 (arg1, arg2, 3);
+  actual = test_vqrdmulhh (-32768, vcreate_s16 (0xd78e000005d78000ULL));
   expected = 10354;
 
   if (expected != actual)
index fd2c61deab8292cd1c03268b997b2f135ed1a0f8..78d6299d7d0bfd7bca6f692ade106782ce7b0521 100644 (file)
@@ -1,25 +1,27 @@
 /* Test the vqrdmulhh_laneq_s16 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int16_t __attribute__((noipa))
+test_vqrdmulhh (int16_t arg1, int16x8_t arg2)
+{
+  return vqrdmulhh_laneq_s16 (arg1, arg2, 7);
+}
+
 int
 main (void)
 {
-  int16_t arg1;
-  int16x8_t arg2;
   int16_t actual;
   int16_t expected;
 
-  arg1 = 0;
-  arg2 = vcombine_s16 (vcreate_s16 (0x7fffffffa7908000ULL),
-                       vcreate_s16 (0x8000d2607fff0000ULL));
-
-  actual = vqrdmulhh_laneq_s16 (arg1, arg2, 7);
+  actual = test_vqrdmulhh (0,
+                          vcombine_s16 (vcreate_s16 (0x7fffffffa7908000ULL),
+                                        vcreate_s16 (0x8000d2607fff0000ULL)));
   expected = 0;
 
   if (expected != actual)
index 30b21c9b4bca63418a2863c36ffa5aa45d05e356..827b52f33d15c1e81b6436ab0871bddb73883826 100644 (file)
@@ -1,25 +1,26 @@
 /* Test the vqrdmulhs_lane_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 #include <stdio.h>
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqrdmulhs (int32_t arg1, int32x2_t arg2)
+{
+  return vqrdmulhs_lane_s32 (arg1, arg2, 1);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int32x2_t arg2;
-  int32_t result;
   int32_t actual;
   int32_t expected;
 
-  arg1 = -2099281921;
-  arg2 = vcreate_s32 (0x000080007fff0000ULL);
-  actual = vqrdmulhs_lane_s32 (arg1, arg2, 1);
+  actual = test_vqrdmulhs (-2099281921, vcreate_s32 (0x000080007fff0000ULL));
   expected = -32033;
 
   if (expected != actual)
index 6d4e7648384340838cbdf4b1610222ada5b99198..b06d16f20e975e7f49cd3b7c93a8a9e2951fbcff 100644 (file)
@@ -1,25 +1,27 @@
 /* Test the vqrdmulhs_laneq_s32 AArch64 SIMD intrinsic.  */
 
 /* { dg-do run } */
-/* { dg-options "-save-temps -O3 -fno-inline" } */
+/* { dg-options "-save-temps -O3" } */
 
 #include "arm_neon.h"
 
 extern void abort (void);
 
+int32_t __attribute__((noipa))
+test_vqrdmulhs (int32_t arg1, int32x4_t arg2)
+{
+  return vqrdmulhs_laneq_s32 (arg1, arg2, 3);
+}
+
 int
 main (void)
 {
-  int32_t arg1;
-  int32x4_t arg2;
   int32_t actual;
   int32_t expected;
 
-  arg1 = 32768;
-  arg2 = vcombine_s32 (vcreate_s32 (0x8000ffffffffcd5bULL),
-                       vcreate_s32 (0x7fffffffffffffffULL));
-
-  actual = vqrdmulhs_laneq_s32 (arg1, arg2, 3);
+  actual = test_vqrdmulhs (32768,
+                          vcombine_s32 (vcreate_s32 (0x8000ffffffffcd5bULL),
+                                        vcreate_s32 (0x7fffffffffffffffULL)));
   expected = 32768;
 
   if (expected != actual)