1 /* Test type-generic builtins with __fp16 arguments.
2 Except as otherwise noted, they should behave exactly
3 the same as those with float arguments. */
6 /* { dg-options "-mfp16-format=ieee -std=gnu99" } */
11 volatile __fp16 h1, h2;
12 volatile float f1, f2;
22 set2 (double x, double y)
32 hp = (p (h1) ? 1 : 0); \
33 fp = (p (f1) ? 1 : 0); \
36 #define test2(p,x,y) \
38 hp = (p (h1, h2) ? 1 : 0); \
39 fp = (p (f1, f2) ? 1 : 0); \
47 test1 (__builtin_isfinite, 17.0);
48 test1 (__builtin_isfinite, INFINITY);
49 test1 (__builtin_isinf, -0.5);
50 test1 (__builtin_isinf, INFINITY);
51 test1 (__builtin_isnan, 493.0);
52 test1 (__builtin_isnan, NAN);
53 test1 (__builtin_isnormal, 3.14159);
55 test2 (__builtin_isgreater, 5.0, 3.0);
56 test2 (__builtin_isgreater, 3.0, 5.0);
57 test2 (__builtin_isgreater, 73.5, 73.5);
58 test2 (__builtin_isgreater, 1.0, NAN);
60 test2 (__builtin_isgreaterequal, 5.0, 3.0);
61 test2 (__builtin_isgreaterequal, 3.0, 5.0);
62 test2 (__builtin_isgreaterequal, 73.5, 73.5);
63 test2 (__builtin_isgreaterequal, 1.0, NAN);
65 test2 (__builtin_isless, 5.0, 3.0);
66 test2 (__builtin_isless, 3.0, 5.0);
67 test2 (__builtin_isless, 73.5, 73.5);
68 test2 (__builtin_isless, 1.0, NAN);
70 test2 (__builtin_islessequal, 5.0, 3.0);
71 test2 (__builtin_islessequal, 3.0, 5.0);
72 test2 (__builtin_islessequal, 73.5, 73.5);
73 test2 (__builtin_islessequal, 1.0, NAN);
75 test2 (__builtin_islessgreater, 5.0, 3.0);
76 test2 (__builtin_islessgreater, 3.0, 5.0);
77 test2 (__builtin_islessgreater, 73.5, 73.5);
78 test2 (__builtin_islessgreater, 1.0, NAN);
80 test2 (__builtin_isunordered, 5.0, 3.0);
81 test2 (__builtin_isunordered, 3.0, 5.0);
82 test2 (__builtin_isunordered, 73.5, 73.5);
83 test2 (__builtin_isunordered, 1.0, NAN);
85 /* Test that __builtin_isnormal recognizes a denormalized __fp16 value,
86 even if it's representable as a normalized float. */
88 if (__builtin_isnormal (h1))