-#define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 9) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<40))
+#define ATOMICMASK (0x1ULL << 63)
+#define NONATOMICMASK ~(0x1ULL << 63)
+
+/**
+ * The basic encoding idea is that (void *) either:
+ * -# points to a full record (RaceRecord) or
+ * -# encodes the information in a 64 bit word. Encoding is as
+ * follows:
+ * - lowest bit set to 1
+ * - next 6 bits are read thread id
+ * - next 25 bits are read clock vector
+ * - next 6 bits are write thread id
+ * - next 25 bits are write clock vector
+ * - highest bit is 1 if the write is from an atomic
+ */
+#define ENCODEOP(rdthread, rdtime, wrthread, wrtime) (0x1ULL | ((rdthread)<<1) | ((rdtime) << 7) | (((uint64_t)wrthread)<<32) | (((uint64_t)wrtime)<<38))