cornell-zhang/hcl-dialect

[Binding][Codegen] Support PowOp

Closed this issue · 1 comments

Current MLIR has two issues that prevent us from supporting PowOp in a clean way:

  1. The math dialect does not inherently support the power of integers. There is only a math.powf operation. See the discussion here.
  2. The llvm dialect has a powi operation but it does not provide Python binding.

The solution is to cast those input operands from integers to floating points and then cast them back from floating points to integers after the calculation.