#ifndef INT128_H
#define INT128_H
-#include <assert.h>
-#include <stdint.h>
-#include <stdbool.h>
typedef struct Int128 Int128;
return (Int128) { 0, 1 };
}
+static inline Int128 int128_exts64(int64_t a)
+{
+ return (Int128) { .lo = a, .hi = (a < 0) ? -1 : 0 };
+}
+
static inline Int128 int128_and(Int128 a, Int128 b)
{
return (Int128) { a.lo & b.lo, a.hi & b.hi };