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

Michael Toguchi via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 12:01:25 PDT 2024


================
@@ -1046,30 +1046,35 @@ defm offload_uniform_block : BoolFOption<"offload-uniform-block",
   NegFlag<SetFalse, [], [ClangOption, CC1Option], "Don't assume">,
   BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>;
 
-def fcx_limited_range : Joined<["-"], "fcx-limited-range">,
+def fcomplex_arithmetic_EQ : Joined<["-"], "fcomplex-arithmetic=">, Group<f_Group>,
+  Visibility<[ClangOption, CC1Option]>,
+  Values<"full,improved,promoted,basic">, NormalizedValuesScope<"LangOptions">,
+  NormalizedValues<["CX_Full", "CX_Improved", "CX_Promoted", "CX_Basic"]>;
+
+def complex_range_EQ : Joined<["-"], "complex-range=">, Group<f_Group>,
+  Visibility<[CC1Option]>,
+  Values<"full,improved,promoted,basic">, NormalizedValuesScope<"LangOptions">,
+  NormalizedValues<["CX_Full", "CX_Improved", "CX_Promoted", "CX_Basic"]>,
+  MarshallingInfoEnum<LangOpts<"ComplexRange">, "CX_Full">;
+
+def fcx_limited_range : Flag<["-"], "fcx-limited-range">,
   Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
   HelpText<"Basic algebraic expansions of complex arithmetic operations "
            "involving are enabled.">;
 
-def fno_cx_limited_range : Joined<["-"], "fno-cx-limited-range">,
+def fno_cx_limited_range : Flag<["-"], "fno-cx-limited-range">,
   Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
   HelpText<"Basic algebraic expansions of complex arithmetic operations "
            "involving are disabled.">;
 
-def fcx_fortran_rules : Joined<["-"], "fcx-fortran-rules">,
+def fcx_fortran_rules : Flag<["-"], "fcx-fortran-rules">,
   Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
   HelpText<"Range reduction is enabled for complex arithmetic operations.">;
 
-def fno_cx_fortran_rules : Joined<["-"], "fno-cx-fortran-rules">,
+def fno_cx_fortran_rules : Flag<["-"], "fno-cx-fortran-rules">,
----------------
mdtoguchi wrote:

for `fcx_limited_range/fno_cx_limited_range`, `fcx_fortran_rules/fno_cx_fortran_rules` additions, these look like good candidates to use `BoolOptionWithoutMarshalling` to simplify the representation.

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


More information about the cfe-commits mailing list