@@ -33,35 +33,50 @@ define <4 x float> @bitcast_shuf_same_size(<4 x i32> %v) {
3333 ret <4 x float > %r
3434}
3535
36- ; TODO - length- changing shuffle
36+ ; Length- changing shuffles
3737
3838define <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]]
4348;
4449 %shuf = shufflevector <2 x i32 > %v , <2 x i32 > poison, <4 x i32 > <i32 1 , i32 0 , i32 1 , i32 0 >
4550 %r = bitcast <4 x i32 > %shuf to <16 x i8 >
4651 ret <16 x i8 > %r
4752}
4853
4954define <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]]
5464;
5565 %shuf = shufflevector <2 x i64 > %v , <2 x i64 > poison, <4 x i32 > <i32 0 , i32 1 , i32 0 , i32 1 >
5666 %r = bitcast <4 x i64 > %shuf to <16 x i16 >
5767 ret <16 x i16 > %r
5868}
5969
6070define <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]]
6580;
6681 %shuf = shufflevector <8 x i32 > %v , <8 x i32 > poison, <4 x i32 > <i32 4 , i32 5 , i32 6 , i32 7 >
6782 %r = bitcast <4 x i32 > %shuf to <16 x i8 >
0 commit comments