64/32 division is supported directly by i386 and possibly by other machines if the high dividend word is smaller than the divider (i.e. the dividend is in the range 32x32-> 64, multiplied by the divider) If your compiler has minimal support for 64- bit types, he can recognize this situation and take advantage of it.
Assuming that you have already checked the generated asm and found that it does not use this, or if you know that your processor does not have such a split instruction, you just need to do a long division, as you learned in class school .. except that she is base-4294967296 instead of base-10.
You can try reading the libgcc source, as it contains code for 64/64 separation for machines that do not have built-in support.
Edit: Actually, since you don't have a 64/32 split operation, you can use base-65536. This is due to the fact that a naive long division requires dividing a "two-digit" number by a "1-digit" number at each step. Of course, now you are stuck taking more steps.
R ..
source share