neg64() makes a 64bit integer negative
- neg64(a) == -a - although we only support 64 bit unsigned arithmetics sometimes it's good to have a 2-complement negative number
This commit is contained in:
parent
8eece1c00c
commit
274fcf8d1f
1 changed files with 6 additions and 0 deletions
|
@ -43,4 +43,10 @@ u64_t not64(u64_t a);
|
|||
#define is_zero64(i) ((i).lo == 0 && (i).hi == 0)
|
||||
#define make_zero64(i) do { (i).lo = (i).hi = 0; } while(0)
|
||||
|
||||
#define neg64(i) do { \
|
||||
(i).lo = ~(i).lo; \
|
||||
(i).hi = ~(i).hi; \
|
||||
(i) = add64u((i), 1); \
|
||||
} while(0)
|
||||
|
||||
#endif /* _MINIX__U64_H */
|
||||
|
|
Loading…
Reference in a new issue