public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/dmf002)] Revert patch.
@ 2022-10-27  3:51 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2022-10-27  3:51 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ee701a2c7f583efd22dd97a2dd4132605312c4e2

commit ee701a2c7f583efd22dd97a2dd4132605312c4e2
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Oct 26 23:50:53 2022 -0400

    Revert patch.
    
    2022-10-26   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/constraints.md (wD constraint): New constraint.
            * config/rs6000/mma.md (UNSPEC_DM_ASSEMBLE_ACC): New unspec.
            (movxo): Convert into define_expand.
            (movxo_p10): Power10 version of movxo.
            (movxo_dm): Dense math version of movxo.
            (mma_assemble_acc): Add dense match support to define_expand.
            (mma_assemble_acc_p10): Rename from mma_assemble_acc, and restrict it to
            non dense math.
            (mma_assemble_acc_dm): Dense math version of mma_assemble_acc.
            (mma_disassemble_acc): Add dense math support to define_expand.
            (mma_disassemble_acc_p10): Rename from mma_disassemble_acc, and restrict
            it to non dense math.
            (mma_disassemble_acc_dm): Dense math version of mma_disassemble_acc.
            (mma_<acc>): New define_expand to handle mma_<acc> for dense math and
            non dense math.
            (mma_<acc> insn): Restrict to non dense math.
            (mma_xxsetaccz): Convert to define_expand to handle non dense math and
            dense math.
            (mma_xxsetaccz_p10): Rename from mma_xxsetaccz and restrict usage to non
            dense math.
            (mma_xxsetaccz_dm): Dense math version of mma_xxsetaccz.
            (mma_<vv>): Add support for dense math.
            (mma_<avv>): Likewise.
            (mma_<pv>): Likewise.
            (mma_<apv>): Likewise.
            (mma_<vvi4i4i8>): Likewise.
            (mma_<avvi4i4i8>): Likewise.
            (mma_<vvi4i4i2>): Likewise.
            (mma_<avvi4i4i2>): Likewise.
            (mma_<vvi4i4>): Likewise.
            (mma_<avvi4i4>): Likewise.
            (mma_<pvi4i2>): Likewise.
            (mma_<apvi4i2>): Likewise.
            (mma_<vvi4i4i4>): Likewise.
            (mma_<avvi4i4i4>): Likewise.
            * config/rs6000/predicates.md (dmr_operand): New predicate.
            (accumulator_operand): Likewise.
            * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS): Add -mdense-math.
            (POWERPC_MASKS): Likewise.
            * config/rs6000/rs6000.cc (enum rs6000_reg_type): Add DMR_REG_TYPE.
            (enum rs6000_reload_reg_type): Add RELOAD_REG_DMR.
            (LAST_RELOAD_REG_CLASS): Add support for DMR registers.
            (reload_reg_map): Likewise.
            (rs6000_reg_names): Likewise.
            (alt_reg_names): Likewise.
            (rs6000_hard_regno_nregs_internal): Likewise.
            (rs6000_hard_regno_mode_ok_uncached): Likewise.
            (rs6000_debug_reg_global): Likewise.
            (rs6000_setup_reg_addr_masks): Likewise.
            (rs6000_init_hard_regno_mode_ok): Likewise.
            (rs6000_option_override_internal): Add checking for -mdense-math.
            (rs6000_secondary_reload_memory): Add support for DMR registers.
            (rs6000_secondary_reload_simple_move): Likewise.
            (rs6000_preferred_reload_class): Likewise.
            (rs6000_secondary_reload_class): Likewise.
            (print_operand): Make %A handle both FPRs and DMRs.
            (rs6000_dmr_register_move_cost): New helper function.
            (rs6000_register_move_cost): Add support for DMR registers.
            (rs6000_memory_move_cost): Likewise.
            (rs6000_compute_pressure_classes): Likewise.
            (rs6000_debugger_regno): Likewise.
            (rs6000_opt_masks): Add -mdense-math.
            (rs6000_split_multireg_move): Add support for DMRs.
            * config/rs6000/rs6000.h (UNITS_PER_DMR_WORD): New macro.
            (FIRST_PSEUDO_REGISTER): Update for DMRs.
            (FIXED_REGISTERS): Add DMRs.
            (CALL_REALLY_USED_REGISTERS): Likewise.
            (REG_ALLOC_ORDER): Likewise.
            (enum reg_class): Add DM_REGS.
            (REG_CLASS_NAMES): Likewise.
            (REG_CLASS_CONTENTS): Likewise.
            * config/rs6000/rs6000.md (FIRST_DMR_REGNO): New constant.
            (LAST_DMR_REGNO): Likewise.
            (isa attribute): Add 'dm' and 'not_dm' attributes.
            (enabled attribute): Support 'dm' and 'not_dm' attributes.
            * config/rs6000/rs6000.opt (-mdense-math): New switch.

Diff:
---
 gcc/config/rs6000/constraints.md  |   3 -
 gcc/config/rs6000/mma.md          | 359 +++++++++++++-------------------------
 gcc/config/rs6000/predicates.md   |  32 ----
 gcc/config/rs6000/rs6000-cpus.def |   4 +-
 gcc/config/rs6000/rs6000.cc       | 212 ++++------------------
 gcc/config/rs6000/rs6000.h        |  37 +---
 gcc/config/rs6000/rs6000.md       |  12 +-
 gcc/config/rs6000/rs6000.opt      |   4 -
 8 files changed, 167 insertions(+), 496 deletions(-)

diff --git a/gcc/config/rs6000/constraints.md b/gcc/config/rs6000/constraints.md
index 809f117c1c4..54fef8d9996 100644
--- a/gcc/config/rs6000/constraints.md
+++ b/gcc/config/rs6000/constraints.md
@@ -107,9 +107,6 @@
        (match_test "TARGET_P8_VECTOR")
        (match_operand 0 "s5bit_cint_operand")))
 
-(define_register_constraint "wD" "DM_REGS"
-  "DMR register.")
-
 (define_constraint "wE"
   "@internal Vector constant that can be loaded with the XXSPLTIB instruction."
   (match_test "xxspltib_constant_nosplit (op, mode)"))
diff --git a/gcc/config/rs6000/mma.md b/gcc/config/rs6000/mma.md
index 7f93f73d3a7..032f4263cb0 100644
--- a/gcc/config/rs6000/mma.md
+++ b/gcc/config/rs6000/mma.md
@@ -91,7 +91,6 @@
    UNSPEC_MMA_XVI8GER4SPP
    UNSPEC_MMA_XXMFACC
    UNSPEC_MMA_XXMTACC
-   UNSPEC_DM_ASSEMBLE_ACC
   ])
 
 (define_c_enum "unspecv"
@@ -312,8 +311,7 @@
    (set_attr "length" "*,*,8")])
 
 \f
-;; Vector quad support.  Under the original MMA, XOmode can only live in FPRs.
-;; With dense math, XOmode can live in either VSX registers or DMR registers.
+;; Vector quad support.  XOmode can only live in FPRs.
 (define_expand "movxo"
   [(set (match_operand:XO 0 "nonimmediate_operand")
 	(match_operand:XO 1 "input_operand"))]
@@ -335,10 +333,10 @@
     gcc_unreachable ();
 })
 
