Add the unsigned complements to the existing FPToSI and SIToFP operations in the
standard dialect, with one-to-one lowerings to the corresponding LLVM operations.
Details
- Reviewers
ftynse - Commits
- rGd34df52377fd: Implement FPToUI and UIToFP ops in standard dialect
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please post an RFC at https://llvm.discourse.group for any additions to the standard dialect.
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
1786 | MLIR supports unsigned integers natively, why is this restricted to signless integers only? |
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
1786 | Consistency with the existing FPToSIOp, which only applies to conversions between floats and signless integers. It would make sense to me that FPToSIOp should also accept signed integer types, and FPToUIOp should accept unsigned integers, but that would expand the scope of this proposal. |
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
1786 | The standard dialect does not operate on signed/unsigned types, it is explicitly signless. https://mlir.llvm.org/docs/Rationale/Rationale/#integer-signedness-semantics |
Friendly poke, wondering what the status of this is. Looks like we have an RFC here https://llvm.discourse.group/t/rfc-standard-add-std-fptoui-and-std-uitofp-operations/1567. AFAICT, there aren't any outstanding issues. This is a required op for certain situations. Because the standard dialect only deals with 'signless' integers, we must be able to reintroduce signedness in a few key areas, one of them being casts, otherwise we get incorrect behavior (we've run into this in real-world situations).
MLIR supports unsigned integers natively, why is this restricted to signless integers only?