110 * If VIS 3.0 instructions are available, use this: 111 * 112 * flcmps %fcc0,%f0,%f1 113 * fmovslg %fcc0,%f1,%f0 ! move if %fcc0 is 1 or 2 114 */ 115 116 union { 117 unsigned i; 118 float f; 119 } xx, yy; 120 unsigned s; 121 122 /* if y is nan, replace it by x */ 123 if (y != y) 124 y = x; 125 126 /* if x is nan, replace it by y */ 127 if (x != x) 128 x = y; 129 130 /* if x is less than y or x and y are unordered, replace x by y */ 131 #if defined(COMPARISON_MACRO_BUG) 132 if (x < y) 133 #else 134 if (!isgreaterequal(x, y)) 135 #endif 136 x = y; 137 138 /* 139 * now x and y are either both NaN or both numeric; clear the 140 * sign of the result if either x or y has its sign clear 141 */ 142 xx.f = x; 143 yy.f = y; 144 s = ~(xx.i & yy.i) & 0x80000000; 145 xx.i &= ~s; 146 147 return (xx.f); 148 } | 110 * If VIS 3.0 instructions are available, use this: 111 * 112 * flcmps %fcc0,%f0,%f1 113 * fmovslg %fcc0,%f1,%f0 ! move if %fcc0 is 1 or 2 114 */ 115 116 union { 117 unsigned i; 118 float f; 119 } xx, yy; 120 unsigned s; 121 122 /* if y is nan, replace it by x */ 123 if (y != y) 124 y = x; 125 126 /* if x is nan, replace it by y */ 127 if (x != x) 128 x = y; 129 130 /* At this point, x and y are either both numeric, or both NaN */ 131 if (!isnan(x) && !isgreaterequal(x, y)) 132 x = y; 133 134 /* 135 * clear the sign of the result if either x or y has its sign clear 136 */ 137 xx.f = x; 138 yy.f = y; 139 s = ~(xx.i & yy.i) & 0x80000000; 140 xx.i &= ~s; 141 142 return (xx.f); 143 } |