@@ -33,35 +33,50 @@ define <4 x float> @bitcast_shuf_same_size(<4 x i32> %v) {
33
33
ret <4 x float > %r
34
34
}
35
35
36
- ; TODO - length- changing shuffle
36
+ ; Length- changing shuffles
37
37
38
38
define <16 x i8 > @bitcast_shuf_narrow_element_subvector (<2 x i32 > %v ) {
39
- ; CHECK-LABEL: @bitcast_shuf_narrow_element_subvector(
40
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <2 x i32> [[V:%.*]], <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
41
- ; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
42
- ; CHECK-NEXT: ret <16 x i8> [[R]]
39
+ ; SSE-LABEL: @bitcast_shuf_narrow_element_subvector(
40
+ ; SSE-NEXT: [[SHUF:%.*]] = shufflevector <2 x i32> [[V:%.*]], <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
41
+ ; SSE-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
42
+ ; SSE-NEXT: ret <16 x i8> [[R]]
43
+ ;
44
+ ; AVX-LABEL: @bitcast_shuf_narrow_element_subvector(
45
+ ; AVX-NEXT: [[TMP1:%.*]] = bitcast <2 x i32> [[V:%.*]] to <8 x i8>
46
+ ; AVX-NEXT: [[R:%.*]] = shufflevector <8 x i8> [[TMP1]], <8 x i8> poison, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3>
47
+ ; AVX-NEXT: ret <16 x i8> [[R]]
43
48
;
44
49
%shuf = shufflevector <2 x i32 > %v , <2 x i32 > poison, <4 x i32 > <i32 1 , i32 0 , i32 1 , i32 0 >
45
50
%r = bitcast <4 x i32 > %shuf to <16 x i8 >
46
51
ret <16 x i8 > %r
47
52
}
48
53
49
54
define <16 x i16 > @bitcast_shuf_narrow_element_concat_subvectors (<2 x i64 > %v ) {
50
- ; CHECK-LABEL: @bitcast_shuf_narrow_element_concat_subvectors(
51
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <2 x i64> [[V:%.*]], <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
52
- ; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i64> [[SHUF]] to <16 x i16>
53
- ; CHECK-NEXT: ret <16 x i16> [[R]]
55
+ ; SSE-LABEL: @bitcast_shuf_narrow_element_concat_subvectors(
56
+ ; SSE-NEXT: [[SHUF:%.*]] = shufflevector <2 x i64> [[V:%.*]], <2 x i64> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
57
+ ; SSE-NEXT: [[R:%.*]] = bitcast <4 x i64> [[SHUF]] to <16 x i16>
58
+ ; SSE-NEXT: ret <16 x i16> [[R]]
59
+ ;
60
+ ; AVX-LABEL: @bitcast_shuf_narrow_element_concat_subvectors(
61
+ ; AVX-NEXT: [[TMP1:%.*]] = bitcast <2 x i64> [[V:%.*]] to <8 x i16>
62
+ ; AVX-NEXT: [[R:%.*]] = shufflevector <8 x i16> [[TMP1]], <8 x i16> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
63
+ ; AVX-NEXT: ret <16 x i16> [[R]]
54
64
;
55
65
%shuf = shufflevector <2 x i64 > %v , <2 x i64 > poison, <4 x i32 > <i32 0 , i32 1 , i32 0 , i32 1 >
56
66
%r = bitcast <4 x i64 > %shuf to <16 x i16 >
57
67
ret <16 x i16 > %r
58
68
}
59
69
60
70
define <16 x i8 > @bitcast_shuf_extract_subvector (<8 x i32 > %v ) {
61
- ; CHECK-LABEL: @bitcast_shuf_extract_subvector(
62
- ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <8 x i32> [[V:%.*]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
63
- ; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
64
- ; CHECK-NEXT: ret <16 x i8> [[R]]
71
+ ; SSE-LABEL: @bitcast_shuf_extract_subvector(
72
+ ; SSE-NEXT: [[TMP1:%.*]] = bitcast <8 x i32> [[V:%.*]] to <32 x i8>
73
+ ; SSE-NEXT: [[R:%.*]] = shufflevector <32 x i8> [[TMP1]], <32 x i8> poison, <16 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
74
+ ; SSE-NEXT: ret <16 x i8> [[R]]
75
+ ;
76
+ ; AVX-LABEL: @bitcast_shuf_extract_subvector(
77
+ ; AVX-NEXT: [[SHUF:%.*]] = shufflevector <8 x i32> [[V:%.*]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
78
+ ; AVX-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
79
+ ; AVX-NEXT: ret <16 x i8> [[R]]
65
80
;
66
81
%shuf = shufflevector <8 x i32 > %v , <8 x i32 > poison, <4 x i32 > <i32 4 , i32 5 , i32 6 , i32 7 >
67
82
%r = bitcast <4 x i32 > %shuf to <16 x i8 >
0 commit comments