@@ -259,35 +259,34 @@ def TileLoadOp : ArmSME_Op<"tile_load"> {
259
259
let summary = "Tile load operation";
260
260
let description = [{
261
261
Loads a 2D SME "virtual tile" from memory defined by a base and indices,
262
- with the shape defined by the 2D scalable vector type of the result tile. A
263
- tile slice layout attribute specifies whether the slices of the tile being
264
- loaded are horizontal or vertical. The slice of memory must be contiguous.
265
- The memref must be either rank 1 or rank 2 with dynamic dimensions, since
266
- the operation is scalable, and the element type must be a scalar that
267
- matches the element type of the result.
268
-
269
- The default tile slice layout when lowering from higher-level dialects is
270
- horizontal.
271
-
272
- Example 1: Load an 8-bit element ZA tile with horizontal layout from memory (ZA0.B).
262
+ with the shape defined by the 2D scalable vector type of the result tile.
263
+ An optional tile slice layout attribute specifies whether the slices of the
264
+ tile being loaded are horizontal (default) or vertical. The slice of memory
265
+ must be contiguous. The memref must be either rank 1 or rank 2 with
266
+ dynamic dimensions, since the operation is scalable, and the element type
267
+ must be a scalar that matches the element type of the result.
268
+
269
+ Example 1: Load an 8-bit element ZA tile with horizontal layout (default) from memory (ZA0.B).
273
270
```mlir
274
- %tile = arm_sme.tile_load <hor>, %base[%c0, %c0] : memref<?x?xi8>, vector<[16]x[16]xi8>
271
+ %tile = arm_sme.tile_load %base[%c0, %c0] : memref<?x?xi8>, vector<[16]x[16]xi8>
275
272
```
276
273
277
274
Example 2: Load a FP 32-bit element ZA tile with vertical layout from memory.
278
275
```mlir
279
- %tile = arm_sme.tile_load <ver>, %base[%c0, %c0] : memref<?x?xf32>, vector<[4]x[4]xf32>
276
+ %tile = arm_sme.tile_load %base[%c0, %c0], <ver> : memref<?x?xf32>, vector<[4]x[4]xf32>
280
277
```
281
278
282
- Example 3: Load a 128-bit element ZA tile with horizontal layout from memory.
279
+ Example 3: Load a 128-bit element ZA tile with horizontal layout (default) from memory.
283
280
```mlir
284
- %tile = arm_sme.tile_load <hor>, %base[%c0, %c0] : memref<?x?xi128>, vector<[1]x[1]xi128>
281
+ %tile = arm_sme.tile_load %base[%c0, %c0], <hor> : memref<?x?xi128>, vector<[1]x[1]xi128>
285
282
```
286
283
}];
287
284
let arguments = (ins
288
- ArmSME_TileSliceLayoutAttr:$layout,
289
- Arg<AnyMemRef, "the reference to load from", [MemRead]>:$base,
290
- Variadic<Index>:$indices);
285
+ Arg<AnyMemRef, "the reference to load from", [MemRead]>:$base,
286
+ Variadic<Index>:$indices,
287
+ DefaultValuedAttr<ArmSME_TileSliceLayoutAttr,
288
+ "::mlir::arm_sme::TileSliceLayout::Horizontal">:$layout
289
+ );
291
290
let results = (outs SMETile:$result);
292
291
293
292
let extraClassDeclaration = [{
@@ -300,43 +299,42 @@ def TileLoadOp : ArmSME_Op<"tile_load"> {
300
299
}];
301
300
302
301
let assemblyFormat =
303
- "$layout `,` $ base `[` $indices `]` attr-dict "
304
- "`:` type($base) `,` type($result)";
302
+ "$ base `[` $indices `]` (`,` $layout^)? attr-dict "
303
+ "`:` type($base) `,` type($result)";
305
304
}
306
305
307
306
def TileStoreOp : ArmSME_Op<"tile_store"> {
308
307
let summary = "Tile store operation";
309
308
let description = [{
310
309
Stores a 2D SME "virtual tile" to memory defined by a base and indices,
311
310
with the shape defined by the 2D scalable vector type of the tile being
312
- stored. A tile slice layout attribute specifies whether the slices of the
313
- tile being stored are horizontal or vertical. The slice of memory must be
314
- contiguous. The memref must be either rank 1 or rank 2 with dynamic
315
- dimensions, since the operation is scalable, and the element type must be a
316
- scalar that matches the element type of the result.
317
-
318
- The default tile slice layout when lowering from higher-level dialects is
319
- horizontal.
311
+ stored. An optional tile slice layout attribute specifies whether the
312
+ slices of the tile being stored are horizontal (default) or vertical. The
313
+ slice of memory must be contiguous. The memref must be either rank 1 or
314
+ rank 2 with dynamic dimensions, since the operation is scalable, and the
315
+ element type must be a scalar that matches the element type of the result.
320
316
321
- Example 1: Store an 8-bit element ZA tile with horizontal layout to memory (ZA0.B).
317
+ Example 1: Store an 8-bit element ZA tile with horizontal (default) layout to memory (ZA0.B).
322
318
```mlir
323
- arm_sme.tile_store %tile, <hor>, %base[%c0, %c0] : vector<[16]x[16]xi8>, memref<?x?xi8>
319
+ arm_sme.tile_store %tile, %base[%c0, %c0] : vector<[16]x[16]xi8>, memref<?x?xi8>
324
320
```
325
321
326
322
Example 2: Store a FP 32-bit element ZA tile with vertical layout to memory.
327
323
```mlir
328
- arm_sme.tile_store %tile, <ver>, %base[%c0, %c0] : vector<[4]x[4]xf32>, memref<?x?xf32>
324
+ arm_sme.tile_store %tile, %base[%c0, %c0], <ver> : vector<[4]x[4]xf32>, memref<?x?xf32>
329
325
```
330
326
331
- Example 3: Store a 128-bit element ZA tile with horizontal layout to memory.
327
+ Example 3: Store a 128-bit element ZA tile with horizontal (default) layout to memory.
332
328
```mlir
333
- arm_sme.tile_store %tile, <hor>, %base[%c0, %c0] : vector<[1]x[1]xi128>, memref<?x?xi128>
329
+ arm_sme.tile_store %tile, %base[%c0, %c0], <hor> : vector<[1]x[1]xi128>, memref<?x?xi128>
334
330
```
335
331
}];
336
332
let arguments = (ins SMETile:$valueToStore,
337
- ArmSME_TileSliceLayoutAttr:$layout,
338
- Arg<AnyMemRef, "the reference to store to", [MemWrite]>:$base,
339
- Variadic<Index>:$indices);
333
+ Arg<AnyMemRef, "the reference to store to", [MemWrite]>:$base,
334
+ Variadic<Index>:$indices,
335
+ DefaultValuedAttr<ArmSME_TileSliceLayoutAttr,
336
+ "::mlir::arm_sme::TileSliceLayout::Horizontal">:$layout
337
+ );
340
338
let extraClassDeclaration = [{
341
339
MemRefType getMemRefType() {
342
340
return ::llvm::cast<MemRefType>(getBase().getType());
@@ -347,7 +345,7 @@ def TileStoreOp : ArmSME_Op<"tile_store"> {
347
345
}];
348
346
349
347
let assemblyFormat =
350
- "$valueToStore `,` $layout `,` $ base `[` $indices `]` attr-dict "
348
+ "$valueToStore `,` $base `[` $indices `]` (`,` $layout^)? attr-dict "
351
349
"`:` type($base) `,` type($valueToStore)";
352
350
}
353
351
@@ -359,23 +357,23 @@ def LoadTileSliceOp : ArmSME_Op<"load_tile_slice", [
359
357
Loads a 1D tile slice from memory into a 2D SME "virtual tile". The tile
360
358
slice is defined by the dimension of the 2D scalable vector type pointed by
361
359
the index. A tile slice index describes where in the input tile the tile
362
- slice is loaded to. A tile slice layout attribute specifies whether the
363
- tile slice being loaded at the given index is horizontal or vertical. The
364
- updated tile is returned as the result.
360
+ slice is loaded to. An optional tile slice layout attribute specifies
361
+ whether the tile slice being loaded at the given index is horizontal
362
+ (default) or vertical. The updated tile is returned as the result.
365
363
366
364
The slice of memory read is defined by a base and indices and must be
367
365
contiguous. The memref must be either rank 1 or rank 2, have dynamic
368
366
dimensions since the operation is scalable, and the element type must be a
369
367
scalar that matches the element type of the result.
370
368
371
- Example 1: Load a vector<[16]xi8> tile slice from memory into tile horizontally at given index.
369
+ Example 1: Load a vector<[16]xi8> tile slice from memory into tile horizontally (default) at given index.
372
370
```mlir
373
- %tile_update = arm_sme.load_tile_slice <hor>, %base[%c0], %tile, %tile_slice_index : memref<?x?xi8>, vector<[16]x[16]xi8>
371
+ %tile_update = arm_sme.load_tile_slice %base[%c0], %tile, %tile_slice_index : memref<?x?xi8>, vector<[16]x[16]xi8>
374
372
```
375
373
376
374
Example 2: Load a vector<[4]xf32> tile slice from memory into tile vertically at given index.
377
375
```mlir
378
- %tile_update = arm_sme.load_tile_slice <ver>, %base[%c0], %tile, %tile_slice_index : memref<?x?xf32>, vector<[4]x[4]xf32>
376
+ %tile_update = arm_sme.load_tile_slice %base[%c0], %tile, %tile_slice_index, <ver> : memref<?x?xf32>, vector<[4]x[4]xf32>
379
377
```
380
378
381
379
Example 3: Load a vector<[1]xi128> tile slice from memory into tile vertically at given index.
@@ -384,9 +382,11 @@ def LoadTileSliceOp : ArmSME_Op<"load_tile_slice", [
384
382
```
385
383
}];
386
384
let arguments = (ins
387
- ArmSME_TileSliceLayoutAttr:$layout,
388
- Arg<AnyMemRef, "the reference to load from">:$base,
389
- SMETile:$tile, Variadic<Index>:$indices, Index:$tile_slice_index);
385
+ Arg<AnyMemRef, "the reference to load from">:$base,
386
+ SMETile:$tile, Variadic<Index>:$indices, Index:$tile_slice_index,
387
+ DefaultValuedAttr<ArmSME_TileSliceLayoutAttr,
388
+ "::mlir::arm_sme::TileSliceLayout::Horizontal">:$layout
389
+ );
390
390
let results = (outs SMETile:$result);
391
391
392
392
let extraClassDeclaration = [{
@@ -399,7 +399,7 @@ def LoadTileSliceOp : ArmSME_Op<"load_tile_slice", [
399
399
}];
400
400
401
401
let assemblyFormat = [{
402
- $layout `,` $ base `[` $indices `]` `,` $tile `,` $tile_slice_index
402
+ $base `[` $indices `]` `,` $tile `,` $tile_slice_index (`,` $layout^)?
403
403
attr-dict `:` type($base) `,` type($result)
404
404
}];
405
405
}
@@ -410,33 +410,36 @@ def StoreTileSliceOp : ArmSME_Op<"store_tile_slice"> {
410
410
Stores a 1D tile slice from a 2D SME "virtual tile" into memory. The tile
411
411
slice is defined by the dimension of the 2D scalable vector type pointed by
412
412
the index. A tile slice index describes where in the input tile the tile
413
- slice is stored from. A tile slice layout attribute specifies whether the
414
- tile slice being stored from the given index is horizontal or vertical.
413
+ slice is stored from. An optional tile slice layout attribute specifies
414
+ whether the tile slice being stored from the given index is horizontal
415
+ (default) or vertical.
415
416
416
417
The slice of memory written is defined by a base and indices and must be
417
418
contiguous. The memref must be either rank 1 or rank 2, have dynamic
418
419
dimensions since the operation is scalable, and the element type must be a
419
420
scalar that matches the element type of the input tile.
420
421
421
- Example 1: Store vector<[16]xi8> horizontal tile slice from tile at given index to memory.
422
+ Example 1: Store vector<[16]xi8> horizontal (default) tile slice from tile at given index to memory.
422
423
```mlir
423
- arm_sme.store_tile_slice %tile, %tile_slice_index, <hor>, %base[%c0] : vector<[16]x[16]xi8>, memref<?x?xi8>
424
+ arm_sme.store_tile_slice %tile, %tile_slice_index, %base[%c0] : vector<[16]x[16]xi8>, memref<?x?xi8>
424
425
```
425
426
426
427
Example 2: Store vector<[4]xf32> vertical tile slice from tile at given index to memory.
427
428
```mlir
428
- arm_sme.store_tile_slice %tile, %tile_slice_index, <ver>, %base[%c0] : vector<[4]x[4]xf32>, memref<?x?xf32>
429
+ arm_sme.store_tile_slice %tile, %tile_slice_index, %base[%c0], <ver> : vector<[4]x[4]xf32>, memref<?x?xf32>
429
430
```
430
431
431
432
Example 3: Store a vector<[1]xi128> vertical tile slice from tile at given index to memory.
432
433
```mlir
433
- arm_sme.store_tile_slice %tile, %tile_slice_index, <ver>, %base[%c0] : vector<[1]x[1]xi128>, memref<?x?xi128>
434
+ arm_sme.store_tile_slice %tile, %tile_slice_index, %base[%c0], <ver> : vector<[1]x[1]xi128>, memref<?x?xi128>
434
435
```
435
436
}];
436
437
let arguments = (ins SMETile:$tile, Index:$tile_slice_index,
437
- ArmSME_TileSliceLayoutAttr:$layout,
438
- Arg<AnyMemRef, "the reference to store to", [MemWrite]>:$base,
439
- Variadic<Index>:$indices);
438
+ Arg<AnyMemRef, "the reference to store to", [MemWrite]>:$base,
439
+ Variadic<Index>:$indices,
440
+ DefaultValuedAttr<ArmSME_TileSliceLayoutAttr,
441
+ "::mlir::arm_sme::TileSliceLayout::Horizontal">:$layout
442
+ );
440
443
let extraClassDeclaration = [{
441
444
MemRefType getMemRefType() {
442
445
return ::llvm::cast<MemRefType>(getBase().getType());
@@ -447,7 +450,7 @@ def StoreTileSliceOp : ArmSME_Op<"store_tile_slice"> {
447
450
}];
448
451
449
452
let assemblyFormat = [{
450
- $tile `,` $tile_slice_index `,` $layout `,` $ base `[` $indices `]`
453
+ $tile `,` $tile_slice_index `,` $base `[` $indices `]` (`,` $layout^)?
451
454
attr-dict `:` type($base) `,` type($tile)
452
455
}];
453
456
}
0 commit comments