[libcxx] r246952 - Cleanup BuildingLibcxx.rst and remove TODO

2015-09-06 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Sep  6 18:31:16 2015
New Revision: 246952

URL: http://llvm.org/viewvc/llvm-project?rev=246952=rev
Log:
Cleanup BuildingLibcxx.rst and remove TODO

Modified:
libcxx/trunk/docs/BuildingLibcxx.rst

Modified: libcxx/trunk/docs/BuildingLibcxx.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/BuildingLibcxx.rst?rev=246952=246951=246952=diff
==
--- libcxx/trunk/docs/BuildingLibcxx.rst (original)
+++ libcxx/trunk/docs/BuildingLibcxx.rst Sun Sep  6 18:31:16 2015
@@ -34,7 +34,7 @@ The basic steps needed to build libc++ a
 
 #. Configure and build libc++ with libc++abi:
 
-   `CMake `_ is the only supported configuration system. Unlike 
other LLVM
+   CMake is the only supported configuration system. Unlike other LLVM
projects autotools is not supported for either libc++ or libc++abi.
 
Clang is the preferred compiler when building and using libc++.
@@ -69,8 +69,8 @@ The instructions are for building libc++
 FreeBSD, Linux, or Mac using `libc++abi`_ as the C++ ABI library.
 On Linux, it is also possible to use :ref:`libsupc++ ` or libcxxrt.
 
-It is sometimes beneficial to build outside of the LLVM tree. To build
-libc++ TODO
+It is sometimes beneficial to build outside of the LLVM tree. An out-of-tree
+build would look like this:
 
 .. code-block:: bash
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r246950 - Try to fix links for libcxx.llvm.org/docs again.

2015-09-06 Thread Eric Fiselier via cfe-commits
Author: ericwf
Date: Sun Sep  6 18:09:54 2015
New Revision: 246950

URL: http://llvm.org/viewvc/llvm-project?rev=246950=rev
Log:
Try to fix links for libcxx.llvm.org/docs again.

Modified:
libcxx/trunk/docs/index.rst

Modified: libcxx/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/index.rst?rev=246950=246949=246950=diff
==
--- libcxx/trunk/docs/index.rst (original)
+++ libcxx/trunk/docs/index.rst Sun Sep  6 18:09:54 2015
@@ -102,14 +102,9 @@ C++ Dialect Support
 -
 
 * C++11 - Complete
-* `C++14 - Complete `_
-* `C++1z - In Progress `_
-* `Post C++14 Technical Specifications - In Progress `_
-
-.. _cxx14 status: http://libcxx.llvm.org/cxx1y_status.html
-.. _cxx1z status: http://libcxx.llvm.org/cxx1z_status.html
-.. _ts status: http://libcxx.llvm.org/ts1z_status.html
-
+* `C++14 - Complete `__
+* `C++1z - In Progress `__
+* `Post C++14 Technical Specifications - In Progress 
`__
 
 Notes and Known Issues
 --
@@ -132,9 +127,9 @@ Design Documents
 * ` design `_
 * ` design `_
 * `Status of debug mode `_
-* `Notes by Marshall Clow `_
+* `Notes by Marshall Clow`__
 
-.. _clow notes: 
https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
+.. __: 
https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
 
 Build Bots
 ---
@@ -152,37 +147,30 @@ and `Getting started with LLVM `_. Please include [libcxx] in the subject and
+`Phabricator `_. Please include 
[libcxx] in the subject and
 add `cfe-commits` as a subscriber. Also make sure you are subscribed to the
-`cfe-commits mailing list `_.
+`cfe-commits mailing list 
`_.
 
 **Discussion and Questions**
 
-Send discussions and questions to the `cfe-dev mailing list `_.
+Send discussions and questions to the
+`cfe-dev mailing list `_.
 Please include [libcxx] in the subject.
 
-.. _phab doc: http://llvm.org/docs/Phabricator.html
 
 
 Quick Links
 ===