-(define_insn_and_split "*movxo_p10"
+(define_insn_and_split "*movxo"
   [(set (match_operand:XO 0 "nonimmediate_operand" "=d,m,d")
 	(match_operand:XO 1 "input_operand" "m,d,d"))]
-  "TARGET_MMA && !TARGET_DENSE_MATH
+  "TARGET_MMA
    && (gpc_reg_operand (operands[0], XOmode)
        || gpc_reg_operand (operands[1], XOmode))"
   "@
@@ -355,31 +353,6 @@
    (set_attr "length" "*,*,16")
    (set_attr "max_prefixed_insns" "2,2,*")])
 
-(define_insn_and_split "*movxo_dm"
-  [(set (match_operand:XO 0 "nonimmediate_operand" "=wa,m, wa,wD,wD,wa")
-	(match_operand:XO 1 "input_operand"          "m,wa,wa,wa,wD,wD"))]
-  "TARGET_DENSE_MATH
-   && (gpc_reg_operand (operands[0], XOmode)
-       || gpc_reg_operand (operands[1], XOmode))"
-  "@
-   #
-   #
-   #
-   dmxxinstdmr512 %0,%1,%Y1,0
-   dmmr %0,%1
-   dmxxextfdmr512 %0,%Y0,%1,0"
-  "&& reload_completed
-   && !dmr_operand (operands[0], XOmode)
-   && !dmr_operand (operands[1], XOmode)"
-  [(const_int 0)]
-{
-  rs6000_split_multireg_move (operands[0], operands[1]);
-  DONE;
-}
-  [(set_attr "type" "vecload,vecstore,veclogical,mma,mma,mma")
-   (set_attr "length" "*,*,16,*,*,*")
-   (set_attr "max_prefixed_insns" "2,2,*,*,*,*")])
-
 (define_expand "vsx_assemble_pair"
   [(match_operand:OO 0 "vsx_register_operand")
    (match_operand:V16QI 1 "mma_assemble_input_operand")
@@ -454,31 +427,18 @@
    (match_operand:V16QI 4 "mma_assemble_input_operand")]
   "TARGET_MMA"
 {
-  rtx op0 = operands[0];
-  rtx op1 = operands[1];
-  rtx op2 = operands[2];
-  rtx op3 = operands[3];
-  rtx op4 = operands[4];
-
-  if (TARGET_DENSE_MATH)
-    {
-      rtx vpair1 = gen_reg_rtx (OOmode);
-      rtx vpair2 = gen_reg_rtx (OOmode);
-      emit_insn (gen_vsx_assemble_pair (vpair1, op1, op2));
-      emit_insn (gen_vsx_assemble_pair (vpair2, op3, op4));
-      emit_insn (gen_mma_assemble_acc_dm (op0, vpair1, vpair2));
-    }
-
-  else
-    emit_insn (gen_mma_assemble_acc_p10 (op0, op1, op2, op3, op4));
-
+  rtx src = gen_rtx_UNSPEC_VOLATILE (XOmode,
+			    	     gen_rtvec (4, operands[1], operands[2],
+				       		operands[3], operands[4]),
+			    	     UNSPECV_MMA_ASSEMBLE);
+  emit_move_insn (operands[0], src);
   DONE;
 })
 
 ;; We cannot update the four output registers atomically, so mark the output
-;; as an early clobber so we don't accidentally clobber the input operands.
+;; as an early clobber so we don't accidentally clobber the input operands.  */
 
-(define_insn_and_split "mma_assemble_acc_p10"
+(define_insn_and_split "*mma_assemble_acc"
   [(set (match_operand:XO 0 "fpr_reg_operand" "=&d")
 	(unspec_volatile:XO
 	  [(match_operand:V16QI 1 "mma_assemble_input_operand" "mwa")
@@ -486,7 +446,7 @@
 	   (match_operand:V16QI 3 "mma_assemble_input_operand" "mwa")
 	   (match_operand:V16QI 4 "mma_assemble_input_operand" "mwa")]
 	  UNSPECV_MMA_ASSEMBLE))]
-  "TARGET_MMA && !TARGET_DENSE_MATH
+  "TARGET_MMA
    && fpr_reg_operand (operands[0], XOmode)"
   "#"
   "&& reload_completed"
@@ -500,31 +460,28 @@
   DONE;
 })
 
-;; On a system with dense math, we build the accumulators from two vector
-;; pairs.
-
-(define_insn "mma_assemble_acc_dm"
- [(set (match_operand:XO 0 "dmr_operand" "=wD")
-       (unspec:XO [(match_operand:OO 1 "vsx_register_operand" "wa")
-		   (match_operand:OO 2 "vsx_register_operand" "wa")]
-		  UNSPEC_DM_ASSEMBLE_ACC))]
- "TARGET_MMA && TARGET_DENSE_MATH"
- "dmxxinsfdmr512 %0,%1,%2,0"
- [(set_attr "type" "mma")])
-
 (define_expand "mma_disassemble_acc"
-  [(set (match_operand:V16QI 0 "register_operand")
-	(unspec:V16QI [(match_operand:XO 1 "register_operand")
-		       (match_operand 2 "const_0_to_3_operand")]
-		      UNSPEC_MMA_EXTRACT))]
-  "TARGET_MMA")
+  [(match_operand:V16QI 0 "mma_disassemble_output_operand")
+   (match_operand:XO 1 "fpr_reg_operand")
+   (match_operand 2 "const_0_to_3_operand")]
+  "TARGET_MMA"
+{
+  rtx src;
+  int regoff = INTVAL (operands[2]);
+  src = gen_rtx_UNSPEC (V16QImode,
+			gen_rtvec (2, operands[1], GEN_INT (regoff)),
+			UNSPEC_MMA_EXTRACT);
+  emit_move_insn (operands[0], src);
+  DONE;
+})
 
