[PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / xorsign.c
blob22c5829449d932bed08de7e453c435ade3b787b2
1 /* { dg-do compile } */
2 /* { dg-options "-O3" } */
4 double
5 check_d_pos (double x, double y)
7 return x * __builtin_copysign (1.0, y);
10 float
11 check_f_pos (float x, float y)
13 return x * __builtin_copysignf (1.0f, y);
16 long double
17 check_l_pos (long double x, long double y)
19 return x * __builtin_copysignl (1.0, y);
22 /* --------------- */
24 double
25 check_d_neg (double x, double y)
27 return x * __builtin_copysign (-1.0, y);
30 float
31 check_f_neg (float x, float y)
33 return x * __builtin_copysignf (-1.0f, y);
36 long double
37 check_l_neg (long double x, long double y)
39 return x * __builtin_copysignl (-1.0, y);
42 /* --------------- */
44 double
45 check_d_pos_rev (double x, double y)
47 return __builtin_copysign (1.0, y) * x;
50 float
51 check_f_pos_rev (float x, float y)
53 return __builtin_copysignf (1.0f, y) * x;
56 long double
57 check_l_pos_rev (long double x, long double y)
59 return __builtin_copysignl (1.0, y) * x;
62 /* --------------- */
64 double
65 check_d_neg_rev (double x, double y)
67 return __builtin_copysign (-1.0, y) * x;
70 float
71 check_f_neg_rev (float x, float y)
73 return __builtin_copysignf (-1.0f, y) * x;
76 long double
77 check_l_neg_rev (long double x, long double y)
79 return __builtin_copysignl (-1.0, y) * x;
82 /* { dg-final { scan-assembler "\[ \t\]?eor\[ \t\]?" } } */
83 /* { dg-final { scan-assembler "\[ \t\]?and\[ \t\]?" } } */
84 /* { dg-final { scan-assembler-not "copysign" } } */
85 /* { dg-final { scan-assembler-not "\[ \t\]?orr\[ \t\]?" } } */
86 /* { dg-final { scan-assembler-not "\[ \t\]?fmul\[ \t\]?" } } */