]> granicus.if.org Git - clang/commitdiff
Define __builtin_ffs[ll] with a signed argument instead of unsigned.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 17 Aug 2012 16:39:13 +0000 (16:39 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 17 Aug 2012 16:39:13 +0000 (16:39 +0000)
GCC documents these as unsigned, but defines them as signed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162106 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/Builtins.def
test/Sema/builtins-decl.c

index 1b060a509232c2722158272159167a72875b3aff..84b28811728efa4afcf0d2964e682a905377f2b3 100644 (file)
@@ -376,9 +376,9 @@ BUILTIN(__builtin_ctz  , "iUi"  , "nc")
 BUILTIN(__builtin_ctzl , "iULi" , "nc")
 BUILTIN(__builtin_ctzll, "iULLi", "nc")
 // TODO: int ctzimax(uintmax_t)
-BUILTIN(__builtin_ffs  , "iUi"  , "nc")
-BUILTIN(__builtin_ffsl , "iULi" , "nc")
-BUILTIN(__builtin_ffsll, "iULLi", "nc")
+BUILTIN(__builtin_ffs  , "ii"  , "nc")
+BUILTIN(__builtin_ffsl , "iLi" , "nc")
+BUILTIN(__builtin_ffsll, "iLLi", "nc")
 BUILTIN(__builtin_parity  , "iUi"  , "nc")
 BUILTIN(__builtin_parityl , "iULi" , "nc")
 BUILTIN(__builtin_parityll, "iULLi", "nc")
index 19bdb840ccfb26a151f22faf693f2bb49ef41986..d6b004aa8820476fbbac0ef9081f99af9bbc27bf 100644 (file)
@@ -6,3 +6,8 @@
 extern unsigned int __builtin_ia32_crc32qi (unsigned int, unsigned char);
 extern unsigned int __builtin_ia32_crc32hi (unsigned int, unsigned short);
 extern unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int);
+
+// GCC documents these as unsigned, but they are defined with a signed argument.
+extern int __builtin_ffs(int);
+extern int __builtin_ffsl(long);
+extern int __builtin_ffsll(long long);