@@ -545,9 +545,7 @@ def Tosa_SigmoidOp : Tosa_ElementwiseUnaryOp<"sigmoid"> {
545545 For quantized integer data types, the TABLE operator should be used instead.
546546 Each implementation may choose an appropriate TABLE given the scale and zero
547547 point of the input data. Eight or sixteen bit precision tables may be used
548- based on the input tensor to the sigmoid function. The sigmoid table has 513
549- entries each of 16-bit precision and covering the input range -16.0 to +16.0
550- in steps of 1/16.
548+ based on the input tensor to the sigmoid function.
551549 }];
552550
553551 let arguments = (ins
@@ -757,10 +755,10 @@ def Tosa_IntDivOp : Tosa_ElementwiseOp<"int_div", [SameOperandsAndResultElementT
757755 let summary = "Integer divide operator.";
758756
759757 let description = [{
760- Elementwise integer divide of input1 by input2. Axis of size 1 will be
761- broadcast as necessary. Rank of input tensors must match. The result of the
762- divide is truncated towards zero. Expected use is for operations on
763- non-scaled integers. Floating point divide should use RECIPROCAL and MUL.
758+ Elementwise integer divide of input1 by input2. Axis of size 1 will be
759+ broadcast as necessary. Rank of input tensors must match. The result of the
760+ divide is truncated towards zero. Expected use is for operations on
761+ non-scaled integers. Floating point divide should use RECIPROCAL and MUL.
764762 Quantized integer divide should use TABLE (for 1/x) and MUL.
765763 }];
766764
@@ -2328,7 +2326,21 @@ def Tosa_RescaleOp : Tosa_InferShapedTypeOp<"rescale"> {
23282326 let summary = "Tosa rescale operator.";
23292327
23302328 let description = [{
2331- Rescale quantized values into a new domain. Supported rescalings are:
2329+ RESCALE is defined using an integer multiply, add, and shift.
2330+
2331+ Rescale supports two precisions of multiplier: 16-bit and 32-bit. The 32-bit multiplier
2332+ version supports two rounding modes to enable simpler lowering of existing frameworks
2333+ that use two stage rounding. All arithmetic is designed so that it does not overflow a
2334+ 64-bit accumulator and that the result fits in 32 bits. In particular, a 48-bit value
2335+ cannot be scaled with the 32-bit multiplier because the accumulator would need to have
2336+ 80 bits.
2337+
2338+ The shift and value range are limited to allow a variety of implementations. The limit
2339+ of 62 on shift allows the shift to be decomposed as two right shifts of 31.
2340+
2341+ Supported rescalings:
2342+ * This table is showing the supported conversions from the TOSA Specification.
2343+ * The MLIR dialect here can be used to represent other conversions.
23322344
23332345 | Mode | Input | Output | Unsigned input | Unsigned output |
23342346 |------------------------|-------|--------|----------------|-----------------|
0 commit comments