| 230 | } |
| 231 | |
| 232 | static void AtomicMultiply(word *C, word A0, word A1, word B0, word B1) |
| 233 | { |
| 234 | word s; |
| 235 | dword_union d; |
| 236 | |
| 237 | if (A1 >= A0) |
| 238 | if (B0 >= B1) |
| 239 | { |
| 240 | s = 0; |
| 241 | d.dw = (dword)(A1-A0)*(B0-B1); |
| 242 | } |
| 243 | else |
| 244 | { |
| 245 | s = (A1-A0); |
| 246 | d.dw = (dword)s*(word)(B0-B1); |
| 247 | } |
| 248 | else |
| 249 | if (B0 > B1) |
| 250 | { |
| 251 | s = (B0-B1); |
| 252 | d.dw = (word)(A1-A0)*(dword)s; |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | s = 0; |
| 257 | d.dw = (dword)(A0-A1)*(B1-B0); |
| 258 | } |
| 259 | |
| 260 | dword_union A0B0; |
| 261 | A0B0.dw = (dword)A0*B0; |
| 262 | C[0] = A0B0.low; |
| 263 | |
| 264 | dword_union A1B1; |
| 265 | A1B1.dw = (dword)A1*B1; |
| 266 | dword_union t; |
| 267 | t.dw = (dword)A0B0.high + A0B0.low + d.low + A1B1.low; |
| 268 | C[1] = t.low; |
| 269 | |
| 270 | t.dw = A1B1.dw + t.high + A0B0.high + d.high + A1B1.high - s; |
| 271 | C[2] = t.low; |
| 272 | C[3] = t.high; |
| 273 | } |
| 274 | |
| 275 | static word AtomicMultiplyAdd(word *C, word A0, word A1, word B0, word B1) |
| 276 | { |
no outgoing calls
no test coverage detected