1// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512pf -emit-llvm -o - -Werror | 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
8void test_mm512_mask_prefetch_i32gather_pd(__m256i index, __mmask8 mask, void const *addr, int hint) {
9  // CHECK-LABEL: @test_mm512_mask_prefetch_i32gather_pd
10  // CHECK: @llvm.x86.avx512.gatherpf.dpd
11  return _mm512_mask_prefetch_i32gather_pd(index, mask, addr, 2, 1);
12}
13
14void test_mm512_prefetch_i32gather_pd(__m256i index, void const *addr, int hint) {
15  // CHECK-LABEL: @test_mm512_prefetch_i32gather_pd
16  // CHECK: @llvm.x86.avx512.gatherpf.dpd
17  return _mm512_prefetch_i32gather_pd(index, addr, 2, 1);
18}
19
20void test_mm512_mask_prefetch_i32gather_ps(__m512i index, __mmask16 mask, void const *addr, int hint) {
21  // CHECK-LABEL: @test_mm512_mask_prefetch_i32gather_ps
22  // CHECK: @llvm.x86.avx512.gatherpf.dps
23  return _mm512_mask_prefetch_i32gather_ps(index, mask, addr, 2, 1);
24}
25
26void test_mm512_prefetch_i32gather_ps(__m512i index,  void const *addr, int hint) {
27  // CHECK-LABEL: @test_mm512_prefetch_i32gather_ps
28  // CHECK: @llvm.x86.avx512.gatherpf.dps
29  return _mm512_prefetch_i32gather_ps(index, addr, 2, 1);
30}
31
32void test_mm512_mask_prefetch_i64gather_pd(__m512i index, __mmask8 mask, void const *addr, int hint) {
33  // CHECK-LABEL: @test_mm512_mask_prefetch_i64gather_pd
34  // CHECK: @llvm.x86.avx512.gatherpf.qpd
35  return _mm512_mask_prefetch_i64gather_pd(index, mask, addr, 2, 1);
36}
37
38void test_mm512_prefetch_i64gather_pd(__m512i index, void const *addr, int hint) {
39  // CHECK-LABEL: @test_mm512_prefetch_i64gather_pd
40  // CHECK: @llvm.x86.avx512.gatherpf.qpd
41  return _mm512_prefetch_i64gather_pd(index, addr, 2, 1);
42}
43
44void test_mm512_mask_prefetch_i64gather_ps(__m512i index, __mmask8 mask, void const *addr, int hint) {
45  // CHECK-LABEL: @test_mm512_mask_prefetch_i64gather_ps
46  // CHECK: @llvm.x86.avx512.gatherpf.qps
47  return _mm512_mask_prefetch_i64gather_ps(index, mask, addr, 2, 1);
48}
49
50void test_mm512_prefetch_i64gather_ps(__m512i index, void const *addr, int hint) {
51  // CHECK-LABEL: @test_mm512_prefetch_i64gather_ps
52  // CHECK: @llvm.x86.avx512.gatherpf.qps
53  return _mm512_prefetch_i64gather_ps(index, addr, 2, 1);
54}
55
56void test_mm512_prefetch_i32scatter_pd(void *addr, __m256i index) {
57  // CHECK-LABEL: @test_mm512_prefetch_i32scatter_pd
58  // CHECK: @llvm.x86.avx512.scatterpf.dpd.512
59  return _mm512_prefetch_i32scatter_pd(addr, index, 1, 2);
60}
61
62void test_mm512_mask_prefetch_i32scatter_pd(void *addr, __mmask8 mask, __m256i index) {
63  // CHECK-LABEL: @test_mm512_mask_prefetch_i32scatter_pd
64  // CHECK: @llvm.x86.avx512.scatterpf.dpd.512
65  return _mm512_mask_prefetch_i32scatter_pd(addr, mask, index, 1, 2);
66}
67
68void test_mm512_prefetch_i32scatter_ps(void *addr, __m512i index) {
69  // CHECK-LABEL: @test_mm512_prefetch_i32scatter_ps
70  // CHECK: @llvm.x86.avx512.scatterpf.dps.512
71  return _mm512_prefetch_i32scatter_ps(addr, index, 1, 2);
72}
73
74void test_mm512_mask_prefetch_i32scatter_ps(void *addr, __mmask16 mask, __m512i index) {
75  // CHECK-LABEL: @test_mm512_mask_prefetch_i32scatter_ps
76  // CHECK: @llvm.x86.avx512.scatterpf.dps.512
77  return _mm512_mask_prefetch_i32scatter_ps(addr, mask, index, 1, 2);
78}
79
80void test_mm512_prefetch_i64scatter_pd(void *addr, __m512i index) {
81  // CHECK-LABEL: @test_mm512_prefetch_i64scatter_pd
82  // CHECK: @llvm.x86.avx512.scatterpf.qpd.512
83  return _mm512_prefetch_i64scatter_pd(addr, index, 1, 2);
84}
85
86void test_mm512_mask_prefetch_i64scatter_pd(void *addr, __mmask16 mask, __m512i index) {
87  // CHECK-LABEL: @test_mm512_mask_prefetch_i64scatter_pd
88  // CHECK: @llvm.x86.avx512.scatterpf.qpd.512
89  return _mm512_mask_prefetch_i64scatter_pd(addr, mask, index, 1, 2);
90}
91
92void test_mm512_prefetch_i64scatter_ps(void *addr, __m512i index) {
93  // CHECK-LABEL: @test_mm512_prefetch_i64scatter_ps
94  // CHECK: @llvm.x86.avx512.scatterpf.qps.512
95  return _mm512_prefetch_i64scatter_ps(addr, index, 1, 2);
96}
97
98void test_mm512_mask_prefetch_i64scatter_ps(void *addr, __mmask16 mask, __m512i index) {
99  // CHECK-LABEL: @test_mm512_mask_prefetch_i64scatter_ps
100  // CHECK: @llvm.x86.avx512.scatterpf.qps.512
101  return _mm512_mask_prefetch_i64scatter_ps(addr, mask, index, 1, 2);
102}
103