-* `LLVM Homepage `_
-* `libc++abi Homepage `_
-* `LLVM Bugzilla`_
-* `cfe-commits Mailing List `_
-* `cfe-dev Mailing List `_
+* `LLVM Homepage `_
+* `libc++abi Homepage `_
+* `LLVM Bugzilla `_
+* `cfe-commits Mailing List`_
+* `cfe-dev Mailing List`_
 * `Browse libc++ -- SVN `_
 * `Browse libc++ -- ViewVC 
`_
-
-
-.. _`llvm`: http://llvm.org/
-.. _`libc++abi`: http://libcxxabi.llvm.org/
-.. _`LLVM Bugzilla`: http://llvm.org/bugs/
-.. _cfe-dev: http://lists.llvm.org/mailman/listinfo/cfe-dev
-.. _cfe-commits: http://lists.llvm.org/mailman/listinfo/cfe-commits


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11619: [OPENMP] allow static local variable on data-sharing attribute clause

2015-09-06 Thread Alexey Bataev via cfe-commits
ABataev added a comment.

LG


http://reviews.llvm.org/D11619



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r246944 - [X86]][SSE42] Added SSE42 IR + assembly codegen builtin tests

2015-09-06 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sun Sep  6 09:05:33 2015
New Revision: 246944

URL: http://llvm.org/viewvc/llvm-project?rev=246944=rev
Log:
[X86]][SSE42] Added SSE42 IR + assembly codegen builtin tests

Added:
cfe/trunk/test/CodeGen/sse42-builtins.c

Added: cfe/trunk/test/CodeGen/sse42-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse42-builtins.c?rev=246944=auto
==
--- cfe/trunk/test/CodeGen/sse42-builtins.c (added)
+++ cfe/trunk/test/CodeGen/sse42-builtins.c Sun Sep  6 09:05:33 2015
@@ -0,0 +1,141 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +sse4.2 
-emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +sse4.2 
-S -o - -Werror | FileCheck %s --check-prefix=CHECK-ASM
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include 
+
+__m128i test_mm_cmpgt_epi64(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpgt_epi64
+  // CHECK: icmp sgt <2 x i64>
+  // CHECK-ASM: pcmpgtq %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpgt_epi64(A, B);
+}
+
+int test_mm_cmpestra(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestra
+  // CHECK: @llvm.x86.sse42.pcmpestria128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestra(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpestrc(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestrc
+  // CHECK: @llvm.x86.sse42.pcmpestric128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestrc(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpestri(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestri
+  // CHECK: @llvm.x86.sse42.pcmpestri128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestri(A, LA, B, LB, 7);
+}
+
+__m128i test_mm_cmpestrm(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestrm
+  // CHECK: @llvm.x86.sse42.pcmpestrm128
+  // CHECK-ASM: pcmpestrm $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestrm(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpestro(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestro
+  // CHECK: @llvm.x86.sse42.pcmpestrio128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestro(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpestrs(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestrs
+  // CHECK: @llvm.x86.sse42.pcmpestris128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestrs(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpestrz(__m128i A, int LA, __m128i B, int LB) {
+  // CHECK-LABEL: test_mm_cmpestrz
+  // CHECK: @llvm.x86.sse42.pcmpestriz128
+  // CHECK-ASM: pcmpestri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpestrz(A, LA, B, LB, 7);
+}
+
+int test_mm_cmpistra(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistra
+  // CHECK: @llvm.x86.sse42.pcmpistria128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistra(A, B, 7);
+}
+
+int test_mm_cmpistrc(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistrc
+  // CHECK: @llvm.x86.sse42.pcmpistric128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistrc(A, B, 7);
+}
+
+int test_mm_cmpistri(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistri
+  // CHECK: @llvm.x86.sse42.pcmpistri128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistri(A, B, 7);
+}
+
+__m128i test_mm_cmpistrm(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistrm
+  // CHECK: @llvm.x86.sse42.pcmpistrm128
+  // CHECK-ASM: pcmpistrm $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistrm(A, B, 7);
+}
+
+int test_mm_cmpistro(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistro
+  // CHECK: @llvm.x86.sse42.pcmpistrio128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistro(A, B, 7);
+}
+
+int test_mm_cmpistrs(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistrs
+  // CHECK: @llvm.x86.sse42.pcmpistris128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistrs(A, B, 7);
+}
+
+int test_mm_cmpistrz(__m128i A, __m128i B) {
+  // CHECK-LABEL: test_mm_cmpistrz
+  // CHECK: @llvm.x86.sse42.pcmpistriz128
+  // CHECK-ASM: pcmpistri $7, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_cmpistrz(A, B, 7);
+}
+
+unsigned int test_mm_crc32_u8(unsigned int CRC, unsigned char V) {
+  // CHECK-LABEL: test_mm_crc32_u8
+  // CHECK: call i32 @llvm.x86.sse42.crc32.32.8
+  // CHECK-ASM: crc32
+  return _mm_crc32_u8(CRC, V);
+}
+
+unsigned int test_mm_crc32_u16(unsigned int CRC, unsigned short V) {
+  // CHECK-LABEL: test_mm_crc32_u16
+  // CHECK: call i32 @llvm.x86.sse42.crc32.32.16
+  // CHECK-ASM: crc32
+  return _mm_crc32_u16(CRC, V);
+}
+
+unsigned int test_mm_crc32_u32(unsigned int CRC, unsigned int V) {
+  // CHECK-LABEL: test_mm_crc32_u32
+  // CHECK: call i32 @llvm.x86.sse42.crc32.32.32

r246945 - [X86]][SSE3] Added SSE3 IR + assembly codegen builtin tests