-(define_insn_and_split "*mma_disassemble_acc_p10"
+(define_insn_and_split "*mma_disassemble_acc"
   [(set (match_operand:V16QI 0 "mma_disassemble_output_operand" "=mwa")
-	(unspec:V16QI [(match_operand:XO 1 "fpr_reg_operand" "d")
-		       (match_operand 2 "const_0_to_3_operand")]
+       (unspec:V16QI [(match_operand:XO 1 "fpr_reg_operand" "d")
+		      (match_operand 2 "const_0_to_3_operand")]
 		      UNSPEC_MMA_EXTRACT))]
-  "TARGET_MMA"
+  "TARGET_MMA
+   && fpr_reg_operand (operands[1], XOmode)"
   "#"
   "&& reload_completed"
   [(const_int 0)]
@@ -536,258 +493,194 @@
   DONE;
 })
 
-(define_insn "*mma_disassemble_acc_dm"
-  [(set (match_operand:V16QI 0 "vsx_register_operand" "=wa")
-	(unspec:V16QI [(match_operand:XO 1 "dmr_operand" "wD")
-		       (match_operand 2 "const_0_to_3_operand")]
-		      UNSPEC_MMA_EXTRACT))]
-  "TARGET_DENSE_MATH"
-  "dmxxextfdmr256 %0,%1,2"
-  [(set_attr "type" "mma")])
-
-;; MMA instructions that do not use their accumulators as an input, still must
-;; not allow their vector operands to overlap the registers used by the
-;; accumulator.  We enforce this by marking the output as early clobber.  If we
-;; have dense math, we don't need the whole prime/de-prime action, so just make
-;; thse instructions be NOPs.
+;; MMA instructions that do not use their accumulators as an input, still
+;; must not allow their vector operands to overlap the registers used by
+;; the accumulator.  We enforce this by marking the output as early clobber.
 
-(define_expand "mma_<acc>"
-  [(set (match_operand:XO 0 "register_operand")
-	(unspec:XO [(match_operand:XO 1 "register_operand")]
-		   MMA_ACC))]
-  "TARGET_MMA"
-{
-  if (TARGET_DENSE_MATH)
-    {
-      if (!rtx_equal_p (operands[0], operands[1]))
-	emit_move_insn (operands[0], operands[1]);
-      DONE;
-    }
-
-  /* Generate the prime/de-prime code.  */
-})
-
-(define_insn "*mma_<acc>"
+(define_insn "mma_<acc>"
   [(set (match_operand:XO 0 "fpr_reg_operand" "=&d")
 	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0")]
 		    MMA_ACC))]
-  "TARGET_MMA && !TARGET_DENSE_MATH"
+  "TARGET_MMA"
   "<acc> %A0"
   [(set_attr "type" "mma")])
 
 ;; We can't have integer constants in XOmode so we wrap this in an
-;; UNSPEC_VOLATILE for the non-dense math case.  For dense math, we don't need
-;; to disable optimization and we can do a normal UNSPEC.
-
-(define_expand "mma_xxsetaccz"
-  [(set (match_operand:XO 0 "register_operand")
-	(unspec_volatile:XO [(const_int 0)]
-			    UNSPECV_MMA_XXSETACCZ))]
-  "TARGET_MMA"
-{
-  if (TARGET_DENSE_MATH)
-    {
-      emit_insn (gen_mma_xxsetaccz_dm (operands[0]));
-      DONE;
-    }
-})
+;; UNSPEC_VOLATILE.
 
-(define_insn "*mma_xxsetaccz_p10"
+(define_insn "mma_xxsetaccz"
   [(set (match_operand:XO 0 "fpr_reg_operand" "=d")
 	(unspec_volatile:XO [(const_int 0)]
 			    UNSPECV_MMA_XXSETACCZ))]
-  "TARGET_MMA && !TARGET_DENSE_MATH"
+  "TARGET_MMA"
   "xxsetaccz %A0"
   [(set_attr "type" "mma")])
 
-
-(define_insn "mma_xxsetaccz_dm"
-  [(set (match_operand:XO 0 "dmr_operand" "=wD")
-	(unspec:XO [(const_int 0)]
-		   UNSPECV_MMA_XXSETACCZ))]
-  "TARGET_DENSE_MATH"
-  "dmsetaccz %0"
-  [(set_attr "type" "mma")])
-
 (define_insn "mma_<vv>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")]
 		    MMA_VV))]
   "TARGET_MMA"
   "<vv> %A0,%x1,%x2"
-  [(set_attr "type" "mma")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+  [(set_attr "type" "mma")])
 
 (define_insn "mma_<avv>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")]
 		    MMA_AVV))]
   "TARGET_MMA"
   "<avv> %A0,%x2,%x3"
-  [(set_attr "type" "mma")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+  [(set_attr "type" "mma")])
 
 (define_insn "mma_<pv>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:OO 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:OO 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")]
 		    MMA_PV))]
   "TARGET_MMA"
   "<pv> %A0,%x1,%x2"
-  [(set_attr "type" "mma")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+  [(set_attr "type" "mma")])
 
 (define_insn "mma_<apv>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:OO 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:OO 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")]
 		    MMA_APV))]
   "TARGET_MMA"
   "<apv> %A0,%x2,%x3"
-  [(set_attr "type" "mma")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+  [(set_attr "type" "mma")])
 
 (define_insn "mma_<vvi4i4i8>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 3 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "u8bit_cint_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 3 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "u8bit_cint_operand" "n,n")]
 		    MMA_VVI4I4I8))]
   "TARGET_MMA"
   "<vvi4i4i8> %A0,%x1,%x2,%3,%4,%5"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<avvi4i4i8>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 6 "u8bit_cint_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 6 "u8bit_cint_operand" "n,n")]
 		    MMA_AVVI4I4I8))]
   "TARGET_MMA"
   "<avvi4i4i8> %A0,%x2,%x3,%4,%5,%6"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<vvi4i4i2>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 3 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_3_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 3 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_3_operand" "n,n")]
 		    MMA_VVI4I4I2))]
   "TARGET_MMA"
   "<vvi4i4i2> %A0,%x1,%x2,%3,%4,%5"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<avvi4i4i2>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 6 "const_0_to_3_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 6 "const_0_to_3_operand" "n,n")]
 		    MMA_AVVI4I4I2))]
   "TARGET_MMA"
   "<avvi4i4i2> %A0,%x2,%x3,%4,%5,%6"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<vvi4i4>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 3 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 3 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")]
 		    MMA_VVI4I4))]
   "TARGET_MMA"
   "<vvi4i4> %A0,%x1,%x2,%3,%4"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<avvi4i4>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_15_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_15_operand" "n,n")]
 		    MMA_AVVI4I4))]
   "TARGET_MMA"
   "<avvi4i4> %A0,%x2,%x3,%4,%5"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<pvi4i2>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:OO 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 3 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 4 "const_0_to_3_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:OO 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 3 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 4 "const_0_to_3_operand" "n,n")]
 		    MMA_PVI4I2))]
   "TARGET_MMA"
   "<pvi4i2> %A0,%x1,%x2,%3,%4"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<apvi4i2>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:OO 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_3_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:OO 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_3_operand" "n,n")]
 		    MMA_APVI4I2))]
   "TARGET_MMA"
   "<apvi4i2> %A0,%x2,%x3,%4,%5"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<vvi4i4i4>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 3 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_15_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:V16QI 1 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 3 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_15_operand" "n,n")]
 		    MMA_VVI4I4I4))]
   "TARGET_MMA"
   "<vvi4i4i4> %A0,%x1,%x2,%3,%4,%5"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
 
 (define_insn "mma_<avvi4i4i4>"
-  [(set (match_operand:XO 0 "accumulator_operand" "=wD,&d,&d")
-	(unspec:XO [(match_operand:XO 1 "accumulator_operand" "0,0,0")
-		    (match_operand:V16QI 2 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:V16QI 3 "vsx_register_operand" "wa,v,?wa")
-		    (match_operand:SI 4 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 5 "const_0_to_15_operand" "n,n,n")
-		    (match_operand:SI 6 "const_0_to_15_operand" "n,n,n")]
+  [(set (match_operand:XO 0 "fpr_reg_operand" "=&d,&d")
+	(unspec:XO [(match_operand:XO 1 "fpr_reg_operand" "0,0")
+		    (match_operand:V16QI 2 "vsx_register_operand" "v,?wa")
+		    (match_operand:V16QI 3 "vsx_register_operand" "v,?wa")
+		    (match_operand:SI 4 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 5 "const_0_to_15_operand" "n,n")
+		    (match_operand:SI 6 "const_0_to_15_operand" "n,n")]
 		    MMA_AVVI4I4I4))]
   "TARGET_MMA"
   "<avvi4i4i4> %A0,%x2,%x3,%4,%5,%6"
   [(set_attr "type" "mma")
-   (set_attr "prefixed" "yes")
-   (set_attr "isa" "dm,not_dm,not_dm")])
+   (set_attr "prefixed" "yes")])
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index ede48189d3d..b1fcc69bb60 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -186,38 +186,6 @@
   return VLOGICAL_REGNO_P (REGNO (op));
 })
 
