1 /* Test the vmulxd_f64 AArch64 SIMD intrinsic.  */
2 
3 /* { dg-do run } */
4 /* { dg-options "-save-temps -O3" } */
5 
6 #include "arm_neon.h"
7 #include "vmulx.x"
8 
9 extern void abort (void);
10 
11 int
main(void)12 main (void)
13 {
14   float64_t v1 = 3.14159265359;
15   float64_t v2 = 1.383894;
16 
17   /* Constant * constant, shouldn't generete fmulx or fmul, only fmov.  */
18   SETUP_TEST_CASE_SCALAR (1, vmulxd_f64, float64_t, v1, v2, v1 * v2);
19   SETUP_TEST_CASE_SCALAR (2, vmulxd_f64, float64_t, 0.0,
20 			  __builtin_huge_val (), 2.0);
21   SETUP_TEST_CASE_SCALAR (3, vmulxd_f64, float64_t, 0.0,
22 			  -__builtin_huge_val (), -2.0);
23   SETUP_TEST_CASE_SCALAR (4, vmulxd_f64, float64_t, -0.0,
24 			  __builtin_huge_val (), -2.0);
25   SETUP_TEST_CASE_SCALAR (5, vmulxd_f64, float64_t, -0.0,
26 			  -__builtin_huge_val (), 2.0);
27   /* Constant +/- 0 or +/- inf * non-constant should generate fmulx.  */
28   SETUP_TEST_CASE_SCALAR (6, vmulxd_f64, float64_t, foo64 (),
29 			  -__builtin_huge_val (), -__builtin_huge_val ());
30   SETUP_TEST_CASE_SCALAR (7, vmulxd_f64, float64_t, foo64 (),
31 			  __builtin_huge_val (), __builtin_huge_val ());
32   SETUP_TEST_CASE_SCALAR (8, vmulxd_f64, float64_t, foo64 (),
33 			  0, 0);
34   SETUP_TEST_CASE_SCALAR (9, vmulxd_f64, float64_t, foo64 (),
35 			  -0.0, -0.0);
36   /* Constant non +/- 0 or non +/- inf * non-constant should generate fmul.  */
37   SETUP_TEST_CASE_SCALAR (10, vmulxd_f64, float64_t, foo64 (),
38 			  v1, v1);
39 
40   return 0;
41 }
42 /* { dg-final { scan-assembler-times "fmulx\[ \t\]+\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+\n" 4 } } */
43 /* { dg-final { scan-assembler-times "fmul\[ \t\]+\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+, ?\[dD\]\[0-9\]+\n" 1 } } */
44 /* { dg-final { scan-assembler-times "fmov\[ \t\]+\[dD\]\[0-9\]+, ?2.0e\\+0\n" 1 } } */
45 /* { dg-final { scan-assembler-times "fmov\[ \t\]+\[dD\]\[0-9\]+, ?-2.0e\\+0\n" 1 } } */
46