1925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper// RUN: %clang_cc1 %s -O3 -triple=x86_64-apple-darwin -target-feature +avx2 -emit-llvm -o - | FileCheck %s
2925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
3925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper// Don't include mm_malloc.h, it's system specific.
4925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper#define __MM_MALLOC_H
5925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
6925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper#include <immintrin.h>
7925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
8cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mpsadbw_epu8(__m256i x, __m256i y) {
9925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.mpsadbw({{.*}}, {{.*}}, i32 3)
10925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_mpsadbw_epu8(x, y, 3);
11925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
12925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
13c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m256i test_mm256_sad_epu8(__m256i x, __m256i y) {
14c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.psad.bw
15c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm256_sad_epu8(x, y);
16c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
17c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren
18cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_abs_epi8(__m256i a) {
19925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.pabs.b
20925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_abs_epi8(a);
21925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
22925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
23cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_abs_epi16(__m256i a) {
24925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.pabs.w
25925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_abs_epi16(a);
26925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
27925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
28cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_abs_epi32(__m256i a) {
29925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.pabs.d
30925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_abs_epi32(a);
31925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
32925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
33cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_packs_epi16(__m256i a, __m256i b) {
34925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.packsswb
35925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_packs_epi16(a, b);
36925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
37925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
38cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_packs_epi32(__m256i a, __m256i b) {
39925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.packssdw
40925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_packs_epi32(a, b);
41925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
42925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
43cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_packs_epu16(__m256i a, __m256i b) {
44925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.packuswb
45925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_packus_epi16(a, b);
46925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
47925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
48cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_packs_epu32(__m256i a, __m256i b) {
49925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: @llvm.x86.avx2.packusdw
50925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_packus_epi32(a, b);
51925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
52925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
53cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_add_epi8(__m256i a, __m256i b) {
54925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: add <32 x i8>
55925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_add_epi8(a, b);
56925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
57925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
58cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_add_epi16(__m256i a, __m256i b) {
59925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: add <16 x i16>
60925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_add_epi16(a, b);
61925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
62925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
63cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_add_epi32(__m256i a, __m256i b) {
64925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: add <8 x i32>
65925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_add_epi32(a, b);
66925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
67925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
68cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_add_epi64(__m256i a, __m256i b) {
69925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: add <4 x i64>
70925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_add_epi64(a, b);
71925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
72925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
73cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_adds_epi8(__m256i a, __m256i b) {
749c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.padds.b
759c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_adds_epi8(a, b);
769c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
779c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
78cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_adds_epi16(__m256i a, __m256i b) {
799c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.padds.w
809c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_adds_epi16(a, b);
819c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
829c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
83cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_adds_epu8(__m256i a, __m256i b) {
849c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.paddus.b
859c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_adds_epu8(a, b);
869c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
879c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
88cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_adds_epu16(__m256i a, __m256i b) {
899c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.paddus.w
909c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_adds_epu16(a, b);
919c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
929c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
93cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_alignr_epi8(__m256i a, __m256i b) {
94aad21d74aaf74bfbd3f8356ab0fea2c1f759efeaEli Friedman  // CHECK: shufflevector <32 x i8> %{{.*}}, <32 x i8> %{{.*}}, <32 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 32, i32 33, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 48, i32 49>
959c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_alignr_epi8(a, b, 2);
969c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
979c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
98cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test2_mm256_alignr_epi8(__m256i a, __m256i b) {
999c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.psrl.dq({{.*}}, i32 8)
1009c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_alignr_epi8(a, b, 17);
1019c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
1029c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
103cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sub_epi8(__m256i a, __m256i b) {
104925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: sub <32 x i8>
105925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_sub_epi8(a, b);
106925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
107925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
108cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sub_epi16(__m256i a, __m256i b) {
109925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: sub <16 x i16>
110925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_sub_epi16(a, b);
111925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
112925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
113cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sub_epi32(__m256i a, __m256i b) {
114925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: sub <8 x i32>
115925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_sub_epi32(a, b);
116925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
117925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper
118cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sub_epi64(__m256i a, __m256i b) {
119925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  // CHECK: sub <4 x i64>
120925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper  return _mm256_sub_epi64(a, b);
121925be547b163675b312e3cac0cc7f37f31d787c1Craig Topper}
1229c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
123cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_subs_epi8(__m256i a, __m256i b) {
1249c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.psubs.b
1259c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_subs_epi8(a, b);
1269c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
1279c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
128cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_subs_epi16(__m256i a, __m256i b) {
1299c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.psubs.w
1309c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_subs_epi16(a, b);
1319c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
1329c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
133cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_subs_epu8(__m256i a, __m256i b) {
1349c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.psubus.b
1359c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_subs_epu8(a, b);
1369c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
1379c2ffd803af03f1728423d0d73ff87d988642633Craig Topper
138cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_subs_epu16(__m256i a, __m256i b) {
1399c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  // CHECK: @llvm.x86.avx2.psubus.w
1409c2ffd803af03f1728423d0d73ff87d988642633Craig Topper  return _mm256_subs_epu16(a, b);
1419c2ffd803af03f1728423d0d73ff87d988642633Craig Topper}
142735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper
143cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_and_si256(__m256i a, __m256i b) {
144735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  // CHECK: and <4 x i64>
145735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  return _mm256_and_si256(a, b);
146735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper}
147735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper
148cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_andnot_si256(__m256i a, __m256i b) {
149735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  // CHECK: xor <4 x i64>
150735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  // CHECK: and <4 x i64>
151735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  return _mm256_andnot_si256(a, b);
152735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper}
153735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper
154cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_or_si256(__m256i a, __m256i b) {
155735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  // CHECK: or <4 x i64>
156735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  return _mm256_or_si256(a, b);
157735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper}
158735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper
159cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_xor_si256(__m256i a, __m256i b) {
160735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  // CHECK: xor <4 x i64>
161735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper  return _mm256_xor_si256(a, b);
162735ceaa4ccb60df5993245e645f7127bf4a4325fCraig Topper}
1634c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
164cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_avg_epu8(__m256i a, __m256i b) {
1654c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: @llvm.x86.avx2.pavg.b
1664c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_avg_epu8(a, b);
1674c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1684c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
169cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_avg_epu16(__m256i a, __m256i b) {
1704c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: @llvm.x86.avx2.pavg.w
1714c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_avg_epu16(a, b);
1724c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1734c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
174cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_blendv_epi8(__m256i a, __m256i b, __m256i m) {
1754c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: @llvm.x86.avx2.pblendvb
1764c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_blendv_epi8(a, b, m);
1774c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1784c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
179cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_blend_epi16(__m256i a, __m256i b) {
1804c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: @llvm.x86.avx2.pblendw(<16 x i16> %{{.*}}, <16 x i16> %{{.*}}, i32 2)
1814c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_blend_epi16(a, b, 2);
1824c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1834c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
184cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpeq_epi8(__m256i a, __m256i b) {
1854c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp eq <32 x i8>
1864c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpeq_epi8(a, b);
1874c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1884c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
189cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpeq_epi16(__m256i a, __m256i b) {
1904c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp eq <16 x i16>
1914c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpeq_epi16(a, b);
1924c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1934c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
194cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpeq_epi32(__m256i a, __m256i b) {
1954c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp eq <8 x i32>
1964c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpeq_epi32(a, b);
1974c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
1984c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
199cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpeq_epi64(__m256i a, __m256i b) {
2004c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp eq <4 x i64>
2014c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpeq_epi64(a, b);
2024c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
2034c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
204cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpgt_epi8(__m256i a, __m256i b) {
2054c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp sgt <32 x i8>
2064c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpgt_epi8(a, b);
2074c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
2084c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
209cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpgt_epi16(__m256i a, __m256i b) {
2104c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp sgt <16 x i16>
2114c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpgt_epi16(a, b);
2124c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
2134c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
214cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpgt_epi32(__m256i a, __m256i b) {
2154c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp sgt <8 x i32>
2164c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpgt_epi32(a, b);
2174c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
2184c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper
219cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cmpgt_epi64(__m256i a, __m256i b) {
2204c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  // CHECK: icmp sgt <4 x i64>
2214c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper  return _mm256_cmpgt_epi64(a, b);
2224c07c5dfebd270b2f0660e86f056eeafdb26a4fbCraig Topper}
223318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
224cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hadd_epi16(__m256i a, __m256i b) {
225318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phadd.w
226318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hadd_epi16(a, b);
227318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
228318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
229cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hadd_epi32(__m256i a, __m256i b) {
230318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phadd.d
231318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hadd_epi32(a, b);
232318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
233318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
234cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hadds_epi16(__m256i a, __m256i b) {
235318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phadd.sw
236318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hadds_epi16(a, b);
237318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
238318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
239cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hsub_epi16(__m256i a, __m256i b) {
240318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phsub.w
241318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hsub_epi16(a, b);
242318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
243318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
244cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hsub_epi32(__m256i a, __m256i b) {
245318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phsub.d
246318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hsub_epi32(a, b);
247318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
248318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper
249cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_hsubs_epi16(__m256i a, __m256i b) {
250318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  // CHECK: @llvm.x86.avx2.phsub.sw
251318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper  return _mm256_hsubs_epi16(a, b);
252318e460ada6e589bd864d9ecb86053cc6852cabfCraig Topper}
2534a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper
254cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_maddubs_epi16(__m256i a, __m256i b) {
2554a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper  // CHECK: @llvm.x86.avx2.pmadd.ub.sw
2564a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper  return _mm256_maddubs_epi16(a, b);
2574a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper}
2584a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper
259cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_madd_epi16(__m256i a, __m256i b) {
2604a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper  // CHECK: @llvm.x86.avx2.pmadd.wd
2614a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper  return _mm256_madd_epi16(a, b);
2624a4f25a5a80dd594acf68c882bcdbf1a38468a45Craig Topper}
263231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
264cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epi8(__m256i a, __m256i b) {
265231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxs.b
266231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epi8(a, b);
267231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
268231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
269cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epi16(__m256i a, __m256i b) {
270231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxs.w
271231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epi16(a, b);
272231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
273231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
274cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epi32(__m256i a, __m256i b) {
275231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxs.d
276231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epi32(a, b);
277231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
278231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
279cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epu8(__m256i a, __m256i b) {
280231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxu.b
281231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epu8(a, b);
282231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
283231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
284cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epu16(__m256i a, __m256i b) {
285231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxu.w
286231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epu16(a, b);
287231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
288231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
289cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_max_epu32(__m256i a, __m256i b) {
290231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmaxu.d
291231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_max_epu32(a, b);
292231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
293231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
294cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epi8(__m256i a, __m256i b) {
295231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmins.b
296231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epi8(a, b);
297231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
298231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
299cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epi16(__m256i a, __m256i b) {
300231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmins.w
301231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epi16(a, b);
302231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
303231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
304cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epi32(__m256i a, __m256i b) {
305231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmins.d
306231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epi32(a, b);
307231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
308231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
309cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epu8(__m256i a, __m256i b) {
310231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pminu.b
311231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epu8(a, b);
312231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
313231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
314cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epu16(__m256i a, __m256i b) {
315231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pminu.w
316231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epu16(a, b);
317231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
318231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
319cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_min_epu32(__m256i a, __m256i b) {
320231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pminu.d
321231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_min_epu32(a, b);
322231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
323231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
324cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topperint test_mm256_movemask_epi8(__m256i a) {
325231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovmskb
326231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_movemask_epi8(a);
327231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
328231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
329cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi8_epi16(__m128i a) {
330231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxbw
331231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi8_epi16(a);
332231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
333231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
334cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi8_epi32(__m128i a) {
335231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxbd
336231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi8_epi32(a);
337231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
338231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
339cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi8_epi64(__m128i a) {
340231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxbq
341231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi8_epi64(a);
342231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
343231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
344cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi16_epi32(__m128i a) {
345231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxwd
346231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi16_epi32(a);
347231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
348231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
349cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi16_epi64(__m128i a) {
350231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxwq
351231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi16_epi64(a);
352231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
353231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
354cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepi32_epi64(__m128i a) {
355231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovsxdq
356231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepi32_epi64(a);
357231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
358231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
359cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu8_epi16(__m128i a) {
360231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxbw
361231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu8_epi16(a);
362231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
363231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
364cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu8_epi32(__m128i a) {
365231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxbd
366231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu8_epi32(a);
367231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
368231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
369cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu8_epi64(__m128i a) {
370231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxbq
371231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu8_epi64(a);
372231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
373231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
374cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu16_epi32(__m128i a) {
375231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxwd
376231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu16_epi32(a);
377231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
378231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
379cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu16_epi64(__m128i a) {
380231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxwq
381231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu16_epi64(a);
382231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
383231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper
384cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_cvtepu32_epi64(__m128i a) {
385231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  // CHECK: @llvm.x86.avx2.pmovzxdq
386231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper  return _mm256_cvtepu32_epi64(a);
387231f793326e3a3ad6e07949adb776f45c07f0f7bCraig Topper}
38828a324a30b0677309a4c5d73ef5197398265e129Craig Topper
389cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mul_epi32(__m256i a, __m256i b) {
39028a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: @llvm.x86.avx2.pmul.dq
39128a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mul_epi32(a, b);
39228a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
39328a324a30b0677309a4c5d73ef5197398265e129Craig Topper
394cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mulhrs_epi16(__m256i a, __m256i b) {
39528a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: @llvm.x86.avx2.pmul.hr.sw
39628a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mulhrs_epi16(a, b);
39728a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
39828a324a30b0677309a4c5d73ef5197398265e129Craig Topper
399cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mulhi_epu16(__m256i a, __m256i b) {
40028a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: @llvm.x86.avx2.pmulhu.w
40128a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mulhi_epu16(a, b);
40228a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
40328a324a30b0677309a4c5d73ef5197398265e129Craig Topper
404cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mulhi_epi16(__m256i a, __m256i b) {
40528a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: @llvm.x86.avx2.pmulh.w
40628a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mulhi_epi16(a, b);
40728a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
40828a324a30b0677309a4c5d73ef5197398265e129Craig Topper
409cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mullo_epi16(__m256i a, __m256i b) {
41028a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: mul <16 x i16>
41128a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mullo_epi16(a, b);
41228a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
41328a324a30b0677309a4c5d73ef5197398265e129Craig Topper
414cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mullo_epi32(__m256i a, __m256i b) {
41528a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: mul <8 x i32>
41628a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mullo_epi32(a, b);
41728a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
41828a324a30b0677309a4c5d73ef5197398265e129Craig Topper
419cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_mul_epu32(__m256i a, __m256i b) {
42028a324a30b0677309a4c5d73ef5197398265e129Craig Topper  // CHECK: @llvm.x86.avx2.pmulu.dq
42128a324a30b0677309a4c5d73ef5197398265e129Craig Topper  return _mm256_mul_epu32(a, b);
42228a324a30b0677309a4c5d73ef5197398265e129Craig Topper}
423cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
424cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_shuffle_epi8(__m256i a, __m256i b) {
425cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.pshuf.b
426cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_shuffle_epi8(a, b);
427cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
428cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
429cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_shuffle_epi32(__m256i a) {
430cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: shufflevector <8 x i32> %{{.*}}, <8 x i32> undef, <8 x i32> <i32 3, i32 3, i32 0, i32 0, i32 7, i32 7, i32 4, i32 4>
431cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_shuffle_epi32(a, 15);
432cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
433cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
434cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_shufflehi_epi16(__m256i a) {
435cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: shufflevector <16 x i16> %{{.*}}, <16 x i16> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 7, i32 6, i32 6, i32 5, i32 8, i32 9, i32 10, i32 11, i32 15, i32 14, i32 14, i32 13>
436cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_shufflehi_epi16(a, 107);
437cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
438cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
439cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_shufflelo_epi16(__m256i a) {
440cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: shufflevector <16 x i16> %{{.*}}, <16 x i16> undef, <16 x i32> <i32 3, i32 0, i32 1, i32 1, i32 4, i32 5, i32 6, i32 7, i32 11, i32 8, i32 9, i32 9, i32 12, i32 13, i32 14, i32 15>
441cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_shufflelo_epi16(a, 83);
442cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
443cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
444cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sign_epi8(__m256i a, __m256i b) {
445cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psign.b
446cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sign_epi8(a, b);
447cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
448cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
449cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sign_epi16(__m256i a, __m256i b) {
450cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psign.w
451cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sign_epi16(a, b);
452cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
453cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
454cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sign_epi32(__m256i a, __m256i b) {
455cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psign.d
456cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sign_epi32(a, b);
457cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
458cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
459cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_slli_si256(__m256i a) {
460cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psll.dq
461cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_slli_si256(a, 3);
462cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
463cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
464cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_slli_epi16(__m256i a) {
465cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.pslli.w
466cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_slli_epi16(a, 3);
467cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
468cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
469cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sll_epi16(__m256i a, __m128i b) {
470cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psll.w
471cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sll_epi16(a, b);
472cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
473cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
474cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_slli_epi32(__m256i a) {
475cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.pslli.d
476cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_slli_epi32(a, 3);
477cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
478cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
479cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sll_epi32(__m256i a, __m128i b) {
480cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psll.d
481cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sll_epi32(a, b);
482cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
483cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
484cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_slli_epi64(__m256i a) {
485cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.pslli.q
486cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_slli_epi64(a, 3);
487cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
488cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
489cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sll_epi64(__m256i a, __m128i b) {
490cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psll.q
491cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sll_epi64(a, b);
492cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
493cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
494cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srai_epi16(__m256i a) {
495cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrai.w
496cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srai_epi16(a, 3);
497cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
498cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
499cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sra_epi16(__m256i a, __m128i b) {
500cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psra.w
501cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sra_epi16(a, b);
502cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
503cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
504cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srai_epi32(__m256i a) {
505cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrai.d
506cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srai_epi32(a, 3);
507cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
508cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
509cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_sra_epi32(__m256i a, __m128i b) {
510cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psra.d
511cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_sra_epi32(a, b);
512cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
513cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
514cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srli_si256(__m256i a) {
515cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrl.dq
516cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srli_si256(a, 3);
517cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
518cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
519cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srli_epi16(__m256i a) {
520cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrli.w
521cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srli_epi16(a, 3);
522cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
523cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
524cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srl_epi16(__m256i a, __m128i b) {
525cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrl.w
526cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srl_epi16(a, b);
527cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
528cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
529cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srli_epi32(__m256i a) {
530cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrli.d
531cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srli_epi32(a, 3);
532cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
533cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
534cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srl_epi32(__m256i a, __m128i b) {
535cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrl.d
536cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srl_epi32(a, b);
537cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
538cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
539cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srli_epi64(__m256i a) {
540cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrli.q
541cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srli_epi64(a, 3);
542cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
543cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper
544cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper__m256i test_mm256_srl_epi64(__m256i a, __m128i b) {
545cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  // CHECK: @llvm.x86.avx2.psrl.q
546cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper  return _mm256_srl_epi64(a, b);
547cbe627b54eaeeeac7a28725de6c9b60b4d3ab32dCraig Topper}
5487f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5497f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpackhi_epi8(__m256i a, __m256i b) {
5507f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <32 x i8> %{{.*}}, <32 x i8> %{{.*}}, <32 x i32> <i32 8, i32 40, i32 9, i32 41, i32 10, i32 42, i32 11, i32 43, i32 12, i32 44, i32 13, i32 45, i32 14, i32 46, i32 15, i32 47, i32 24, i32 56, i32 25, i32 57, i32 26, i32 58, i32 27, i32 59, i32 28, i32 60, i32 29, i32 61, i32 30, i32 62, i32 31, i32 63>
5517f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpackhi_epi8(a, b);
5527f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5537f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5547f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpackhi_epi16(__m256i a, __m256i b) {
5557f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <16 x i16> %{{.*}}, <16 x i16> %{{.*}}, <16 x i32> <i32 4, i32 20, i32 5, i32 21, i32 6, i32 22, i32 7, i32 23, i32 12, i32 28, i32 13, i32 29, i32 14, i32 30, i32 15, i32 31>
5567f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpackhi_epi16(a, b);
5577f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5587f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5597f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpackhi_epi32(__m256i a, __m256i b) {
5607f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
5617f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpackhi_epi32(a, b);
5627f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5637f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5647f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpackhi_epi64(__m256i a, __m256i b) {
5657f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 1, i32 5, i32 3, i32 7>
5667f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpackhi_epi64(a, b);
5677f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5687f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5697f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpacklo_epi8(__m256i a, __m256i b) {
5707f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <32 x i8> %{{.*}}, <32 x i8> %{{.*}}, <32 x i32> <i32 0, i32 32, i32 1, i32 33, i32 2, i32 34, i32 3, i32 35, i32 4, i32 36, i32 5, i32 37, i32 6, i32 38, i32 7, i32 39, i32 16, i32 48, i32 17, i32 49, i32 18, i32 50, i32 19, i32 51, i32 20, i32 52, i32 21, i32 53, i32 22, i32 54, i32 23, i32 55>
5717f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpacklo_epi8(a, b);
5727f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5737f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5747f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpacklo_epi16(__m256i a, __m256i b) {
5757f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <16 x i16> %{{.*}}, <16 x i16> %{{.*}}, <16 x i32> <i32 0, i32 16, i32 1, i32 17, i32 2, i32 18, i32 3, i32 19, i32 8, i32 24, i32 9, i32 25, i32 10, i32 26, i32 11, i32 27>
5767f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpacklo_epi16(a, b);
5777f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5787f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5797f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpacklo_epi32(__m256i a, __m256i b) {
5807f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <8 x i32> %{{.*}}, <8 x i32> %{{.*}}, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
5817f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpacklo_epi32(a, b);
5827f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
5837f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper
5847f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper__m256i test_mm256_unpacklo_epi64(__m256i a, __m256i b) {
5857f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  // CHECK: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
5867f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper  return _mm256_unpacklo_epi64(a, b);
5877f16caa3c087dbc51585ec4bb6e154c10516944dCraig Topper}
588967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
589967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m256i test_mm256_stream_load_si256(__m256i *a) {
590967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.movntdqa
591967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm256_stream_load_si256(a);
592967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
593967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
594967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m128 test_mm_broadcastss_ps(__m128 a) {
595967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.vbroadcast.ss.ps
596967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm_broadcastss_ps(a);
597967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
598967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
599967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m256 test_mm256_broadcastss_ps(__m128 a) {
600967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.vbroadcast.ss.ps.256
601967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm256_broadcastss_ps(a);
602967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
603967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
604967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m256d test_mm256_broadcastsd_pd(__m128d a) {
6057bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // check: @llvm.x86.avx2.vbroadcast.sd.pd.256
606967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm256_broadcastsd_pd(a);
607967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
608967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
609967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m256i test_mm_broadcastsi128_si256(__m128i *a) {
610967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.vbroadcasti128
611967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm_broadcastsi128_si256(a);
612967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
613967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
614967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m128i test_mm_blend_epi32(__m128i a, __m128i b) {
615967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.pblendd.128
616967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm_blend_epi32(a, b, 57);
617967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
618967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper
619967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper__m256i test_mm256_blend_epi32(__m256i a, __m256i b) {
620967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  // CHECK: @llvm.x86.avx2.pblendd.256
621967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper  return _mm256_blend_epi32(a, b, 57);
622967cd889e59ff73a53b71463d33df7bdfc4b8567Craig Topper}
6237bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6247bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_broadcastb_epi8(__m128i a) {
6257bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastb.256
6267bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_broadcastb_epi8(a);
6277bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6287bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6297bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_broadcastw_epi16(__m128i a) {
6307bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastw.256
6317bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_broadcastw_epi16(a);
6327bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6337bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6347bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_broadcastd_epi32(__m128i a) {
6357bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastd.256
6367bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_broadcastd_epi32(a);
6377bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6387bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6397bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_broadcastq_epi64(__m128i a) {
6407bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastq.256
6417bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_broadcastq_epi64(a);
6427bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6437bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6447bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m128i test_mm_broadcastb_epi8(__m128i a) {
6457bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastb.128
6467bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm_broadcastb_epi8(a);
6477bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6487bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6497bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m128i test_mm_broadcastw_epi16(__m128i a) {
6507bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastw.128
6517bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm_broadcastw_epi16(a);
6527bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6537bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6547bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m128i test_mm_broadcastd_epi32(__m128i a) {
6557bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastd.128
6567bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm_broadcastd_epi32(a);
6577bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6587bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6597bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m128i test_mm_broadcastq_epi64(__m128i a) {
6607bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.pbroadcastq.128
6617bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm_broadcastq_epi64(a);
6627bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6637bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6647bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_permutevar8x32_epi32(__m256i a, __m256i b) {
6657bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.permd
6667bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_permutevar8x32_epi32(a, b);
6677bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6687bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6697bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256d test_mm256_permute4x64_pd(__m256d a) {
670b5491f3d7b688b37745397fafd6c1f10548fd5c2Craig Topper  // CHECK: shufflevector{{.*}}<i32 1, i32 2, i32 1, i32 0>
6717bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_permute4x64_pd(a, 25);
6727bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6737bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6747bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256 test_mm256_permutevar8x32_ps(__m256 a, __m256 b) {
6757bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  // CHECK: @llvm.x86.avx2.permps
6767bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_permutevar8x32_ps(a, b);
6777bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6787bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6797bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_permute4x64_epi64(__m256i a) {
680b5491f3d7b688b37745397fafd6c1f10548fd5c2Craig Topper  // CHECK: shufflevector{{.*}}<i32 3, i32 0, i32 2, i32 0>
6817bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper  return _mm256_permute4x64_epi64(a, 35);
6827bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6837bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper
6847bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper__m256i test_mm256_permute2x128_si256(__m256i a, __m256i b) {
68549a110db4c43835681bb89671f8f73c8d8c7c28cCraig Topper  // CHECK: @llvm.x86.avx2.vperm2i128
686cfa8e6530dbc5ed6147281be78bc319dea928d76Craig Topper  return _mm256_permute2x128_si256(a, b, 0x31);
6877bb034065ec8bf54f54e4a87e77cbfae704ea419Craig Topper}
6885cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
6895cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm256_extracti128_si256(__m256i a) {
6905cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.vextracti128
6915cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_extracti128_si256(a, 1);
6925cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
6935cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
6945cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_inserti128_si256(__m256i a, __m128i b) {
6955cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.vinserti128
6965cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_inserti128_si256(a, b, 1);
6975cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
6985cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
6995cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_maskload_epi32(int const *a, __m256i m) {
7005cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskload.d.256
7015cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_maskload_epi32(a, m);
7025cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7035cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7045cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_maskload_epi64(long long const *a, __m256i m) {
7055cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskload.q.256
7065cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_maskload_epi64(a, m);
7075cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7085cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7095cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_maskload_epi32(int const *a, __m128i m) {
7105cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskload.d
7115cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_maskload_epi32(a, m);
7125cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7135cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7145cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_maskload_epi64(long long const *a, __m128i m) {
7155cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskload.q
7165cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_maskload_epi64(a, m);
7175cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7185cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7195cbd751a2f9d73248c5336140d73680fcd4669a3Craig Toppervoid test_mm256_maskstore_epi32(int *a, __m256i m, __m256i b) {
7205cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskstore.d.256
7215cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  _mm256_maskstore_epi32(a, m, b);
7225cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7235cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7245cbd751a2f9d73248c5336140d73680fcd4669a3Craig Toppervoid test_mm256_maskstore_epi64(long long *a, __m256i m, __m256i b) {
7255cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskstore.q.256
7265cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  _mm256_maskstore_epi64(a, m, b);
7275cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7285cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7295cbd751a2f9d73248c5336140d73680fcd4669a3Craig Toppervoid test_mm_maskstore_epi32(int *a, __m128i m, __m128i b) {
7305cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskstore.d
7315cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  _mm_maskstore_epi32(a, m, b);
7325cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7335cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7345cbd751a2f9d73248c5336140d73680fcd4669a3Craig Toppervoid test_mm_maskstore_epi64(long long *a, __m128i m, __m128i b) {
7355cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.maskstore.q
7365cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  _mm_maskstore_epi64(a, m, b);
7375cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7385cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7395cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_sllv_epi32(__m256i a, __m256i b) {
7405cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psllv.d.256
7415cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_sllv_epi32(a, b);
7425cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7435cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7445cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_sllv_epi32(__m128i a, __m128i b) {
7455cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psllv.d
7465cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_sllv_epi32(a, b);
7475cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7485cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7495cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_sllv_epi64(__m256i a, __m256i b) {
7505cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psllv.q.256
7515cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_sllv_epi64(a, b);
7525cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7535cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7545cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_sllv_epi64(__m128i a, __m128i b) {
7555cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psllv.q
7565cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_sllv_epi64(a, b);
7575cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7585cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7595cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_srav_epi32(__m256i a, __m256i b) {
7605cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrav.d.256
7615cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_srav_epi32(a, b);
7625cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7635cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7645cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_srav_epi32(__m128i a, __m128i b) {
7655cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrav.d
7665cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_srav_epi32(a, b);
7675cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7685cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7695cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_srlv_epi32(__m256i a, __m256i b) {
7705cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrlv.d.256
7715cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_srlv_epi32(a, b);
7725cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7735cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7745cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_srlv_epi32(__m128i a, __m128i b) {
7755cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrlv.d
7765cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_srlv_epi32(a, b);
7775cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7785cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7795cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m256i test_mm256_srlv_epi64(__m256i a, __m256i b) {
7805cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrlv.q.256
7815cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm256_srlv_epi64(a, b);
7825cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7835cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper
7845cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper__m128i test_mm_srlv_epi64(__m128i a, __m128i b) {
7855cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  // CHECK: @llvm.x86.avx2.psrlv.q
7865cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper  return _mm_srlv_epi64(a, b);
7875cbd751a2f9d73248c5336140d73680fcd4669a3Craig Topper}
7885283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren
7895283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m128d test_mm_mask_i32gather_pd(__m128d a, double const *b, __m128i c,
7905283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                  __m128d d) {
7915283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.pd
7925283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm_mask_i32gather_pd(a, b, c, d, 2);
7935283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
7945283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren
795c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m256d test_mm256_mask_i32gather_pd(__m256d a, double const *b, __m128i c,
7965283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                      __m256d d) {
7975283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.pd.256
7985283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm256_mask_i32gather_pd(a, b, c, d, 2);
7995283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
8005283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m128d test_mm_mask_i64gather_pd(__m128d a, double const *b, __m128i c,
8015283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                  __m128d d) {
8025283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.pd
8035283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm_mask_i64gather_pd(a, b, c, d, 2);
8045283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
8055283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m256d test_mm256_mask_i64gather_pd(__m256d a, double const *b, __m256i c,
8065283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                      __m256d d) {
8075283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.pd.256
8085283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm256_mask_i64gather_pd(a, b, c, d, 2);
8095283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
8105283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren
8115283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m128 test_mm_mask_i32gather_ps(__m128 a, float const *b, __m128i c,
8125283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                 __m128 d) {
8135283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.ps
8145283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm_mask_i32gather_ps(a, b, c, d, 2);
8155283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
8165283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m256 test_mm256_mask_i32gather_ps(__m256 a, float const *b, __m256i c,
8175283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                     __m256 d) {
8185283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.ps.256
8195283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm256_mask_i32gather_ps(a, b, c, d, 2);
8205283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
8215283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren__m128 test_mm_mask_i64gather_ps(__m128 a, float const *b, __m128i c,
8225283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren                                 __m128 d) {
8235283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.ps
8245283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm_mask_i64gather_ps(a, b, c, d, 2);
8255283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
826c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128 test_mm256_mask_i64gather_ps(__m128 a, float const *b, __m256i c,
827c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                    __m128 d) {
8285283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.ps.256
8295283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren  return _mm256_mask_i64gather_ps(a, b, c, d, 2);
8305283c99365ec4697a5a6bb2b2505469a9aa474d5Manman Ren}
831c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren
832c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128i test_mm_mask_i32gather_epi32(__m128i a, int const *b, __m128i c,
833c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                     __m128i d) {
834c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.d
835c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm_mask_i32gather_epi32(a, b, c, d, 2);
836c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
837c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m256i test_mm256_mask_i32gather_epi32(__m256i a, int const *b, __m256i c,
838c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                        __m256i d) {
839c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.d.256
840c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm256_mask_i32gather_epi32(a, b, c, d, 2);
841c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
842c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128i test_mm_mask_i64gather_epi32(__m128i a, int const *b, __m128i c,
843c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                     __m128i d) {
844c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.d
845c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm_mask_i64gather_epi32(a, b, c, d, 2);
846c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
847c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128i test_mm256_mask_i64gather_epi32(__m128i a, int const *b, __m256i c,
848c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                        __m128i d) {
849c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.d.256
850c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm256_mask_i64gather_epi32(a, b, c, d, 2);
851c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
852c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren
853c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128i test_mm_mask_i32gather_epi64(__m128i a, int const *b, __m128i c,
854c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                     __m128i d) {
855c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.q
856c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm_mask_i32gather_epi64(a, b, c, d, 2);
857c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
858c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m256i test_mm256_mask_i32gather_epi64(__m256i a, int const *b, __m128i c,
859c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                        __m256i d) {
860c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.d.q.256
861c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm256_mask_i32gather_epi64(a, b, c, d, 2);
862c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
863c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m128i test_mm_mask_i64gather_epi64(__m128i a, int const *b, __m128i c,
864c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                     __m128i d) {
865c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.q
866c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm_mask_i64gather_epi64(a, b, c, d, 2);
867c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
868c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren__m256i test_mm256_mask_i64gather_epi64(__m256i a, int const *b, __m256i c,
869c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren                                        __m256i d) {
870c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  // CHECK: @llvm.x86.avx2.gather.q.q.256
871c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren  return _mm256_mask_i64gather_epi64(a, b, c, d, 2);
872c84804a7409927813430f5bb1b56bb7b8afbcee8Manman Ren}
87356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren
87456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128d test_mm_i32gather_pd(double const *b, __m128i c) {
87556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.pd
87656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i32gather_pd(b, c, 2);
87756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
87856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256d test_mm256_i32gather_pd(double const *b, __m128i c) {
87956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.pd.256
88056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i32gather_pd(b, c, 2);
88156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
88256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128d test_mm_i64gather_pd(double const *b, __m128i c) {
88356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.pd
88456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i64gather_pd(b, c, 2);
88556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
88656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256d test_mm256_i64gather_pd(double const *b, __m256i c) {
88756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.pd.256
88856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i64gather_pd(b, c, 2);
88956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
89056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128 test_mm_i32gather_ps(float const *b, __m128i c) {
89156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.ps
89256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i32gather_ps(b, c, 2);
89356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
89456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256 test_mm256_i32gather_ps(float const *b, __m256i c) {
89556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.ps.256
89656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i32gather_ps(b, c, 2);
89756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
89856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128 test_mm_i64gather_ps(float const *b, __m128i c) {
89956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.ps
90056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i64gather_ps(b, c, 2);
90156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
90256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128 test_mm256_i64gather_ps(float const *b, __m256i c) {
90356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.ps.256
90456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i64gather_ps(b, c, 2);
90556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
90656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren
90756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128i test_mm_i32gather_epi32(int const *b, __m128i c) {
90856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.d
90956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i32gather_epi32(b, c, 2);
91056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
91156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256i test_mm256_i32gather_epi32(int const *b, __m256i c) {
91256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.d.256
91356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i32gather_epi32(b, c, 2);
91456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
91556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128i test_mm_i64gather_epi32(int const *b, __m128i c) {
91656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.d
91756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i64gather_epi32(b, c, 2);
91856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
91956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128i test_mm256_i64gather_epi32(int const *b, __m256i c) {
92056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.d.256
92156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i64gather_epi32(b, c, 2);
92256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
92356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128i test_mm_i32gather_epi64(int const *b, __m128i c) {
92456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.q
92556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i32gather_epi64(b, c, 2);
92656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
92756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256i test_mm256_i32gather_epi64(int const *b, __m128i c) {
92856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.d.q.256
92956c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i32gather_epi64(b, c, 2);
93056c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
93156c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m128i test_mm_i64gather_epi64(int const *b, __m128i c) {
93256c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.q
93356c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm_i64gather_epi64(b, c, 2);
93456c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
93556c045ed5e148d3eff9b344001370b80ec14d43bManman Ren__m256i test_mm256_i64gather_epi64(int const *b, __m256i c) {
93656c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  // CHECK: @llvm.x86.avx2.gather.q.q.256
93756c045ed5e148d3eff9b344001370b80ec14d43bManman Ren  return _mm256_i64gather_epi64(b, c, 2);
93856c045ed5e148d3eff9b344001370b80ec14d43bManman Ren}
939