1 /* PR tree-optimization/111109 */
4 f should return 0 if either fa and fb are a nan.
5 Rather than the value of a or b.
8 int f(int a
, int b
, float fa
, float fb
) {
9 const _Bool c
= fa
< fb
;
10 const _Bool c1
= fa
>= fb
;
11 return (c
* a
) | (c1
* b
);
15 f1 should return 0 if either fa and fb are a nan.
16 Rather than the value of a&1 or b&1.
18 __attribute__((noipa
))
19 int f1(int a
, int b
, float fa
, float fb
) {
20 const _Bool c
= fa
< fb
;
21 const _Bool c1
= fa
>= fb
;
22 return (c
& a
) | (c1
& b
);
25 #if __SIZEOF_INT__ == __SIZEOF_FLOAT__
26 typedef int v4si
__attribute__ ((vector_size (1*sizeof(int))));
27 typedef float v4sf
__attribute__ ((vector_size (1*sizeof(float))));
29 fvf0 should return {0} if either fa and fb are a nan.
30 Rather than the value of a or b.
32 __attribute__((noipa
))
33 v4si
vf0(v4si a
, v4si b
, v4sf fa
, v4sf fb
) {
34 const v4si c
= fa
< fb
;
35 const v4si c1
= fa
>= fb
;
36 return (c
& a
) | (c1
& b
);
44 float a
= __builtin_nan("");
46 if (f(-1,-1, a
, a
) != 0)
48 if (f(-1,-1, a
, 0) != 0)
50 if (f(-1,-1, 0, a
) != 0)
52 if (f(-1,-1, 0, 0) != -1)
56 if (f1(1,1, a
, a
) != 0)
58 if (f1(1,1, a
, 0) != 0)
60 if (f1(1,1, 0, a
) != 0)
62 if (f1(1,1, 0, 0) != 1)
65 #if __SIZEOF_INT__ == __SIZEOF_FLOAT__
69 if (vf0(b
,b
, c
, c
)[0] != 0)
71 if (vf0(b
,b
, c
, d
)[0] != 0)
73 if (vf0(b
,b
, d
, c
)[0] != 0)
75 if (vf0(b
,b
, d
, d
)[0] != b
[0])