1 /* Test the vmulxs_f32 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   float32_t v1 = 3.14159265359;
15   float32_t v2 = 1.383894;
16 
17   /* Constant * constant, shouldn't generete fmulx or fmul, only fmov.  */
18   SETUP_TEST_CASE_SCALAR (1, vmulxs_f32, float32_t, v1, v2, v1 * v2);
19   SETUP_TEST_CASE_SCALAR (2, vmulxs_f32, float32_t, 0.0,
20 			  __builtin_huge_valf (), 2.0);
21   SETUP_TEST_CASE_SCALAR (3, vmulxs_f32, float32_t, 0.0,
22 			  -__builtin_huge_valf (), -2.0);
23   SETUP_TEST_CASE_SCALAR (4, vmulxs_f32, float32_t, -0.0,
24 			  __builtin_huge_valf (), -2.0);
25   SETUP_TEST_CASE_SCALAR (5, vmulxs_f32, float32_t, -0.0,
26 			  -__builtin_huge_valf (), 2.0);
27   /* Constant +/- 0 or +/- inf * non-constant should generate fmulx.  */
28   SETUP_TEST_CASE_SCALAR (6, vmulxs_f32, float32_t, foo32 (),
29 			  -__builtin_huge_valf (), -__builtin_huge_valf ());
30   SETUP_TEST_CASE_SCALAR (7, vmulxs_f32, float32_t, foo32 (),
31 			  __builtin_huge_valf (), __builtin_huge_valf ());
32   SETUP_TEST_CASE_SCALAR (8, vmulxs_f32, float32_t, foo32 (),
33 			  0, 0);
34   SETUP_TEST_CASE_SCALAR (9, vmulxs_f32, float32_t, foo32 (),
35 			  -0.0, -0.0);
36   /* Constant non +/- 0 or non +/- inf * non-constant should generate fmul.  */
37   SETUP_TEST_CASE_SCALAR (10, vmulxs_f32, float32_t, foo32 (),
38 			  v1, v1);
39   return 0;
40 }
41 /* { dg-final { scan-assembler-times "fmulx\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+\n" 4 } } */
42 /* { dg-final { scan-assembler-times "fmul\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+\n" 1 } } */
43 /* { dg-final { scan-assembler-times "fmov\[ \t\]+\[sS\]\[0-9\]+, ?2.0e\\+0\n" 1 } } */
44 /* { dg-final { scan-assembler-times "fmov\[ \t\]+\[sS\]\[0-9\]+, ?-2.0e\\+0\n" 1 } } */
45