1 /* Test the vmuls_laneq_f32 AArch64 SIMD intrinsic. */
2
3 /* { dg-do run } */
4 /* { dg-options " -O3" } */
5
6 #include "arm_neon.h"
7
8 extern void abort (void);
9
10 int
main(void)11 main (void)
12 {
13 volatile float32_t minus_e, pi, ln2, sqrt2, phi;
14 float32_t expected, actual;
15 float32x4_t arg2;
16 float32_t arr[4];
17
18 pi = 3.14159265359;
19 arr[0] = minus_e = -2.71828;
20 arr[1] = ln2 = 0.69314718056;
21 arr[2] = sqrt2 = 1.41421356237;
22 arr[3] = phi = 1.61803398874;
23
24 arg2 = vld1q_f32 (arr);
25 actual = vmuls_laneq_f32 (pi, arg2, 0);
26 expected = pi * minus_e;
27
28 if (expected != actual)
29 abort ();
30
31 expected = pi * ln2;
32 actual = vmuls_laneq_f32 (pi, arg2, 1);
33
34 if (expected != actual)
35 abort ();
36
37 expected = pi * sqrt2;
38 actual = vmuls_laneq_f32 (pi, arg2, 2);
39
40 if (expected != actual)
41 abort ();
42
43 expected = pi * phi;
44 actual = vmuls_laneq_f32 (pi, arg2, 3);
45
46 if (expected != actual)
47 abort ();
48
49 return 0;
50 }
51