Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
int64mask.h
Go to the documentation of this file.
1#ifndef int64mask_h
2#define int64mask_h
3
4#include <inttypes.h>
5
6/* masks are -1 if condition holds, 0 if not */
7
8static inline int64_t int64mask_negative(int64_t x)
9{
10 return x>>63; /* requires -fwrapv */
11}
12
13static inline int64_t int64mask_nonzero(int64_t x)
14{
15 return int64mask_negative(x)|int64mask_negative(-x);
16}
17
18static inline int64_t int64mask_zero(int64_t x)
19{
20 return ~int64mask_nonzero(x);
21}
22
23static inline int64_t int64mask_equal(int64_t x,int64_t y)
24{
25 return int64mask_zero(x^y);
26}
27
28#endif