<p dir="ltr">Yeah, I've been trying to fix them. I didn't see them go in. :(</p>
<p dir="ltr">And yes, that's a good way to tie them. It shouldn't be bad though. Separation of concerns and all.</p>
<p dir="ltr">-eric<br>
</p>
<p dir="ltr"></p>
<p dir="ltr">On Sun, Nov 29, 2015, 3:10 PM Robinson, Paul <<a href="mailto:Paul_Robinson@playstation.sony.com">Paul_Robinson@playstation.sony.com</a>> wrote:</p>
<blockquote><p dir="ltr">It looks like there are a number of the *-builtins.c tests that have grown this feature of testing both IR and asm. Seems to have sprung from PR24580.<br>
</p>
</blockquote>
<p dir="ltr"><br><br></p>
<blockquote><p dir="ltr"><br>
</p>
<p dir="ltr">Simon, if you're concerned about bitrot, I'd think you could have comments in the Clang test citing the LLVM test, and vice versa. It's not a guarantee but it certainly should help.</p>
<p dir="ltr">--paulr</p>
<p dir="ltr"> </p>
<p dir="ltr"><b>From:</b> cfe-commits [mailto:<a href="mailto:cfe-commits-bounces@lists.llvm.org">cfe-commits-bounces@lists.llvm.org</a>] <b>On Behalf Of </b>Eric Christopher via cfe-commits<br>
<b>Sent:</b> Sunday, November 29, 2015 2:21 PM<br>
<b>To:</b> Simon Pilgrim; <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<b>Subject:</b> Re: r254262 - [X86][SSE2] Added SSE2 IR + assembly codegen builtin tests</p>
<p dir="ltr"> </p>
<p dir="ltr">There's no reason a split set of tests would fail at doing this. You can test that the IR is what you expect and then that the backend tests it as well. It's very simple to do. </p>
<p dir="ltr"> </p>
<p dir="ltr">On Sun, Nov 29, 2015, 2:08 PM Simon Pilgrim <<a href="mailto:llvm-dev@redking.me.uk">llvm-dev@redking.me.uk</a>> wrote:</p>
</blockquote>
<blockquote><blockquote><p dir="ltr">So the problem we’re trying to solve is it make sure that in debug builds, clang compiles c/c++ intrinsics in the headers down to assembly that is very close to the expected instruction.</p>
<p dir="ltr"> </p>
<p dir="ltr">What we had before (testing c/c++ to IR results in clang/test/CodeGen and testing with llc on ‘similar' IR in llvm/test/CodeGen/X86) was very sensitive to bitrot, especially as we’ve put so much effort into removing what target specific intrinsics that we can.</p>
<p dir="ltr"> </p>
<p dir="ltr">I’m happy to split the tests but would prefer that they are both being tested from c/c++ source (that at least is unlikely to ever change) so that we have a better chance of keeping track of any big changes - so is there anywhere in the clang project that they can be put?</p>
<p dir="ltr"> </p>
</blockquote>
</blockquote>
<blockquote><blockquote><blockquote><p dir="ltr">On 29 Nov 2015, at 21:47, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</p>
<p dir="ltr"> </p>
<p dir="ltr">In the backend. If at all possible IR tests only in the front end. Same with optimization etc. </p>
<p dir="ltr"> </p>
<p dir="ltr">On Sun, Nov 29, 2015, 1:46 PM Simon Pilgrim <<a href="mailto:llvm-dev@redking.me.uk">llvm-dev@redking.me.uk</a>> wrote:</p>
</blockquote>
</blockquote>
</blockquote>
<blockquote><blockquote><blockquote><blockquote><p dir="ltr">I can try - if asm is not supposed to go in tests/CodeGen where is it supposed to go? </p>
<p dir="ltr"> </p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote><blockquote><blockquote><blockquote><blockquote><p dir="ltr">On 29 Nov 2015, at 20:38, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@</a><a href="mailto:echristo@gmail.com">gmail.com</a>> wrote:</p>
<p dir="ltr"> </p>
<p dir="ltr">This is amazing... And entirely the wrong place for the asm tests. :)</p>
<p dir="ltr">Would you mind splitting this test case in two with an IR test for clang and an asm test for llvm?</p>
<p dir="ltr">Thanks!</p>
<p dir="ltr"> </p>
<p dir="ltr">On Sun, Nov 29, 2015, 12:25 PM Simon Pilgrim via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote><blockquote><blockquote><blockquote><blockquote><blockquote><p dir="ltr">Author: rksimon<br>
Date: Sun Nov 29 14:23:00 2015<br>
New Revision: 254262</p>
<p dir="ltr">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">http://</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">llvm.org</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">/</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">viewvc</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">/</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">llvm-project</a><a href="http://llvm.org/viewvc/llvm-project?rev=254262&view=rev">?rev=254262&view=rev</a><br>
Log:<br>
[X86][SSE2] Added SSE2 IR + assembly codegen builtin tests</p>
<p dir="ltr">Improved tests as discussed in PR24580</p>
<p dir="ltr">Added:<br>
cfe/trunk/test/CodeGen/sse2-builtins.c</p>
<p dir="ltr">Added: cfe/trunk/test/CodeGen/sse2-builtins.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">http://</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">llvm.org</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">/</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">viewvc</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">/</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">llvm-project</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">/</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">cfe</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">/trunk/test/</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">CodeGen</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">/</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">sse2-builtins.c</a><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=254262&view=auto">?rev=254262&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGen/sse2-builtins.c (added)<br>
+++ cfe/trunk/test/CodeGen/sse2-builtins.c Sun Nov 29 14:23:00 2015<br>
@@ -0,0 +1,1656 @@<br>
+// REQUIRES: x86-registered-target<br>
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +sse2 -emit-llvm -o - -Werror | FileCheck %s --check-prefix=DAG<br>
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +sse2 -fno-signed-char -emit-llvm -o - -Werror | FileCheck %s --check-prefix=DAG<br>
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +sse2 -S -o - -Werror | FileCheck %s --check-prefix=ASM<br>
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +sse2 -fno-signed-char -S -o - -Werror | FileCheck %s --check-prefix=ASM<br>
+<br>
+// Don't include mm_malloc.h, it's system specific.<br>
+#define __MM_MALLOC_H<br>
+<br>
+#include <x86intrin.h><br>
+<br>
+__m128i test_mm_add_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_add_epi8<br>
+ // DAG: add <16 x i8><br>
+ //<br>
+ // ASM-LABEL: test_mm_add_epi8<br>
+ // ASM: paddb<br>
+ return _mm_add_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_add_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_add_epi16<br>
+ // DAG: add <8 x i16><br>
+ //<br>
+ // ASM-LABEL: test_mm_add_epi16<br>
+ // ASM: paddw<br>
+ return _mm_add_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_add_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_add_epi32<br>
+ // DAG: add <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_add_epi32<br>
+ // ASM: paddd<br>
+ return _mm_add_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_add_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_add_epi64<br>
+ // DAG: add <2 x i64><br>
+ //<br>
+ // ASM-LABEL: test_mm_add_epi64<br>
+ // ASM: paddq<br>
+ return _mm_add_epi64(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_add_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_add_pd<br>
+ // DAG: fadd <2 x double><br>
+ //<br>
+ // ASM-LABEL: test_mm_add_pd<br>
+ // ASM: addpd<br>
+ return _mm_add_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_add_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_add_sd<br>
+ // DAG: fadd double<br>
+ //<br>
+ // ASM-LABEL: test_mm_add_sd<br>
+ // ASM: addsd<br>
+ return _mm_add_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_adds_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_adds_epi8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.padds.b<br>
+ //<br>
+ // ASM-LABEL: test_mm_adds_epi8<br>
+ // ASM: paddsb<br>
+ return _mm_adds_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_adds_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_adds_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.padds.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_adds_epi16<br>
+ // ASM: paddsw<br>
+ return _mm_adds_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_adds_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_adds_epu8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.paddus.b<br>
+ //<br>
+ // ASM-LABEL: test_mm_adds_epu8<br>
+ // ASM: paddusb<br>
+ return _mm_adds_epu8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_adds_epu16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_adds_epu16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.paddus.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_adds_epu16<br>
+ // ASM: paddusw<br>
+ return _mm_adds_epu16(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_and_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_and_pd<br>
+ // DAG: and <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_and_pd<br>
+ // ASM: pand<br>
+ return _mm_and_pd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_and_si128(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_and_si128<br>
+ // DAG: and <2 x i64><br>
+ //<br>
+ // ASM-LABEL: test_mm_and_si128<br>
+ // ASM: andps<br>
+ return _mm_and_si128(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_avg_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_avg_epu8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.pavg.b<br>
+ //<br>
+ // ASM-LABEL: test_mm_avg_epu8<br>
+ // ASM: pavgb<br>
+ return _mm_avg_epu8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_avg_epu16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_avg_epu16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pavg.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_avg_epu16<br>
+ // ASM: pavgw<br>
+ return _mm_avg_epu16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_bslli_si128(__m128i A) {<br>
+ // DAG-LABEL: test_mm_bslli_si128<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26><br>
+ //<br>
+ // ASM-LABEL: test_mm_bslli_si128<br>
+ // ASM: pslldq $5, %xmm{{.*}}<br>
+ return _mm_bslli_si128(A, 5);<br>
+}<br>
+<br>
+__m128i test_mm_bsrli_si128(__m128i A) {<br>
+ // DAG-LABEL: test_mm_bsrli_si128<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20><br>
+ //<br>
+ // ASM-LABEL: test_mm_bsrli_si128<br>
+ // ASM: psrldq $5, %xmm{{.*}}<br>
+ return _mm_bsrli_si128(A, 5);<br>
+}<br>
+<br>
+void test_mm_clflush(void* A) {<br>
+ // DAG-LABEL: test_mm_clflush<br>
+ // DAG: call void @llvm.x86.sse2.clflush(i8* %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_clflush<br>
+ // ASM: clflush<br>
+ _mm_clflush(A);<br>
+}<br>
+<br>
+__m128i test_mm_cmpeq_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpeq_epi8<br>
+ // DAG: icmp eq <16 x i8><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpeq_epi8<br>
+ // ASM: pcmpeqb<br>
+ return _mm_cmpeq_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmpeq_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpeq_epi16<br>
+ // DAG: icmp eq <8 x i16><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpeq_epi16<br>
+ // ASM: pcmpeqw<br>
+ return _mm_cmpeq_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmpeq_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpeq_epi32<br>
+ // DAG: icmp eq <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpeq_epi32<br>
+ // ASM: pcmpeqd<br>
+ return _mm_cmpeq_epi32(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpeq_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpeq_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 0)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpeq_pd<br>
+ // ASM: cmpeqpd<br>
+ return _mm_cmpeq_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpeq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpeq_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 0)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpeq_sd<br>
+ // ASM: cmpeqsd<br>
+ return _mm_cmpeq_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpge_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpge_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 2)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpge_pd<br>
+ // ASM: cmplepd<br>
+ return _mm_cmpge_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpge_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpge_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 2)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpge_sd<br>
+ // ASM: cmplesd<br>
+ return _mm_cmpge_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmpgt_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpgt_epi8<br>
+ // DAG: icmp sgt <16 x i8><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpgt_epi8<br>
+ // ASM: pcmpgtb<br>
+ return _mm_cmpgt_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmpgt_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpgt_epi16<br>
+ // DAG: icmp sgt <8 x i16><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpgt_epi16<br>
+ // ASM: pcmpgtw<br>
+ return _mm_cmpgt_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmpgt_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmpgt_epi32<br>
+ // DAG: icmp sgt <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpgt_epi32<br>
+ // ASM: pcmpgtd<br>
+ return _mm_cmpgt_epi32(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpgt_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpgt_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 1)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpgt_pd<br>
+ // ASM: cmpltpd<br>
+ return _mm_cmpgt_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpgt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpgt_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 1)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpgt_sd<br>
+ // ASM: cmpltsd<br>
+ return _mm_cmpgt_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmple_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmple_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 2)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmple_pd<br>
+ // ASM: cmplepd<br>
+ return _mm_cmple_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmple_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmple_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.</a><a href="http://llvm.x86.sse2.cmp.sd/">cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 2)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmple_sd<br>
+ // ASM: cmplesd<br>
+ return _mm_cmple_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmplt_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmplt_epi8<br>
+ // DAG: icmp sgt <16 x i8><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmplt_epi8<br>
+ // ASM: pcmpgtb<br>
+ return _mm_cmplt_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmplt_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmplt_epi16<br>
+ // DAG: icmp sgt <8 x i16><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmplt_epi16<br>
+ // ASM: pcmpgtw<br>
+ return _mm_cmplt_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cmplt_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_cmplt_epi32<br>
+ // DAG: icmp sgt <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_cmplt_epi32<br>
+ // ASM: pcmpgtd<br>
+ return _mm_cmplt_epi32(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmplt_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmplt_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 1)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmplt_pd<br>
+ // ASM: cmpltpd<br>
+ return _mm_cmplt_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmplt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmplt_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 1)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmplt_sd<br>
+ // ASM: cmpltsd<br>
+ return _mm_cmplt_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpneq_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpneq_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 4)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpneq_pd<br>
+ // ASM: cmpneqpd<br>
+ return _mm_cmpneq_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpneq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpneq_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.</a><a href="http://llvm.x86.sse2.cmp.sd/">cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 4)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpneq_sd<br>
+ // ASM: cmpneqsd<br>
+ return _mm_cmpneq_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnge_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnge_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 6)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnge_pd<br>
+ // ASM: cmpnlepd<br>
+ return _mm_cmpnge_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnge_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnge_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 6)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnge_sd<br>
+ // ASM: cmpnlesd<br>
+ return _mm_cmpnge_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpngt_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpngt_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 5)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpngt_pd<br>
+ // ASM: cmpnltpd<br>
+ return _mm_cmpngt_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpngt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpngt_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 5)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpngt_sd<br>
+ // ASM: cmpnltsd<br>
+ return _mm_cmpngt_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnle_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnle_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 6)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnle_pd<br>
+ // ASM: cmpnlepd<br>
+ return _mm_cmpnle_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnle_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnle_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 6)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnle_sd<br>
+ // ASM: cmpnlesd<br>
+ return _mm_cmpnle_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnlt_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnlt_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 5)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnlt_pd<br>
+ // ASM: cmpnltpd<br>
+ return _mm_cmpnlt_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpnlt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpnlt_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 5)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpnlt_sd<br>
+ // ASM: cmpnltsd<br>
+ return _mm_cmpnlt_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpord_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpord_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 7)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpord_pd<br>
+ // ASM: cmpordpd<br>
+ return _mm_cmpord_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpord_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpord_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 7)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpord_sd<br>
+ // ASM: cmpordsd<br>
+ return _mm_cmpord_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpunord_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpunord_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 3)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpunord_pd<br>
+ // ASM: cmpunordpd<br>
+ return _mm_cmpunord_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cmpunord_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cmpunord_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.cmp.sd/">llvm.x86.sse2.cmp.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}}, i8 3)<br>
+ //<br>
+ // ASM-LABEL: test_mm_cmpunord_sd<br>
+ // ASM: cmpunordsd<br>
+ return _mm_cmpunord_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comieq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comieq_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comieq.sd/">llvm.x86.sse2.comieq.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comieq_sd<br>
+ // ASM: comisd<br>
+ return _mm_comieq_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comige_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comige_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comige.sd/">llvm.x86.sse2.comige.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comige_sd<br>
+ // ASM: comisd<br>
+ return _mm_comige_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comigt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comigt_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comigt.sd/">llvm.x86.</a><a href="http://llvm.x86.sse2.comigt.sd/">sse2.comigt.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comigt_sd<br>
+ // ASM: comisd<br>
+ return _mm_comigt_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comile_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comile_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comile.sd/">llvm.x86.sse2.comile.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comile_sd<br>
+ // ASM: comisd<br>
+ return _mm_comile_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comilt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comilt_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comilt.sd/">llvm.x86.sse2.comilt.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comilt_sd<br>
+ // ASM: comisd<br>
+ return _mm_comilt_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_comineq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_comineq_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.comineq.sd/">llvm.x86.sse2.comineq.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_comineq_sd<br>
+ // ASM: comisd<br>
+ return _mm_comineq_sd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_cvtepi32_pd(__m128i A) {<br>
+ // DAG-LABEL: test_mm_cvtepi32_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cvtdq2pd<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtepi32_pd<br>
+ // ASM: cvtdq2pd<br>
+ return _mm_cvtepi32_pd(A);<br>
+}<br>
+<br>
+__m128 test_mm_cvtepi32_ps(__m128i A) {<br>
+ // DAG-LABEL: test_mm_cvtepi32_ps<br>
+ // DAG: call <4 x float> @llvm.x86.sse2.cvtdq2ps<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtepi32_ps<br>
+ // ASM: cvtdq2ps<br>
+ return _mm_cvtepi32_ps(A);<br>
+}<br>
+<br>
+__m128i test_mm_cvtpd_epi32(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvtpd_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.cvtpd2dq<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtpd_epi32<br>
+ // ASM: cvtpd2dq<br>
+ return _mm_cvtpd_epi32(A);<br>
+}<br>
+<br>
+__m128 test_mm_cvtpd_ps(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvtpd_ps<br>
+ // DAG: call <4 x float> @llvm.x86.sse2.cvtpd2ps<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtpd_ps<br>
+ // ASM: cvtpd2ps<br>
+ return _mm_cvtpd_ps(A);<br>
+}<br>
+<br>
+__m128i test_mm_cvtps_epi32(__m128 A) {<br>
+ // DAG-LABEL: test_mm_cvtps_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.cvtps2dq<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtps_epi32<br>
+ // ASM: cvtps2dq<br>
+ return _mm_cvtps_epi32(A);<br>
+}<br>
+<br>
+__m128d test_mm_cvtps_pd(__m128 A) {<br>
+ // DAG-LABEL: test_mm_cvtps_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.cvtps2pd<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtps_pd<br>
+ // ASM: cvtps2pd<br>
+ return _mm_cvtps_pd(A);<br>
+}<br>
+<br>
+double test_mm_cvtsd_f64(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvtsd_f64<br>
+ // DAG: extractelement <2 x double> %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsd_f64<br>
+ // ASM: movapd<br>
+ return _mm_cvtsd_f64(A);<br>
+}<br>
+<br>
+int test_mm_cvtsd_si32(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvtsd_si32<br>
+ // DAG: call i32 @llvm.x86.sse2.cvtsd2si<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsd_si32<br>
+ // ASM: cvtsd2si<br>
+ return _mm_cvtsd_si32(A);<br>
+}<br>
+<br>
+long long test_mm_cvtsd_si64(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvtsd_si64<br>
+ // DAG: call i64 @llvm.x86.sse2.cvtsd2si64<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsd_si64<br>
+ // ASM: cvtsd2si<br>
+ return _mm_cvtsd_si64(A);<br>
+}<br>
+<br>
+__m128 test_mm_cvtsd_ss(__m128 A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_cvtsd_ss<br>
+ // DAG: fptrunc double %{{.*}} to float<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsd_ss<br>
+ // ASM: cvtsd2ss<br>
+ return _mm_cvtsd_ss(A, B);<br>
+}<br>
+<br>
+int test_mm_cvtsi128_si32(__m128i A) {<br>
+ // DAG-LABEL: test_mm_cvtsi128_si32<br>
+ // DAG: extractelement <4 x i32> %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi128_si32<br>
+ // ASM: movd<br>
+ return _mm_cvtsi128_si32(A);<br>
+}<br>
+<br>
+long long test_mm_cvtsi128_si64(__m128i A) {<br>
+ // DAG-LABEL: test_mm_cvtsi128_si64<br>
+ // DAG: extractelement <2 x i64> %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi128_si64<br>
+ // ASM: movd<br>
+ return _mm_cvtsi128_si64(A);<br>
+}<br>
+<br>
+__m128d test_mm_cvtsi32_sd(__m128d A, int B) {<br>
+ // DAG-LABEL: test_mm_cvtsi32_sd<br>
+ // DAG: sitofp i32 %{{.*}} to double<br>
+ // DAG: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi32_sd<br>
+ // ASM: cvtsi2sdl<br>
+ return _mm_cvtsi32_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cvtsi32_si128(int A) {<br>
+ // DAG-LABEL: test_mm_cvtsi32_si128<br>
+ // DAG: insertelement <4 x i32> undef, i32 %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi32_si128<br>
+ // ASM: movd<br>
+ return _mm_cvtsi32_si128(A);<br>
+}<br>
+<br>
+__m128d test_mm_cvtsi64_sd(__m128d A, long long B) {<br>
+ // DAG-LABEL: test_mm_cvtsi64_sd<br>
+ // DAG: sitofp i64 %{{.*}} to double<br>
+ // DAG: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi64_sd<br>
+ // ASM: cvtsi2sdq<br>
+ return _mm_cvtsi64_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cvtsi64_si128(long long A) {<br>
+ // DAG-LABEL: test_mm_cvtsi64_si128<br>
+ // DAG: insertelement <2 x i64> undef, i64 %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtsi64_si128<br>
+ // ASM: movq<br>
+ return _mm_cvtsi64_si128(A);<br>
+}<br>
+<br>
+__m128d test_mm_cvtss_sd(__m128d A, __m128 B) {<br>
+ // DAG-LABEL: test_mm_cvtss_sd<br>
+ // DAG: extractelement <4 x float> %{{.*}}, i32 0<br>
+ // DAG: fpext float %{{.*}} to double<br>
+ // DAG: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 0<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvtss_sd<br>
+ // ASM: cvtss2sd<br>
+ return _mm_cvtss_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_cvttpd_epi32(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvttpd_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.cvttpd2dq<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvttpd_epi32<br>
+ // ASM: cvttpd2dq<br>
+ return _mm_cvttpd_epi32(A);<br>
+}<br>
+<br>
+__m128i test_mm_cvttps_epi32(__m128 A) {<br>
+ // DAG-LABEL: test_mm_cvttps_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.cvttps2dq<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvttps_epi32<br>
+ // ASM: cvttps2dq<br>
+ return _mm_cvttps_epi32(A);<br>
+}<br>
+<br>
+int test_mm_cvttsd_si32(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvttsd_si32<br>
+ // DAG: extractelement <2 x double> %{{.*}}, i32 0<br>
+ // DAG: fptosi double %{{.*}} to i32<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvttsd_si32<br>
+ // ASM: cvttsd2si<br>
+ return _mm_cvttsd_si32(A);<br>
+}<br>
+<br>
+long long test_mm_cvttsd_si64(__m128d A) {<br>
+ // DAG-LABEL: test_mm_cvttsd_si64<br>
+ // DAG: extractelement <2 x double> %{{.*}}, i32 0<br>
+ // DAG: fptosi double %{{.*}} to i64<br>
+ //<br>
+ // ASM-LABEL: test_mm_cvttsd_si64<br>
+ // ASM: cvttsd2si<br>
+ return _mm_cvttsd_si64(A);<br>
+}<br>
+<br>
+__m128d test_mm_div_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_div_pd<br>
+ // DAG: fdiv <2 x double><br>
+ //<br>
+ // ASM-LABEL: test_mm_div_pd<br>
+ // ASM: divpd<br>
+ return _mm_div_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_div_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_div_sd<br>
+ // DAG: fdiv double<br>
+ //<br>
+ // ASM-LABEL: test_mm_div_sd<br>
+ // ASM: divsd<br>
+ return _mm_div_sd(A, B);<br>
+}<br>
+<br>
+// Lowering to pextrw requires optimization.<br>
+int test_mm_extract_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_extract_epi16<br>
+ // DAG: [[x:%.*]] = and i32 %{{.*}}, 7<br>
+ // DAG: extractelement <8 x i16> %{{.*}}, i32 [[x]]<br>
+ //<br>
+ // ASM-LABEL: test_mm_extract_epi16<br>
+ // ASM: movzwl<br>
+ return _mm_extract_epi16(A, 8);<br>
+}<br>
+<br>
+// Lowering to pinsrw requires optimization.<br>
+__m128i test_mm_insert_epi16(__m128i A, short B) {<br>
+ // DAG-LABEL: test_mm_insert_epi16<br>
+ // DAG: [[x:%.*]] = and i32 %{{.*}}, 7<br>
+ // DAG: insertelement <8 x i16> %{{.*}}, i32 [[x]]<br>
+ //<br>
+ // ASM-LABEL: test_mm_insert_epi16<br>
+ // ASM: movw<br>
+ return _mm_insert_epi16(A, B, 8);<br>
+}<br>
+<br>
+void test_mm_lfence() {<br>
+ // DAG-LABEL: test_mm_lfence<br>
+ // DAG: call void @llvm.x86.sse2.lfence()<br>
+ //<br>
+ // ASM-LABEL: test_mm_lfence<br>
+ // ASM: lfence<br>
+ _mm_lfence();<br>
+}<br>
+<br>
+__m128d test_mm_load_pd(double const* A) {<br>
+ // DAG-LABEL: test_mm_load_pd<br>
+ // DAG: load <2 x double>, <2 x double>* %{{.*}}, align 16<br>
+ //<br>
+ // ASM-LABEL: test_mm_load_pd<br>
+ // ASM: movapd<br>
+ return _mm_load_pd(A);<br>
+}<br>
+<br>
+__m128d test_mm_load_sd(double const* A) {<br>
+ // DAG-LABEL: test_mm_load_sd<br>
+ // DAG: load double, double* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_load_sd<br>
+ // ASM: movsd<br>
+ return _mm_load_sd(A);<br>
+}<br>
+<br>
+__m128i test_mm_load_si128(__m128i const* A) {<br>
+ // DAG-LABEL: test_mm_load_si128<br>
+ // DAG: load <2 x i64>, <2 x i64>* %{{.*}}, align 16<br>
+ //<br>
+ // ASM-LABEL: test_mm_load_si128<br>
+ // ASM: movdqa<br>
+ return _mm_load_si128(A);<br>
+}<br>
+<br>
+__m128d test_mm_load1_pd(double const* A) {<br>
+ // DAG-LABEL: test_mm_load1_pd<br>
+ // DAG: load double, double* %{{.*}}, align 8<br>
+ // DAG: insertelement <2 x double> undef, double %{{.*}}, i32 0<br>
+ // DAG: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_load1_pd<br>
+ // ASM: movsd<br>
+ // ASM: movlhps<br>
+ return _mm_load1_pd(A);<br>
+}<br>
+<br>
+__m128d test_mm_loadh_pd(__m128d x, void* y) {<br>
+ // DAG-LABEL: test_mm_loadh_pd<br>
+ // DAG: load double, double* %{{.*}}, align 1{{$}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_loadh_pd<br>
+ // ASM: movsd<br>
+ // ASM: unpcklpd<br>
+ return _mm_loadh_pd(x, y);<br>
+}<br>
+<br>
+__m128d test_mm_loadr_pd(double const* A) {<br>
+ // DAG-LABEL: test_mm_loadr_pd<br>
+ // DAG: load <2 x double>, <2 x double>* %{{.*}}, align 16<br>
+ // DAG: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 0><br>
+ //<br>
+ // ASM-LABEL: test_mm_loadr_pd<br>
+ // ASM: movapd<br>
+ // ASM: shufpd $1,<br>
+ return _mm_loadr_pd(A);<br>
+}<br>
+<br>
+__m128d test_mm_loadu_pd(double const* A) {<br>
+ // DAG-LABEL: test_mm_loadu_pd<br>
+ // DAG: load <2 x double>, <2 x double>* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_loadu_pd<br>
+ // ASM: movupd<br>
+ return _mm_loadu_pd(A);<br>
+}<br>
+<br>
+__m128i test_mm_loadu_si128(__m128i const* A) {<br>
+ // DAG-LABEL: test_mm_loadu_si128<br>
+ // DAG: load <2 x i64>, <2 x i64>* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_loadu_si128<br>
+ // ASM: movdqu<br>
+ return _mm_loadu_si128(A);<br>
+}<br>
+<br>
+__m128i test_mm_madd_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_madd_epi16<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.pmadd.wd(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_madd_epi16<br>
+ // ASM: pmaddwd<br>
+ return _mm_madd_epi16(A, B);<br>
+}<br>
+<br>
+void test_mm_maskmoveu_si128(__m128i A, __m128i B, char* C) {<br>
+ // DAG-LABEL: test_mm_maskmoveu_si128<br>
+ // DAG: call void @llvm.x86.sse2.maskmov.dqu(<16 x i8> %{{.*}}, <16 x i8> %{{.*}}, i8* %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_maskmoveu_si128<br>
+ // ASM: maskmovdqu<br>
+ _mm_maskmoveu_si128(A, B, C);<br>
+}<br>
+<br>
+__m128i test_mm_max_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_max_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pmaxs.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_max_epi16<br>
+ // ASM: pmaxsw<br>
+ return _mm_max_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_max_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_max_epu8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.pmaxu.b(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_max_epu8<br>
+ // ASM: pmaxub<br>
+ return _mm_max_epu8(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_max_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_max_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.max.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_max_pd<br>
+ // ASM: maxpd<br>
+ return _mm_max_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_max_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_max_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.max.sd/">llvm.x86.sse2.max.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_max_sd<br>
+ // ASM: maxsd<br>
+ return _mm_max_sd(A, B);<br>
+}<br>
+<br>
+void test_mm_mfence() {<br>
+ // DAG-LABEL: test_mm_mfence<br>
+ // DAG: call void @llvm.x86.sse2.mfence()<br>
+ //<br>
+ // ASM-LABEL: test_mm_mfence<br>
+ // ASM: mfence<br>
+ _mm_mfence();<br>
+}<br>
+<br>
+__m128i test_mm_min_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_min_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pmins.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_min_epi16<br>
+ // ASM: pminsw<br>
+ return _mm_min_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_min_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_min_epu8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.pminu.b(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_min_epu8<br>
+ // ASM: pminub<br>
+ return _mm_min_epu8(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_min_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_min_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> %{{.*}}, <2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_min_pd<br>
+ // ASM: minpd<br>
+ return _mm_min_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_min_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_min_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.min.sd/">llvm.x86.sse2.min.sd</a>(<2 x double> %{{.*}}, <2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_min_sd<br>
+ // ASM: minsd<br>
+ return _mm_min_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_movemask_epi8(__m128i A) {<br>
+ // DAG-LABEL: test_mm_movemask_epi8<br>
+ // DAG: call i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_movemask_epi8<br>
+ // ASM: pmovmskb<br>
+ return _mm_movemask_epi8(A);<br>
+}<br>
+<br>
+int test_mm_movemask_pd(__m128d A) {<br>
+ // DAG-LABEL: test_mm_movemask_pd<br>
+ // DAG: call i32 @llvm.x86.sse2.movmsk.pd(<2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_movemask_pd<br>
+ // ASM: movmskpd<br>
+ return _mm_movemask_pd(A);<br>
+}<br>
+<br>
+__m128i test_mm_mul_epu32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_mul_epu32<br>
+ // DAG: call <2 x i64> @llvm.x86.sse2.pmulu.dq(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_mul_epu32<br>
+ // ASM: pmuludq<br>
+ return _mm_mul_epu32(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_mul_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_mul_pd<br>
+ // DAG: fmul <2 x double> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_mul_pd<br>
+ // ASM: mulpd<br>
+ return _mm_mul_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_mul_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_mul_sd<br>
+ // DAG: fmul double %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_mul_sd<br>
+ // ASM: mulsd<br>
+ return _mm_mul_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_mulhi_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_mulhi_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_mulhi_epi16<br>
+ // ASM: pmulhw<br>
+ return _mm_mulhi_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_mulhi_epu16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_mulhi_epu16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pmulhu.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_mulhi_epu16<br>
+ // ASM: pmulhuw<br>
+ return _mm_mulhi_epu16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_mullo_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_mullo_epi16<br>
+ // DAG: mul <8 x i16> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_mullo_epi16<br>
+ // ASM: pmullw<br>
+ return _mm_mullo_epi16(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_or_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_or_pd<br>
+ // DAG: or <4 x i32> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_or_pd<br>
+ // ASM: por<br>
+ return _mm_or_pd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_or_si128(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_or_si128<br>
+ // DAG: or <2 x i64> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_or_si128<br>
+ // ASM: orps<br>
+ return _mm_or_si128(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_packs_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_packs_epi16<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.packsswb.128(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_packs_epi16<br>
+ // ASM: packsswb<br>
+ return _mm_packs_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_packs_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_packs_epi32<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.packssdw.128(<4 x i32> %{{.*}}, <4 x i32> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_packs_epi32<br>
+ // ASM: packssdw<br>
+ return _mm_packs_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_packus_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_packus_epi16<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.packuswb.128(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_packus_epi16<br>
+ // ASM: packuswb<br>
+ return _mm_packus_epi16(A, B);<br>
+}<br>
+<br>
+void test_mm_pause() {<br>
+ // DAG-LABEL: test_mm_pause<br>
+ // DAG: call void @llvm.x86.sse2.pause()<br>
+ //<br>
+ // ASM-LABEL: test_mm_pause<br>
+ // ASM: pause<br>
+ return _mm_pause();<br>
+}<br>
+<br>
+__m128i test_mm_sad_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sad_epu8<br>
+ // DAG: call <2 x i64> @<a href="http://llvm.x86.sse2.psad.bw/">llvm.x86.sse2.psad.bw</a>(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_sad_epu8<br>
+ // ASM: psadbw<br>
+ return _mm_sad_epu8(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_setzero_pd() {<br>
+ // DAG-LABEL: test_mm_setzero_pd<br>
+ // DAG: store <2 x double> zeroinitializer<br>
+ //<br>
+ // ASM-LABEL: test_mm_setzero_pd<br>
+ // ASM: xorps<br>
+ return _mm_setzero_pd();<br>
+}<br>
+<br>
+__m128i test_mm_setzero_si128() {<br>
+ // DAG-LABEL: test_mm_setzero_si128<br>
+ // DAG: store <2 x i64> zeroinitializer<br>
+ //<br>
+ // ASM-LABEL: test_mm_setzero_si128<br>
+ // ASM: xorps<br>
+ return _mm_setzero_si128();<br>
+}<br>
+<br>
+__m128i test_mm_shuffle_epi32(__m128i A) {<br>
+ // DAG-LABEL: test_mm_shuffle_epi32<br>
+ // DAG: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> zeroinitializer<br>
+ //<br>
+ // ASM-LABEL: test_mm_shuffle_epi32<br>
+ // ASM: pshufd $0,<br>
+ return _mm_shuffle_epi32(A, 0);<br>
+}<br>
+<br>
+__m128d test_mm_shuffle_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_shuffle_pd<br>
+ // DAG: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 2><br>
+ //<br>
+ // ASM-LABEL: test_mm_shuffle_pd<br>
+ // ASM: shufpd $1,<br>
+ return _mm_shuffle_pd(A, B, 1);<br>
+}<br>
+<br>
+__m128i test_mm_shufflehi_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_shufflehi_epi16<br>
+ // DAG: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 4><br>
+ //<br>
+ // ASM-LABEL: test_mm_shufflehi_epi16<br>
+ // ASM: pshufhw $0,<br>
+ return _mm_shufflehi_epi16(A, 0);<br>
+}<br>
+<br>
+__m128i test_mm_shufflelo_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_shufflelo_epi16<br>
+ // DAG: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 5, i32 6, i32 7><br>
+ //<br>
+ // ASM-LABEL: test_mm_shufflelo_epi16<br>
+ // ASM: pshuflw $0,<br>
+ return _mm_shufflelo_epi16(A, 0);<br>
+}<br>
+<br>
+__m128i test_mm_sll_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sll_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psll.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_sll_epi16<br>
+ // ASM: psllw<br>
+ return _mm_sll_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sll_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sll_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.psll.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_sll_epi32<br>
+ // ASM: pslld<br>
+ return _mm_sll_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sll_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sll_epi64<br>
+ // DAG: call <2 x i64> @llvm.x86.sse2.psll.q<br>
+ //<br>
+ // ASM-LABEL: test_mm_sll_epi64<br>
+ // ASM: psllq<br>
+ return _mm_sll_epi64(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_slli_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_slli_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.pslli.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_slli_epi16<br>
+ // ASM: psllw<br>
+ return _mm_slli_epi16(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_slli_epi32(__m128i A) {<br>
+ // DAG-LABEL: test_mm_slli_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.pslli.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_slli_epi32<br>
+ // ASM: pslld<br>
+ return _mm_slli_epi32(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_slli_epi64(__m128i A) {<br>
+ // DAG-LABEL: test_mm_slli_epi64<br>
+ // DAG: call <2 x i64> @llvm.x86.sse2.pslli.q<br>
+ //<br>
+ // ASM-LABEL: test_mm_slli_epi64<br>
+ // ASM: psllq<br>
+ return _mm_slli_epi64(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_slli_si128(__m128i A) {<br>
+ // DAG-LABEL: test_mm_slli_si128<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26><br>
+ //<br>
+ // ASM-LABEL: test_mm_slli_si128<br>
+ // ASM: pslldq $5, %xmm{{.*}}<br>
+ return _mm_slli_si128(A, 5);<br>
+}<br>
+<br>
+__m128d test_mm_sqrt_pd(__m128d A) {<br>
+ // DAG-LABEL: test_mm_sqrt_pd<br>
+ // DAG: call <2 x double> @llvm.x86.sse2.sqrt.pd(<2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_sqrt_pd<br>
+ // ASM: sqrtpd<br>
+ return _mm_sqrt_pd(A);<br>
+}<br>
+<br>
+__m128d test_mm_sqrt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_sqrt_sd<br>
+ // DAG: call <2 x double> @<a href="http://llvm.x86.sse2.sqrt.sd/">llvm.x86.sse2.sqrt.sd</a>(<2 x double> %{{.*}})<br>
+ //<br>
+ // ASM-LABEL: test_mm_sqrt_sd<br>
+ // ASM: sqrtsd<br>
+ return _mm_sqrt_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sra_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sra_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psra.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_sra_epi16<br>
+ // ASM: psraw<br>
+ return _mm_sra_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sra_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sra_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.psra.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_sra_epi32<br>
+ // ASM: psrad<br>
+ return _mm_sra_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_srai_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srai_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psrai.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_srai_epi16<br>
+ // ASM: psraw<br>
+ return _mm_srai_epi16(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_srai_epi32(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srai_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.psrai.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_srai_epi32<br>
+ // ASM: psrad<br>
+ return _mm_srai_epi32(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_srl_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_srl_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psrl.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_srl_epi16<br>
+ // ASM: psrlw<br>
+ return _mm_srl_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_srl_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_srl_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.psrl.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_srl_epi32<br>
+ // ASM: psrld<br>
+ return _mm_srl_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_srl_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_srl_epi64<br>
+ // DAG: call <2 x i64> @llvm.x86.sse2.psrl.q<br>
+ //<br>
+ // ASM-LABEL: test_mm_srl_epi64<br>
+ // ASM: psrlq<br>
+ return _mm_srl_epi64(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_srli_epi16(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srli_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psrli.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_srli_epi16<br>
+ // ASM: psrlw<br>
+ return _mm_srli_epi16(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_srli_epi32(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srli_epi32<br>
+ // DAG: call <4 x i32> @llvm.x86.sse2.psrli.d<br>
+ //<br>
+ // ASM-LABEL: test_mm_srli_epi32<br>
+ // ASM: psrld<br>
+ return _mm_srli_epi32(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_srli_epi64(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srli_epi64<br>
+ // DAG: call <2 x i64> @llvm.x86.sse2.psrli.q<br>
+ //<br>
+ // ASM-LABEL: test_mm_srli_epi64<br>
+ // ASM: psrlq<br>
+ return _mm_srli_epi64(A, 1);<br>
+}<br>
+<br>
+__m128i test_mm_srli_si128(__m128i A) {<br>
+ // DAG-LABEL: test_mm_srli_si128<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20><br>
+ //<br>
+ // ASM-LABEL: test_mm_srli_si128<br>
+ // ASM: psrldq $5, %xmm{{.*}}<br>
+ return _mm_srli_si128(A, 5);<br>
+}<br>
+<br>
+void test_mm_store_pd(double* A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_store_pd<br>
+ // DAG: store <2 x double> %{{.*}}, <2 x double>* %{{.*}}, align 16<br>
+ //<br>
+ // ASM-LABEL: test_mm_store_pd<br>
+ // ASM: movapd<br>
+ _mm_store_pd(A, B);<br>
+}<br>
+<br>
+void test_mm_store_sd(double* A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_store_sd<br>
+ // DAG: store double %{{.*}}, double* %{{.*}}, align 1{{$}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_store_sd<br>
+ // ASM: movsd<br>
+ _mm_store_sd(A, B);<br>
+}<br>
+<br>
+void test_mm_store_si128(__m128i* A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_store_si128<br>
+ // DAG: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 16<br>
+ //<br>
+ // ASM-LABEL: test_mm_store_si128<br>
+ // ASM: movdqa<br>
+ _mm_store_si128(A, B);<br>
+}<br>
+<br>
+void test_mm_storeh_pd(double* A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_storeh_pd<br>
+ // DAG: store double %{{.*}}, double* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_storeh_pd<br>
+ // ASM: shufpd $1<br>
+ // ASM: movsd<br>
+ _mm_storeh_pd(A, B);<br>
+}<br>
+<br>
+void test_mm_storel_pd(double* A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_storel_pd<br>
+ // DAG: store double %{{.*}}, double* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_storel_pd<br>
+ // ASM: movsd<br>
+ _mm_storel_pd(A, B);<br>
+}<br>
+<br>
+void test_mm_storeu_pd(double* A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_storeu_pd<br>
+ // DAG: store <2 x double> %{{.*}}, <2 x double>* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_storeu_pd<br>
+ // ASM: movupd<br>
+ _mm_storeu_pd(A, B);<br>
+}<br>
+<br>
+void test_mm_storeu_si128(__m128i* A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_storeu_si128<br>
+ // DAG: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 1<br>
+ //<br>
+ // ASM-LABEL: test_mm_storeu_si128<br>
+ // ASM: movdqu<br>
+ _mm_storeu_si128(A, B);<br>
+}<br>
+<br>
+void test_mm_stream_pd(double *A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_stream_pd<br>
+ // DAG: store <2 x double> %{{.*}}, <2 x double>* %{{.*}}, align 16, !nontemporal<br>
+ //<br>
+ // ASM-LABEL: test_mm_stream_pd<br>
+ // ASM: movntpd<br>
+ _mm_stream_pd(A, B);<br>
+}<br>
+<br>
+void test_mm_stream_si32(int *A, int B) {<br>
+ // DAG-LABEL: test_mm_stream_si32<br>
+ // DAG: store i32 %{{.*}}, i32* %{{.*}}, align 1, !nontemporal<br>
+ //<br>
+ // ASM-LABEL: test_mm_stream_si32<br>
+ // ASM: movntil<br>
+ _mm_stream_si32(A, B);<br>
+}<br>
+<br>
+void test_mm_stream_si64(long long *A, long long B) {<br>
+ // DAG-LABEL: test_mm_stream_si64<br>
+ // DAG: store i64 %{{.*}}, i64* %{{.*}}, align 1, !nontemporal<br>
+ //<br>
+ // ASM-LABEL: test_mm_stream_si64<br>
+ // ASM: movntiq<br>
+ _mm_stream_si64(A, B);<br>
+}<br>
+<br>
+void test_mm_stream_si128(__m128i *A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_stream_si128<br>
+ // DAG: store <2 x i64> %{{.*}}, <2 x i64>* %{{.*}}, align 16, !nontemporal<br>
+ //<br>
+ // ASM-LABEL: test_mm_stream_si128<br>
+ // ASM: movntdq<br>
+ _mm_stream_si128(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sub_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sub_epi8<br>
+ // DAG: sub <16 x i8><br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_epi8<br>
+ // ASM: psubb<br>
+ return _mm_sub_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sub_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sub_epi16<br>
+ // DAG: sub <8 x i16><br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_epi16<br>
+ // ASM: psubw<br>
+ return _mm_sub_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sub_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sub_epi32<br>
+ // DAG: sub <4 x i32><br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_epi32<br>
+ // ASM: psubd<br>
+ return _mm_sub_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_sub_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_sub_epi64<br>
+ // DAG: sub <2 x i64><br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_epi64<br>
+ // ASM: psubq<br>
+ return _mm_sub_epi64(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_sub_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_sub_pd<br>
+ // DAG: fsub <2 x double><br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_pd<br>
+ // ASM: subpd<br>
+ return _mm_sub_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_sub_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_sub_sd<br>
+ // DAG: fsub double<br>
+ //<br>
+ // ASM-LABEL: test_mm_sub_sd<br>
+ // ASM: subsd<br>
+ return _mm_sub_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_subs_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_subs_epi8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.psubs.b<br>
+ //<br>
+ // ASM-LABEL: test_mm_subs_epi8<br>
+ // ASM: psubsb<br>
+ return _mm_subs_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_subs_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_subs_epi16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psubs.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_subs_epi16<br>
+ // ASM: psubsw<br>
+ return _mm_subs_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_subs_epu8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_subs_epu8<br>
+ // DAG: call <16 x i8> @llvm.x86.sse2.psubus.b<br>
+ //<br>
+ // ASM-LABEL: test_mm_subs_epu8<br>
+ // ASM: psubusb<br>
+ return _mm_subs_epu8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_subs_epu16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_subs_epu16<br>
+ // DAG: call <8 x i16> @llvm.x86.sse2.psubus.w<br>
+ //<br>
+ // ASM-LABEL: test_mm_subs_epu16<br>
+ // ASM: psubusw<br>
+ return _mm_subs_epu16(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomieq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomieq_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomieq.sd/">llvm.x86.sse2.ucomieq.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomieq_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomieq_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomige_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomige_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomige.sd/">llvm.x86.sse2.ucomige.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomige_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomige_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomigt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomigt_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomigt.sd/">llvm.x86.sse2.ucomigt.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomigt_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomigt_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomile_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomile_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomile.sd/">llvm.x86.sse2.ucomile.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomile_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomile_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomilt_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomilt_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomilt.sd/">llvm.x86.sse2.ucomilt.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomilt_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomilt_sd(A, B);<br>
+}<br>
+<br>
+int test_mm_ucomineq_sd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_ucomineq_sd<br>
+ // DAG: call i32 @<a href="http://llvm.x86.sse2.ucomineq.sd/">llvm.x86.sse2.ucomineq.sd</a><br>
+ //<br>
+ // ASM-LABEL: test_mm_ucomineq_sd<br>
+ // ASM: ucomisd<br>
+ return _mm_ucomineq_sd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpackhi_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpackhi_epi8<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpackhi_epi8<br>
+ // ASM: unpckhbw<br>
+ return _mm_unpackhi_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpackhi_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpackhi_epi16<br>
+ // DAG: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> <i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpackhi_epi16<br>
+ // ASM: unpckhwd<br>
+ return _mm_unpackhi_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpackhi_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpackhi_epi32<br>
+ // DAG: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> <i32 2, i32 6, i32 3, i32 7><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpackhi_epi32<br>
+ // ASM: unpckhdq<br>
+ return _mm_unpackhi_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpackhi_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpackhi_epi64<br>
+ // DAG: shufflevector <2 x i64> %{{.*}}, <2 x i64> %{{.*}}, <2 x i32> <i32 1, i32 3><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpackhi_epi64<br>
+ // ASM: unpckhqdq<br>
+ return _mm_unpackhi_epi64(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_unpackhi_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_unpackhi_pd<br>
+ // DAG: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 1, i32 3><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpackhi_pd<br>
+ // ASM: unpckhpd<br>
+ return _mm_unpackhi_pd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpacklo_epi8(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpacklo_epi8<br>
+ // DAG: shufflevector <16 x i8> %{{.*}}, <16 x i8> %{{.*}}, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpacklo_epi8<br>
+ // ASM: unpcklbw<br>
+ return _mm_unpacklo_epi8(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpacklo_epi16(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpacklo_epi16<br>
+ // DAG: shufflevector <8 x i16> %{{.*}}, <8 x i16> %{{.*}}, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpacklo_epi16<br>
+ // ASM: unpcklwd<br>
+ return _mm_unpacklo_epi16(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpacklo_epi32(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpacklo_epi32<br>
+ // DAG: shufflevector <4 x i32> %{{.*}}, <4 x i32> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 1, i32 5><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpacklo_epi32<br>
+ // ASM: unpckldq<br>
+ return _mm_unpacklo_epi32(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_unpacklo_epi64(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_unpacklo_epi64<br>
+ // DAG: shufflevector <2 x i64> %{{.*}}, <2 x i64> %{{.*}}, <2 x i32> <i32 0, i32 2><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpacklo_epi64<br>
+ // ASM: unpcklqdq<br>
+ return _mm_unpacklo_epi64(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_unpacklo_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_unpacklo_pd<br>
+ // DAG: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 0, i32 2><br>
+ //<br>
+ // ASM-LABEL: test_mm_unpacklo_pd<br>
+ // ASM: unpcklpd<br>
+ return _mm_unpacklo_pd(A, B);<br>
+}<br>
+<br>
+__m128d test_mm_xor_pd(__m128d A, __m128d B) {<br>
+ // DAG-LABEL: test_mm_xor_pd<br>
+ // DAG: xor <4 x i32> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_xor_pd<br>
+ // ASM: pxor<br>
+ return _mm_xor_pd(A, B);<br>
+}<br>
+<br>
+__m128i test_mm_xor_si128(__m128i A, __m128i B) {<br>
+ // DAG-LABEL: test_mm_xor_si128<br>
+ // DAG: xor <2 x i64> %{{.*}}, %{{.*}}<br>
+ //<br>
+ // ASM-LABEL: test_mm_xor_si128<br>
+ // ASM: xorps<br>
+ return _mm_xor_si128(A, B);<br>
+}<br></p>
<p dir="ltr">_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote><blockquote><blockquote><blockquote><p dir="ltr"><br>
<br>
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<blockquote><blockquote><p dir="ltr"><br>
<br>
</p>
</blockquote>
</blockquote>
<p dir="ltr"><br>
</p>