! moving all bits into the left side 'bits' times return value <- this <- C 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 lowest bits and the method returns state of the last moved bit */
| 417 | and the method returns state of the last moved bit |
| 418 | */ |
| 419 | uint Rcl(uint bits, uint c=0) |
| 420 | { |
| 421 | uint last_c = 0; |
| 422 | uint rest_bits = bits; |
| 423 | |
| 424 | if( bits == 0 ) |
| 425 | return 0; |
| 426 | |
| 427 | if( bits >= TTMATH_BITS_PER_UINT ) |
| 428 | RclMoveAllWords(rest_bits, last_c, bits, c); |
| 429 | |
| 430 | if( rest_bits == 0 ) |
| 431 | { |
| 432 | TTMATH_LOG("UInt::Rcl") |
| 433 | return last_c; |
| 434 | } |
| 435 | |
| 436 | // rest_bits is from 1 to TTMATH_BITS_PER_UINT-1 now |
| 437 | if( rest_bits == 1 ) |
| 438 | { |
| 439 | last_c = Rcl2_one(c); |
| 440 | } |
| 441 | else if( rest_bits == 2 ) |
| 442 | { |
| 443 | // performance tests showed that for rest_bits==2 it's better to use Rcl2_one twice instead of Rcl2(2,c) |
| 444 | Rcl2_one(c); |
| 445 | last_c = Rcl2_one(c); |
| 446 | } |
| 447 | else |
| 448 | { |
| 449 | last_c = Rcl2(rest_bits, c); |
| 450 | } |
| 451 | |
| 452 | TTMATH_LOGC("UInt::Rcl", last_c) |
| 453 | |
| 454 | return last_c; |
| 455 | } |
| 456 | |
| 457 | private: |
| 458 |
no outgoing calls
no test coverage detected