! moving all bits into the right side 'bits' times c -> this -> return value bits is from a range of <0, man * TTMATH_BITS_PER_UINT> or it can be even bigger then all bits will be set to 'c' the value c will be set into the highest bits and the method returns state of the last moved bit */
| 512 | and the method returns state of the last moved bit |
| 513 | */ |
| 514 | uint Rcr(uint bits, uint c=0) |
| 515 | { |
| 516 | uint last_c = 0; |
| 517 | uint rest_bits = bits; |
| 518 | |
| 519 | if( bits == 0 ) |
| 520 | return 0; |
| 521 | |
| 522 | if( bits >= TTMATH_BITS_PER_UINT ) |
| 523 | RcrMoveAllWords(rest_bits, last_c, bits, c); |
| 524 | |
| 525 | if( rest_bits == 0 ) |
| 526 | { |
| 527 | TTMATH_LOG("UInt::Rcr") |
| 528 | return last_c; |
| 529 | } |
| 530 | |
| 531 | // rest_bits is from 1 to TTMATH_BITS_PER_UINT-1 now |
| 532 | if( rest_bits == 1 ) |
| 533 | { |
| 534 | last_c = Rcr2_one(c); |
| 535 | } |
| 536 | else if( rest_bits == 2 ) |
| 537 | { |
| 538 | // performance tests showed that for rest_bits==2 it's better to use Rcr2_one twice instead of Rcr2(2,c) |
| 539 | Rcr2_one(c); |
| 540 | last_c = Rcr2_one(c); |
| 541 | } |
| 542 | else |
| 543 | { |
| 544 | last_c = Rcr2(rest_bits, c); |
| 545 | } |
| 546 | |
| 547 | TTMATH_LOGC("UInt::Rcr", last_c) |
| 548 | |
| 549 | return last_c; |
| 550 | } |
| 551 | |
| 552 | |
| 553 | /*! |
no outgoing calls
no test coverage detected