[gcc r17-2331] Revert "rs6000: Add -mdense-math option"

Surya Kumari Jangala via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:f92b46f7f2a8d0821f9fd49d4cc3f248aa009ae6

commit r17-2331-gf92b46f7f2a8d0821f9fd49d4cc3f248aa009ae6
Author: Surya Kumari Jangala <[email protected]>
Date:   Sat Jul 11 12:22:03 2026 -0500

    Revert "rs6000: Add -mdense-math option"
    
    This reverts commit 2601cb4d27364e2ae5c0eb4f53e186e0e0ecadde.

Diff:
---
 gcc/config/rs6000/rs6000-cpus.def |  4 +---
 gcc/config/rs6000/rs6000.cc       | 14 --------------
 gcc/config/rs6000/rs6000.opt      |  4 ----
 gcc/doc/invoke.texi               | 12 ++----------
 4 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index 365e0c6899c1..a110860acce6 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -85,8 +85,7 @@
 
 /* -mcpu=future flags.  */
 #define FUTURE_MASKS_SERVER	(POWER11_MASKS_SERVER			\
-				 | OPTION_MASK_FUTURE			\
-				 | OPTION_MASK_DMF)
+				 | OPTION_MASK_FUTURE)
 
 /* Flags that need to be turned off if -mno-vsx.  */
 #define OTHER_VSX_VECTOR_MASKS	(OPTION_MASK_EFFICIENT_UNALIGNED_VSX	\
@@ -127,7 +126,6 @@
 				 | OPTION_MASK_POWER10			\
 				 | OPTION_MASK_POWER11			\
 				 | OPTION_MASK_FUTURE			\
-				 | OPTION_MASK_DMF			\
 				 | OPTION_MASK_P10_FUSION		\
 				 | OPTION_MASK_HTM			\
 				 | OPTION_MASK_ISEL			\
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 7743c9cdc4a1..d8669d9ffce4 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -4381,19 +4381,6 @@ rs6000_option_override_internal (bool global_init_p)
       rs6000_isa_flags &= ~OPTION_MASK_MMA;
     }
 
-  /* Enable -mdense_math by default on future systems.  */
-  if (TARGET_FUTURE && (rs6000_isa_flags_explicit & OPTION_MASK_DMF) == 0)
-    rs6000_isa_flags |= OPTION_MASK_DMF;
-
-  /* Turn off DMF options on non-future systems.  */
-  else if (!TARGET_FUTURE && TARGET_DMF)
-    {
-      if ((rs6000_isa_flags_explicit & OPTION_MASK_DMF) != 0)
-	error ("%qs requires %qs", "-mdense_math", "-mcpu=future");
-
-      rs6000_isa_flags &= ~OPTION_MASK_DMF;
-    }
-
   /* Enable power10 fusion if we are tuning for power10, even if we aren't
      generating power10 instructions.  */
   if (!(rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION))
@@ -24483,7 +24470,6 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] =
   { "power10",			OPTION_MASK_POWER10,		false, true  },
   { "power11",			OPTION_MASK_POWER11,		false, false },
   { "future",			OPTION_MASK_FUTURE,		false, false },
-  { "dense-math",		OPTION_MASK_DMF,		false, true  },
   { "hard-dfp",			OPTION_MASK_DFP,		false, true  },
   { "htm",			OPTION_MASK_HTM,		false, true  },
   { "isel",			OPTION_MASK_ISEL,		false, true  },
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index d9e9de92b21a..2b6ec5222fc1 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -599,10 +599,6 @@ Target Undocumented Mask(POWER11) Var(rs6000_isa_flags) WarnRemoved
 mfuture
 Target Undocumented Mask(FUTURE) Var(rs6000_isa_flags) Warn(Do not use %<-mfuture>, use %<-mcpu=future>)
 
-mdense-math
-Target Mask(DMF) Var(rs6000_isa_flags)
-Generate (do not generate) DMF (Dense Math Facility) instructions.
-
 mprefixed
 Target Mask(PREFIXED) Var(rs6000_isa_flags)
 Generate (do not generate) prefixed memory instructions.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3234efa04ba2..354ceb76f538 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1407,7 +1407,7 @@ See RS/6000 and PowerPC Options.
 -mgnu-attribute
 -mstack-protector-guard=@var{guard}  -mstack-protector-guard-reg=@var{reg}
 -mstack-protector-guard-offset=@var{offset}  -mprefixed
--mpcrel  -mmma  -mdense-math  -mrop-protect  -mprivileged
+-mpcrel  -mmma  -mrop-protect  -mprivileged
 -mno-splat-word-constant  -mno-splat-float-constant
 -mno-ieee128-constant  -mno-warn-altivec-long}
 
@@ -31792,7 +31792,7 @@ following options:
 -mcrypto  -mhtm  -mpower8-fusion
 -mquad-memory  -mquad-memory-atomic  -mfloat128
 -mfloat128-hardware  -mprefixed  -mpcrel  -mmma
--mdense-math -mrop-protect}
+-mrop-protect}
 
 The particular options set for any particular CPU varies between
 compiler versions, depending on what setting seems to produce optimal
@@ -32889,14 +32889,6 @@ Generate (do not generate) the MMA instructions.  The @option{-mma}
 option requires that the option @option{-mcpu=power10} (or later)
 is enabled.
 
-@opindex mdense-math
-@opindex mno-dense-math
-@item -mdense-math
-@itemx -mno-dense-math
-Generate (do not generate) Dense Math Facility (DMF) instructions.
-The @option{-mdense-math} option requires that the option
-@option{-mcpu=future} (or later) is enabled.
-
 @opindex mrop-protect
 @opindex mno-rop-protect
 @item -mrop-protect
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.