gen/genascon.c
static void rotate_reg64_right(Reg64 *reg, int bits)
{
    int bytes;
    if ((bits % 8) < 4) {
        // Rotate in the right direction.
        bytes = bits / 8;
        while (bytes > 0) {
            rotate_reg64_right_8(reg);
            --bytes;
        }
        bits %= 8;
        while (bits > 0) {
            rotate_reg64_right_1(reg);
            --bits;
        }
    } else {
        // Quicker to rotate in the left direction.
        bits = 64 - bits;
        bytes = bits / 8;
        while (bytes > 0) {
            rotate_reg64_left_8(reg);
            --bytes;
        }
        bits %= 8;
        while (bits > 0) {
            rotate_reg64_left_1(reg);
            --bits;
        }
    }
}
// Rotate a 64-bit register right by a number of bits.
Rotate a 64-bit register right by a number of bits.
Rotate a 64 - bit register right by a number of bits .
static void rotate_reg64_right(Reg64 *reg, int bits)
{
    int bytes;
    if ((bits % 8) < 4) {
        bytes = bits / 8;
        while (bytes > 0) {
            rotate_reg64_right_8(reg);
            --bytes;
        }
        bits %= 8;
        while (bits > 0) {
            rotate_reg64_right_1(reg);
            --bits;
        }
    } else {
        bits = 64 - bits;
        bytes = bits / 8;
        while (bytes > 0) {
            rotate_reg64_left_8(reg);
            --bytes;
        }
        bits %= 8;
        while (bits > 0) {
            rotate_reg64_left_1(reg);
            --bits;
        }
    }
}
static void rotate_reg64_right ( Reg64 * reg , int bits ) { int bytes ; if ( ( bits % 8 ) < 4 ) { bytes = bits / 8 ; while ( bytes > 0 ) { rotate_reg64_right_8 ( reg ) ; -- bytes ; } bits %= 8 ; while ( bits > 0 ) { rotate_reg64_right_1 ( reg ) ; -- bits ; } } else { bits = 64 - bits ; bytes = bits / 8 ; while ( bytes > 0 ) { rotate_reg64_left_8 ( reg ) ; -- bytes ; } bits %= 8 ; while ( bits > 0 ) { rotate_reg64_left_1 ( reg ) ; -- bits ; } } }
Rotate a 64-bit register right by a number of bits.
Rotate a 64 - bit register right by a number of bits .
// Rotate in the right direction. // Quicker to rotate in the left direction.