[clang] [CLANG] Full support of complex multiplication and division. (PR #81514)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 11:40:49 PST 2024


================
@@ -1847,19 +1847,51 @@ floating point semantic models: precise (the default), strict, and fast.
    * ``16`` - Forces ``_Float16`` operations to be emitted without using excess
      precision arithmetic.
 
+.. option:: -fcomplex-arithmetic=<value>:
+
+   This option specifies the implementation for complex multiplication and division.
+
+   Valid values are: ``basic``, ``improved``, ``full`` and ``promoted``.
+
+   * ``basic`` Implementation of complex division and multiplication using
+     algebraic formulas at source precision. No special handling to avoid
+     overflow. NaN and infinite and  values are not handled.
+   * ``improved`` Implementation of complex division using the Smith algorithm
+     at source precision. Smith's algorithm for complex division.
+     See SMITH, R. L. Algorithm 116: Complex division. Commun. ACM 5, 8 (1962).
+     This value offers improved handling for overflow in intermediate
+     calculations, but overflow may occur. NaN and infinite and  values are not
----------------
AaronBallman wrote:

```suggestion
     calculations, but overflow may occur. NaN and infinite values are not
```

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


More information about the cfe-commits mailing list