1/* Test the vcale_f64 AArch64 SIMD intrinsic.  */
2
3/* { dg-do run } */
4/* { dg-options "-save-temps -O3" } */
5
6#include "arm_neon.h"
7
8#define SIZE 6
9
10extern void abort (void);
11
12volatile float64_t in[SIZE] = { -10.4, -3.14, 0.0, 1.5, 5.3, 532.3 };
13
14int
15main (void)
16{
17  uint64_t expected;
18  uint64_t actual;
19  float64x1_t arg1, arg2;
20  int i, j;
21
22  for (i = 0; i < SIZE; ++i)
23   for (j = 0; j < SIZE; ++j)
24     {
25        expected = __builtin_fabs (in[i]) <= __builtin_fabs (in[j]) ? -1 : 0;
26        arg1 = (float64x1_t) { in[i] };
27        arg2 = (float64x1_t) { in[j] };
28        actual = vget_lane_u64 (vcale_f64 (arg1, arg2), 0);
29
30        if (actual != expected)
31          abort ();
32     }
33
34  return 0;
35}
36
37/* { dg-final { scan-assembler "facge\[ \t\]+\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+\n" } } */
38/* { dg-final { cleanup-saved-temps } } */
39