2015-09-06 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sun Sep  6 09:45:13 2015
New Revision: 246945

URL: http://llvm.org/viewvc/llvm-project?rev=246945=rev
Log:
[X86]][SSE3] Added SSE3 IR + assembly codegen builtin tests

Added:
cfe/trunk/test/CodeGen/sse3-builtins.c

Added: cfe/trunk/test/CodeGen/sse3-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse3-builtins.c?rev=246945=auto
==
--- cfe/trunk/test/CodeGen/sse3-builtins.c (added)
+++ cfe/trunk/test/CodeGen/sse3-builtins.c Sun Sep  6 09:45:13 2015
@@ -0,0 +1,85 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +sse3 
-emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +sse3 -S 
-o - -Werror | FileCheck %s --check-prefix=CHECK-ASM
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include 
+
+__m128d test_mm_addsub_pd(__m128d A, __m128d B) {
+  // CHECK-LABEL: test_mm_addsub_pd
+  // CHECK: call <2 x double> @llvm.x86.sse3.addsub.pd
+  // CHECK-ASM: addsubpd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_addsub_pd(A, B);
+}
+
+__m128 test_mm_addsub_ps(__m128 A, __m128 B) {
+  // CHECK-LABEL: test_mm_addsub_ps
+  // CHECK: call <4 x float> @llvm.x86.sse3.addsub.ps
+  // CHECK-ASM: addsubps %xmm{{.*}}, %xmm{{.*}}
+  return _mm_addsub_ps(A, B);
+}
+
+__m128d test_mm_hadd_pd(__m128d A, __m128d B) {
+  // CHECK-LABEL: test_mm_hadd_pd
+  // CHECK: call <2 x double> @llvm.x86.sse3.hadd.pd
+  // CHECK-ASM: haddpd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hadd_pd(A, B);
+}
+
+__m128 test_mm_hadd_ps(__m128 A, __m128 B) {
+  // CHECK-LABEL: test_mm_hadd_ps
+  // CHECK: call <4 x float> @llvm.x86.sse3.hadd.ps
+  // CHECK-ASM: haddps %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hadd_ps(A, B);
+}
+
+__m128d test_mm_hsub_pd(__m128d A, __m128d B) {
+  // CHECK-LABEL: test_mm_hsub_pd
+  // CHECK: call <2 x double> @llvm.x86.sse3.hsub.pd
+  // CHECK-ASM: hsubpd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hsub_pd(A, B);
+}
+
+__m128 test_mm_hsub_ps(__m128 A, __m128 B) {
+  // CHECK-LABEL: test_mm_hsub_ps
+  // CHECK: call <4 x float> @llvm.x86.sse3.hsub.ps
+  // CHECK-ASM: hsubps %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hsub_ps(A, B);
+}
+
+__m128i test_mm_lddqu_si128(__m128i const* P) {
+  // CHECK-LABEL: test_mm_lddqu_si128
+  // CHECK: call <16 x i8> @llvm.x86.sse3.ldu.dq
+  // CHECK-ASM: lddqu
+  return _mm_lddqu_si128(P);
+}
+
+__m128d test_mm_loaddup_pd(double const* P) {
+  // CHECK-LABEL: test_mm_loaddup_pd
+  // CHECK: load double*
+  // CHECK-ASM: movddup %xmm{{.*}}
+  return _mm_loaddup_pd(P);
+}
+
+__m128d test_mm_movedup_pd(__m128d A) {
+  // CHECK-LABEL: test_mm_movedup_pd
+  // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x 
i32> zeroinitializer
+  // CHECK-ASM: movddup %xmm{{.*}}, %xmm{{.*}}
+  return _mm_movedup_pd(A);
+}
+
+__m128 test_mm_movehdup_ps(__m128 A) {
+  // CHECK-LABEL: test_mm_movehdup_ps
+  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x i32> 

+  // CHECK-ASM: movshdup %xmm{{.*}}, %xmm{{.*}}
+  return _mm_movehdup_ps(A);
+}
+
+__m128 test_mm_movedup_ps(__m128 A) {
+  // CHECK-LABEL: test_mm_movedup_ps
+  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x i32> 

+  // CHECK-ASM: movsldup %xmm{{.*}}, %xmm{{.*}}
+  return _mm_moveldup_ps(A);
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D12666: [LibClang] Fix clang_getCursorAvailability

2015-09-06 Thread Sergey Kalinichev via cfe-commits
skalinichev created this revision.
skalinichev added a subscriber: cfe-commits.

Make it report correct availability kind for deleted methods



http://reviews.llvm.org/D12666

Files:
  test/Index/availability.cpp
  tools/libclang/CIndex.cpp

Index: tools/libclang/CIndex.cpp
===
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -6400,7 +6400,7 @@
 
 static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {
   if (isa(D) && cast(D)->isDeleted())
-return CXAvailability_Available;
+return CXAvailability_NotAvailable;
   
   switch (D->getAvailability()) {
   case AR_Available:
Index: test/Index/availability.cpp
===
--- /dev/null
+++ test/Index/availability.cpp
@@ -0,0 +1,13 @@
+void foo() = delete;
+
+struct Foo {
+  int foo() = delete;
+  Foo() = delete;
+};
+
+
+// RUN: c-index-test -test-print-type --std=c++11 %s | FileCheck %s
+// CHECK: FunctionDecl=foo:1:6 (unavailable) [type=void ()] 
[typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: StructDecl=Foo:3:8 (Definition) [type=Foo] [typekind=Record] 
[isPOD=1]
+// CHECK: CXXMethod=foo:4:7 (unavailable) [type=int ()] 
[typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0]
+// CHECK: CXXConstructor=Foo:5:3 (unavailable) [type=void ()] 
[typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]


Index: tools/libclang/CIndex.cpp
===
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -6400,7 +6400,7 @@
 
 static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {
   if (isa(D) && cast(D)->isDeleted())
-return CXAvailability_Available;
+return CXAvailability_NotAvailable;
   
   switch (D->getAvailability()) {
   case AR_Available:
Index: test/Index/availability.cpp
===
--- /dev/null
+++ test/Index/availability.cpp
@@ -0,0 +1,13 @@
+void foo() = delete;
+
+struct Foo {
+  int foo() = delete;
+  Foo() = delete;
+};
+
+
+// RUN: c-index-test -test-print-type --std=c++11 %s | FileCheck %s
+// CHECK: FunctionDecl=foo:1:6 (unavailable) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: StructDecl=Foo:3:8 (Definition) [type=Foo] [typekind=Record] [isPOD=1]
+// CHECK: CXXMethod=foo:4:7 (unavailable) [type=int ()] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0]
+// CHECK: CXXConstructor=Foo:5:3 (unavailable) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r246948 - [X86][SSSE3] Added SSSE3 IR + assembly codegen builtin tests

2015-09-06 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sun Sep  6 12:06:22 2015
New Revision: 246948

URL: http://llvm.org/viewvc/llvm-project?rev=246948=rev
Log:
[X86][SSSE3] Added SSSE3 IR + assembly codegen builtin tests

Transferred SSSE3 instructions from sse-builtins.c

Added:
cfe/trunk/test/CodeGen/ssse3-builtins.c
Modified:
cfe/trunk/test/CodeGen/sse-builtins.c

Modified: cfe/trunk/test/CodeGen/sse-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse-builtins.c?rev=246948=246947=246948=diff
==
--- cfe/trunk/test/CodeGen/sse-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse-builtins.c Sun Sep  6 12:06:22 2015
@@ -478,16 +478,6 @@ __m128 test_mm_bsrli_si128(__m128 a) {
   return _mm_bsrli_si128(a, 5);
 }
 
-__m128i test_mm_alignr_epi8(__m128i a, __m128i b) {
-  // CHECK: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> 

-  return _mm_alignr_epi8(a, b, 2);
-}
-
-__m128i test2_mm_alignr_epi8(__m128i a, __m128i b) {
-  // CHECK: shufflevector <16 x i8> %{{.*}}, <16 x i8> zeroinitializer, <16 x 
i32> 
-  return _mm_alignr_epi8(a, b, 17);
-}
-
 __m128 test_mm_undefined_ps() {
   // CHECK-LABEL: @test_mm_undefined_ps
   // CHECK: ret <4 x float> undef

Added: cfe/trunk/test/CodeGen/ssse3-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ssse3-builtins.c?rev=246948=auto
==
--- cfe/trunk/test/CodeGen/ssse3-builtins.c (added)
+++ cfe/trunk/test/CodeGen/ssse3-builtins.c Sun Sep  6 12:06:22 2015
@@ -0,0 +1,127 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +ssse3 
-emit-llvm -o - -Werror | FileCheck %s
+// RUN: %clang_cc1 %s -O0 -triple=x86_64-apple-darwin -target-feature +ssse3 
-S -o - -Werror | FileCheck %s --check-prefix=CHECK-ASM
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include 
+
+__m128i test_mm_abs_epi8(__m128i a) {
+  // CHECK-LABEL: test_mm_abs_epi8
+  // CHECK: call <16 x i8> @llvm.x86.ssse3.pabs.b.128
+  // CHECK-ASM: pabsb %xmm{{.*}}, %xmm{{.*}}
+  return _mm_abs_epi8(a);
+}
+
+__m128i test_mm_abs_epi16(__m128i a) {
+  // CHECK-LABEL: test_mm_abs_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.pabs.w.128
+  // CHECK-ASM: pabsw %xmm{{.*}}, %xmm{{.*}}
+  return _mm_abs_epi16(a);
+}
+
+__m128i test_mm_abs_epi32(__m128i a) {
+  // CHECK-LABEL: test_mm_abs_epi32
+  // CHECK: call <4 x i32> @llvm.x86.ssse3.pabs.d.128
+  // CHECK-ASM: pabsd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_abs_epi32(a);
+}
+
+__m128i test_mm_alignr_epi8(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_alignr_epi8
+  // CHECK: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> 

+  // CHECK-ASM: palignr $2, %xmm{{.*}}, %xmm{{.*}}
+  return _mm_alignr_epi8(a, b, 2);
+}
+
+__m128i test2_mm_alignr_epi8(__m128i a, __m128i b) {
+  // CHECK-LABEL: test2_mm_alignr_epi8
+  // CHECK: shufflevector <16 x i8> %{{.*}}, <16 x i8> zeroinitializer, <16 x 
i32> 
+  // CHECK-ASM: psrldq $1, %xmm{{.*}}
+  return _mm_alignr_epi8(a, b, 17);
+}
+
+__m128i test_mm_hadd_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hadd_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.phadd.w.128
+  // CHECK-ASM: phaddw %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hadd_epi16(a, b);
+}
+
+__m128i test_mm_hadd_epi32(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hadd_epi32
+  // CHECK: call <4 x i32> @llvm.x86.ssse3.phadd.d.128
+  // CHECK-ASM: phaddd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hadd_epi32(a, b);
+}
+
+__m128i test_mm_hadds_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hadds_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.phadd.sw.128
+  // CHECK-ASM: phaddsw %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hadds_epi16(a, b);
+}
+
+__m128i test_mm_hsub_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hsub_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.phsub.w.128
+  // CHECK-ASM: phsubw %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hsub_epi16(a, b);
+}
+
+__m128i test_mm_hsub_epi32(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hsub_epi32
+  // CHECK: call <4 x i32> @llvm.x86.ssse3.phsub.d.128
+  // CHECK-ASM: phsubd %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hsub_epi32(a, b);
+}
+
+__m128i test_mm_hsubs_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_hsubs_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.phsub.sw.128
+  // CHECK-ASM: phsubsw %xmm{{.*}}, %xmm{{.*}}
+  return _mm_hsubs_epi16(a, b);
+}
+
+__m128i test_mm_maddubs_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_maddubs_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.pmadd.ub.sw.128
+  // CHECK-ASM: pmaddubsw %xmm{{.*}},  %xmm{{.*}}
+  return _mm_maddubs_epi16(a, b);
+}
+
+__m128i test_mm_mulhrs_epi16(__m128i a, __m128i b) {
+  // CHECK-LABEL: test_mm_mulhrs_epi16
+  // CHECK: call <8 x i16> @llvm.x86.ssse3.pmul.hr.sw.128
+  // CHECK-ASM: pmulhrsw %xmm{{.*}}, 

r246946 - Refactoring of how ARMTargetInfo handles default target features.

2015-09-06 Thread Alexandros Lamprineas via cfe-commits
Author: alelab01
Date: Sun Sep  6 11:15:45 2015
New Revision: 246946

URL: http://llvm.org/viewvc/llvm-project?rev=246946=rev
Log:
Refactoring of how ARMTargetInfo handles default target features.

Differential Revision: http://reviews.llvm.org/D11299

Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/arm-target-features.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=246946=246945=246946=diff
==
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sun Sep  6 11:15:45 2015
@@ -4442,37 +4442,20 @@ public:
   bool initFeatureMap(llvm::StringMap , DiagnosticsEngine 
,
   StringRef CPU,
   std::vector ) const override {
-if (CPU == "arm1136jf-s" || CPU == "arm1176jzf-s" || CPU == "mpcore")
-  Features["vfp2"] = true;
-else if (CPU == "cortex-a8" || CPU == "cortex-a9") {
-  Features["vfp3"] = true;
-  Features["neon"] = true;
-}
-else if (CPU == "cortex-a5") {
-  Features["vfp4"] = true;
-  Features["neon"] = true;
-} else if (CPU == "swift" || CPU == "cortex-a7" ||
-   CPU == "cortex-a12" || CPU == "cortex-a15" ||
-   CPU == "cortex-a17" || CPU == "krait") {
-  Features["vfp4"] = true;
-  Features["neon"] = true;
-  Features["hwdiv"] = true;
-  Features["hwdiv-arm"] = true;
-} else if (CPU == "cyclone" || CPU == "cortex-a53" || CPU == "cortex-a57" 
||
-   CPU == "cortex-a72") {
-  Features["fp-armv8"] = true;
-  Features["neon"] = true;
-  Features["hwdiv"] = true;
-  Features["hwdiv-arm"] = true;
-  Features["crc"] = true;
-  Features["crypto"] = true;
-} else if (CPU == "cortex-r5" || CPU == "cortex-r7" || ArchVersion == 8) {
-  Features["hwdiv"] = true;
-  Features["hwdiv-arm"] = true;
-} else if (CPU == "cortex-m3" || CPU == "cortex-m4" || CPU == "cortex-m7" 
||
-   CPU == "sc300" || CPU == "cortex-r4" || CPU == "cortex-r4f") {
-  Features["hwdiv"] = true;
-}
+   
+std::vector TargetFeatures;
+
+// get default FPU features
+unsigned FPUKind = llvm::ARM::getDefaultFPU(CPU);
+llvm::ARM::getFPUFeatures(FPUKind, TargetFeatures);
+
+// get default Extension features
+unsigned Extensions = llvm::ARM::getDefaultExtensions(CPU);
+llvm::ARM::getExtensionFeatures(Extensions, TargetFeatures);
+
+for (const char *Feature : TargetFeatures)
+  if (Feature[0] == '+')
+Features[Feature+1] = true; 
 
 if (ArchVersion < 6  || 
(ArchVersion == 6 && ArchProfile == llvm::ARM::PK_M))

Modified: cfe/trunk/test/CodeGen/arm-target-features.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-target-features.c?rev=246946=246945=246946=diff
==
--- cfe/trunk/test/CodeGen/arm-target-features.c (original)
+++ cfe/trunk/test/CodeGen/arm-target-features.c Sun Sep  6 11:15:45 2015
@@ -1,10 +1,13 @@
 // REQUIRES: arm-registered-target
 
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a8 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3
-// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a9 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3
 // CHECK-VFP3: "target-features"="+neon,+vfp3"
 
 
+// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-a9 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-FP16
+// CHECK-VFP3-FP16: "target-features"="+fp16,+neon,+vfp3"
+
+
 // RUN: %clang_cc1 -triple thumbv7-linux-gnueabihf -target-cpu cortex-a5 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4
 // CHECK-VFP4: "target-features"="+neon,+vfp4"
 
@@ -25,10 +28,30 @@
 // CHECK-BASIC-V8: 
"target-features"="+crc,+crypto,+fp-armv8,+hwdiv,+hwdiv-arm,+neon"
 
 
+// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r5f 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-DIV
+// CHECK-VFP3-D16-DIV: "target-features"="+d16,+hwdiv,+hwdiv-arm,+vfp3"
+
+
+// RUN: %clang_cc1 -triple armv7-linux-gnueabi -target-cpu cortex-r4f 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-THUMB-DIV
+// CHECK-VFP3-D16-THUMB-DIV: "target-features"="+d16,+hwdiv,+vfp3"
+
+
+// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r7 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-FP16-DIV
+// CHECK-VFP3-D16-FP16-DIV: 
"target-features"="+d16,+fp16,+hwdiv,+hwdiv-arm,+vfp3"
+
+
+// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-m4f 
-emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP4-D16-SP-THUMB-DIV
+// CHECK-VFP4-D16-SP-THUMB-DIV: 
"target-features"="+d16,+fp-only-sp,+hwdiv,+vfp4"
+
+
+// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu 

r246947 - [X86]][SSE3] Added SSE41 IR + assembly codegen builtin tests

2015-09-06 Thread Simon Pilgrim via cfe-commits
Author: rksimon
Date: Sun Sep  6 11:38:17 2015
New Revision: 246947

URL: http://llvm.org/viewvc/llvm-project?rev=246947=rev
Log:
[X86]][SSE3] Added SSE41 IR + assembly codegen builtin tests

Transferred SSE41 instructions from sse-builtins.c

Added:
cfe/trunk/test/CodeGen/sse41-builtins.c
Modified:
cfe/trunk/test/CodeGen/sse-builtins.c

Modified: cfe/trunk/test/CodeGen/sse-builtins.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse-builtins.c?rev=246947=246946=246947=diff
==
--- cfe/trunk/test/CodeGen/sse-builtins.c (original)
+++ cfe/trunk/test/CodeGen/sse-builtins.c Sun Sep  6 11:38:17 2015
@@ -135,54 +135,6 @@ __m128i test_loadl_epi64(void* y) {
   return _mm_loadl_epi64(y);
 }
 
-__m128i test_mm_minpos_epu16(__m128i x) {
-  // CHECK: define {{.*}} @test_mm_minpos_epu16
-  // CHECK: @llvm.x86.sse41.phminposuw
-  return _mm_minpos_epu16(x);
-}
-
-__m128i test_mm_mpsadbw_epu8(__m128i x, __m128i y) {
-  // CHECK: define {{.*}} @test_mm_mpsadbw_epu8
-  // CHECK: @llvm.x86.sse41.mpsadbw
-  return _mm_mpsadbw_epu8(x, y, 1);
-}
-
-__m128 test_mm_dp_ps(__m128 x, __m128 y) {
-  // CHECK: define {{.*}} @test_mm_dp_ps
-  // CHECK: @llvm.x86.sse41.dpps
-  return _mm_dp_ps(x, y, 2);
-}
-
-__m128d test_mm_dp_pd(__m128d x, __m128d y) {
-  // CHECK: define {{.*}} @test_mm_dp_pd
-  // CHECK: @llvm.x86.sse41.dppd
-  return _mm_dp_pd(x, y, 2);
-}
-
-__m128 test_mm_round_ps(__m128 x) {
-  // CHECK: define {{.*}} @test_mm_round_ps
-  // CHECK: @llvm.x86.sse41.round.ps
-  return _mm_round_ps(x, 2);
-}
-
-__m128 test_mm_round_ss(__m128 x, __m128 y) {
-  // CHECK: define {{.*}} @test_mm_round_ss
-  // CHECK: @llvm.x86.sse41.round.ss
-  return _mm_round_ss(x, y, 2);
-}
-
-__m128d test_mm_round_pd(__m128d x) {
-  // CHECK: define {{.*}} @test_mm_round_pd
-  // CHECK: @llvm.x86.sse41.round.pd
-  return _mm_round_pd(x, 2);
-}
-
-__m128d test_mm_round_sd(__m128d x, __m128d y) {
-  // CHECK: define {{.*}} @test_mm_round_sd
-  // CHECK: @llvm.x86.sse41.round.sd
-  return _mm_round_sd(x, y, 2);
-}
-
 void test_storel_epi64(__m128i x, void* y) {
   // CHECK-LABEL: define void @test_storel_epi64
   // CHECK: store {{.*}} i64* {{.*}}, align 1{{$}}
@@ -214,48 +166,6 @@ void test_extract_epi16(__m128i __a) {
   _mm_extract_epi16(__a, 8);
 }
 
-int test_extract_ps(__m128i __a) {
-  // CHECK-LABEL: @test_extract_ps
-  // CHECK: extractelement <4 x float> %{{.*}}, i32 0
-  return _mm_extract_ps(__a, 4);
-}
-
-int test_extract_epi8(__m128i __a) {
-  // CHECK-LABEL: @test_extract_epi8
-  // CHECK: extractelement <16 x i8> %{{.*}}, i32 0
-  return _mm_extract_epi8(__a, 16);
-}
-
-int test_extract_epi32(__m128i __a) {
-  // CHECK-LABEL: @test_extract_epi32
-  // CHECK: extractelement <4 x i32> %{{.*}}, i32 0
-  return _mm_extract_epi32(__a, 4);
-}
-
-void test_insert_epi32(__m128i __a, int b) {
-  // CHECK-LABEL: @test_insert_epi32
-  // CHECK: insertelement <4 x i32> %{{.*}}, i32 %{{.*}}, i32 0
-   _mm_insert_epi32(__a, b, 4);
-}
-
-__m128d test_blend_pd(__m128d V1, __m128d V2) {
-  // CHECK-LABEL: @test_blend_pd
-  // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x 
i32> 
-  return _mm_blend_pd(V1, V2, 1);
-}
-
-__m128 test_blend_ps(__m128 V1, __m128 V2) {
-  // CHECK-LABEL: @test_blend_ps
-  // CHECK: shufflevector <4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x i32> 

-  return _mm_blend_ps(V1, V2, 5);
-}
-
-__m128i test_blend_epi16(__m128i V1, __m128i V2) {
-  // CHECK-LABEL: @test_blend_epi16
-  // CHECK: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> 
-  return _mm_blend_epi16(V1, V2, 42);
-}
-
 __m128 test_mm_cmpeq_ss(__m128 __a, __m128 __b) {
   // CHECK-LABEL: @test_mm_cmpeq_ss
   // CHECK: @llvm.x86.sse.cmp.ss(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i8 
0)
@@ -578,78 +488,6 @@ __m128i test2_mm_alignr_epi8(__m128i a,
   return _mm_alignr_epi8(a, b, 17);
 }
 
-__m128i test_mm_cvtepi8_epi16(__m128i a) {
-  // CHECK-LABEL: @test_mm_cvtepi8_epi16
-  // CHECK: call <8 x i16> @llvm.x86.sse41.pmovsxbw(<16 x i8> {{.*}})
-  return _mm_cvtepi8_epi16(a);
-}
-
-__m128i test_mm_cvtepi8_epi32(__m128i a) {
-  // CHECK-LABEL: @test_mm_cvtepi8_epi32
-  // CHECK: call <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8> {{.*}})
-  return _mm_cvtepi8_epi32(a);
-}
-
-__m128i test_mm_cvtepi8_epi64(__m128i a) {
-  // CHECK-LABEL: @test_mm_cvtepi8_epi64
-  // CHECK: call <2 x i64> @llvm.x86.sse41.pmovsxbq(<16 x i8> {{.*}})
-  return _mm_cvtepi8_epi64(a);
-}
-
-__m128i test_mm_cvtepi16_epi32(__m128i a) {
-  // CHECK-LABEL: @test_mm_cvtepi16_epi32
-  // CHECK: call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> {{.*}})
-  return _mm_cvtepi16_epi32(a);
-}
-
-__m128i test_mm_cvtepi16_epi64(__m128i a) {
-  // CHECK-LABEL: @test_mm_cvtepi16_epi64
-  // CHECK: call <2 x i64> @llvm.x86.sse41.pmovsxwq(<8 x i16> {{.*}})
-  return _mm_cvtepi16_epi64(a);
-}
-
-__m128i test_mm_cvtepi32_epi64(__m128i a) {
-  // CHECK-LABEL: