4 extern const u32 fast_div_tab[];
5 extern const byte fast_sqrt_tab[];
14 fast_div_u32_u8(uns x, uns y)
21 :"1"(x),"g"(fast_div_tab[y])
25 return ((u64)(x) * fast_div_tab[y]) >> 32;
33 if (x < (1 << 10) - 3)
34 y = fast_sqrt_tab[(x + 3) >> 2] >> 3;
35 else if (x < (1 << 14) - 28)
36 y = fast_sqrt_tab[(x + 28) >> 6] >> 1;
38 y = fast_sqrt_tab[x >> 8];
39 return (x < y * y) ? y - 1 : y;
48 if (x < (1 << 10) - 3)
49 y = fast_sqrt_tab[(x + 3) >> 2] >> 3;
50 else if (x < (1 << 14) - 28)
51 y = fast_sqrt_tab[(x + 28) >> 6] >> 1;
53 y = fast_sqrt_tab[x >> 8];
61 y = fast_sqrt_tab[x >> 12];
62 y = (fast_div_u32_u8(x, y) >> 3) + (y << 1);
66 y = fast_sqrt_tab[x >> 16];
67 y = (fast_div_u32_u8(x, y) >> 5) + (y << 3);
76 y = fast_sqrt_tab[x >> 18];
77 y = (fast_div_u32_u8(x, y) >> 6) + (y << 4);
81 y = fast_sqrt_tab[x >> 20];
82 y = (fast_div_u32_u8(x, y) >> 7) + (y << 5);
89 y = fast_sqrt_tab[x >> 22];
90 y = (fast_div_u32_u8(x, y) >> 8) + (y << 6);
94 y = fast_sqrt_tab[x >> 24];
95 y = (fast_div_u32_u8(x, y) >> 9) + (y << 7);
100 return (x < y * y) ? y - 1 : y;