Complex addition and substraction are the first two binary operations on complex
numbers.
Remaining operations will follow the same pattern.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| mlir/include/mlir/Dialect/StandardOps/IR/Ops.td | ||
|---|---|---|
| 222 | I don't see an immediate need, but, e.g., C++ supports complex<int>. | |
| mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
| 1409 | Nit: drop the extra whitespace before :: | |
| 1419 | I wonder if it wouldn't be better to just have a helper function that returns something like struct PairOfComplex {
Value lhsReal, lhsImag, rhsReal, rhsImag;
};
template <typename OpTy> PairOfComplex extractComplexComponents(OpTy op);that you would call from two individual patterns. Feels like it would be less code and less concepts in the code. | |
@ftynse Alex, do you know if there is a need for arithmetic ops for complex<integer_type>? If yes, how should we call this one? AddCFOp? :)