Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Mendler
bcda8fc696
simplifications: remove unnecessary optimization
* these double checks are not necessary
* the compiler will move the early return outside of the called
  function, basically the functions is partially inlined
* however lto/amalgamation needed for the optimization
2019-11-04 15:41:33 +01:00
Daniel Mendler
795cd2013f
simplifications: add s_mp_zero_(digs|buf) and s_mp_copy_digs
Originally I made those as macros. However we have many
other small functions like mp_clamp, mp_exch which are also not implemented
as macros right now.

If we would use c99, I would implement them as private static inline
functions. And mp_exch would be a public static inline function.

But since we are bound to c89, we simply use normal functions.
To achieve optimal performance one should either use link time
optimization or amalgamation.
2019-11-04 15:41:32 +01:00
Daniel Mendler
143e0376a1
simplifications: basic arithmetic functions 2019-11-04 15:41:31 +01:00
Daniel Mendler
c91c1ba2b1
rework mp_add_d and mp_sub_d 2019-10-27 18:36:56 +01:00
Daniel Mendler
a44e68e652
remove MP_IS_* macros 2019-10-27 18:36:55 +01:00
Daniel Mendler
f21ea6ce18
add fast path to mp_add_d and mp_sub_d 2019-10-27 18:36:53 +01:00
Steffen Jaeckel
7a68f12873 Execute move.sh - Rename files from bn_* to match the function names.
* git blame <renamed-file> is not affected
* git log --follow <renamed-file> can be used to show log across renames
2019-10-19 16:24:39 +02:00