Exp2 functions are pushed directly to libm. This is problematic for
situations where libm is not available. This patch will expand the exp2
function to use exp2 with the input multiplied by ln2 (natural log).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp | ||
---|---|---|
25 | Rather than self defining we can just using stdlib's <numbers> library: | |
mlir/test/Dialect/Math/expand-math.mlir | ||
191 | Missing newline at the end of the file. | |
mlir/test/mlir-cpu-runner/math-polynomial-approx.mlir | ||
700 ↗ | (On Diff #512622) | Could we check values that fall outside the boundaries? We should verify that the edgecase behavior is approximately correct (e.g. very negative or very positive numbers should have a reasonable behavior). Also we could we include nan, inf, and -inf cases. |
Rather than self defining we can just using stdlib's <numbers> library:
https://en.cppreference.com/w/cpp/header/numbers