layer 1 unscaling */ n = number of bits of the mantissa minus 1 */
| 162 | /* layer 1 unscaling */ |
| 163 | /* n = number of bits of the mantissa minus 1 */ |
| 164 | static inline int l1_unscale(int n, int mant, int scale_factor) |
| 165 | { |
| 166 | int shift, mod; |
| 167 | int64_t val; |
| 168 | |
| 169 | shift = scale_factor_modshift[scale_factor]; |
| 170 | mod = shift & 3; |
| 171 | shift >>= 2; |
| 172 | val = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]); |
| 173 | shift += n; |
| 174 | /* NOTE: at this point, 1 <= shift >= 21 + 15 */ |
| 175 | return (int)((val + (1LL << (shift - 1))) >> shift); |
| 176 | } |
| 177 | |
| 178 | static inline int l2_unscale_group(int steps, int mant, int scale_factor) |
| 179 | { |
no test coverage detected