| 1 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512bw -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 +avx512bw -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 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.1-512 -target-feature +avx512vl -fclangir -emit-cir -o %t.cir -Wall -Werror -Wsign-conversion |
| 7 |
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 8 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx10.1-512 -target-feature +avx512vl -fclangir -emit-llvm -o %t.ll -Wall -Werror -Wsign-conversion |
| 9 |
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s |
| 10 |
|
| 11 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512bw -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -Wsign-conversion | FileCheck %s --check-prefixes=OGCG |
| 12 |
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx10.1-512 -target-feature +avx512bw -target-feature +avx512vl -emit-llvm -o - -Wall -Werror -Wsign-conversion | FileCheck %s --check-prefixes=OGCG |
| 13 |
|
| 14 |
|
| 15 |
#include <immintrin.h> |
| 16 |
|
| 17 |
__m128i test_mm_movm_epi8(__mmask16 __A) { |
| 18 |
// CIR-LABEL: _mm_movm_epi8 |
| 19 |
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !u16i -> !cir.vector<16 x !cir.int<s, 1>> |
| 20 |
// CIR: %{{.*}} = cir.cast integral %{{.*}} : !cir.vector<16 x !cir.int<s, 1>> -> !cir.vector<16 x !s8i> |
| 21 |
|
| 22 |
// LLVM-LABEL: @test_mm_movm_epi8 |
| 23 |
// LLVM: %{{.*}} = bitcast i16 %{{.*}} to <16 x i1> |
| 24 |
// LLVM: %{{.*}} = sext <16 x i1> %{{.*}} to <16 x i8> |
| 25 |
|
| 26 |
// OGCG-LABEL: @test_mm_movm_epi8 |
| 27 |
// OGCG: %{{.*}} = bitcast i16 %{{.*}} to <16 x i1> |
| 28 |
// OGCG: %{{.*}} = sext <16 x i1> %{{.*}} to <16 x i8> |
| 29 |
return _mm_movm_epi8(__A); |
| 30 |
} |
| 31 |
|
| 32 |
__m256i test_mm256_movm_epi8(__mmask32 __A) { |
| 33 |
// CIR-LABEL: _mm256_movm_epi8 |
| 34 |
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !u32i -> !cir.vector<32 x !cir.int<s, 1>> |
| 35 |
// CIR: %{{.*}} = cir.cast integral %{{.*}} : !cir.vector<32 x !cir.int<s, 1>> -> !cir.vector<32 x !s8i> |
| 36 |
|
| 37 |
// LLVM-LABEL: @test_mm256_movm_epi8 |
| 38 |
// LLVM: %{{.*}} = bitcast i32 %{{.*}} to <32 x i1> |
| 39 |
// LLVM: %{{.*}} = sext <32 x i1> %{{.*}} to <32 x i8> |
| 40 |
|
| 41 |
// OGCG-LABEL: @test_mm256_movm_epi8 |
| 42 |
// OGCG: %{{.*}} = bitcast i32 %{{.*}} to <32 x i1> |
| 43 |
// OGCG: %{{.*}} = sext <32 x i1> %{{.*}} to <32 x i8> |
| 44 |
return _mm256_movm_epi8(__A); |
| 45 |
} |
| 46 |
|
| 47 |
__m512i test_mm512_movm_epi8(__mmask64 __A) { |
| 48 |
// CIR-LABEL: _mm512_movm_epi8 |
| 49 |
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !u64i -> !cir.vector<64 x !cir.int<s, 1>> |
| 50 |
// CIR: %{{.*}} = cir.cast integral %{{.*}} : !cir.vector<64 x !cir.int<s, 1>> -> !cir.vector<64 x !s8i> |
| 51 |
|
| 52 |
// LLVM-LABEL: @test_mm512_movm_epi8 |
| 53 |
// LLVM: %{{.*}} = bitcast i64 %{{.*}} to <64 x i1> |
| 54 |
// LLVM: %{{.*}} = sext <64 x i1> %{{.*}} to <64 x i8> |
| 55 |
|
| 56 |
// OGCG-LABEL: @test_mm512_movm_epi8 |
| 57 |
// OGCG: %{{.*}} = bitcast i64 %{{.*}} to <64 x i1> |
| 58 |
// OGCG: %{{.*}} = sext <64 x i1> %{{.*}} to <64 x i8> |
| 59 |
return _mm512_movm_epi8(__A); |
| 60 |
} |
| 61 |
|
| 62 |
__m128i test_mm_movm_epi16(__mmask8 __A) { |
| 63 |
// CIR-LABEL: _mm_movm_epi16 |
| 64 |
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !u8i -> !cir.vector<8 x !cir.int<s, 1>> |
| 65 |
// CIR: %{{.*}} = cir.cast integral %{{.*}} : !cir.vector<8 x !cir.int<s, 1>> -> !cir.vector<8 x !s16i> |
| 66 |
|
| 67 |
// LLVM-LABEL: @test_mm_movm_epi16 |
| 68 |
// LLVM: %{{.*}} = bitcast i8 %{{.*}} to <8 x i1> |
| 69 |
// LLVM: %{{.*}} = sext <8 x i1> %{{.*}} to <8 x i16> |
| 70 |
|
| 71 |
// OGCG-LABEL: @test_mm_movm_epi16 |
| 72 |
// OGCG: %{{.*}} = bitcast i8 %{{.*}} to <8 x i1> |
| 73 |
// OGCG: %{{.*}} = sext <8 x i1> %{{.*}} to <8 x i16> |
| 74 |
return _mm_movm_epi16(__A); |
| 75 |
} |
| 76 |
|
| 77 |
__m256i test_mm256_movm_epi16(__mmask16 __A) { |
| 78 |
// CIR-LABEL: _mm256_movm_epi16 |
| 79 |
// CIR: %{{.*}} = cir.cast bitcast %{{.*}} : !u16i -> !cir.vector<16 x !cir.int<s, 1>> |
| 80 |
// CIR: %{{.*}} = cir.cast integral %{{.*}} : !cir.vector<16 x !cir.int<s, 1>> -> !cir.vector<16 x !s16i> |
| 81 |
|
| 82 |
// LLVM-LABEL: @test_mm256_movm_epi16 |
| 83 |
// LLVM: %{{.*}} = bitcast i16 %{{.*}} to <16 x i1> |
| 84 |
// LLVM: %{{.*}} = sext <16 x i1> %{{.*}} to <16 x i16> |
| 85 |
|
| 86 |
// OGCG-LABEL: @test_mm256_movm_epi16 |
| 87 |
// OGCG: %{{.*}} = bitcast i16 %{{.*}} to <16 x i1> |
| 88 |
// OGCG: %{{.*}} = sext <16 x i1> %{{.*}} to <16 x i16> |
| 89 |
return _mm256_movm_epi16(__A); |
| 90 |
} |
| 91 |
|
| 92 |
__mmask16 test_mm_movepi8_mask(__m128i __A) { |
| 93 |
// CIR-LABEL: _mm_movepi8_mask |
| 94 |
// CIR: cir.cast bitcast %{{.*}} : !cir.vector<2 x !s64i> -> !cir.vector<16 x !s8i> |
| 95 |
// CIR: [[CMP:%.*]] = cir.vec.cmp(lt, %{{.*}}, %{{.*}}) : !cir.vector<16 x !s8i>, !cir.vector<16 x !cir.int<s, 1>> |
| 96 |
// CIR: %{{.*}} = cir.cast bitcast [[CMP]] : !cir.vector<16 x !cir.int<s, 1>> -> !u16i |
| 97 |
|
| 98 |
// LLVM-LABEL: @test_mm_movepi8_mask |
| 99 |
// LLVM: [[CMP:%.*]] = icmp slt <16 x i8> %{{.*}}, zeroinitializer |
| 100 |
// LLVM: bitcast <16 x i1> [[CMP]] to i16 |
| 101 |
|
| 102 |
// OGCG-LABEL: @test_mm_movepi8_mask |
| 103 |
// OGCG: [[CMP:%.*]] = icmp slt <16 x i8> %{{.*}}, zeroinitializer |
| 104 |
// OGCG: bitcast <16 x i1> [[CMP]] to i16 |
| 105 |
return _mm_movepi8_mask(__A); |
| 106 |
} |
| 107 |
|
| 108 |
__mmask16 test_mm256_movepi16_mask(__m256i __A) { |
| 109 |
// CIR-LABEL: _mm256_movepi16_mask |
| 110 |
// CIR: cir.cast bitcast %{{.*}} : !cir.vector<4 x !s64i> -> !cir.vector<16 x !s16i> |
| 111 |
// CIR: [[CMP:%.*]] = cir.vec.cmp(lt, %{{.*}}, %{{.*}}) : !cir.vector<16 x !s16i>, !cir.vector<16 x !cir.int<s, 1>> |
| 112 |
// CIR: %{{.*}} = cir.cast bitcast [[CMP]] : !cir.vector<16 x !cir.int<s, 1>> -> !u16i |
| 113 |
|
| 114 |
// LLVM-LABEL: @test_mm256_movepi16_mask |
| 115 |
// LLVM: [[CMP:%.*]] = icmp slt <16 x i16> %{{.*}}, zeroinitializer |
| 116 |
// LLVM: bitcast <16 x i1> [[CMP]] to i16 |
| 117 |
|
| 118 |
// OGCG-LABEL: @test_mm256_movepi16_mask |
| 119 |
// OGCG: [[CMP:%.*]] = icmp slt <16 x i16> %{{.*}}, zeroinitializer |
| 120 |
// OGCG: bitcast <16 x i1> [[CMP]] to i16 |
| 121 |
return _mm256_movepi16_mask(__A); |
| 122 |
} |