ridiculousfish / libdivide

Official git repository for libdivide: optimized integer division
http://libdivide.com
Other
1.1k stars 79 forks source link

Save 1 instruction in libdivide_u*_branchfree_do() #13

Closed kimwalisch closed 8 years ago

kimwalisch commented 8 years ago

As discussed in https://github.com/ridiculousfish/libdivide/issues/12 I have made a modification to libdivide_u*_branchfree_do() so that it uses 1 instruction less.

There are 2 possible ways to implement this:

I chose the first solution because it requires less code and is much easier to implement. Though I have to agree that the second solution would be cleaner at the expense of duplicating some code.

Please let me know what you think about these code changes.

ridiculousfish commented 8 years ago

Thanks!