From e38488ae48380c26f3d86c0cf551afa97aab0d16 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 11 Mar 2012 10:46:45 +0100 Subject: [PATCH] Add time value operations to clear to zero and test for zero. Signed-off-by: Richard Cochran --- tmv.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tmv.h b/tmv.h index 610e7c6..e6689f0 100644 --- a/tmv.h +++ b/tmv.h @@ -51,11 +51,21 @@ static inline tmv_t tmv_div(tmv_t a, int divisor) return a / divisor; } +static inline int tmv_is_zero(tmv_t x) +{ + return x == ((tmv_t) 0) ? 1 : 0; +} + static inline tmv_t tmv_sub(tmv_t a, tmv_t b) { return a - b; } +static inline tmv_t tmv_zero(void) +{ + return (tmv_t) 0; +} + static inline tmv_t correction_to_tmv(Integer64 c) { return c >> 16;