Hi everyone, I know I was told what the algorithm was already, but I can't find it in my email history, so I'm forced to ask again... is there a reference to the algorithm that's used to calculate the reciprocal constants used in the integer division optimisations for x86 and AArch64? It's more to gain a personal understanding of the algorithm so I can possibly learn to write assembly language routines that both do it faster and produce the same results (my original implementation, such required double-width registers, produced magic constants that were bit-shifted to calc_magic_div_unsigned but which nonetheless produced correct results when the actual divisions were applied).
Gareth aka. Kit _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel