// RUN: mlir-opt -verify-diagnostics %s | mlir-opt | FileCheck %s // CHECK-LABEL: tloadstore // CHECK: %[[x:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}], %{{.*}} : // CHECK-SAME: memref into !x86.amx.tile<16x32xbf16> // CHECK: %[[y:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}], %{{.*}} : // CHECK-SAME: memref into !x86.amx.tile<16x32xbf16> // CHECK: %[[z:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : // CHECK-SAME: memref> into !x86.amx.tile<16x32xbf16> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}], %[[z]], %{{.*}} : // CHECK-SAME: memref, !x86.amx.tile<16x32xbf16> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %[[x]], %{{.*}} : // CHECK-SAME: memref, !x86.amx.tile<16x32xbf16> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %[[y]] : // CHECK-SAME: memref>, !x86.amx.tile<16x32xbf16> func.func @tloadstore(%stride: index, %arg0: memref, %arg1: memref, %arg2: memref>) { %0 = arith.constant 0 : index %c64 = arith.constant 64 : index %1 = x86.amx.tile_load %arg0[%0], %stride : memref into !x86.amx.tile<16x32xbf16> %2 = x86.amx.tile_load %arg1[%0, %0], %stride : memref into !x86.amx.tile<16x32xbf16> %3 = x86.amx.tile_load %arg2[%0, %0] : memref> into !x86.amx.tile<16x32xbf16> x86.amx.tile_store %arg0[%0], %3, %stride : memref, !x86.amx.tile<16x32xbf16> x86.amx.tile_store %arg1[%0, %0], %1, %stride : memref, !x86.amx.tile<16x32xbf16> x86.amx.tile_store %arg2[%0, %0], %2 : memref>, !x86.amx.tile<16x32xbf16> return } // CHECK-LABEL: tzero // CHECK: x86.amx.tile_zero : !x86.amx.tile<16x16xbf16> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %{{.*}} : memref, !x86.amx.tile<16x16xbf16> func.func @tzero(%arg0: memref) { %0 = arith.constant 0 : index %1 = x86.amx.tile_zero : !x86.amx.tile<16x16xbf16> x86.amx.tile_store %arg0[%0, %0], %1 : memref, !x86.amx.tile<16x16xbf16> return } // CHECK-LABEL: tmulf // CHECK: %[[x:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : memref into !x86.amx.tile<16x32xbf16> // CHECK: %[[z:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : memref into !x86.amx.tile<16x16xf32> // CHECK: %[[m:.*]] = x86.amx.tile_mulf %[[x]], %[[x]], %[[z]] : !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x16xf32> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %[[m]] : memref, !x86.amx.tile<16x16xf32> func.func @tmulf(%arg0: memref, %arg1: memref) { %0 = arith.constant 0 : index %1 = x86.amx.tile_load %arg0[%0, %0] : memref into !x86.amx.tile<16x32xbf16> %2 = x86.amx.tile_load %arg1[%0, %0] : memref into !x86.amx.tile<16x16xf32> %3 = x86.amx.tile_mulf %1, %1, %2 : !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x32xbf16>, !x86.amx.tile<16x16xf32> x86.amx.tile_store %arg1[%0, %0], %3 : memref, !x86.amx.tile<16x16xf32> return } // CHECK-LABEL: tmuli // CHECK: %[[x:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : memref into !x86.amx.tile<16x64xi8> // CHECK: %[[y:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : memref into !x86.amx.tile<16x64xi8> // CHECK: %[[z:.*]] = x86.amx.tile_load %{{.*}}[%{{.*}}, %{{.*}}] : memref into !x86.amx.tile<16x16xi32> // CHECK: %[[m:.*]] = x86.amx.tile_muli %[[x]] zext, %[[y]] zext, %[[z]] : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32> // CHECK: x86.amx.tile_store %{{.*}}[%{{.*}}, %{{.*}}], %[[m]] : memref, !x86.amx.tile<16x16xi32> // Verify the parsing/printing of the sign-extension annotation. // CHECK: x86.amx.tile_muli %{{.*}}, %{{.*}} zext, %{{.*}} // CHECK: x86.amx.tile_muli %{{.*}} zext, %{{.*}}, %{{.*}} // CHECK: x86.amx.tile_muli %{{.*}}, %{{.*}}, %{{.*}} func.func @tmuli(%arg0: memref, %arg1: memref, %arg2: memref) { %0 = arith.constant 0 : index %1 = x86.amx.tile_load %arg0[%0, %0] : memref into !x86.amx.tile<16x64xi8> %2 = x86.amx.tile_load %arg1[%0, %0] : memref into !x86.amx.tile<16x64xi8> %3 = x86.amx.tile_load %arg2[%0, %0] : memref into !x86.amx.tile<16x16xi32> %4 = x86.amx.tile_muli %1 zext, %2 zext, %3 : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32> x86.amx.tile_store %arg2[%0, %0], %4 : memref, !x86.amx.tile<16x16xi32> // Verify the various `zext` combinations. %5 = x86.amx.tile_muli %1, %2 zext, %3 : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32> %6 = x86.amx.tile_muli %1 zext, %2, %3 : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32> %7 = x86.amx.tile_muli %1, %2, %3 : !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x64xi8>, !x86.amx.tile<16x16xi32> return }