Rounding to integers requires rounding (for floating points) and clipping
to the min/max values of the destination range. Added this behavior and
updated tests appropriately.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
517–518 | Would be cleaner to integer clip in the integer domain here instead of the seemingly awkward expression of intMin and intMax and F32Attrs and then doing an integer range clamping in the fp Domain ? This could then reuse the intMin/intMax further below (they'd be common for all dstTy.isa<IntegerType>() ) and swap the last two ops around - FPtoSI(rounded) followed by CmpIOp ? |
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp | ||
---|---|---|
517–518 | Right, realized that on second thought. |
Would be cleaner to integer clip in the integer domain here instead of the seemingly awkward expression of intMin and intMax and F32Attrs and then doing an integer range clamping in the fp Domain ?
This could then reuse the intMin/intMax further below (they'd be common for all dstTy.isa<IntegerType>() ) and swap the last two ops around - FPtoSI(rounded) followed by CmpIOp ?