1 // RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s
2
3 // Don't include mm_malloc.h, it's system specific.
4 #define __MM_MALLOC_H
5
6 #include <immintrin.h>
7
8 //
9 // Test LLVM IR codegen of shuffle instructions
10 //
11
test__mm256_loadu_ps(void * p)12 __m256 test__mm256_loadu_ps(void* p) {
13 // CHECK: load <8 x float>* %{{.*}}, align 1
14 return _mm256_loadu_ps(p);
15 }
16
test__mm256_loadu_pd(void * p)17 __m256d test__mm256_loadu_pd(void* p) {
18 // CHECK: load <4 x double>* %{{.*}}, align 1
19 return _mm256_loadu_pd(p);
20 }
21
test__mm256_loadu_si256(void * p)22 __m256i test__mm256_loadu_si256(void* p) {
23 // CHECK: load <4 x i64>* %{{.+}}, align 1
24 return _mm256_loadu_si256(p);
25 }
26
test_mm_cmpestrm(__m128i A,int LA,__m128i B,int LB)27 __m128i test_mm_cmpestrm(__m128i A, int LA, __m128i B, int LB) {
28 // CHECK: @llvm.x86.sse42.pcmpestrm128
29 return _mm_cmpestrm(A, LA, B, LB, 7);
30 }
31
test_mm_cmpestri(__m128i A,int LA,__m128i B,int LB)32 int test_mm_cmpestri(__m128i A, int LA, __m128i B, int LB) {
33 // CHECK: @llvm.x86.sse42.pcmpestri128
34 return _mm_cmpestri(A, LA, B, LB, 7);
35 }
36
test_mm_cmpestra(__m128i A,int LA,__m128i B,int LB)37 int test_mm_cmpestra(__m128i A, int LA, __m128i B, int LB) {
38 // CHECK: @llvm.x86.sse42.pcmpestria128
39 return _mm_cmpestra(A, LA, B, LB, 7);
40 }
41
test_mm_cmpestrc(__m128i A,int LA,__m128i B,int LB)42 int test_mm_cmpestrc(__m128i A, int LA, __m128i B, int LB) {
43 // CHECK: @llvm.x86.sse42.pcmpestric128
44 return _mm_cmpestrc(A, LA, B, LB, 7);
45 }
46
test_mm_cmpestro(__m128i A,int LA,__m128i B,int LB)47 int test_mm_cmpestro(__m128i A, int LA, __m128i B, int LB) {
48 // CHECK: @llvm.x86.sse42.pcmpestrio128
49 return _mm_cmpestro(A, LA, B, LB, 7);
50 }
51
test_mm_cmpestrs(__m128i A,int LA,__m128i B,int LB)52 int test_mm_cmpestrs(__m128i A, int LA, __m128i B, int LB) {
53 // CHECK: @llvm.x86.sse42.pcmpestris128
54 return _mm_cmpestrs(A, LA, B, LB, 7);
55 }
56
test_mm_cmpestrz(__m128i A,int LA,__m128i B,int LB)57 int test_mm_cmpestrz(__m128i A, int LA, __m128i B, int LB) {
58 // CHECK: @llvm.x86.sse42.pcmpestriz128
59 return _mm_cmpestrz(A, LA, B, LB, 7);
60 }
61
test_mm_cmpistrm(__m128i A,__m128i B)62 __m128i test_mm_cmpistrm(__m128i A, __m128i B) {
63 // CHECK: @llvm.x86.sse42.pcmpistrm128
64 return _mm_cmpistrm(A, B, 7);
65 }
66
test_mm_cmpistri(__m128i A,__m128i B)67 int test_mm_cmpistri(__m128i A, __m128i B) {
68 // CHECK: @llvm.x86.sse42.pcmpistri128
69 return _mm_cmpistri(A, B, 7);
70 }
71
test_mm_cmpistra(__m128i A,__m128i B)72 int test_mm_cmpistra(__m128i A, __m128i B) {
73 // CHECK: @llvm.x86.sse42.pcmpistria128
74 return _mm_cmpistra(A, B, 7);
75 }
76
test_mm_cmpistrc(__m128i A,__m128i B)77 int test_mm_cmpistrc(__m128i A, __m128i B) {
78 // CHECK: @llvm.x86.sse42.pcmpistric128
79 return _mm_cmpistrc(A, B, 7);
80 }
81
test_mm_cmpistro(__m128i A,__m128i B)82 int test_mm_cmpistro(__m128i A, __m128i B) {
83 // CHECK: @llvm.x86.sse42.pcmpistrio128
84 return _mm_cmpistro(A, B, 7);
85 }
86
test_mm_cmpistrs(__m128i A,__m128i B)87 int test_mm_cmpistrs(__m128i A, __m128i B) {
88 // CHECK: @llvm.x86.sse42.pcmpistris128
89 return _mm_cmpistrs(A, B, 7);
90 }
91
test_mm_cmpistrz(__m128i A,__m128i B)92 int test_mm_cmpistrz(__m128i A, __m128i B) {
93 // CHECK: @llvm.x86.sse42.pcmpistriz128
94 return _mm_cmpistrz(A, B, 7);
95 }
96