[Mlir-commits] [mlir] [mlir][tosa] Update document of `tosa.rescale`(NFC) (PR #112531)

Longsheng Mou llvmlistbot at llvm.org
Wed Oct 16 05:24:35 PDT 2024


https://github.com/CoTinker created https://github.com/llvm/llvm-project/pull/112531

This PR formats the `supported rescalings` using a table. The previous structure was disorganized, as seen in the documentation: https://mlir.llvm.org/docs/Dialects/TOSA/#tosarescale-mlirtosarescaleop.

>From 81857cb2d6c86d32976fa3113b215093b53ad016 Mon Sep 17 00:00:00 2001
From: Longsheng Mou <longshengmou at gmail.com>
Date: Wed, 16 Oct 2024 19:42:38 +0800
Subject: [PATCH] [mlir][tosa] Update document of `tosa.rescale`(NFC)

This PR formats the `supported rescalings` using a table.
The previous structure was disorganized, as seen in the documentation:
https://mlir.llvm.org/docs/Dialects/TOSA/#tosarescale-mlirtosarescaleop.
---
 mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td | 32 +++++++++++---------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
index 07402c8695b382..3bb5ceb0f4695b 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
@@ -1877,21 +1877,23 @@ def Tosa_RescaleOp: Tosa_Op<"rescale", [Pure,
 
   let description = [{
     Rescale quantized values into a new domain. Supported rescalings are:
-    Mode                    Input   Output
-    signed 8 to 8           int8    int8
-    signed 8 to 16          int8    int16
-    signed 8 to 32          int8    int32
-    signed 16 to 8          int16   int8
-    signed 16 to 16         int16   int16
-    signed 16 to 32         int16   int32
-    signed 32 to 8          int32   int8
-    signed 32 to 16         int32   int16
-    signed 32 to 32         int32   int32
-    signed 48 to 8          int48   int8
-    signed 48 to 16         int48   int16
-    signed 48 to 32         int48   int32
-    unsigned 8 to signed 8  uint8   int8
-    signed 8 to unsigned 8  int8    uint8
+
+    | Mode                   | Input | Output |
+    |------------------------|-------|--------|
+    | signed 8 to 8          | int8  | int8   |
+    | signed 8 to 16         | int8  | int16  |
+    | signed 8 to 32         | int8  | int32  |
+    | signed 16 to 8         | int16 | int8   |
+    | signed 16 to 16        | int16 | int16  |
+    | signed 16 to 32        | int16 | int32  |
+    | signed 32 to 8         | int32 | int8   |
+    | signed 32 to 16        | int32 | int16  |
+    | signed 32 to 32        | int32 | int32  |
+    | signed 48 to 8         | int48 | int8   |
+    | signed 48 to 16        | int48 | int16  |
+    | signed 48 to 32        | int48 | int32  |
+    | unsigned 8 to signed 8 | uint8 | int8   |
+    | signed 8 to unsigned 8 | int8  | uint8  |
   }];
 
   let arguments = (ins



More information about the Mlir-commits mailing list