4 extern const u32 fast_div_tab[];
5 extern const byte fast_sqrt_tab[];
14 fast_div_u32_u8(uns x, uns y)
16 return ((u64)(x) * fast_div_tab[y]) >> 32;
23 if (x < (1 << 10) - 3)
24 y = fast_sqrt_tab[(x + 3) >> 2] >> 3;
25 else if (x < (1 << 14) - 28)
26 y = fast_sqrt_tab[(x + 28) >> 6] >> 1;
28 y = fast_sqrt_tab[x >> 8];
29 return (x < y * y) ? y - 1 : y;
38 if (x < (1 << 10) - 3)
39 y = fast_sqrt_tab[(x + 3) >> 2] >> 3;
40 else if (x < (1 << 14) - 28)
41 y = fast_sqrt_tab[(x + 28) >> 6] >> 1;
43 y = fast_sqrt_tab[x >> 8];
51 y = fast_sqrt_tab[x >> 12];
52 y = (fast_div_u32_u8(x, y) >> 3) + (y << 1);
56 y = fast_sqrt_tab[x >> 16];
57 y = (fast_div_u32_u8(x, y) >> 5) + (y << 3);
66 y = fast_sqrt_tab[x >> 18];
67 y = (fast_div_u32_u8(x, y) >> 6) + (y << 4);
71 y = fast_sqrt_tab[x >> 20];
72 y = (fast_div_u32_u8(x, y) >> 7) + (y << 5);
79 y = fast_sqrt_tab[x >> 22];
80 y = (fast_div_u32_u8(x, y) >> 8) + (y << 6);
84 y = fast_sqrt_tab[x >> 24];
85 y = (fast_div_u32_u8(x, y) >> 9) + (y << 7);
90 return (x < y * y) ? y - 1 : y;