aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-25 17:26:18 +0100
committergingerBill <bill@gingerbill.org>2022-05-25 17:26:18 +0100
commitb032d5af87ebe8d9dee28698cfa570d3628e58e5 (patch)
tree6d2f1a90d597a3909430c8a4c6002b1e586e76e7 /src/common.cpp
parentd8e77cd738844b172d1741b1b1d3d4376efd17b5 (diff)
Make `#simd` an opaque type
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common.cpp b/src/common.cpp
index 94248fb62..77caddfe8 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -47,6 +47,13 @@ void debugf(char const *fmt, ...);
#include "range_cache.cpp"
+bool is_power_of_two(i64 x) {
+ if (x <= 0) {
+ return false;
+ }
+ return !(x & (x-1));
+}
+
int isize_cmp(isize x, isize y) {
if (x < y) {
return -1;