69 * If VIS 3.0 instructions are available, use this: 70 * 71 * flcmps %fcc0,%f0,%f1 72 * fmovsge %fcc0,%f1,%f0 ! move if %fcc0 is 0 or 2 73 */ 74 75 union { 76 unsigned i; 77 float f; 78 } xx, yy; 79 unsigned s; 80 81 /* if y is nan, replace it by x */ 82 if (y != y) 83 y = x; 84 85 /* if x is nan, replace it by y */ 86 if (x != x) 87 x = y; 88 89 /* if x is greater than y or x and y are unordered, replace x by y */ 90 #if defined(COMPARISON_MACRO_BUG) 91 if (x > y) 92 #else 93 if (!islessequal(x, y)) 94 #endif 95 x = y; 96 97 /* 98 * now x and y are either both NaN or both numeric; set the 99 * sign of the result if either x or y has its sign set 100 */ 101 xx.f = x; 102 yy.f = y; 103 s = (xx.i | yy.i) & 0x80000000; 104 xx.i |= s; 105 106 return (xx.f); 107 } | 69 * If VIS 3.0 instructions are available, use this: 70 * 71 * flcmps %fcc0,%f0,%f1 72 * fmovsge %fcc0,%f1,%f0 ! move if %fcc0 is 0 or 2 73 */ 74 75 union { 76 unsigned i; 77 float f; 78 } xx, yy; 79 unsigned s; 80 81 /* if y is nan, replace it by x */ 82 if (y != y) 83 y = x; 84 85 /* if x is nan, replace it by y */ 86 if (x != x) 87 x = y; 88 89 /* At this point, x and y are either both numeric, or both NaN */ 90 if (!isnan(x) && !islessequal(x, y)) 91 x = y; 92 93 /* 94 * set the sign of the result if either x or y has its sign set 95 */ 96 xx.f = x; 97 yy.f = y; 98 s = (xx.i | yy.i) & 0x80000000; 99 xx.i |= s; 100 101 return (xx.f); 102 } |