|
| 1 | +// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512vl -fclangir -emit-cir -o %t.cir -Wall -Werror -Wsign-conversion |
| 2 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 3 | +// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512vl -fclangir -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion |
| 4 | +// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s |
| 5 | + |
| 6 | + |
| 7 | +#include <immintrin.h> |
| 8 | + |
| 9 | +__m128d test_mm_mmask_i64gather_pd(__m128d __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 10 | + // CIR-LABEL: test_mm_mmask_i64gather_pd |
| 11 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div2.df" |
| 12 | + |
| 13 | + // LLVM-LABEL: @test_mm_mmask_i64gather_pd |
| 14 | + // LLVM: @llvm.x86.avx512.mask.gather3div2.df |
| 15 | + return _mm_mmask_i64gather_pd(__v1_old, __mask, __index, __addr, 2); |
| 16 | +} |
| 17 | + |
| 18 | +__m128i test_mm_mmask_i64gather_epi64(__m128i __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 19 | + // CIR-LABEL: test_mm_mmask_i64gather_epi64 |
| 20 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div2.di" |
| 21 | + |
| 22 | + // LLVM-LABEL: @test_mm_mmask_i64gather_epi64 |
| 23 | + // LLVM: @llvm.x86.avx512.mask.gather3div2.di |
| 24 | + return _mm_mmask_i64gather_epi64(__v1_old, __mask, __index, __addr, 2); |
| 25 | +} |
| 26 | + |
| 27 | +__m256d test_mm256_mmask_i64gather_pd(__m256d __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 28 | + // CIR-LABEL: test_mm256_mmask_i64gather_pd |
| 29 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div4.df" |
| 30 | + |
| 31 | + // LLVM-LABEL: @test_mm256_mmask_i64gather_pd |
| 32 | + // LLVM: @llvm.x86.avx512.mask.gather3div4.df |
| 33 | + return _mm256_mmask_i64gather_pd(__v1_old, __mask, __index, __addr, 2); |
| 34 | +} |
| 35 | + |
| 36 | +__m256i test_mm256_mmask_i64gather_epi64(__m256i __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 37 | + // CIR-LABEL: test_mm256_mmask_i64gather_epi64 |
| 38 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div4.di" |
| 39 | + |
| 40 | + // LLVM-LABEL: @test_mm256_mmask_i64gather_epi64 |
| 41 | + // LLVM: @llvm.x86.avx512.mask.gather3div4.di |
| 42 | + return _mm256_mmask_i64gather_epi64(__v1_old, __mask, __index, __addr, 2); |
| 43 | +} |
| 44 | + |
| 45 | +__m128 test_mm_mmask_i64gather_ps(__m128 __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 46 | + // CIR-LABEL: test_mm_mmask_i64gather_ps |
| 47 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div4.sf" |
| 48 | + |
| 49 | + // LLVM-LABEL: @test_mm_mmask_i64gather_ps |
| 50 | + // LLVM: @llvm.x86.avx512.mask.gather3div4.sf |
| 51 | + return _mm_mmask_i64gather_ps(__v1_old, __mask, __index, __addr, 2); |
| 52 | +} |
| 53 | + |
| 54 | +__m128i test_mm_mmask_i64gather_epi32(__m128i __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 55 | + // CIR-LABEL: test_mm_mmask_i64gather_epi32 |
| 56 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div4.si" |
| 57 | + |
| 58 | + // LLVM-LABEL: @test_mm_mmask_i64gather_epi32 |
| 59 | + // LLVM: @llvm.x86.avx512.mask.gather3div4.si |
| 60 | + return _mm_mmask_i64gather_epi32(__v1_old, __mask, __index, __addr, 2); |
| 61 | +} |
| 62 | + |
| 63 | +__m128 test_mm256_mmask_i64gather_ps(__m128 __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 64 | + // CIR-LABEL: test_mm256_mmask_i64gather_ps |
| 65 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div8.sf" |
| 66 | + |
| 67 | + // LLVM-LABEL: @test_mm256_mmask_i64gather_ps |
| 68 | + // LLVM: @llvm.x86.avx512.mask.gather3div8.sf |
| 69 | + return _mm256_mmask_i64gather_ps(__v1_old, __mask, __index, __addr, 2); |
| 70 | +} |
| 71 | + |
| 72 | +__m128i test_mm256_mmask_i64gather_epi32(__m128i __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 73 | + // CIR-LABEL: test_mm256_mmask_i64gather_epi32 |
| 74 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3div8.si" |
| 75 | + |
| 76 | + // LLVM-LABEL: @test_mm256_mmask_i64gather_epi32 |
| 77 | + // LLVM: @llvm.x86.avx512.mask.gather3div8.si |
| 78 | + return _mm256_mmask_i64gather_epi32(__v1_old, __mask, __index, __addr, 2); |
| 79 | +} |
| 80 | + |
| 81 | +__m128d test_mm_mask_i32gather_pd(__m128d __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 82 | + // CIR-LABEL: test_mm_mask_i32gather_pd |
| 83 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv2.df" |
| 84 | + |
| 85 | + // LLVM-LABEL: @test_mm_mask_i32gather_pd |
| 86 | + // LLVM: @llvm.x86.avx512.mask.gather3siv2.df |
| 87 | + return _mm_mmask_i32gather_pd(__v1_old, __mask, __index, __addr, 2); |
| 88 | +} |
| 89 | + |
| 90 | +__m128i test_mm_mask_i32gather_epi64(__m128i __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 91 | + // CIR-LABEL: test_mm_mask_i32gather_epi64 |
| 92 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv2.di" |
| 93 | + |
| 94 | + // LLVM-LABEL: @test_mm_mask_i32gather_epi64 |
| 95 | + // LLVM: @llvm.x86.avx512.mask.gather3siv2.di |
| 96 | + return _mm_mmask_i32gather_epi64(__v1_old, __mask, __index, __addr, 2); |
| 97 | +} |
| 98 | + |
| 99 | +__m256d test_mm256_mask_i32gather_pd(__m256d __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 100 | + // CIR-LABEL: test_mm256_mask_i32gather_pd |
| 101 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv4.df" |
| 102 | + |
| 103 | + // LLVM-LABEL: @test_mm256_mask_i32gather_pd |
| 104 | + // LLVM: @llvm.x86.avx512.mask.gather3siv4.df |
| 105 | + return _mm256_mmask_i32gather_pd(__v1_old, __mask, __index, __addr, 2); |
| 106 | +} |
| 107 | + |
| 108 | +__m256i test_mm256_mask_i32gather_epi64(__m256i __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 109 | + // CIR-LABEL: test_mm256_mask_i32gather_epi64 |
| 110 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv4.di" |
| 111 | + |
| 112 | + // LLVM-LABEL: @test_mm256_mask_i32gather_epi64 |
| 113 | + // LLVM: @llvm.x86.avx512.mask.gather3siv4.di |
| 114 | + return _mm256_mmask_i32gather_epi64(__v1_old, __mask, __index, __addr, 2); |
| 115 | +} |
| 116 | + |
| 117 | +__m128 test_mm_mask_i32gather_ps(__m128 __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 118 | + // CIR-LABEL: test_mm_mask_i32gather_ps |
| 119 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv4.sf" |
| 120 | + |
| 121 | + // LLVM-LABEL: @test_mm_mask_i32gather_ps |
| 122 | + // LLVM: @llvm.x86.avx512.mask.gather3siv4.sf |
| 123 | + return _mm_mmask_i32gather_ps(__v1_old, __mask, __index, __addr, 2); |
| 124 | +} |
| 125 | + |
| 126 | +__m128i test_mm_mask_i32gather_epi32(__m128i __v1_old, __mmask8 __mask, __m128i __index, void const *__addr) { |
| 127 | + // CIR-LABEL: test_mm_mask_i32gather_epi32 |
| 128 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv4.si" |
| 129 | + |
| 130 | + // LLVM-LABEL: @test_mm_mask_i32gather_epi32 |
| 131 | + // LLVM: @llvm.x86.avx512.mask.gather3siv4.si |
| 132 | + return _mm_mmask_i32gather_epi32(__v1_old, __mask, __index, __addr, 2); |
| 133 | +} |
| 134 | + |
| 135 | +__m256 test_mm256_mask_i32gather_ps(__m256 __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 136 | + // CIR-LABEL: test_mm256_mask_i32gather_ps |
| 137 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv8.sf" |
| 138 | + |
| 139 | + // LLVM-LABEL: @test_mm256_mask_i32gather_ps |
| 140 | + // LLVM: @llvm.x86.avx512.mask.gather3siv8.sf |
| 141 | + return _mm256_mmask_i32gather_ps(__v1_old, __mask, __index, __addr, 2); |
| 142 | +} |
| 143 | + |
| 144 | +__m256i test_mm256_mask_i32gather_epi32(__m256i __v1_old, __mmask8 __mask, __m256i __index, void const *__addr) { |
| 145 | + // CIR-LABEL: test_mm256_mask_i32gather_epi32 |
| 146 | + // CIR: cir.call_llvm_intrinsic "x86.avx512.mask.gather3siv8.si" |
| 147 | + |
| 148 | + // LLVM-LABEL: @test_mm256_mask_i32gather_epi32 |
| 149 | + // LLVM: @llvm.x86.avx512.mask.gather3siv8.si |
| 150 | + return _mm256_mmask_i32gather_epi32(__v1_old, __mask, __index, __addr, 2); |
| 151 | +} |
0 commit comments