Skip to content

Commit 9c31755

Browse files
committed
Add test coverage for palingr semantics
1 parent 5067555 commit 9c31755

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %clang_cc1 %s -triple=x86_64-unknown-linux -target-feature +ssse3 -fclangir -emit-cir -o %t.cir
2+
// RUN: FileCheck --input-file=%t.cir %s
3+
4+
5+
#define _mm_alignr_epi8(a, b, n) (__builtin_ia32_palignr128((a), (b), (n)))
6+
typedef __attribute__((vector_size(16))) int int4;
7+
8+
// CHECK-LABEL: align1
9+
// CHECK: cir.vec.shuffle({{.*}}) [#cir.int<15> : !s32i, #cir.int<16> : !s32i
10+
int4 align1(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 15); }
11+
12+
// CHECK-LABEL: align2
13+
// CHECK: cir.vec.shuffle({{.*}}) [#cir.int<16> : !s32i, #cir.int<17> : !s32i
14+
int4 align2(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 16); }
15+
16+
// CHECK-LABEL: align3
17+
// CHECK: cir.const #cir.zero : !cir.vector<!s8i x 16>
18+
// CHECK: cir.vec.shuffle({{.*}}) [#cir.int<1> : !s32i, #cir.int<2> : !s32i
19+
int4 align3(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 17); }
20+
21+
// CHECK-LABEL: align4
22+
// CHECK: cir.const #cir.zero : !cir.vector<!s8i x 16>
23+
// CHECK-NOT: cir.vec.shuffle
24+
int4 align4(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 32); }

0 commit comments

Comments
 (0)