[cfe-commits] r162106 - in /cfe/trunk: include/clang/Basic/Builtins.def test/Sema/builtins-decl.c
Benjamin Kramer
benny.kra at googlemail.com
Fri Aug 17 09:39:13 PDT 2012
Author: d0k
Date: Fri Aug 17 11:39:13 2012
New Revision: 162106
URL: http://llvm.org/viewvc/llvm-project?rev=162106&view=rev
Log:
Define __builtin_ffs[ll] with a signed argument instead of unsigned.
GCC documents these as unsigned, but defines them as signed.
Modified:
cfe/trunk/include/clang/Basic/Builtins.def
cfe/trunk/test/Sema/builtins-decl.c
Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=162106&r1=162105&r2=162106&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Fri Aug 17 11:39:13 2012
@@ -376,9 +376,9 @@
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")
Modified: cfe/trunk/test/Sema/builtins-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtins-decl.c?rev=162106&r1=162105&r2=162106&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtins-decl.c (original)
+++ cfe/trunk/test/Sema/builtins-decl.c Fri Aug 17 11:39:13 2012
@@ -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);
More information about the cfe-commits
mailing list