[cfe-commits] r127329 - in /cfe/trunk: include/clang/Basic/BuiltinsX86.def test/Sema/builtins-decl.c

NAKAMURA Takumi geek4civic at gmail.com
Wed Mar 9 04:00:19 PST 2011


Author: chapuni
Date: Wed Mar  9 06:00:19 2011
New Revision: 127329

URL: http://llvm.org/viewvc/llvm-project?rev=127329&view=rev
Log:
include/clang/Basic/BuiltinsX86.def: __builtin_ia32_crc32**() should be defined to take unsigned args and to return unsigned value.

mingw-w64's intrin.h declares __builtin_ia32_crc32**() as external.

Added:
    cfe/trunk/test/Sema/builtins-decl.c
Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=127329&r1=127328&r2=127329&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Wed Mar  9 06:00:19 2011
@@ -342,10 +342,10 @@
 
 BUILTIN(__builtin_ia32_pcmpgtq, "V2LLiV2LLiV2LLi", "")
 
-BUILTIN(__builtin_ia32_crc32qi, "iic", "")
-BUILTIN(__builtin_ia32_crc32hi, "iis", "")
-BUILTIN(__builtin_ia32_crc32si, "iii", "")
-BUILTIN(__builtin_ia32_crc32di, "LLiLLiLLi", "")
+BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "")
+BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "")
+BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "")
+BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "")
 
 // AES
 BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "")

Added: cfe/trunk/test/Sema/builtins-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtins-decl.c?rev=127329&view=auto
==============================================================================
--- cfe/trunk/test/Sema/builtins-decl.c (added)
+++ cfe/trunk/test/Sema/builtins-decl.c Wed Mar  9 06:00:19 2011
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=i686-mingw32
+// RUN: %clang_cc1 %s -fsyntax-only -verify -triple=x86_64-mingw32
+
+// mingw-w64's intrin.h has decls below.
+// we should accept them.
+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);





More information about the cfe-commits mailing list