-;; Return 1 if op is a DMR register
-(define_predicate "dmr_operand"
-  (match_operand 0 "register_operand")
-{
-  if (!REG_P (op))
-    return 0;
-
-  if (!HARD_REGISTER_P (op))
-    return 1;
-
-  return DMR_REGNO_P (REGNO (op));
-})
-
-;; Return 1 if op is an accumulator.  On power10 systems, the accumulators
-;; overlap with the FPRs, while on systems with dense math, the accumulators
-;; are separate dense math registers and do not overlap with the FPR
-;; registers..
-(define_predicate "accumulator_operand"
-  (match_operand 0 "register_operand")
-{
-  if (!REG_P (op))
-    return 0;
-
-  if (!HARD_REGISTER_P (op))
-    return 1;
-
-  int r = REGNO (op);
-  return (TARGET_DENSE_MATH
-	  ? DMR_REGNO_P (r)
-	  : FP_REGNO_P (r) && (r & 3) == 0);
-})
-
 ;; Return 1 if op is the carry register.
 (define_predicate "ca_operand"
   (match_operand 0 "register_operand")
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index 467f6b01ae9..8cddea36d76 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -89,8 +89,7 @@
 
 /* Flags for a potential future processor that may or may not be delivered.  */
 #define ISA_FUTURE_MASKS	(ISA_3_1_MASKS_SERVER			\
-				 | OPTION_MASK_BLOCK_OPS_VECTOR_PAIR	\
-				 | OPTION_MASK_DENSE_MATH)
+				 | OPTION_MASK_BLOCK_OPS_VECTOR_PAIR)
 
 /* Flags that need to be turned off if -mno-power9-vector.  */
 #define OTHER_P9_VECTOR_MASKS	(OPTION_MASK_FLOAT128_HW		\
@@ -133,7 +132,6 @@
 				 | OPTION_MASK_DFP			\
 				 | OPTION_MASK_DIRECT_MOVE		\
 				 | OPTION_MASK_DLMZB			\
-				 | OPTION_MASK_DENSE_MATH		\
 				 | OPTION_MASK_EFFICIENT_UNALIGNED_VSX	\
 				 | OPTION_MASK_FLOAT128_HW		\
 				 | OPTION_MASK_FLOAT128_KEYWORD		\
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 93ef5973e2d..74c30c3b07a 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -290,8 +290,7 @@ enum rs6000_reg_type {
   ALTIVEC_REG_TYPE,
   FPR_REG_TYPE,
   SPR_REG_TYPE,
-  CR_REG_TYPE,
-  DMR_REG_TYPE
+  CR_REG_TYPE
 };
 
 /* Map register class to register type.  */
@@ -305,23 +304,22 @@ static enum rs6000_reg_type reg_class_to_reg_type[N_REG_CLASSES];
 
 
 /* Register classes we care about in secondary reload or go if legitimate
-   address.  We only need to worry about GPR, FPR, Altivec, and DMR registers
-   here, along an ANY field that is the OR of the 4 register classes.  */
+   address.  We only need to worry about GPR, FPR, and Altivec registers here,
+   along an ANY field that is the OR of the 3 register classes.  */
 
 enum rs6000_reload_reg_type {
   RELOAD_REG_GPR,			/* General purpose registers.  */
   RELOAD_REG_FPR,			/* Traditional floating point regs.  */
   RELOAD_REG_VMX,			/* Altivec (VMX) registers.  */
-  RELOAD_REG_DMR,			/* DMR registers.  */
-  RELOAD_REG_ANY,			/* OR of GPR/FPR/VMX/DMR masks.  */
+  RELOAD_REG_ANY,			/* OR of GPR, FPR, Altivec masks.  */
   N_RELOAD_REG
 };
 
-/* For setting up register classes, loop through the 4 register classes mapping
+/* For setting up register classes, loop through the 3 register classes mapping
    into real registers, and skip the ANY class, which is just an OR of the
    bits.  */
 #define FIRST_RELOAD_REG_CLASS	RELOAD_REG_GPR
-#define LAST_RELOAD_REG_CLASS	RELOAD_REG_DMR
+#define LAST_RELOAD_REG_CLASS	RELOAD_REG_VMX
 
 /* Map reload register type to a register in the register class.  */
 struct reload_reg_map_type {
@@ -333,7 +331,6 @@ static const struct reload_reg_map_type reload_reg_map[N_RELOAD_REG] = {
   { "Gpr",	FIRST_GPR_REGNO },	/* RELOAD_REG_GPR.  */
   { "Fpr",	FIRST_FPR_REGNO },	/* RELOAD_REG_FPR.  */
   { "VMX",	FIRST_ALTIVEC_REGNO },	/* RELOAD_REG_VMX.  */
-  { "DMR",	FIRST_DMR_REGNO },	/* RELOAD_REG_DMR.  */
   { "Any",	-1 },			/* RELOAD_REG_ANY.  */
 };
 
@@ -1226,8 +1223,6 @@ char rs6000_reg_names[][8] =
       "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",
   /* vrsave vscr sfp */
       "vrsave", "vscr", "sfp",
-  /* DMRs */
-      "0", "1", "2", "3", "4", "5", "6", "7",
 };
 
 #ifdef TARGET_REGNAMES
@@ -1254,8 +1249,6 @@ static const char alt_reg_names[][8] =
   "%cr0",  "%cr1", "%cr2", "%cr3", "%cr4", "%cr5", "%cr6", "%cr7",
   /* vrsave vscr sfp */
   "vrsave", "vscr", "sfp",
-  /* DMRs */
-  "%dmr0", "%dmr1", "%dmr2", "%dmr3", "%dmr4", "%dmr5", "%dmr6", "%dmr7",
 };
 #endif
 
@@ -1827,9 +1820,6 @@ rs6000_hard_regno_nregs_internal (int regno, machine_mode mode)
   else if (ALTIVEC_REGNO_P (regno))
     reg_size = UNITS_PER_ALTIVEC_WORD;
 
