| 137 | matter. */ |
| 138 | |
| 139 | static NOINLINE void xsum_small_add_inf_nan |
| 140 | (xsum_small_accumulator *restrict sacc, xsum_int ivalue) |
| 141 | { |
| 142 | xsum_int mantissa; |
| 143 | double fltv; |
| 144 | |
| 145 | mantissa = ivalue & XSUM_MANTISSA_MASK; |
| 146 | |
| 147 | if (mantissa == 0) /* Inf */ |
| 148 | { if (sacc->Inf == 0) |
| 149 | { /* no previous Inf */ |
| 150 | sacc->Inf = ivalue; |
| 151 | } |
| 152 | else if (sacc->Inf != ivalue) |
| 153 | { /* previous Inf was opposite sign */ |
| 154 | COPY64 (fltv, ivalue); |
| 155 | fltv = fltv - fltv; /* result will be a NaN */ |
| 156 | COPY64 (sacc->Inf, fltv); |
| 157 | } |
| 158 | } |
| 159 | else /* NaN */ |
| 160 | { /* Choose the NaN with the bigger payload and clear its sign. Using <= |
| 161 | ensures that we will choose the first NaN over the previous zero. */ |
| 162 | if ((sacc->NaN & XSUM_MANTISSA_MASK) <= mantissa) |
| 163 | { sacc->NaN = ivalue & ~XSUM_SIGN_MASK; |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | |
| 169 | /* PROPAGATE CARRIES TO NEXT CHUNK IN A SMALL ACCUMULATOR. Needs to |
no outgoing calls
no test coverage detected