[flang-commits] [clang] [flang] [flang] Add -fcomplex-arithmetic= option and select complex division algorithm (PR #146641)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Mon Jul 7 07:44:13 PDT 2025


================
@@ -74,4 +74,26 @@ The ComplexToStandard dialect does still call into libm for some floating
 point math operations, however these don't have the same ABI issues as the
 complex libm functions.
 
+The flang driver option `-fcomplex-arithmetic=` allows you to select whether
+complex number division is lowered to function calls or to the `complex.div`
+operation in the MLIR complex dialect. To avoid the ABI issues mentioned above,
+the selection between function calls and the `complex.div` is made during the
+lowering phase. The behavior of this option is as follows:
----------------
tarunprabhu wrote:

```suggestion
the choice of function calls or the `complex.div` operation is made during the
lowering phase. The behavior of this option is as follows:
```

https://github.com/llvm/llvm-project/pull/146641


More information about the flang-commits mailing list