@@ -1108,5 +1108,169 @@ define <8 x i8> @operandbundles_second(<8 x i8> %a) {
1108
1108
ret <8 x i8 > %r
1109
1109
}
1110
1110
1111
+ define <8 x i32 > @fptoi (<8 x float > %a , <8 x float > %b ) {
1112
+ ; CHECK-LABEL: @fptoi(
1113
+ ; CHECK-NEXT: [[AB:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1114
+ ; CHECK-NEXT: [[AT:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 7, i32 6, i32 5, i32 4>
1115
+ ; CHECK-NEXT: [[BB:%.*]] = shufflevector <8 x float> [[B:%.*]], <8 x float> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1116
+ ; CHECK-NEXT: [[BT:%.*]] = shufflevector <8 x float> [[B]], <8 x float> poison, <4 x i32> <i32 7, i32 6, i32 5, i32 4>
1117
+ ; CHECK-NEXT: [[ABT:%.*]] = fptosi <4 x float> [[AT]] to <4 x i32>
1118
+ ; CHECK-NEXT: [[ABB:%.*]] = fptosi <4 x float> [[AB]] to <4 x i32>
1119
+ ; CHECK-NEXT: [[BBT:%.*]] = fptoui <4 x float> [[BT]] to <4 x i32>
1120
+ ; CHECK-NEXT: [[BBB:%.*]] = fptoui <4 x float> [[BB]] to <4 x i32>
1121
+ ; CHECK-NEXT: [[MT:%.*]] = mul <4 x i32> [[ABT]], [[BBT]]
1122
+ ; CHECK-NEXT: [[MB:%.*]] = mul <4 x i32> [[ABB]], [[BBB]]
1123
+ ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x i32> [[MT]], <4 x i32> [[MB]], <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
1124
+ ; CHECK-NEXT: ret <8 x i32> [[R]]
1125
+ ;
1126
+ %ab = shufflevector <8 x float > %a , <8 x float > poison, <4 x i32 > <i32 3 , i32 2 , i32 1 , i32 0 >
1127
+ %at = shufflevector <8 x float > %a , <8 x float > poison, <4 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 >
1128
+ %bb = shufflevector <8 x float > %b , <8 x float > poison, <4 x i32 > <i32 3 , i32 2 , i32 1 , i32 0 >
1129
+ %bt = shufflevector <8 x float > %b , <8 x float > poison, <4 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 >
1130
+ %abt = fptosi <4 x float > %at to <4 x i32 >
1131
+ %abb = fptosi <4 x float > %ab to <4 x i32 >
1132
+ %bbt = fptoui <4 x float > %bt to <4 x i32 >
1133
+ %bbb = fptoui <4 x float > %bb to <4 x i32 >
1134
+ %mt = mul <4 x i32 > %abt , %bbt
1135
+ %mb = mul <4 x i32 > %abb , %bbb
1136
+ %r = shufflevector <4 x i32 > %mt , <4 x i32 > %mb , <8 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 , i32 3 , i32 2 , i32 1 , i32 0 >
1137
+ ret <8 x i32 > %r
1138
+ }
1139
+
1140
+ define <8 x half > @itofp (<8 x i16 > %a , <8 x i16 > %b ) {
1141
+ ; CHECK-LABEL: @itofp(
1142
+ ; CHECK-NEXT: [[AB:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1143
+ ; CHECK-NEXT: [[AT:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> poison, <4 x i32> <i32 7, i32 6, i32 5, i32 4>
1144
+ ; CHECK-NEXT: [[BB:%.*]] = shufflevector <8 x i16> [[B:%.*]], <8 x i16> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
1145
+ ; CHECK-NEXT: [[BT:%.*]] = shufflevector <8 x i16> [[B]], <8 x i16> poison, <4 x i32> <i32 7, i32 6, i32 5, i32 4>
1146
+ ; CHECK-NEXT: [[ABT:%.*]] = sitofp <4 x i16> [[AT]] to <4 x half>
1147
+ ; CHECK-NEXT: [[ABB:%.*]] = sitofp <4 x i16> [[AB]] to <4 x half>
1148
+ ; CHECK-NEXT: [[BBT:%.*]] = uitofp <4 x i16> [[BT]] to <4 x half>
1149
+ ; CHECK-NEXT: [[BBB:%.*]] = uitofp <4 x i16> [[BB]] to <4 x half>
1150
+ ; CHECK-NEXT: [[MT:%.*]] = fmul <4 x half> [[ABT]], [[BBT]]
1151
+ ; CHECK-NEXT: [[MB:%.*]] = fmul <4 x half> [[ABB]], [[BBB]]
1152
+ ; CHECK-NEXT: [[R:%.*]] = shufflevector <4 x half> [[MT]], <4 x half> [[MB]], <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
1153
+ ; CHECK-NEXT: ret <8 x half> [[R]]
1154
+ ;
1155
+ %ab = shufflevector <8 x i16 > %a , <8 x i16 > poison, <4 x i32 > <i32 3 , i32 2 , i32 1 , i32 0 >
1156
+ %at = shufflevector <8 x i16 > %a , <8 x i16 > poison, <4 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 >
1157
+ %bb = shufflevector <8 x i16 > %b , <8 x i16 > poison, <4 x i32 > <i32 3 , i32 2 , i32 1 , i32 0 >
1158
+ %bt = shufflevector <8 x i16 > %b , <8 x i16 > poison, <4 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 >
1159
+ %abt = sitofp <4 x i16 > %at to <4 x half >
1160
+ %abb = sitofp <4 x i16 > %ab to <4 x half >
1161
+ %bbt = uitofp <4 x i16 > %bt to <4 x half >
1162
+ %bbb = uitofp <4 x i16 > %bb to <4 x half >
1163
+ %mt = fmul <4 x half > %abt , %bbt
1164
+ %mb = fmul <4 x half > %abb , %bbb
1165
+ %r = shufflevector <4 x half > %mt , <4 x half > %mb , <8 x i32 > <i32 7 , i32 6 , i32 5 , i32 4 , i32 3 , i32 2 , i32 1 , i32 0 >
1166
+ ret <8 x half > %r
1167
+ }
1168
+
1169
+ define <16 x i32 > @const_types (<16 x i32 > %wide.vec , <16 x i32 > %wide.vec116 ) {
1170
+ ; CHECK-LABEL: @const_types(
1171
+ ; CHECK-NEXT: [[STRIDED_VEC:%.*]] = shufflevector <16 x i32> [[WIDE_VEC:%.*]], <16 x i32> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
1172
+ ; CHECK-NEXT: [[STRIDED_VEC113:%.*]] = shufflevector <16 x i32> [[WIDE_VEC]], <16 x i32> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
1173
+ ; CHECK-NEXT: [[STRIDED_VEC114:%.*]] = shufflevector <16 x i32> [[WIDE_VEC]], <16 x i32> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
1174
+ ; CHECK-NEXT: [[STRIDED_VEC115:%.*]] = shufflevector <16 x i32> [[WIDE_VEC]], <16 x i32> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
1175
+ ; CHECK-NEXT: [[TMP1:%.*]] = sext <4 x i32> [[STRIDED_VEC]] to <4 x i64>
1176
+ ; CHECK-NEXT: [[STRIDED_VEC117:%.*]] = shufflevector <16 x i32> [[WIDE_VEC116:%.*]], <16 x i32> poison, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
1177
+ ; CHECK-NEXT: [[STRIDED_VEC118:%.*]] = shufflevector <16 x i32> [[WIDE_VEC116]], <16 x i32> poison, <4 x i32> <i32 1, i32 5, i32 9, i32 13>
1178
+ ; CHECK-NEXT: [[STRIDED_VEC119:%.*]] = shufflevector <16 x i32> [[WIDE_VEC116]], <16 x i32> poison, <4 x i32> <i32 2, i32 6, i32 10, i32 14>
1179
+ ; CHECK-NEXT: [[STRIDED_VEC120:%.*]] = shufflevector <16 x i32> [[WIDE_VEC116]], <16 x i32> poison, <4 x i32> <i32 3, i32 7, i32 11, i32 15>
1180
+ ; CHECK-NEXT: [[TMP2:%.*]] = sext <4 x i32> [[STRIDED_VEC117]] to <4 x i64>
1181
+ ; CHECK-NEXT: [[TMP3:%.*]] = mul nsw <4 x i64> [[TMP2]], [[TMP1]]
1182
+ ; CHECK-NEXT: [[TMP4:%.*]] = sext <4 x i32> [[STRIDED_VEC113]] to <4 x i64>
1183
+ ; CHECK-NEXT: [[TMP5:%.*]] = sext <4 x i32> [[STRIDED_VEC118]] to <4 x i64>
1184
+ ; CHECK-NEXT: [[TMP6:%.*]] = mul nsw <4 x i64> [[TMP5]], [[TMP4]]
1185
+ ; CHECK-NEXT: [[TMP7:%.*]] = sext <4 x i32> [[STRIDED_VEC114]] to <4 x i64>
1186
+ ; CHECK-NEXT: [[TMP8:%.*]] = sext <4 x i32> [[STRIDED_VEC119]] to <4 x i64>
1187
+ ; CHECK-NEXT: [[TMP9:%.*]] = mul nsw <4 x i64> [[TMP8]], [[TMP7]]
1188
+ ; CHECK-NEXT: [[TMP10:%.*]] = sext <4 x i32> [[STRIDED_VEC115]] to <4 x i64>
1189
+ ; CHECK-NEXT: [[TMP11:%.*]] = sext <4 x i32> [[STRIDED_VEC120]] to <4 x i64>
1190
+ ; CHECK-NEXT: [[TMP12:%.*]] = mul nsw <4 x i64> [[TMP11]], [[TMP10]]
1191
+ ; CHECK-NEXT: [[TMP13:%.*]] = shufflevector <4 x i64> [[TMP3]], <4 x i64> [[TMP6]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1192
+ ; CHECK-NEXT: [[TMP14:%.*]] = lshr <8 x i64> [[TMP13]], splat (i64 32)
1193
+ ; CHECK-NEXT: [[TMP15:%.*]] = trunc nuw <8 x i64> [[TMP14]] to <8 x i32>
1194
+ ; CHECK-NEXT: [[TMP16:%.*]] = call <8 x i32> @llvm.smin.v8i32(<8 x i32> [[TMP15]], <8 x i32> splat (i32 1073741823))
1195
+ ; CHECK-NEXT: [[TMP17:%.*]] = shl <8 x i32> [[TMP16]], splat (i32 1)
1196
+ ; CHECK-NEXT: [[TMP18:%.*]] = shufflevector <4 x i64> [[TMP9]], <4 x i64> [[TMP12]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1197
+ ; CHECK-NEXT: [[TMP19:%.*]] = lshr <8 x i64> [[TMP18]], splat (i64 32)
1198
+ ; CHECK-NEXT: [[TMP20:%.*]] = trunc nuw <8 x i64> [[TMP19]] to <8 x i32>
1199
+ ; CHECK-NEXT: [[TMP21:%.*]] = call <8 x i32> @llvm.smin.v8i32(<8 x i32> [[TMP20]], <8 x i32> splat (i32 1073741823))
1200
+ ; CHECK-NEXT: [[TMP22:%.*]] = shl <8 x i32> [[TMP21]], splat (i32 1)
1201
+ ; CHECK-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <8 x i32> [[TMP17]], <8 x i32> [[TMP22]], <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
1202
+ ; CHECK-NEXT: ret <16 x i32> [[INTERLEAVED_VEC]]
1203
+ ;
1204
+ %strided.vec = shufflevector <16 x i32 > %wide.vec , <16 x i32 > poison, <4 x i32 > <i32 0 , i32 4 , i32 8 , i32 12 >
1205
+ %strided.vec113 = shufflevector <16 x i32 > %wide.vec , <16 x i32 > poison, <4 x i32 > <i32 1 , i32 5 , i32 9 , i32 13 >
1206
+ %strided.vec114 = shufflevector <16 x i32 > %wide.vec , <16 x i32 > poison, <4 x i32 > <i32 2 , i32 6 , i32 10 , i32 14 >
1207
+ %strided.vec115 = shufflevector <16 x i32 > %wide.vec , <16 x i32 > poison, <4 x i32 > <i32 3 , i32 7 , i32 11 , i32 15 >
1208
+ %10 = sext <4 x i32 > %strided.vec to <4 x i64 >
1209
+ %strided.vec117 = shufflevector <16 x i32 > %wide.vec116 , <16 x i32 > poison, <4 x i32 > <i32 0 , i32 4 , i32 8 , i32 12 >
1210
+ %strided.vec118 = shufflevector <16 x i32 > %wide.vec116 , <16 x i32 > poison, <4 x i32 > <i32 1 , i32 5 , i32 9 , i32 13 >
1211
+ %strided.vec119 = shufflevector <16 x i32 > %wide.vec116 , <16 x i32 > poison, <4 x i32 > <i32 2 , i32 6 , i32 10 , i32 14 >
1212
+ %strided.vec120 = shufflevector <16 x i32 > %wide.vec116 , <16 x i32 > poison, <4 x i32 > <i32 3 , i32 7 , i32 11 , i32 15 >
1213
+ %11 = sext <4 x i32 > %strided.vec117 to <4 x i64 >
1214
+ %12 = mul nsw <4 x i64 > %11 , %10
1215
+ %13 = lshr <4 x i64 > %12 , splat (i64 32 )
1216
+ %14 = trunc nuw <4 x i64 > %13 to <4 x i32 >
1217
+ %15 = call <4 x i32 > @llvm.smin.v4i32 (<4 x i32 > %14 , <4 x i32 > splat (i32 1073741823 ))
1218
+ %16 = shl <4 x i32 > %15 , splat (i32 1 )
1219
+ %17 = sext <4 x i32 > %strided.vec113 to <4 x i64 >
1220
+ %18 = sext <4 x i32 > %strided.vec118 to <4 x i64 >
1221
+ %19 = mul nsw <4 x i64 > %18 , %17
1222
+ %20 = lshr <4 x i64 > %19 , splat (i64 32 )
1223
+ %21 = trunc nuw <4 x i64 > %20 to <4 x i32 >
1224
+ %22 = call <4 x i32 > @llvm.smin.v4i32 (<4 x i32 > %21 , <4 x i32 > splat (i32 1073741823 ))
1225
+ %23 = shl <4 x i32 > %22 , splat (i32 1 )
1226
+ %24 = sext <4 x i32 > %strided.vec114 to <4 x i64 >
1227
+ %25 = sext <4 x i32 > %strided.vec119 to <4 x i64 >
1228
+ %26 = mul nsw <4 x i64 > %25 , %24
1229
+ %27 = lshr <4 x i64 > %26 , splat (i64 32 )
1230
+ %28 = trunc nuw <4 x i64 > %27 to <4 x i32 >
1231
+ %29 = call <4 x i32 > @llvm.smin.v4i32 (<4 x i32 > %28 , <4 x i32 > splat (i32 1073741823 ))
1232
+ %30 = shl <4 x i32 > %29 , splat (i32 1 )
1233
+ %31 = sext <4 x i32 > %strided.vec115 to <4 x i64 >
1234
+ %32 = sext <4 x i32 > %strided.vec120 to <4 x i64 >
1235
+ %33 = mul nsw <4 x i64 > %32 , %31
1236
+ %34 = lshr <4 x i64 > %33 , splat (i64 32 )
1237
+ %35 = trunc nuw <4 x i64 > %34 to <4 x i32 >
1238
+ %36 = call <4 x i32 > @llvm.smin.v4i32 (<4 x i32 > %35 , <4 x i32 > splat (i32 1073741823 ))
1239
+ %37 = shl <4 x i32 > %36 , splat (i32 1 )
1240
+ %38 = shufflevector <4 x i32 > %16 , <4 x i32 > %23 , <8 x i32 > <i32 0 , i32 1 , i32 2 , i32 3 , i32 4 , i32 5 , i32 6 , i32 7 >
1241
+ %39 = shufflevector <4 x i32 > %30 , <4 x i32 > %37 , <8 x i32 > <i32 0 , i32 1 , i32 2 , i32 3 , i32 4 , i32 5 , i32 6 , i32 7 >
1242
+ %interleaved.vec = shufflevector <8 x i32 > %38 , <8 x i32 > %39 , <16 x i32 > <i32 0 , i32 4 , i32 8 , i32 12 , i32 1 , i32 5 , i32 9 , i32 13 , i32 2 , i32 6 , i32 10 , i32 14 , i32 3 , i32 7 , i32 11 , i32 15 >
1243
+ ret <16 x i32 > %interleaved.vec
1244
+ }
1245
+
1246
+ define <32 x half > @cast_types (<32 x i16 > %wide.vec ) {
1247
+ ; CHECK-LABEL: @cast_types(
1248
+ ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <32 x i16> [[WIDE_VEC:%.*]], <32 x i16> poison, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 16, i32 20, i32 24, i32 28, i32 1, i32 5, i32 9, i32 13, i32 17, i32 21, i32 25, i32 29>
1249
+ ; CHECK-NEXT: [[TMP5:%.*]] = sitofp <16 x i16> [[TMP1]] to <16 x half>
1250
+ ; CHECK-NEXT: [[TMP6:%.*]] = fmul fast <16 x half> [[TMP5]], splat (half 0xH0200)
1251
+ ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <32 x i16> [[WIDE_VEC]], <32 x i16> poison, <16 x i32> <i32 2, i32 6, i32 10, i32 14, i32 18, i32 22, i32 26, i32 30, i32 3, i32 7, i32 11, i32 15, i32 19, i32 23, i32 27, i32 31>
1252
+ ; CHECK-NEXT: [[TMP7:%.*]] = sitofp <16 x i16> [[TMP4]] to <16 x half>
1253
+ ; CHECK-NEXT: [[TMP8:%.*]] = fmul fast <16 x half> [[TMP7]], splat (half 0xH0200)
1254
+ ; CHECK-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <16 x half> [[TMP6]], <16 x half> [[TMP8]], <32 x i32> <i32 0, i32 8, i32 16, i32 24, i32 1, i32 9, i32 17, i32 25, i32 2, i32 10, i32 18, i32 26, i32 3, i32 11, i32 19, i32 27, i32 4, i32 12, i32 20, i32 28, i32 5, i32 13, i32 21, i32 29, i32 6, i32 14, i32 22, i32 30, i32 7, i32 15, i32 23, i32 31>
1255
+ ; CHECK-NEXT: ret <32 x half> [[INTERLEAVED_VEC]]
1256
+ ;
1257
+ %strided.vec = shufflevector <32 x i16 > %wide.vec , <32 x i16 > poison, <8 x i32 > <i32 0 , i32 4 , i32 8 , i32 12 , i32 16 , i32 20 , i32 24 , i32 28 >
1258
+ %strided.vec49 = shufflevector <32 x i16 > %wide.vec , <32 x i16 > poison, <8 x i32 > <i32 1 , i32 5 , i32 9 , i32 13 , i32 17 , i32 21 , i32 25 , i32 29 >
1259
+ %strided.vec50 = shufflevector <32 x i16 > %wide.vec , <32 x i16 > poison, <8 x i32 > <i32 2 , i32 6 , i32 10 , i32 14 , i32 18 , i32 22 , i32 26 , i32 30 >
1260
+ %strided.vec51 = shufflevector <32 x i16 > %wide.vec , <32 x i16 > poison, <8 x i32 > <i32 3 , i32 7 , i32 11 , i32 15 , i32 19 , i32 23 , i32 27 , i32 31 >
1261
+ %5 = sitofp <8 x i16 > %strided.vec to <8 x half >
1262
+ %6 = fmul fast <8 x half > %5 , splat (half 0xH0200)
1263
+ %7 = sitofp <8 x i16 > %strided.vec49 to <8 x half >
1264
+ %8 = fmul fast <8 x half > %7 , splat (half 0xH0200)
1265
+ %9 = sitofp <8 x i16 > %strided.vec50 to <8 x half >
1266
+ %10 = fmul fast <8 x half > %9 , splat (half 0xH0200)
1267
+ %11 = sitofp <8 x i16 > %strided.vec51 to <8 x half >
1268
+ %12 = fmul fast <8 x half > %11 , splat (half 0xH0200)
1269
+ %13 = shufflevector <8 x half > %6 , <8 x half > %8 , <16 x i32 > <i32 0 , i32 1 , i32 2 , i32 3 , i32 4 , i32 5 , i32 6 , i32 7 , i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 >
1270
+ %14 = shufflevector <8 x half > %10 , <8 x half > %12 , <16 x i32 > <i32 0 , i32 1 , i32 2 , i32 3 , i32 4 , i32 5 , i32 6 , i32 7 , i32 8 , i32 9 , i32 10 , i32 11 , i32 12 , i32 13 , i32 14 , i32 15 >
1271
+ %interleaved.vec = shufflevector <16 x half > %13 , <16 x half > %14 , <32 x i32 > <i32 0 , i32 8 , i32 16 , i32 24 , i32 1 , i32 9 , i32 17 , i32 25 , i32 2 , i32 10 , i32 18 , i32 26 , i32 3 , i32 11 , i32 19 , i32 27 , i32 4 , i32 12 , i32 20 , i32 28 , i32 5 , i32 13 , i32 21 , i32 29 , i32 6 , i32 14 , i32 22 , i32 30 , i32 7 , i32 15 , i32 23 , i32 31 >
1272
+ ret <32 x half > %interleaved.vec
1273
+ }
1274
+
1111
1275
declare <4 x i64 > @llvm.fshl.v4i64 (<4 x i64 >, <4 x i64 >, <4 x i64 >)
1112
1276
declare void @use (<4 x i8 >)
0 commit comments