This repository was archived by the owner on Oct 11, 2025. It is now read-only.
Commit 3e1102c
authored
[MLIR] Add f8E8M0FNU type (#111028)
This PR adds `f8E8M0FNU` type to MLIR.
`f8E8M0FNU` type is proposed in [OpenCompute MX
Specification](https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf).
It defines a 8-bit floating point number with bit layout S0E8M0. Unlike
IEEE-754 types, there are no infinity, denormals, zeros or negative
values.
```c
f8E8M0FNU
- Exponent bias: 127
- Maximum stored exponent value: 254 (binary 1111'1110)
- Maximum unbiased exponent value: 254 - 127 = 127
- Minimum stored exponent value: 0 (binary 0000'0000)
- Minimum unbiased exponent value: 0 − 127 = -127
- Doesn't have zero
- Doesn't have infinity
- NaN is encoded as binary 1111'1111
Additional details:
- Zeros cannot be represented
- Negative values cannot be represented
- Mantissa is always 1
```
Related PRs:
- [PR-107127](llvm/llvm-project#107127)
[APFloat] Add APFloat support for E8M0 type
- [PR-105573](llvm/llvm-project#105573) [MLIR]
Add f6E3M2FN type - was used as a template for this PR
- [PR-107999](llvm/llvm-project#107999) [MLIR]
Add f6E2M3FN type
- [PR-108877](llvm/llvm-project#108877) [MLIR]
Add f4E2M1FN type1 parent 10a18ba commit 3e1102c
1 file changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
334 | 355 | | |
335 | 356 | | |
336 | 357 | | |
| |||
953 | 974 | | |
954 | 975 | | |
955 | 976 | | |
| 977 | + | |
956 | 978 | | |
957 | 979 | | |
958 | 980 | | |
| |||
0 commit comments