Root/
Source at commit 1077 created 13 years 1 month ago. By azimutz, Removing this info from DEBUG's realm. This will be enabled by default until i gather enough feedback to decide whether it will stay On or Off by default. This info display, is only available on Gui; ShowInfo=No disables it. For the Gui minimalist, "Boot Banner"=No also disables it. Ok, "house cleaning" is suspended until i figure out what Meklort's cooking over at that new branch... "rewrite" :-o just the name sounds scary :-D | |
---|---|
1 | #include "libsaio.h"␊ |
2 | ␊ |
3 | extern void __divide_error();␊ |
4 | ␊ |
5 | uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem_p)␊ |
6 | {␊ |
7 | ␉uint64_t quot = 0, qbit = 1;␊ |
8 | ␊ |
9 | ␉if (den == 0) {␊ |
10 | ␉␉__divide_error();␊ |
11 | ␉␉return 0;␉/* If trap returns... */␊ |
12 | ␉}␊ |
13 | ␊ |
14 | ␉/* Left-justify denominator and count shift */␊ |
15 | ␉while ((int64_t) den >= 0) {␊ |
16 | ␉␉den <<= 1;␊ |
17 | ␉␉qbit <<= 1;␊ |
18 | ␉}␊ |
19 | ␊ |
20 | ␉while (qbit) {␊ |
21 | ␉␉if (den <= num) {␊ |
22 | ␉␉␉num -= den;␊ |
23 | ␉␉␉quot += qbit;␊ |
24 | ␉␉}␊ |
25 | ␉␉den >>= 1;␊ |
26 | ␉␉qbit >>= 1;␊ |
27 | ␉}␊ |
28 | ␊ |
29 | ␉if (rem_p)␊ |
30 | ␉␉*rem_p = num;␊ |
31 | ␊ |
32 | ␉return quot;␊ |
33 | }␊ |
34 |