You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This test mimics clang/test/CodeGen/X86/xop-builtins.c, which eventually
29
+
// CIR shall be able to support fully.
30
+
31
+
__m128itest_mm_roti_epi8(__m128ia) {
32
+
// CIR-LABEL: test_mm_roti_epi8
33
+
// CIR: cir.vec.splat %{{.*}} : !{{[us]}}8i, !cir.vector<16 x !{{[us]}}8i>
34
+
// CIR: cir.call_llvm_intrinsic "fshl" {{.*}} : (!cir.vector<16 x !{{[su]}}8i>, !cir.vector<16 x !{{[su]}}8i>, !cir.vector<16 x !{{[su]}}8i>) -> !cir.vector<16 x !{{[su]}}8i>
35
+
36
+
// LLVM-LABEL: test_mm_roti_epi8
37
+
// LLVM: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <16 x i8>
38
+
// LLVM: call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %[[CASTED_VAR]], <16 x i8> %[[CASTED_VAR]], <16 x i8> splat (i8 1))
39
+
40
+
// OGCG-LABEL: test_mm_roti_epi8
41
+
// OGCG: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <16 x i8>
42
+
// OGCG: call <16 x i8> @llvm.fshl.v16i8(<16 x i8> %[[CASTED_VAR]], <16 x i8> %[[CASTED_VAR]], <16 x i8> splat (i8 1))
43
+
return_mm_roti_epi8(a, 1);
44
+
}
45
+
46
+
__m128itest_mm_roti_epi16(__m128ia) {
47
+
// CIR-LABEL: test_mm_roti_epi16
48
+
// CIR: cir.cast integral %{{.*}} : !u8i -> !u16i
49
+
// CIR: cir.vec.splat %{{.*}} : !{{[us]}}16i, !cir.vector<8 x !u16i>
50
+
// CIR: cir.call_llvm_intrinsic "fshl" {{.*}} : (!cir.vector<8 x !{{[su]}}16i>, !cir.vector<8 x !{{[su]}}16i>, !cir.vector<8 x !u16i>) -> !cir.vector<8 x !{{[su]}}16i>
51
+
52
+
// LLVM-LABEL: test_mm_roti_epi16
53
+
// LLVM: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <8 x i16>
54
+
// LLVM: call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %[[CASTED_VAR]], <8 x i16> %[[CASTED_VAR]], <8 x i16> splat (i16 50))
55
+
56
+
// OGCG-LABEL: test_mm_roti_epi16
57
+
// OGCG: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <8 x i16>
58
+
// OGCG: call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %[[CASTED_VAR]], <8 x i16> %[[CASTED_VAR]], <8 x i16> splat (i16 50))
59
+
return_mm_roti_epi16(a, 50);
60
+
}
61
+
62
+
__m128itest_mm_roti_epi32(__m128ia) {
63
+
// CIR-LABEL: test_mm_roti_epi32
64
+
// CIR: cir.cast integral %{{.*}} : !u8i -> !u32i
65
+
// CIR: cir.vec.splat %{{.*}} : !{{[us]}}32i, !cir.vector<4 x !u32i>
66
+
// CIR: cir.call_llvm_intrinsic "fshl" {{.*}} : (!cir.vector<4 x !{{[su]}}32i>, !cir.vector<4 x !{{[su]}}32i>, !cir.vector<4 x !u32i>) -> !cir.vector<4 x !{{[su]}}32i>
67
+
68
+
// LLVM-LABEL: test_mm_roti_epi32
69
+
// LLVM: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <4 x i32>
70
+
// LLVM: call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %[[CASTED_VAR]], <4 x i32> %[[CASTED_VAR]], <4 x i32> splat (i32 226))
71
+
72
+
// OGCG-LABEL: test_mm_roti_epi32
73
+
// OGCG: %[[CASTED_VAR:.*]] = bitcast <2 x i64> %{{.*}} to <4 x i32>
74
+
// OGCG: call <4 x i32> @llvm.fshl.v4i32(<4 x i32> %[[CASTED_VAR]], <4 x i32> %[[CASTED_VAR]], <4 x i32> splat (i32 226))
75
+
return_mm_roti_epi32(a, -30);
76
+
}
77
+
78
+
__m128itest_mm_roti_epi64(__m128ia) {
79
+
// CIR-LABEL: test_mm_roti_epi64
80
+
// CIR: cir.cast integral %{{.*}} : !u8i -> !u64i
81
+
// CIR: cir.vec.splat %{{.*}} : !u64i, !cir.vector<2 x !u64i>
82
+
// CIR: cir.call_llvm_intrinsic "fshl" {{.*}} : (!cir.vector<2 x !{{[su]}}64i>, !cir.vector<2 x !{{[su]}}64i>, !cir.vector<2 x !u64i>) -> !cir.vector<2 x !s64i>
0 commit comments