-  else if (DMR_REGNO_P (regno))
-    reg_size = UNITS_PER_DMR_WORD;
-
   else
     reg_size = UNITS_PER_WORD;
 
@@ -1851,35 +1841,9 @@ rs6000_hard_regno_mode_ok_uncached (int regno, machine_mode mode)
   if (mode == OOmode)
     return (TARGET_MMA && VSX_REGNO_P (regno) && (regno & 1) == 0);
 
-  /* On power10, MMA accumulator modes need FPR registers divisible by 4.
-
-     If dense math is enabled, allow all VSX registers plus the DMR registers.
-     We need to make sure we don't cross between the boundary of FPRs and
-     traditional Altiviec registers.  */
+  /* MMA accumulator modes need FPR registers divisible by 4.  */
   if (mode == XOmode)
-    {
-      if (TARGET_MMA && !TARGET_DENSE_MATH)
-	return (FP_REGNO_P (regno) && (regno & 3) == 0);
-
-      else if (TARGET_DENSE_MATH)
-	{
-	  if (DMR_REGNO_P (regno))
-	    return 1;
-
-	  if (FP_REGNO_P (regno))
-	    return ((regno & 1) == 0 && regno <= LAST_FPR_REGNO - 3);
-
-	  if (ALTIVEC_REGNO_P (regno))
-	    return ((regno & 1) == 0 && regno <= LAST_ALTIVEC_REGNO - 3);
-	}
-
-      else
-	return 0;
-    }
-
-  /* No other types other than XOmode can go in DMRs.  */
-  if (DMR_REGNO_P (regno))
-    return 0;
+    return (TARGET_MMA && FP_REGNO_P (regno) && (regno & 3) == 0);
 
   /* PTImode can only go in GPRs.  Quad word memory operations require even/odd
      register combinations, and use PTImode where we need to deal with quad
@@ -2322,7 +2286,6 @@ rs6000_debug_reg_global (void)
   rs6000_debug_reg_print (FIRST_ALTIVEC_REGNO,
 			  LAST_ALTIVEC_REGNO,
 			  "vs");
-  rs6000_debug_reg_print (FIRST_DMR_REGNO, LAST_DMR_REGNO, "dmr");
   rs6000_debug_reg_print (LR_REGNO, LR_REGNO, "lr");
   rs6000_debug_reg_print (CTR_REGNO, CTR_REGNO, "ctr");
   rs6000_debug_reg_print (CR0_REGNO, CR7_REGNO, "cr");
@@ -2647,21 +2610,6 @@ rs6000_setup_reg_addr_masks (void)
 	  addr_mask = 0;
 	  reg = reload_reg_map[rc].reg;
 
-	  /* Special case DMR registers.  */
-	  if (rc == RELOAD_REG_DMR)
-	    {
-	      if (TARGET_DENSE_MATH && m2 == XOmode)
-		{
-		  addr_mask = RELOAD_REG_VALID;
-		  reg_addr[m].addr_mask[rc] = addr_mask;
-		  any_addr_mask |= addr_mask;
-		}
-	      else
-		reg_addr[m].addr_mask[rc] = 0;
-
-	      continue;
-	    }
-
 	  /* Can mode values go in the GPR/FPR/Altivec registers?  */
 	  if (reg >= 0 && rs6000_hard_regno_mode_ok_p[m][reg])
 	    {
@@ -2757,8 +2705,8 @@ rs6000_setup_reg_addr_masks (void)
 
 	  /* Vector pairs can do both indexed and offset loads if the
 	     instructions are enabled, otherwise they can only do offset loads
-	     since it will be broken into two vector moves.  Vector quads and
-	     1,024 bit DMR values can only do offset loads.  */
+	     since it will be broken into two vector moves.  Vector quads can
+	     only do offset loads.  */
 	  else if ((addr_mask != 0) && TARGET_MMA
 		   && (m2 == OOmode || m2 == XOmode))
 	    {
@@ -2812,9 +2760,6 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
   for (r = CR1_REGNO; r <= CR7_REGNO; ++r)
     rs6000_regno_regclass[r] = CR_REGS;
 
-  for (r = FIRST_DMR_REGNO; r <= LAST_DMR_REGNO; ++r)
-    rs6000_regno_regclass[r] = DM_REGS;
-
   rs6000_regno_regclass[LR_REGNO] = LINK_REGS;
   rs6000_regno_regclass[CTR_REGNO] = CTR_REGS;
   rs6000_regno_regclass[CA_REGNO] = NO_REGS;
@@ -2839,7 +2784,6 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
   reg_class_to_reg_type[(int)LINK_OR_CTR_REGS] = SPR_REG_TYPE;
   reg_class_to_reg_type[(int)CR_REGS] = CR_REG_TYPE;
   reg_class_to_reg_type[(int)CR0_REGS] = CR_REG_TYPE;
-  reg_class_to_reg_type[(int)DM_REGS] = DMR_REG_TYPE;
 
   if (TARGET_VSX)
     {
@@ -4455,14 +4399,6 @@ rs6000_option_override_internal (bool global_init_p)
   if (!TARGET_PCREL && TARGET_PCREL_OPT)
     rs6000_isa_flags &= ~OPTION_MASK_PCREL_OPT;
 
-  /* Dense math requires MMA.  */
-  if (TARGET_DENSE_MATH && !TARGET_MMA)
-    {
-      if ((rs6000_isa_flags_explicit & OPTION_MASK_DENSE_MATH) != 0)
-	error ("%qs requires %qs", "-mdense-math", "-mmma");
-      rs6000_isa_flags &= ~OPTION_MASK_DENSE_MATH;
-    }
-
   if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
     rs6000_print_isa_options (stderr, 0, "after subtarget", rs6000_isa_flags);
 
@@ -12118,11 +12054,6 @@ rs6000_secondary_reload_memory (rtx addr,
     addr_mask = (reg_addr[mode].addr_mask[RELOAD_REG_VMX]
 		 & ~RELOAD_REG_AND_M16);
 
-  /* DMR registers use VSX registers, and need to generate some extra
-     instructions.  */
-  else if (rclass == DM_REGS)
-    return 2;
-
   /* If the register allocator hasn't made up its mind yet on the register
      class to use, settle on defaults to use.  */
   else if (rclass == NO_REGS)
@@ -12451,13 +12382,6 @@ rs6000_secondary_reload_simple_move (enum rs6000_reg_type to_type,
 	       || (to_type == SPR_REG_TYPE && from_type == GPR_REG_TYPE)))
     return true;
 
-  /* We can transfer between VSX registers and DMR registers without needing
-     extra registers.  */
-  if (TARGET_DENSE_MATH && mode == XOmode
-      && ((to_type == DMR_REG_TYPE && from_type == VSX_REG_TYPE)
-	  || (to_type == VSX_REG_TYPE && from_type == DMR_REG_TYPE)))
-    return true;
-
   return false;
 }
 
@@ -13152,10 +13076,6 @@ rs6000_preferred_reload_class (rtx x, enum reg_class rclass)
   machine_mode mode = GET_MODE (x);
   bool is_constant = CONSTANT_P (x);
 
-  /* DMR registers can't be loaded or stored.  */
-  if (rclass == DM_REGS)
-    return NO_REGS;
-
   /* If a mode can't go in FPR/ALTIVEC/VSX registers, don't return a preferred
      reload class for it.  */
   if ((rclass == ALTIVEC_REGS || rclass == VSX_REGS)
@@ -13252,7 +13172,7 @@ rs6000_preferred_reload_class (rtx x, enum reg_class rclass)
 	return VSX_REGS;
 
       if (mode == XOmode)
-	return TARGET_DENSE_MATH ? VSX_REGS : FLOAT_REGS;
+	return FLOAT_REGS;
 
       if (GET_MODE_CLASS (mode) == MODE_INT)
 	return GENERAL_REGS;
@@ -13377,11 +13297,6 @@ rs6000_secondary_reload_class (enum reg_class rclass, machine_mode mode,
   else
     regno = -1;
 
-  /* DMR registers don't have loads or stores.  We have to go through the VSX
-     registers to load XOmode (vector quad).  */
-  if (TARGET_DENSE_MATH && rclass == DM_REGS)
-    return VSX_REGS;
-
   /* If we have VSX register moves, prefer moving scalar values between
      Altivec registers and GPR by going via an FPR (and then via memory)
      instead of reloading the secondary memory address for Altivec moves.  */
@@ -13895,19 +13810,8 @@ print_operand (FILE *file, rtx x, int code)
 	 output_operand.  */
 
     case 'A':
-      /* Write the MMA accumulator number associated with VSX register X.  On
-	 dense math systems, only allow DMR accumulators, not accumulators
-	 overlapping with the FPR registers.  */
-      if (!REG_P (x))
-	output_operand_lossage ("invalid %%A value");
-      else if (TARGET_DENSE_MATH)
-	{
-	  if (DMR_REGNO_P (REGNO (x)))
-	    fprintf (file, "%d", REGNO (x) - FIRST_DMR_REGNO);
-	  else
-	    output_operand_lossage ("%%A operand is not a DMR");
-	}
-      else if (!FP_REGNO_P (REGNO (x)) || (REGNO (x) % 4) != 0)
+      /* Write the MMA accumulator number associated with VSX register X.  */
+      if (!REG_P (x) || !FP_REGNO_P (REGNO (x)) || (REGNO (x) % 4) != 0)
 	output_operand_lossage ("invalid %%A value");
       else
 	fprintf (file, "%d", (REGNO (x) - FIRST_FPR_REGNO) / 4);
@@ -22509,31 +22413,6 @@ rs6000_debug_address_cost (rtx x, machine_mode mode,
 }
 
 
-/* Subroutine to determine the move cost of dense math registers.  If we are
-   moving to/from VSX_REGISTER registers, the cost is either 1 move (for
-   512-bit accumulators) or 2 moves (for 1,024 dmr registers).  If we are
-   moving to anything else like GPR registers, make the cost very high.  */
-
-static int
-rs6000_dmr_register_move_cost (machine_mode mode, reg_class_t rclass)
-{
-  const int reg_move_base = 2;
-  HARD_REG_SET vsx_set = (reg_class_contents[rclass]
-			  & reg_class_contents[VSX_REGS]);
-
-  if (TARGET_DENSE_MATH && !hard_reg_set_empty_p (vsx_set))
-    {
-      /* __vector_quad (i.e. XOmode) is tranfered in 1 instruction.  */
-      if (mode == XOmode)
-	return reg_move_base;
-
-      else
-	return reg_move_base * 2 * hard_regno_nregs (FIRST_DMR_REGNO, mode);
-    }
-
-  return 1000 * 2 * hard_regno_nregs (FIRST_DMR_REGNO, mode);
-}
-
 /* A C expression returning the cost of moving data from a register of class
    CLASS1 to one of CLASS2.  */
 
@@ -22547,28 +22426,17 @@ rs6000_register_move_cost (machine_mode mode,
   if (TARGET_DEBUG_COST)
     dbg_cost_ctrl++;
 
-  HARD_REG_SET to_vsx, from_vsx;
-  to_vsx = reg_class_contents[to] & reg_class_contents[VSX_REGS];
-  from_vsx = reg_class_contents[from] & reg_class_contents[VSX_REGS];
-
-  /* Special case DMR registers, that can only move to/from VSX registers.  */
-  if (from == DM_REGS && to == DM_REGS)
-    ret = 2 * hard_regno_nregs (FIRST_DMR_REGNO, mode);
-
-  else if (from == DM_REGS)
-    ret = rs6000_dmr_register_move_cost (mode, to);
-
-  else if (to == DM_REGS)
-    ret = rs6000_dmr_register_move_cost (mode, from);
-
   /* If we have VSX, we can easily move between FPR or Altivec registers,
      otherwise we can only easily move within classes.
      Do this first so we give best-case answers for union classes
      containing both gprs and vsx regs.  */
-  else if (!hard_reg_set_empty_p (to_vsx)
-	   && !hard_reg_set_empty_p (from_vsx)
-	   && (TARGET_VSX
-	       || hard_reg_set_intersect_p (to_vsx, from_vsx)))
+  HARD_REG_SET to_vsx, from_vsx;
+  to_vsx = reg_class_contents[to] & reg_class_contents[VSX_REGS];
+  from_vsx = reg_class_contents[from] & reg_class_contents[VSX_REGS];
+  if (!hard_reg_set_empty_p (to_vsx)
+      && !hard_reg_set_empty_p (from_vsx)
+      && (TARGET_VSX
+	  || hard_reg_set_intersect_p (to_vsx, from_vsx)))
     {
       int reg = FIRST_FPR_REGNO;
       if (TARGET_VSX
@@ -22664,9 +22532,6 @@ rs6000_memory_move_cost (machine_mode mode, reg_class_t rclass,
     ret = 4 * hard_regno_nregs (32, mode);
   else if (reg_classes_intersect_p (rclass, ALTIVEC_REGS))
     ret = 4 * hard_regno_nregs (FIRST_ALTIVEC_REGNO, mode);
-  else if (reg_classes_intersect_p (rclass, DM_REGS))
-    ret = (rs6000_dmr_register_move_cost (mode, VSX_REGS)
-	   + rs6000_memory_move_cost (mode, VSX_REGS, false));
   else
     ret = 4 + rs6000_register_move_cost (mode, rclass, GENERAL_REGS);
 
@@ -23875,8 +23740,6 @@ rs6000_compute_pressure_classes (enum reg_class *pressure_classes)
       if (TARGET_HARD_FLOAT)
 	pressure_classes[n++] = FLOAT_REGS;
     }
-  if (TARGET_DENSE_MATH)
-    pressure_classes[n++] = DM_REGS;
   pressure_classes[n++] = CR_REGS;
   pressure_classes[n++] = SPECIAL_REGS;
 
@@ -24041,10 +23904,6 @@ rs6000_debugger_regno (unsigned int regno, unsigned int format)
     return 67;
   if (regno == 64)
     return 64;
-  /* XXX: This is a guess.  The GCC register number for FIRST_DMR_REGNO is 111,
-     but the frame pointer regnum uses that.  */
-  if (DMR_REGNO_P (regno))
-    return regno - FIRST_DMR_REGNO + 112;
 
   gcc_unreachable ();
 }
@@ -24255,7 +24114,6 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] =
   { "crypto",			OPTION_MASK_CRYPTO,		false, true  },
   { "direct-move",		OPTION_MASK_DIRECT_MOVE,	false, true  },
   { "dlmzb",			OPTION_MASK_DLMZB,		false, true  },
-  { "dense-math",		OPTION_MASK_DENSE_MATH,		false, true  },
   { "efficient-unaligned-vsx",	OPTION_MASK_EFFICIENT_UNALIGNED_VSX,
 								false, true  },
   { "float128",			OPTION_MASK_FLOAT128_KEYWORD,	false, true  },
@@ -27293,7 +27151,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 
 	  /* If we are reading an accumulator register, we have to
 	     deprime it before we can access it.  */
-	  if (TARGET_MMA && !TARGET_DENSE_MATH
+	  if (TARGET_MMA
 	      && GET_MODE (src) == XOmode && FP_REGNO_P (REGNO (src)))
 	    emit_insn (gen_mma_xxmfacc (src, src));
 
@@ -27325,9 +27183,9 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 	      emit_insn (gen_rtx_SET (dst2, src2));
 	    }
 
-	  /* If we are writing an accumulator register that overlaps with the
-	     FPR registers, we have to prime it after we've written it.  */
-	  if (TARGET_MMA && !TARGET_DENSE_MATH
+	  /* If we are writing an accumulator register, we have to
+	     prime it after we've written it.  */
+	  if (TARGET_MMA
 	      && GET_MODE (dst) == XOmode && FP_REGNO_P (REGNO (dst)))
 	    emit_insn (gen_mma_xxmtacc (dst, dst));
 
@@ -27341,9 +27199,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 		      || XINT (src, 1) == UNSPECV_MMA_ASSEMBLE);
 	  gcc_assert (REG_P (dst));
 	  if (GET_MODE (src) == XOmode)
-	    gcc_assert ((TARGET_DENSE_MATH
-			 ? VSX_REGNO_P (REGNO (dst))
-			 : FP_REGNO_P (REGNO (dst))));
+	    gcc_assert (FP_REGNO_P (REGNO (dst)));
 	  if (GET_MODE (src) == OOmode)
 	    gcc_assert (VSX_REGNO_P (REGNO (dst)));
 
@@ -27396,9 +27252,9 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 	      emit_insn (gen_rtx_SET (dst_i, op));
 	    }
 
-	  /* On systems without dense math where accumulators overlap with the
-	     vector registers, we have to prime it after we've written it.  */
-	  if (GET_MODE (src) == XOmode && !TARGET_DENSE_MATH)
+	  /* We are writing an accumulator register, so we have to
+	     prime it after we've written it.  */
+	  if (GET_MODE (src) == XOmode)
 	    emit_insn (gen_mma_xxmtacc (dst, dst));
 
 	  return;
@@ -27409,9 +27265,9 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 
   if (REG_P (src) && REG_P (dst) && (REGNO (src) < REGNO (dst)))
     {
-      /* If we are reading an accumulator register and we don't have dense
-	 math, we have to deprime it before we can access it.  */
-      if (TARGET_MMA && !TARGET_DENSE_MATH
+      /* If we are reading an accumulator register, we have to
+	 deprime it before we can access it.  */
+      if (TARGET_MMA
 	  && GET_MODE (src) == XOmode && FP_REGNO_P (REGNO (src)))
 	emit_insn (gen_mma_xxmfacc (src, src));
 
@@ -27439,7 +27295,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 
       /* If we are writing an accumulator register, we have to
 	 prime it after we've written it.  */
-      if (TARGET_MMA && !TARGET_DENSE_MATH
+      if (TARGET_MMA
 	  && GET_MODE (dst) == XOmode && FP_REGNO_P (REGNO (dst)))
 	emit_insn (gen_mma_xxmtacc (dst, dst));
     }
@@ -27576,7 +27432,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 
       /* If we are reading an accumulator register, we have to
 	 deprime it before we can access it.  */
-      if (TARGET_MMA && !TARGET_DENSE_MATH && REG_P (src)
+      if (TARGET_MMA && REG_P (src)
 	  && GET_MODE (src) == XOmode && FP_REGNO_P (REGNO (src)))
 	emit_insn (gen_mma_xxmfacc (src, src));
 
@@ -27608,7 +27464,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
 
       /* If we are writing an accumulator register, we have to
 	 prime it after we've written it.  */
-      if (TARGET_MMA && !TARGET_DENSE_MATH && REG_P (dst)
+      if (TARGET_MMA && REG_P (dst)
 	  && GET_MODE (dst) == XOmode && FP_REGNO_P (REGNO (dst)))
 	emit_insn (gen_mma_xxmtacc (dst, dst));
 
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 3bfc69f39c2..0df5911d852 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -662,7 +662,6 @@ extern unsigned char rs6000_recip_bits[];
 #define UNITS_PER_FP_WORD 8
 #define UNITS_PER_ALTIVEC_WORD 16
 #define UNITS_PER_VSX_WORD 16
-#define UNITS_PER_DMR_WORD 128
 
 /* Type used for ptrdiff_t, as a string used in a declaration.  */
 #define PTRDIFF_TYPE "int"
@@ -790,7 +789,7 @@ enum data_align { align_abi, align_opt, align_both };
    Another pseudo (not included in DWARF_FRAME_REGISTERS) is soft frame
    pointer, which is eventually eliminated in favor of SP or FP.  */
 
-#define FIRST_PSEUDO_REGISTER 119
+#define FIRST_PSEUDO_REGISTER 111
 
 /* Use standard DWARF numbering for DWARF debugging information.  */
 #define DEBUGGER_REGNO(REGNO) rs6000_debugger_regno ((REGNO), 0)
@@ -827,9 +826,7 @@ enum data_align { align_abi, align_opt, align_both };
    /* cr0..cr7 */				   \
    0, 0, 0, 0, 0, 0, 0, 0,			   \
    /* vrsave vscr sfp */			   \
-   1, 1, 1,					   \
-   /* DMR registers.  */			   \
-   0, 0, 0, 0, 0, 0, 0, 0			   \
+   1, 1, 1					   \
 }
 
 /* Like `CALL_USED_REGISTERS' except this macro doesn't require that
@@ -853,9 +850,7 @@ enum data_align { align_abi, align_opt, align_both };
    /* cr0..cr7 */				   \
    1, 1, 0, 0, 0, 1, 1, 1,			   \
    /* vrsave vscr sfp */			   \
-   0, 0, 0,					   \
-   /* DMR registers.  */			   \
-   0, 0, 0, 0, 0, 0, 0, 0			   \
+   0, 0, 0					   \
 }
 
 #define TOTAL_ALTIVEC_REGS	(LAST_ALTIVEC_REGNO - FIRST_ALTIVEC_REGNO + 1)
@@ -892,7 +887,6 @@ enum data_align { align_abi, align_opt, align_both };
 	v2		(not saved; incoming vector arg reg; return value)
 	v19 - v14	(not saved or used for anything)
 	v31 - v20	(saved; order given to save least number)
-	dmr0 - dmr7	(not saved)
 	vrsave, vscr	(fixed)
 	sfp		(fixed)
 */
@@ -935,9 +929,6 @@ enum data_align { align_abi, align_opt, align_both };
    66,								\
    83, 82, 81, 80, 79, 78,					\
    95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84,		\
-   /* DMR registers.  */					\
-   111, 112, 113, 114, 115, 116, 117, 118,			\
-   /* Vrsave, vscr, sfp.  */					\
    108, 109,							\
    110								\
 }
@@ -964,9 +955,6 @@ enum data_align { align_abi, align_opt, align_both };
 /* True if register is a VSX register.  */
 #define VSX_REGNO_P(N) (FP_REGNO_P (N) || ALTIVEC_REGNO_P (N))
 
-/* True if register is a DMR register.  */
-#define DMR_REGNO_P(N) ((N) >= FIRST_DMR_REGNO && (N) <= LAST_DMR_REGNO)
-
 /* Alternate name for any vector register supporting floating point, no matter
    which instruction set(s) are available.  */
 #define VFLOAT_REGNO_P(N) \
@@ -1102,7 +1090,6 @@ enum reg_class
   FLOAT_REGS,
   ALTIVEC_REGS,
   VSX_REGS,
-  DM_REGS,
   VRSAVE_REGS,
   VSCR_REGS,
   GEN_OR_FLOAT_REGS,
@@ -1132,7 +1119,6 @@ enum reg_class
   "FLOAT_REGS",								\
   "ALTIVEC_REGS",							\
   "VSX_REGS",								\
-  "DM_REGS",								\
   "VRSAVE_REGS",							\
   "VSCR_REGS",								\
   "GEN_OR_FLOAT_REGS",							\
@@ -1167,8 +1153,6 @@ enum reg_class
   { 0x00000000, 0x00000000, 0xffffffff, 0x00000000 },			\
   /* VSX_REGS.  */							\
   { 0x00000000, 0xffffffff, 0xffffffff, 0x00000000 },			\
-  /* DM_REGS.  */							\
-  { 0x00000000, 0x00000000, 0x00000000, 0x007f8000 },			\
   /* VRSAVE_REGS.  */							\
   { 0x00000000, 0x00000000, 0x00000000, 0x00001000 },			\
   /* VSCR_REGS.  */							\
@@ -1196,7 +1180,7 @@ enum reg_class
   /* CA_REGS.  */							\
   { 0x00000000, 0x00000000, 0x00000000, 0x00000004 },			\
   /* ALL_REGS.  */							\
-  { 0xffffffff, 0xffffffff, 0xffffffff, 0x007fffff }			\
+  { 0xffffffff, 0xffffffff, 0xffffffff, 0x00007fff }			\
 }
 
 /* The same information, inverted:
@@ -2093,16 +2077,7 @@ extern char rs6000_reg_names[][8];	/* register names (0 vs. %r0).  */
   &rs6000_reg_names[108][0],	/* vrsave  */				\
   &rs6000_reg_names[109][0],	/* vscr  */				\
 									\
-  &rs6000_reg_names[110][0],	/* sfp  */				\
-									\
-  &rs6000_reg_names[111][0],	/* dmr0  */				\
-  &rs6000_reg_names[112][0],	/* dmr1  */				\
-  &rs6000_reg_names[113][0],	/* dmr2  */				\
-  &rs6000_reg_names[114][0],	/* dmr3  */				\
-  &rs6000_reg_names[115][0],	/* dmr4  */				\
-  &rs6000_reg_names[116][0],	/* dmr5  */				\
-  &rs6000_reg_names[117][0],	/* dmr6  */				\
-  &rs6000_reg_names[118][0],	/* dmr7  */				\
+  &rs6000_reg_names[110][0]	/* sfp  */				\
 }
 
 /* Table of additional register names to use in user input.  */
@@ -2156,8 +2131,6 @@ extern char rs6000_reg_names[][8];	/* register names (0 vs. %r0).  */
   {"vs52", 84}, {"vs53", 85}, {"vs54", 86}, {"vs55", 87},	\
   {"vs56", 88}, {"vs57", 89}, {"vs58", 90}, {"vs59", 91},	\
   {"vs60", 92}, {"vs61", 93}, {"vs62", 94}, {"vs63", 95},	\
-  {"dmr0", 111}, {"dmr1", 112}, {"dmr2", 113}, {"dmr3", 114},	\
-  {"dmr4", 115}, {"dmr5", 116}, {"dmr6", 117}, {"dmr7", 118},	\
 }
 
 /* This is how to output an element of a case-vector that is relative.  */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 709a75cb542..25fcef7a4c7 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -51,8 +51,6 @@
    (VRSAVE_REGNO		108)
    (VSCR_REGNO			109)
    (FRAME_POINTER_REGNUM	110)
-   (FIRST_DMR_REGNO		111)
-   (LAST_DMR_REGNO		118)
   ])
 
 ;;
@@ -356,7 +354,7 @@
   (const (symbol_ref "(enum attr_cpu) rs6000_tune")))
 
 ;; The ISA we implement.
-(define_attr "isa" "any,p5,p6,p7,p7v,p8v,p9,p9v,p9kf,p9tf,p10,dm,not_dm"
+(define_attr "isa" "any,p5,p6,p7,p7v,p8v,p9,p9v,p9kf,p9tf,p10"
   (const_string "any"))
 
 ;; Is this alternative enabled for the current CPU/ISA/etc.?
@@ -404,14 +402,6 @@
      (and (eq_attr "isa" "p10")
 	  (match_test "TARGET_POWER10"))
      (const_int 1)
-
-     (and (eq_attr "isa" "dm")
-	  (match_test "TARGET_DENSE_MATH"))
-     (const_int 1)
-
-     (and (eq_attr "isa" "not_dm")
-	  (match_test "!TARGET_DENSE_MATH"))
-     (const_int 1)
     ] (const_int 0)))
 
 ;; If this instruction is microcoded on the CELL processor
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 633a8eca130..b63a5d443af 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -620,10 +620,6 @@ mieee128-constant
 Target Var(TARGET_IEEE128_CONSTANT) Init(1) Save
 Generate (do not generate) code that uses the LXVKQ instruction.
 
-mdense-math
-Target Mask(DENSE_MATH) Var(rs6000_isa_flags)
-Generate (do not generate) dense math instructions.
-
 ; Documented parameters
 
 -param=rs6000-vect-unroll-limit=

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-27  3:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27  3:51 [gcc(refs/users/meissner/heads/dmf002)] Revert patch Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).