aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tcctest.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 5851fb4..7fd8171 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2584,6 +2584,17 @@ unsigned long mconstraint_test(struct struct1231 *r)
return ret + a[0];
}
+#ifdef __x86_64__
+int fls64(unsigned long long x)
+{
+ int bitpos = -1;
+ asm("bsrq %1,%q0"
+ : "+r" (bitpos)
+ : "rm" (x));
+ return bitpos + 1;
+}
+#endif
+
unsigned int set;
void asm_test(void)