aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-05-31 11:52:24 +0100
committerGitHub <noreply@github.com>2022-05-31 11:52:24 +0100
commita1f15c2c69b557be5a95882d18137d1f74d980ee (patch)
tree3f484753712a6d9d9cf1074f56bc91af6d6432c1 /src/common.cpp
parenta6c779b50ecf5c8c0cb86c9d49768ab34508b1d2 (diff)
parent516f6647b46c69a67139154c02c74b436cd4b999 (diff)
Merge pull request #1807 from odin-lang/simd-dev
Generic #simd type and intrinsics
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;