Skip to content

Commit ecbad79

Browse files
committed
renaming tests
1 parent 2e1e0f1 commit ecbad79

File tree

1 file changed

+107
-105
lines changed

1 file changed

+107
-105
lines changed

mlir/test/Dialect/Vector/vector-rewrite-narrow-types.mlir

Lines changed: 107 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -193,36 +193,8 @@ func.func @f3ext(%a: vector<5xi8>) -> vector<8xi17> {
193193
return %1 : vector<8xi17>
194194
}
195195

196-
// CHECK-LABEL: func.func @aligned_extsi(
197-
func.func @aligned_extsi(%a: vector<8xi4>) -> vector<8xi32> {
198-
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi32> {
199-
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
200-
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
201-
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
202-
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<4xi8>
203-
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
204-
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
205-
// CHECK: %[[I32:.*]] = arith.extsi %[[INTERLEAVE]] : vector<8xi8> to vector<8xi32>
206-
%0 = arith.extsi %a : vector<8xi4> to vector<8xi32>
207-
return %0 : vector<8xi32>
208-
}
209-
210-
// CHECK-LABEL: func.func @aligned_extsi_2d(
211-
func.func @aligned_extsi_2d(%a: vector<8x32xi4>) -> vector<8x32xi32> {
212-
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xi32> {
213-
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<8x16xi8>
214-
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8x32xi4> to vector<8x16xi8>
215-
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
216-
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<8x16xi8>
217-
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
218-
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<8x16xi8>
219-
// CHECK: %[[I32:.*]] = arith.extsi %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xi32>
220-
%0 = arith.extsi %a : vector<8x32xi4> to vector<8x32xi32>
221-
return %0 : vector<8x32xi32>
222-
}
223-
224-
// CHECK-LABEL: func.func @aligned_extsi_base_case(
225-
func.func @aligned_extsi_base_case(%a: vector<8xi4>) -> vector<8xi8> {
196+
// CHECK-LABEL: func.func @aligned_extsi_i4_to_i8(
197+
func.func @aligned_extsi_i4_to_i8(%a: vector<8xi4>) -> vector<8xi8> {
226198
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi8> {
227199
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
228200
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
@@ -234,88 +206,61 @@ func.func @aligned_extsi_base_case(%a: vector<8xi4>) -> vector<8xi8> {
234206
return %0 : vector<8xi8>
235207
}
236208

237-
// CHECK-LABEL: func.func @aligned_sitofp(
238-
func.func @aligned_sitofp(%a: vector<8xi4>) -> vector<8xf32> {
239-
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xf32> {
209+
// CHECK-LABEL: func.func @aligned_extsi_i4_to_i32(
210+
func.func @aligned_extsi_i4_to_i32(%a: vector<8xi4>) -> vector<8xi32> {
211+
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi32> {
240212
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
241213
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
242214
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
243215
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<4xi8>
244216
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
245217
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
246-
// CHECK: %[[F32:.*]] = arith.sitofp %[[INTERLEAVE]] : vector<8xi8> to vector<8xf32>
247-
%0 = arith.sitofp %a : vector<8xi4> to vector<8xf32>
248-
return %0 : vector<8xf32>
218+
// CHECK: %[[I32:.*]] = arith.extsi %[[INTERLEAVE]] : vector<8xi8> to vector<8xi32>
219+
%0 = arith.extsi %a : vector<8xi4> to vector<8xi32>
220+
return %0 : vector<8xi32>
249221
}
250222

251-
// CHECK-LABEL: func.func @aligned_sitofp_2d(
252-
func.func @aligned_sitofp_2d(%a: vector<8x32xi4>) -> vector<8x32xf32> {
253-
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xf32> {
223+
// CHECK-LABEL: func.func @aligned_extsi_2d(
224+
func.func @aligned_extsi_2d(%a: vector<8x32xi4>) -> vector<8x32xi32> {
225+
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xi32> {
254226
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<8x16xi8>
255227
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8x32xi4> to vector<8x16xi8>
256228
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
257229
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<8x16xi8>
258230
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
259231
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<8x16xi8>
260-
// CHECK: %[[F32:.*]] = arith.sitofp %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xf32>
261-
%0 = arith.sitofp %a : vector<8x32xi4> to vector<8x32xf32>
262-
return %0 : vector<8x32xf32>
263-
}
264-
265-
// CHECK-LABEL: func.func @aligned_uitofp(
266-
func.func @aligned_uitofp(%a: vector<8xi4>) -> vector<8xf32> {
267-
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xf32> {
268-
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
269-
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
270-
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
271-
// CHECK: %[[LOW:.*]] = arith.andi %[[BITCAST]], %[[LOWBITS_MASK]] : vector<4xi8>
272-
// CHECK: %[[HIGH:.*]] = arith.shrui %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
273-
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
274-
// CHECK: %[[F32:.*]] = arith.uitofp %[[INTERLEAVE]] : vector<8xi8> to vector<8xf32>
275-
%0 = arith.uitofp %a : vector<8xi4> to vector<8xf32>
276-
return %0 : vector<8xf32>
232+
// CHECK: %[[I32:.*]] = arith.extsi %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xi32>
233+
%0 = arith.extsi %a : vector<8x32xi4> to vector<8x32xi32>
234+
return %0 : vector<8x32xi32>
277235
}
278236

279-
// CHECK-LABEL: func.func @aligned_uitofp_2d(
280-
func.func @aligned_uitofp_2d(%a: vector<8x32xi4>) -> vector<8x32xf32> {
281-
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xf32> {
282-
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<8x16xi8>
283-
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<8x16xi8>
284-
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8x32xi4> to vector<8x16xi8>
285-
// CHECK: %[[LOW:.*]] = arith.andi %[[BITCAST]], %[[LOWBITS_MASK]] : vector<8x16xi8>
286-
// CHECK: %[[HIGH:.*]] = arith.shrui %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
287-
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<8x16xi8>
288-
// CHECK: %[[F32:.*]] = arith.uitofp %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xf32>
289-
%0 = arith.uitofp %a : vector<8x32xi4> to vector<8x32xf32>
290-
return %0 : vector<8x32xf32>
291-
}
292237

293-
// CHECK-LABEL: func.func @aligned_trunci(
294-
func.func @aligned_trunci(%a: vector<8xi32>) -> vector<8xi4> {
295-
// CHECK-SAME: %[[IN:.*]]: vector<8xi32>) -> vector<8xi4> {
238+
// CHECK-LABEL: func.func @aligned_trunci_i8_to_i4(
239+
func.func @aligned_trunci_i8_to_i4(%a: vector<8xi8>) -> vector<8xi4> {
240+
// CHECK-SAME: %[[IN:.*]]: vector<8xi8>) -> vector<8xi4> {
296241
// CHECK-DAG: %[[LOW_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
297242
// CHECK-DAG: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
298-
// CHECK: %[[I8:.*]] = arith.trunci %[[IN]] : vector<8xi32> to vector<8xi8>
299-
// CHECK: %[[LOW:.*]], %[[HIGH:.*]] = vector.deinterleave %[[I8]] : vector<8xi8> -> vector<4xi8>
243+
// CHECK: %[[LOW:.*]], %[[HIGH:.*]] = vector.deinterleave %[[IN]] : vector<8xi8> -> vector<4xi8>
300244
// CHECK: %[[ZEROED_LOW:.*]] = arith.andi %[[LOW]], %[[LOW_MASK]] : vector<4xi8>
301245
// CHECK: %[[SHL_HIGH:.*]] = arith.shli %[[HIGH]], %[[I4_BITS]] : vector<4xi8>
302246
// CHECK: %[[MERGED:.*]] = arith.ori %[[ZEROED_LOW]], %[[SHL_HIGH]] : vector<4xi8>
303247
// CHECK: %[[I4:.*]] = vector.bitcast %[[MERGED]] : vector<4xi8> to vector<8xi4>
304-
%0 = arith.trunci %a : vector<8xi32> to vector<8xi4>
248+
%0 = arith.trunci %a : vector<8xi8> to vector<8xi4>
305249
return %0 : vector<8xi4>
306250
}
307251

308-
// CHECK-LABEL: func.func @aligned_trunci_base_case(
309-
func.func @aligned_trunci_base_case(%a: vector<8xi8>) -> vector<8xi4> {
310-
// CHECK-SAME: %[[IN:.*]]: vector<8xi8>) -> vector<8xi4> {
252+
// CHECK-LABEL: func.func @aligned_trunci_i32_to_i4(
253+
func.func @aligned_trunci_i32_to_i4(%a: vector<8xi32>) -> vector<8xi4> {
254+
// CHECK-SAME: %[[IN:.*]]: vector<8xi32>) -> vector<8xi4> {
311255
// CHECK-DAG: %[[LOW_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
312256
// CHECK-DAG: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
313-
// CHECK: %[[LOW:.*]], %[[HIGH:.*]] = vector.deinterleave %[[IN]] : vector<8xi8> -> vector<4xi8>
257+
// CHECK: %[[I8:.*]] = arith.trunci %[[IN]] : vector<8xi32> to vector<8xi8>
258+
// CHECK: %[[LOW:.*]], %[[HIGH:.*]] = vector.deinterleave %[[I8]] : vector<8xi8> -> vector<4xi8>
314259
// CHECK: %[[ZEROED_LOW:.*]] = arith.andi %[[LOW]], %[[LOW_MASK]] : vector<4xi8>
315260
// CHECK: %[[SHL_HIGH:.*]] = arith.shli %[[HIGH]], %[[I4_BITS]] : vector<4xi8>
316261
// CHECK: %[[MERGED:.*]] = arith.ori %[[ZEROED_LOW]], %[[SHL_HIGH]] : vector<4xi8>
317262
// CHECK: %[[I4:.*]] = vector.bitcast %[[MERGED]] : vector<4xi8> to vector<8xi4>
318-
%0 = arith.trunci %a : vector<8xi8> to vector<8xi4>
263+
%0 = arith.trunci %a : vector<8xi32> to vector<8xi4>
319264
return %0 : vector<8xi4>
320265
}
321266

@@ -347,28 +292,21 @@ func.func @aligned_trunci_nd(%a: vector<3x8x32xi32>) -> vector<3x8x32xi4> {
347292
return %0 : vector<3x8x32xi4>
348293
}
349294

350-
// CHECK-LABEL: func.func @i4_transpose(
351-
func.func @i4_transpose(%a: vector<8x16xi4>) -> vector<16x8xi4> {
352-
// CHECK-SAME: %[[IN:.*]]: vector<8x16xi4>) -> vector<16x8xi4> {
353-
// CHECK: %[[EXT:.*]] = vector.interleave
354-
// CHECK: %[[TRANS:.*]] = vector.transpose %[[EXT]], [1, 0] : vector<8x16xi8> to vector<16x8xi8>
355-
// CHECK: vector.deinterleave %[[TRANS]] : vector<16x8xi8> -> vector<16x4xi8>
356-
%0 = vector.transpose %a, [1, 0] : vector<8x16xi4> to vector<16x8xi4>
357-
return %0 : vector<16x8xi4>
358-
}
359-
360-
// CHECK-LABEL: func.func @i7_transpose(
361-
func.func @i7_transpose(%a: vector<8x16xi7>) -> vector<16x8xi7> {
362-
// CHECK-SAME: %[[IN:.*]]: vector<8x16xi7>) -> vector<16x8xi7> {
363-
// CHECK: %[[EXT:.*]] = arith.extsi %[[IN]] : vector<8x16xi7> to vector<8x16xi8>
364-
// CHECK: %[[TRANS:.*]] = vector.transpose %[[EXT]], [1, 0] : vector<8x16xi8> to vector<16x8xi8>
365-
// CHECK: %[[TRUNC:.*]] = arith.trunci %[[TRANS]] : vector<16x8xi8> to vector<16x8xi7>
366-
%0 = vector.transpose %a, [1, 0] : vector<8x16xi7> to vector<16x8xi7>
367-
return %0 : vector<16x8xi7>
295+
// CHECK-LABEL: func.func @aligned_extui_i4_to_i8(
296+
func.func @aligned_extui_i4_to_i8(%a: vector<8xi4>) -> vector<8xi8> {
297+
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi8> {
298+
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
299+
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
300+
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
301+
// CHECK: %[[LOW:.*]] = arith.andi %[[BITCAST]], %[[LOWBITS_MASK]] : vector<4xi8>
302+
// CHECK: %[[HIGH:.*]] = arith.shrui %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
303+
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
304+
%0 = arith.extui %a : vector<8xi4> to vector<8xi8>
305+
return %0 : vector<8xi8>
368306
}
369307

370-
// CHECK-LABEL: func.func @aligned_extui(
371-
func.func @aligned_extui(%a: vector<8xi4>) -> vector<8xi32> {
308+
// CHECK-LABEL: func.func @aligned_extui_i4_to_i32(
309+
func.func @aligned_extui_i4_to_i32(%a: vector<8xi4>) -> vector<8xi32> {
372310
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi32> {
373311
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
374312
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
@@ -395,19 +333,83 @@ func.func @aligned_extui_2d(%a: vector<8x32xi4>) -> vector<8x32xi32> {
395333
return %0 : vector<8x32xi32>
396334
}
397335

398-
// CHECK-LABEL: func.func @aligned_extui_base_case(
399-
func.func @aligned_extui_base_case(%a: vector<8xi4>) -> vector<8xi8> {
400-
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xi8> {
336+
// CHECK-LABEL: func.func @aligned_sitofp(
337+
func.func @aligned_sitofp(%a: vector<8xi4>) -> vector<8xf32> {
338+
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xf32> {
339+
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
340+
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
341+
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
342+
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<4xi8>
343+
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
344+
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
345+
// CHECK: %[[F32:.*]] = arith.sitofp %[[INTERLEAVE]] : vector<8xi8> to vector<8xf32>
346+
%0 = arith.sitofp %a : vector<8xi4> to vector<8xf32>
347+
return %0 : vector<8xf32>
348+
}
349+
350+
// CHECK-LABEL: func.func @aligned_sitofp_2d(
351+
func.func @aligned_sitofp_2d(%a: vector<8x32xi4>) -> vector<8x32xf32> {
352+
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xf32> {
353+
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<8x16xi8>
354+
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8x32xi4> to vector<8x16xi8>
355+
// CHECK: %[[SHL_LOW:.*]] = arith.shli %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
356+
// CHECK: %[[LOW:.*]] = arith.shrsi %[[SHL_LOW]], %[[I4_BITS]] : vector<8x16xi8>
357+
// CHECK: %[[HIGH:.*]] = arith.shrsi %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
358+
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<8x16xi8>
359+
// CHECK: %[[F32:.*]] = arith.sitofp %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xf32>
360+
%0 = arith.sitofp %a : vector<8x32xi4> to vector<8x32xf32>
361+
return %0 : vector<8x32xf32>
362+
}
363+
364+
// CHECK-LABEL: func.func @aligned_uitofp(
365+
func.func @aligned_uitofp(%a: vector<8xi4>) -> vector<8xf32> {
366+
// CHECK-SAME: %[[IN:.*]]: vector<8xi4>) -> vector<8xf32> {
401367
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<4xi8>
402368
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<4xi8>
403369
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8xi4> to vector<4xi8>
404370
// CHECK: %[[LOW:.*]] = arith.andi %[[BITCAST]], %[[LOWBITS_MASK]] : vector<4xi8>
405371
// CHECK: %[[HIGH:.*]] = arith.shrui %[[BITCAST]], %[[I4_BITS]] : vector<4xi8>
406372
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<4xi8>
407-
%0 = arith.extui %a : vector<8xi4> to vector<8xi8>
408-
return %0 : vector<8xi8>
373+
// CHECK: %[[F32:.*]] = arith.uitofp %[[INTERLEAVE]] : vector<8xi8> to vector<8xf32>
374+
%0 = arith.uitofp %a : vector<8xi4> to vector<8xf32>
375+
return %0 : vector<8xf32>
409376
}
410377

378+
// CHECK-LABEL: func.func @aligned_uitofp_2d(
379+
func.func @aligned_uitofp_2d(%a: vector<8x32xi4>) -> vector<8x32xf32> {
380+
// CHECK-SAME: %[[IN:.*]]: vector<8x32xi4>) -> vector<8x32xf32> {
381+
// CHECK: %[[I4_BITS:.*]] = arith.constant dense<4> : vector<8x16xi8>
382+
// CHECK: %[[LOWBITS_MASK:.*]] = arith.constant dense<15> : vector<8x16xi8>
383+
// CHECK: %[[BITCAST:.*]] = vector.bitcast %[[IN]] : vector<8x32xi4> to vector<8x16xi8>
384+
// CHECK: %[[LOW:.*]] = arith.andi %[[BITCAST]], %[[LOWBITS_MASK]] : vector<8x16xi8>
385+
// CHECK: %[[HIGH:.*]] = arith.shrui %[[BITCAST]], %[[I4_BITS]] : vector<8x16xi8>
386+
// CHECK: %[[INTERLEAVE:.*]] = vector.interleave %[[LOW]], %[[HIGH]] : vector<8x16xi8>
387+
// CHECK: %[[F32:.*]] = arith.uitofp %[[INTERLEAVE]] : vector<8x32xi8> to vector<8x32xf32>
388+
%0 = arith.uitofp %a : vector<8x32xi4> to vector<8x32xf32>
389+
return %0 : vector<8x32xf32>
390+
}
391+
392+
// CHECK-LABEL: func.func @i4_transpose(
393+
func.func @i4_transpose(%a: vector<8x16xi4>) -> vector<16x8xi4> {
394+
// CHECK-SAME: %[[IN:.*]]: vector<8x16xi4>) -> vector<16x8xi4> {
395+
// CHECK: %[[EXT:.*]] = vector.interleave
396+
// CHECK: %[[TRANS:.*]] = vector.transpose %[[EXT]], [1, 0] : vector<8x16xi8> to vector<16x8xi8>
397+
// CHECK: vector.deinterleave %[[TRANS]] : vector<16x8xi8> -> vector<16x4xi8>
398+
%0 = vector.transpose %a, [1, 0] : vector<8x16xi4> to vector<16x8xi4>
399+
return %0 : vector<16x8xi4>
400+
}
401+
402+
// CHECK-LABEL: func.func @i7_transpose(
403+
func.func @i7_transpose(%a: vector<8x16xi7>) -> vector<16x8xi7> {
404+
// CHECK-SAME: %[[IN:.*]]: vector<8x16xi7>) -> vector<16x8xi7> {
405+
// CHECK: %[[EXT:.*]] = arith.extsi %[[IN]] : vector<8x16xi7> to vector<8x16xi8>
406+
// CHECK: %[[TRANS:.*]] = vector.transpose %[[EXT]], [1, 0] : vector<8x16xi8> to vector<16x8xi8>
407+
// CHECK: %[[TRUNC:.*]] = arith.trunci %[[TRANS]] : vector<16x8xi8> to vector<16x8xi7>
408+
%0 = vector.transpose %a, [1, 0] : vector<8x16xi7> to vector<16x8xi7>
409+
return %0 : vector<16x8xi7>
410+
}
411+
412+
411413
module attributes {transform.with_named_sequence} {
412414
transform.named_sequence @__transform_main(%module_op: !transform.any_op {transform.readonly}) {
413415
%f = transform.structured.match ops{["func.func"]} in %module_op

0 commit comments

Comments
 (0)