Very interesting, Gareth !
Is the div-by-7 related to 2 to the 3rd ? If yes, is it possible to design a
div-by-3 with similar magics ?
Cheers, Ched'
Le 03.09.21 à 15:35, J. Gareth Moreton via fpc-devel a écrit :
Hey Marģers,
So I've been experimenting with your suggestion, and it looks
s loosing popularity.
But Python is not compiled and not suited for large programs (my own opinion). I rest with my favourite
language : (Free)Pascal :)
https://www.tiobe.com/tiobe-index/
https://pypl.github.io/PYPL.html?country=FR
Cheers, Ched'
___
Hi,
I haven't done the check if already implemented, but there are some interesting
optimisations possible like:
if a is a non-negative integer and t is a non-negative integer power of two,
then
a mod t
can be translated at compile time to
a and (t-1)
Cheers, Ched'
Le 05.01.2018 à
are to be specified in first places.
By tree, much faster for nearly same-probability items.
Can the compiler manage the tree version or have I to hardcode a tree of cascaded IF THEN ELSE ? If so,
how much levels can I develop in this cascade ?
Cheers, Ched