Add a math.cbrt instruction and lowering to libm.
authorJohannes Reifferscheid <jreiffers@google.com>
Mon, 2 Jan 2023 14:23:12 +0000 (15:23 +0100)
committerJohannes Reifferscheid <jreiffers@google.com>
Tue, 3 Jan 2023 07:44:12 +0000 (08:44 +0100)
commit998a3a38948c9d220ddc759b8a6eee987e3ad320
treed3b8e48dbc8eb090eb033c82d5d18f9886c79ade
parent367e618fd605353ad77bb78f884c758948f0d573
Add a math.cbrt instruction and lowering to libm.

There's currently no way to get accurate cube roots in the math dialect.
powf(x, 1/3.0) is too inaccurate in some cases.

Reviewed By: akuegel

Differential Revision: https://reviews.llvm.org/D140842
mlir/include/mlir/Dialect/Math/IR/MathOps.td
mlir/lib/Conversion/MathToLibm/MathToLibm.cpp
mlir/test/Conversion/MathToLibm/convert-to-libm.mlir
mlir/test/Dialect/Math/ops.mlir