hirrolot / metalang99

Full-blown preprocessor metaprogramming
https://metalang99.readthedocs.io/en/latest/
MIT License
871 stars 25 forks source link

Optimise unsigned integers #7

Closed hirrolot closed 3 years ago

hirrolot commented 3 years ago

Currently, operations on unsigned integers are implemented recursively.

The task is to optimise the unsigned integers module (include/metalang99/uint.h), e.g. make fewer reduction steps. Maybe it would be better to deal with digits (the usual way of calculating) instead of Peano arithmetic.

hirrolot commented 3 years ago

After optimising M_callTrivial, the whole tests/uint.c compiles in less than a second, which is probably okay for now.