[mlir][tosa] Handle tosa.resize nearest rounding correctly
authorRob Suderman <suderman@google.com>
Mon, 5 Dec 2022 20:45:06 +0000 (12:45 -0800)
committerRob Suderman <suderman@google.com>
Mon, 5 Dec 2022 21:10:08 +0000 (13:10 -0800)
commit58fa8426fff78fcc18393d2842907a556006ec93
treea8e646e01d882c4797fb37511b4c5039d57177a3
parent7d58c95635cce63ce6acd43c953b57f10bf5c686
[mlir][tosa] Handle tosa.resize nearest rounding correctly

Rounding of tosa.resize did not handle rounding to the nearest pixel correctly.
Rather than dividing the scale by 2 we should double the partial pixel to
guarantee we include a check on the lowest bit.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D139162
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-resize.mlir