| 120 | } |
| 121 | |
| 122 | struct msr msr_shl(const struct msr a, const uint8_t bits) { |
| 123 | struct msr ret; |
| 124 | |
| 125 | ret.hi = bits < 32 ? a.hi << bits : 0; |
| 126 | ret.lo = bits < 32 ? a.lo << bits : 0; |
| 127 | |
| 128 | if (bits < 32) |
| 129 | ret.hi |= bits ? a.lo >> (32 - bits) : 0; |
| 130 | else |
| 131 | ret.hi |= a.lo << (bits - 32); |
| 132 | |
| 133 | return ret; |
| 134 | } |
| 135 | |
| 136 | struct msr msr_shr(const struct msr a, const uint8_t bits) { |
| 137 | struct msr ret; |