| 391 | // do a 4 word by 2 word divide, returns 2 word quotient in Q0 and Q1 |
| 392 | template <class S, class D> |
| 393 | inline D DivideFourWordsByTwo(S *T, const D &Al, const D &Ah, const D &B) |
| 394 | { |
| 395 | if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) |
| 396 | return D(Ah.GetLowHalf(), Ah.GetHighHalf()); |
| 397 | else |
| 398 | { |
| 399 | S Q[2]; |
| 400 | T[0] = Al.GetLowHalf(); |
| 401 | T[1] = Al.GetHighHalf(); |
| 402 | T[2] = Ah.GetLowHalf(); |
| 403 | T[3] = Ah.GetHighHalf(); |
| 404 | Q[1] = DivideThreeWordsByTwo<S, D>(T+1, B.GetLowHalf(), |
| 405 | B.GetHighHalf()); |
| 406 | Q[0] = DivideThreeWordsByTwo<S, D>(T, B.GetLowHalf(), B.GetHighHalf()); |
| 407 | return D(Q[0], Q[1]); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | |
| 412 | // returns quotient, which must fit in a word |
nothing calls this directly
no test coverage detected