Commit e4f490c9 authored by Niels Möller's avatar Niels Möller

Generalize INCREMENT macro, allow size == 1.

parent cc382d42
2013-04-16 Niels Möller <nisse@lysator.liu.se>
* macros.h (INCREMENT): Allow size == 1.
2013-04-15 Niels Möller <nisse@lysator.liu.se>
* x86_64/umac-nh.asm: New file. 4.4 time speedup.
......
......@@ -145,16 +145,14 @@ do { \
#define ROTL64(n,x) (((x)<<(n)) | ((x)>>(64-(n))))
/* Requires that size >= 2 */
/* Requires that size > 0 */
#define INCREMENT(size, ctr) \
do { \
unsigned increment_i = (size) - 1; \
if (++(ctr)[increment_i] == 0) \
{ \
while (++(ctr)[--increment_i] == 0 \
&& increment_i > 0) \
; \
} \
while (increment_i > 0 \
&& ++(ctr)[--increment_i] == 0 ) \
; \
} while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment