Skip to content

[mlir][tosa] Update the description section for CastOp to align with TOSA v1.0 spec #129958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 49 additions & 19 deletions mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -2234,28 +2234,58 @@ def Tosa_CastOp: Tosa_Op<"cast", [Pure,
let summary = "Cast operation";

let description = [{
Performs a set of permissible cast operations
Casts a tensor from one data type to another.
* This table is showing the supported conversions from the TOSA Specification.
* The MLIR dialect here can be used to represent other conversions.

| Mode | Input | Output |
|--------------------------|---------|---------|
| signed 8 to bool | int8 | Boolean |
| signed 16 to bool | int16 | Boolean |
| signed 32 to bool | int32 | Boolean |
| bool to 8 | Boolean | int8 |
| bool to 16 | Boolean | int16 |
| bool to 32 | Boolean | int32 |
| signed 8 to signed 16 | int8 | int16 |
| signed 8 to signed 32 | int8 | int32 |
| signed 16 to signed 8 | int16 | int8 |
| signed 16 to signed 32 | int16 | int32 |
| signed 32 to signed 8 | int32 | int8 |
| signed 32 to signed 16 | int32 | int16 |
| float to signed 8 | float | int8 |
| float to signed 16 | float | int16 |
| signed 8 to float | int8 | float |
| signed 16 to float | int16 | float |
| float 32 to float 64 | float32 | float64 |
| float 64 to float 32 | float64 | float32 |
| fp16 to fp32 | float16 | float32 |
| fp16 to int 16 | float16 | int16 |
| fp16 to int 32 | float16 | int32 |
| fp16 to int 8 | float16 | int8 |
| fp32 to fp16 | float32 | float16 |
| fp32 to int 16 | float32 | int16 |
| fp32 to int 32 | float32 | int32 |
| fp32 to int 8 | float32 | int8 |
| int 16 to fp16 | int16 | float16 |
| int 16 to fp32 | int16 | float32 |
| int 32 to fp16 | int32 | float16 |
| int 32 to fp32 | int32 | float32 |
| int 8 to fp16 | int8 | float16 |
| int 8 to fp32 | int8 | float32 |
| bool to int 16 | Boolean | int16 |
| bool to int 32 | Boolean | int32 |
| bool to int 8 | Boolean | int8 |
| int 16 to bool | int16 | Boolean |
| int 16 to int 32 | int16 | int32 |
| int 16 to int 8 | int16 | int8 |
| int 32 to bool | int32 | Boolean |
| int 32 to int 16 | int32 | int16 |
| int 32 to int 8 | int32 | int8 |
| int 8 to bool | int8 | Boolean |
| int 8 to int 16 | int8 | int16 |
| int 8 to int 32 | int8 | int32 |
| bf16 to fp32 | bf16 | float32 |
| bf16 to int 16 | bf16 | int16 |
| bf16 to int 32 | bf16 | int32 |
| bf16 to int 8 | bf16 | int8 |
| fp32 to bf16 | float32 | bf16 |
| int 16 to bf16 | int16 | bf16 |
| int 32 to bf16 | int32 | bf16 |
| int 8 to bf16 | int8 | bf16 |
| bf16 to fp8e4m3 | bf16 | fp8e4m3 |
| fp8e4m3 to bf16 | fp8e4m3 | bf16 |
| bf16 to fp8e5m2 | bf16 | fp8e5m2 |
| fp8e5m2 to bf16 | fp8e5m2 | bf16 |
| fp16 to fp8e4m3 | float16 | fp8e4m3 |
| fp32 to fp8e4m3 | float32 | fp8e4m3 |
| fp8e4m3 to fp16 | fp8e4m3 | float16 |
| fp8e4m3 to fp32 | fp8e4m3 | float32 |
| fp16 to fp8e5m2 | float16 | fp8e5m2 |
| fp32 to fp8e5m2 | float32 | fp8e5m2 |
| fp8e5m2 to fp16 | fp8e5m2 | float16 |
| fp8e5m2 to fp32 | fp8e5m2 | float32 |
}];

let arguments = (ins
Expand Down