|
2 | 2 | // RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
|
3 | 3 | // RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512dq -target-feature +avx512vl -fclangir -emit-llvm -o %t.ll -Wall -Werror
|
4 | 4 | // RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
|
| 5 | +// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512dq -target-feature +avx512vl -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=OGCG |
5 | 6 |
|
6 | 7 | #include <immintrin.h>
|
7 | 8 |
|
@@ -83,3 +84,43 @@ __m256i test_mm256_inserti64x2(__m256i __A, __m128i __B) {
|
83 | 84 | // LLVM: shufflevector <4 x i64> %{{.*}}, <4 x i64> %{{.*}}, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
|
84 | 85 | return _mm256_inserti64x2(__A, __B, 1);
|
85 | 86 | }
|
| 87 | + |
| 88 | +__mmask8 test_mm256_movepi32_mask(__m256i __A) { |
| 89 | + // LLVM-LABEL: @test_mm256_movepi32_mask |
| 90 | + // LLVM: [[CMP:%.*]] = icmp slt <8 x i32> %{{.*}}, zeroinitializer |
| 91 | + |
| 92 | + // OGCG-LABEL: @test_mm256_movepi32_mask |
| 93 | + // OGCG: [[CMP:%.*]] = icmp slt <8 x i32> %{{.*}}, zeroinitializer |
| 94 | + return _mm256_movepi32_mask(__A); |
| 95 | +} |
| 96 | + |
| 97 | +__mmask8 test_mm_movepi64_mask(__m128i __A) { |
| 98 | + // CIR-LABEL: _mm_movepi64_mask |
| 99 | + // CIR: %{{.*}} = cir.vec.cmp(lt, %{{.*}}, %{{.*}}) : !cir.vector<!s64i x 2>, !cir.vector<!cir.int<u, 1> x 2> |
| 100 | + // CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<!cir.int<u, 1> x 2>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i] : !cir.vector<!cir.int<u, 1> x 8> |
| 101 | + // CIR: %{{.*}} = cir.cast(bitcast, %{{.*}} : !cir.vector<!cir.int<u, 1> x 8>), !u8i |
| 102 | + |
| 103 | + // LLVM-LABEL: @test_mm_movepi64_mask |
| 104 | + // LLVM: [[CMP:%.*]] = icmp slt <2 x i64> %{{.*}}, zeroinitializer |
| 105 | + // LLVM: [[SHUF:%.*]] = shufflevector <2 x i1> [[CMP]], <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3> |
| 106 | + |
| 107 | + // OGCG-LABEL: @test_mm_movepi64_mask |
| 108 | + // OGCG: [[CMP:%.*]] = icmp slt <2 x i64> %{{.*}}, zeroinitializer |
| 109 | + // OGCG: [[SHUF:%.*]] = shufflevector <2 x i1> [[CMP]], <2 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 3, i32 2, i32 3> |
| 110 | + return _mm_movepi64_mask(__A); |
| 111 | +} |
| 112 | + |
| 113 | +__mmask8 test_mm256_movepi64_mask(__m256i __A) { |
| 114 | + // CIR-LABEL: _mm256_movepi64_mask |
| 115 | + // CIR: %{{.*}} = cir.vec.cmp(lt, %{{.*}}, %{{.*}}) : !cir.vector<!s64i x 4>, !cir.vector<!cir.int<u, 1> x 4> |
| 116 | + // CIR: %{{.*}} = cir.vec.shuffle(%{{.*}}, %{{.*}} : !cir.vector<!cir.int<u, 1> x 4>) [#cir.int<0> : !s32i, #cir.int<1> : !s32i, #cir.int<2> : !s32i, #cir.int<3> : !s32i, #cir.int<4> : !s32i, #cir.int<5> : !s32i, #cir.int<6> : !s32i, #cir.int<7> : !s32i] : !cir.vector<!cir.int<u, 1> x 8> |
| 117 | + |
| 118 | + // LLVM-LABEL: @test_mm256_movepi64_mask |
| 119 | + // LLVM: [[CMP:%.*]] = icmp slt <4 x i64> %{{.*}}, zeroinitializer |
| 120 | + // LLVM: [[SHUF:%.*]] = shufflevector <4 x i1> [[CMP]], <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
| 121 | + |
| 122 | + // OGCG-LABEL: @test_mm256_movepi64_mask |
| 123 | + // OGCG: [[CMP:%.*]] = icmp slt <4 x i64> %{{.*}}, zeroinitializer |
| 124 | + // OGCG: [[SHUF:%.*]] = shufflevector <4 x i1> [[CMP]], <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
| 125 | + return _mm256_movepi64_mask(__A); |
| 126 | +} |
0 commit comments