@@ -33,10 +33,10 @@ define <4 x float> @bitcast_shuf_same_size(<4 x i32> %v) {
33
33
ret <4 x float > %r
34
34
}
35
35
36
- ; Negative test - length-changing shuffle
36
+ ; TODO - length-changing shuffle
37
37
38
- define <16 x i8 > @bitcast_shuf_narrow_element_wrong_size (<2 x i32 > %v ) {
39
- ; CHECK-LABEL: @bitcast_shuf_narrow_element_wrong_size (
38
+ define <16 x i8 > @bitcast_shuf_narrow_element_subvector (<2 x i32 > %v ) {
39
+ ; CHECK-LABEL: @bitcast_shuf_narrow_element_subvector (
40
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
41
; CHECK-NEXT: [[R:%.*]] = bitcast <4 x i32> [[SHUF]] to <16 x i8>
42
42
; CHECK-NEXT: ret <16 x i8> [[R]]
@@ -46,6 +46,28 @@ define <16 x i8> @bitcast_shuf_narrow_element_wrong_size(<2 x i32> %v) {
46
46
ret <16 x i8 > %r
47
47
}
48
48
49
+ 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]]
54
+ ;
55
+ %shuf = shufflevector <2 x i64 > %v , <2 x i64 > poison, <4 x i32 > <i32 0 , i32 1 , i32 0 , i32 1 >
56
+ %r = bitcast <4 x i64 > %shuf to <16 x i16 >
57
+ ret <16 x i16 > %r
58
+ }
59
+
60
+ 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]]
65
+ ;
66
+ %shuf = shufflevector <8 x i32 > %v , <8 x i32 > poison, <4 x i32 > <i32 4 , i32 5 , i32 6 , i32 7 >
67
+ %r = bitcast <4 x i32 > %shuf to <16 x i8 >
68
+ ret <16 x i8 > %r
69
+ }
70
+
49
71
; Negative test - must cast to vector type
50
72
51
73
define i128 @bitcast_shuf_narrow_element_wrong_type (<4 x i32 > %v ) {
0 commit comments