[mlir][tosa] Rework tosa.apply_scale lowering for 32-bit
authorRobert Suderman <suderman@google.com>
Tue, 17 May 2022 23:00:04 +0000 (16:00 -0700)
committerRob Suderman <suderman@google.com>
Tue, 17 May 2022 23:01:12 +0000 (16:01 -0700)
commit9294a1e9a8ab8fed60ee1b0737e944077b5339cd
tree67d4f3dda973d8bcf4002c7f6aba83d4b9e54d5c
parentd4545e6fa0366718c2416d3578dd4e1f26855c29
[mlir][tosa] Rework tosa.apply_scale lowering for 32-bit

Added handling rounding behavior in 32-bits for when possible. This
avoids kernel compilation generating scalarized code on platforms where
64-bit vectors are not available.

As the 48-bit lowering requires 64-bit anyway, we added a full 64-bit
solution simplifying the old path.

Reviewed By: dcaballe, mravishankar

Differential Revision: https://reviews.llvm.org/D125583
mlir/include/mlir/Conversion/Passes.td
mlir/include/mlir/Conversion/TosaToArith/TosaToArith.h
mlir/lib/Conversion/TosaToArith/TosaToArith.cpp
mlir/lib/Conversion/TosaToArith/TosaToArithPass.cpp
mlir/test/Conversion/TosaToArith/tosa-to-arith.mlir