public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-15 18:43 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-15 18:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:646e2e9bb56adf101680da2b13f9dd6e2d46d75b

commit 646e2e9bb56adf101680da2b13f9dd6e2d46d75b
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Nov 15 13:42:53 2022 -0500

    Revert patch.
    
    Add parameter for memcpy inline code moves
    
    2022-11-15   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000.opt (rs6000-memcpy-inline-bytes): New parameter,
            set to 0.
            * config/rs6000/rs6000-string.cc (expand_block_move): Only do
            optimization if rs6000-memcpy-inline-bytes is 16.

Diff:
---
 gcc/config/rs6000/rs6000-string.cc | 1 -
 gcc/config/rs6000/rs6000.opt       | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 1fa2d1fe553..2468e375781 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -2766,7 +2766,6 @@ expand_block_move (rtx operands[], bool might_overlap)
   if (! constp)
     {
       if (TARGET_BLOCK_OPS_UNALIGNED_VSX && TARGET_P9_VECTOR && TARGET_64BIT
-	  && rs6000_memcpy_inline_bytes == 16
 	  && !optimize_size)
 	{
 	  rtx join_label = gen_label_rtx ();
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 90dc91a277f..6872d359952 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -687,8 +687,3 @@ default value is 4.
 Target Undocumented Joined UInteger Var(rs6000_vect_unroll_reduc_threshold) Init(1) Param
 When reduction factor computed for a loop exceeds the threshold specified by
 this parameter, prefer to unroll this loop.  The default value is 1.
-
--param=rs6000-memcpy-inline-bytes=
-Target Undocumented Joined UInteger Var(rs6000_memcpy_inline_bytes) Init(0) Param
-Maximum number of bytes to move with inline code before calling the memcpy
-library function.  The default value is 0.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-17 22:08 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-17 22:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2e627fa8146109d3b572ab63633d796dd1bd16a0

commit 2e627fa8146109d3b572ab63633d796dd1bd16a0
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Nov 17 17:07:12 2022 -0500

    Revert patch.
    
    2022-11-17   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000-protos.h (expand_block_set): Add declaration.
            * config/rs6000/rs6000-string.cc (expand_block_set): New support for
            optimizing variable sized memsets.
            * config/rs6000/rs6000.md (setmem<mode>): Add setmemdi along with
            setmemsi.  Add support for optimizing memsets of other bytes than just
            0.  Add support for using stxvl to support variable sized sets.
            * config/rs6000/rs6000.opt (--param rs6000-memcpy-inline-bytes): Make
            the default 16, not 32.
            (--param rs6000-memset-inline-bytes): New parameter.
            * ChangeLog.meissner: Revert changes.

Diff:
---
 gcc/ChangeLog.meissner             | 18 +-------
 gcc/config/rs6000/rs6000-protos.h  |  1 -
 gcc/config/rs6000/rs6000-string.cc | 87 --------------------------------------
 gcc/config/rs6000/rs6000.md        | 16 ++++---
 gcc/config/rs6000/rs6000.opt       |  9 +---
 5 files changed, 13 insertions(+), 118 deletions(-)

diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner
index 3186721cb64..69ae5984bd9 100644
--- a/gcc/ChangeLog.meissner
+++ b/gcc/ChangeLog.meissner
@@ -1,20 +1,4 @@
-==================== Dmf004 branch, patch #28.
-
-Add suuport to use stxvl for variable sized memsets.
-
-2022-11-17   Michael Meissner  <meissner@linux.ibm.com>
-
-gcc/
-
-	* config/rs6000/rs6000-protos.h (expand_block_set): Add declaration.
-	* config/rs6000/rs6000-string.cc (expand_block_set): New support for
-	optimizing variable sized memsets.
-	* config/rs6000/rs6000.md (setmem<mode>): Add setmemdi along with
-	setmemsi.  Add support for optimizing memsets of other bytes than just
-	0.  Add support for using stxvl to support variable sized sets.
-	* config/rs6000/rs6000.opt (--param rs6000-memcpy-inline-bytes): Make
-	the default 16, not 32.
-	((--param rs6000-memset-inline-bytes): New parameter.
+==================== Dmf004 branch, patch #28 was reverted.
 
 ==================== Dmf004 branch, patch #27.
 
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 07f0759e19c..d0d89320ef6 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -69,7 +69,6 @@ extern void rs6000_generate_float2_code (bool, rtx, rtx, rtx);
 extern void rs6000_generate_float2_double_code (rtx, rtx, rtx);
 extern void rs6000_generate_vsigned2_code (bool, rtx, rtx, rtx);
 extern int expand_block_clear (rtx[]);
-extern int expand_block_set (rtx[]);
 extern int expand_block_move (rtx[], bool);
 extern bool expand_block_compare (rtx[]);
 extern bool expand_strn_compare (rtx[], int);
diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 4649993cf1a..ee17ddb87e1 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -39,11 +39,6 @@
 #include "predict.h"
 #include "optabs.h"
 
-/* Forward reference.  */
-static void do_ifelse (machine_mode cmpmode, rtx_code comparison,
-		       rtx a, rtx b, rtx cr, rtx true_label,
-		       profile_probability br_prob);
-
 /* Expand a block clear operation, and return 1 if successful.  Return 0
    if we should let the compiler generate normal code.
 
@@ -153,88 +148,6 @@ expand_block_clear (rtx operands[])
   return 1;
 }
 
-/* Expand a block set operation, and return 1 if successful.  Return 0
-   if we should let the compiler generate normal code.
-
-   operands[0] is the destination
-   operands[1] is the length
-   operands[2] is the value to set memory to (normally 0)
-   operands[3] is the alignment */
-
-int
-expand_block_set (rtx operands[])
-{
-  rtx bytes_rtx	= operands[1];
-  rtx set_byte = operands[2];
-  bool constp = CONST_INT_P (bytes_rtx);
-
-  /* At the moment, only handle setting memory to a constant.  */
-  if (!CONST_INT_P (set_byte)
-      || !IN_RANGE (INTVAL (set_byte), -127, 255))
-    return 0;
-
-  /* If we are storing to a memory region with a variable size, see if we have
-     the necessary support for store vector with length, and we want to do the
-     optimization.  Fall back to using the clear memory support if we don't
-     want to use stxvl using an inline test.  */
-  if (constp
-      || !TARGET_BLOCK_OPS_UNALIGNED_VSX
-      || !TARGET_P9_VECTOR
-      || !TARGET_64BIT
-      || rs6000_memset_inline_bytes == 0
-      || !param_vect_partial_vector_usage
-      || !optimize
-      || optimize_size)
-    {
-      if (set_byte == const0_rtx)
-	return expand_block_clear (operands);
-
-      return 0;
-    }
-
-  rtx dest_addr = force_reg (Pmode, XEXP (operands[0], 0));
-  int vect_size_int = (rs6000_memset_inline_bytes >= GET_MODE_SIZE (V16QImode)
-		       ? GET_MODE_SIZE (V16QImode)
-		       : rs6000_memset_inline_bytes);
-
-  rtx vect_size = GEN_INT (vect_size_int);
-  rtx var_cr = gen_reg_rtx (CCUNSmode);
-  emit_insn (gen_rtx_SET (var_cr,
-			  gen_rtx_COMPARE (CCUNSmode, bytes_rtx, vect_size)));
-				  
-  rtx var_label = gen_label_rtx ();
-  do_ifelse (CCUNSmode, LEU, NULL_RTX, NULL_RTX, var_cr, var_label,
-	     profile_probability::likely ());
-
-  /* Call memset if the size is too large.  */
-  tree fun = builtin_decl_explicit (BUILT_IN_MEMSET);
-  emit_library_call_value (XEXP (DECL_RTL (fun), 0),
-			   NULL_RTX, LCT_NORMAL, Pmode,
-			   dest_addr, Pmode,
-			   set_byte, SImode,
-			   bytes_rtx, Pmode);
-
-  rtx join_label = gen_label_rtx ();
-  rtx join_ref = gen_rtx_LABEL_REF (VOIDmode, join_label);
-  emit_jump_insn (gen_rtx_SET (pc_rtx, join_ref));
-  emit_barrier ();
-
-  emit_label (var_label);
-
-  if (IN_RANGE (INTVAL (set_byte), 128, 255))
-    set_byte = GEN_INT (((INTVAL (set_byte) & 0xff) ^ 0x80) - 0x80);
-
-  /* Create the vector with the bytes splatted.  */
-  rtx vreg = gen_reg_rtx (V16QImode);
-  emit_insn (gen_xxspltib_v16qi (vreg, set_byte));
-
-  /* We want to set bytes inline.  Set 0..16 bytes now.  */
-  emit_insn (gen_stxvl (vreg, dest_addr, bytes_rtx));
-
-  emit_label (join_label);
-  return 1;
-}
-
 /* Figure out the correct instructions to generate to load data for
    block compare.  MODE is used for the read from memory, and
    data is zero extended if REG is wider than MODE.  If LE code
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 6d9d08c6172..12bae0d32a7 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9790,14 +9790,18 @@
   DONE;
 })
 \f
-(define_expand "setmem<mode>"
-  [(use (match_operand:BLK 0 ""))
-   (use (match_operand:GPR 1 ""))
-   (use (match_operand:SI 2 ""))
-   (use (match_operand:SI 3 ""))]
+(define_expand "setmemsi"
+  [(parallel [(set (match_operand:BLK 0 "")
+		   (match_operand 2 "const_int_operand"))
+	      (use (match_operand:SI 1 ""))
+	      (use (match_operand:SI 3 ""))])]
   ""
 {
-  if (expand_block_set (operands))
+  /* If value to set is not zero, use the library routine.  */
+  if (operands[2] != const0_rtx)
+    FAIL;
+
+  if (expand_block_clear (operands))
     DONE;
   else
     FAIL;
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 30641de5ac3..602930063cd 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -689,11 +689,6 @@ When reduction factor computed for a loop exceeds the threshold specified by
 this parameter, prefer to unroll this loop.  The default value is 1.
 
 -param=rs6000-memcpy-inline-bytes=
-Target Undocumented Joined UInteger Var(rs6000_memcpy_inline_bytes) Init(16) Param
+Target Undocumented Joined UInteger Var(rs6000_memcpy_inline_bytes) Init(32) Param
 Maximum number of bytes to move with inline code before calling the memcpy
-library function.  The default value is 16.
-
--param=rs6000-memset-inline-bytes=
-Target Undocumented Joined UInteger Var(rs6000_memset_inline_bytes) Init(16) Param
-Maximum number of bytes to move with inline code before calling the memset
-library function.  The default value is 16.
+library function.  The default value is 32.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-17 21:54 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-17 21:54 UTC (permalink / raw)
  To: gcc-cvs

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

commit b71fb0208a4535709c1621b0e4780ffc3919203d
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Nov 15 13:42:53 2022 -0500

    Revert patch.
    
    Add parameter for memcpy inline code moves
    
    2022-11-15   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000.opt (rs6000-memcpy-inline-bytes): New parameter,
            set to 0.
            * config/rs6000/rs6000-string.cc (expand_block_move): Only do
            optimization if rs6000-memcpy-inline-bytes is 16.

Diff:
---
 gcc/config/rs6000/rs6000-string.cc | 1 -
 gcc/config/rs6000/rs6000.opt       | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 1fa2d1fe553..2468e375781 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -2766,7 +2766,6 @@ expand_block_move (rtx operands[], bool might_overlap)
   if (! constp)
     {
       if (TARGET_BLOCK_OPS_UNALIGNED_VSX && TARGET_P9_VECTOR && TARGET_64BIT
-	  && rs6000_memcpy_inline_bytes == 16
 	  && !optimize_size)
 	{
 	  rtx join_label = gen_label_rtx ();
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 90dc91a277f..6872d359952 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -687,8 +687,3 @@ default value is 4.
 Target Undocumented Joined UInteger Var(rs6000_vect_unroll_reduc_threshold) Init(1) Param
 When reduction factor computed for a loop exceeds the threshold specified by
 this parameter, prefer to unroll this loop.  The default value is 1.
-
--param=rs6000-memcpy-inline-bytes=
-Target Undocumented Joined UInteger Var(rs6000_memcpy_inline_bytes) Init(0) Param
-Maximum number of bytes to move with inline code before calling the memcpy
-library function.  The default value is 0.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-17 21:54 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-17 21:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:82d4df0e7d2b7c125084be757aa233b599bd761b

commit 82d4df0e7d2b7c125084be757aa233b599bd761b
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Mon Nov 14 20:52:10 2022 -0500

    Revert patch.
    
    2022-11-14   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000-string.cc (expand_block_move): Add support for
            using lxvl and stxvl to move up to 16 bytes inline without calling
            memcpy.
            * config/rs6000/rs6000.md (cpymem<mode>): Expand cpymemsi to also
            provide cpymemdi to handle DImode sizes as well as SImode sizes.
            (movmem<mode>): Expand movmemsi to also provide movmemdi to handle
            DImode sizes as well as SImode sizes.

Diff:
---
 gcc/config/rs6000/rs6000-string.cc | 49 ++------------------------------------
 gcc/config/rs6000/rs6000.md        | 12 +++++-----
 2 files changed, 8 insertions(+), 53 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 596fbc634f4..cd8ee8c2f7e 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -2760,54 +2760,9 @@ expand_block_move (rtx operands[], bool might_overlap)
   rtx stores[MAX_MOVE_REG];
   int num_reg = 0;
 
-  /* If this is not a fixed size move, see if we can use load/store vector with
-     length to handle multiple bytes. Don't do the optimization if -Os.
-     Otherwise, just call memcpy.  */
+  /* If this is not a fixed size move, just call memcpy */
   if (! constp)
-    {
-      if (TARGET_BLOCK_OPS_UNALIGNED_VSX && TARGET_P9_VECTOR && TARGET_64BIT
-	  && !optimize_size)
-	{
-	  rtx join_label = gen_label_rtx ();
-	  rtx inline_label = gen_label_rtx ();
-	  rtx dest_addr = copy_addr_to_reg (XEXP (orig_dest, 0));
-	  rtx src_addr = copy_addr_to_reg (XEXP (orig_src, 0));
-
-	  /* Call memcpy if the size is too large.  */
-	  bytes_rtx = force_reg (Pmode, bytes_rtx);
-	  rtx cr = gen_reg_rtx (CCUNSmode);
-	  rtx max_size = GEN_INT (16);
-	  emit_insn (gen_rtx_SET (cr,
-				  gen_rtx_COMPARE (CCUNSmode, bytes_rtx,
-						   max_size)));
-				  
-	  do_ifelse (CCUNSmode, LEU, NULL_RTX, NULL_RTX, cr,
-		     inline_label, profile_probability::likely ());
-
-	  tree fun = builtin_decl_explicit (BUILT_IN_MEMCPY);
-	  emit_library_call_value (XEXP (DECL_RTL (fun), 0),
-				   NULL_RTX, LCT_NORMAL, Pmode,
-				   dest_addr, Pmode,
-				   src_addr, Pmode,
-				   bytes_rtx, Pmode);
-
-	  rtx join_ref = gen_rtx_LABEL_REF (VOIDmode, join_label);
-	  emit_jump_insn (gen_rtx_SET (pc_rtx, join_ref));
-	  emit_barrier ();
-
-	  emit_label (inline_label);
-
-	  /* Move the final 0..16 bytes.  */
-	  rtx vreg = gen_reg_rtx (V16QImode);
-	  emit_insn (gen_lxvl (vreg, src_addr, bytes_rtx));
-	  emit_insn (gen_stxvl (vreg, dest_addr, bytes_rtx));
-
-	  emit_label (join_label);
-	  return 1;
-	}
-
-      return 0;
-    }
+    return 0;
 
   /* This must be a fixed size alignment */
   gcc_assert (CONST_INT_P (align_rtx));
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 12bae0d32a7..e9dfb138603 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9880,11 +9880,11 @@
 ;; Argument 2 is the length
 ;; Argument 3 is the alignment
 
-(define_expand "cpymem<mode>"
+(define_expand "cpymemsi"
   [(parallel [(set (match_operand:BLK 0 "")
 		   (match_operand:BLK 1 ""))
-	      (use (match_operand:GPR 2 ""))
-	      (use (match_operand:GPR 3 ""))])]
+	      (use (match_operand:SI 2 ""))
+	      (use (match_operand:SI 3 ""))])]
   ""
 {
   if (expand_block_move (operands, false))
@@ -9899,11 +9899,11 @@
 ;; Argument 2 is the length
 ;; Argument 3 is the alignment
 
-(define_expand "movmem<mode>"
+(define_expand "movmemsi"
   [(parallel [(set (match_operand:BLK 0 "")
 		   (match_operand:BLK 1 ""))
-	      (use (match_operand:GPR 2 ""))
-	      (use (match_operand:GPR 3 ""))])]
+	      (use (match_operand:SI 2 ""))
+	      (use (match_operand:SI 3 ""))])]
   ""
 {
   if (expand_block_move (operands, true))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-17 21:53 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-17 21:53 UTC (permalink / raw)
  To: gcc-cvs

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

commit f45ec6b2655049183a16399a42f27ed5da9febb3
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Nov 11 19:41:36 2022 -0500

    Revert patch.
    
    2022-11-11   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000-builtin.cc (rs6000_invalid_builtin): Add support
            for flagging invalid use of future built-in functions.
            (rs6000_builtin_is_supported): Add support for future built-in
            functions.
            * config/rs6000/rs6000-builtins.def (__builtin_saturate_subtract32): New
            built-in function for -mcpu=future.
            (__builtin_saturate_subtract64): Likewise.
            * config/rs6000/rs6000-gen-builtins.cc (enum bif_stanza): Add stanzas
            for -mcpu=future built-ins.
            (stanza_map): Likewise.
            (enable_string): Likewise.
            (struct attrinfo): Likewise.
            (parse_bif_attrs): Likewise.
            (write_decls): Likewise.
            * config/rs6000/rs6000.md (sat_sub<mode>3): Add saturating subtract
            built-in insn declarations.
            (sat_sub<mode>3_dot): Likewise.
            (sat_sub<mode>3_dot2): Likewise.
    
    gcc/testsuite/
    
            * gcc.target/powerpc/subfus-1.c: New test.
            * gcc.target/powerpc/subfus-2.c: Likewise.
            * lib/target-supports.exp (check_effective_target_powerpc_subfus_ok):
            New effective target.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc         | 17 --------
 gcc/config/rs6000/rs6000-builtins.def       | 11 ------
 gcc/config/rs6000/rs6000-gen-builtins.cc    | 35 +++--------------
 gcc/config/rs6000/rs6000.md                 | 60 -----------------------------
 gcc/testsuite/gcc.target/powerpc/subfus-1.c | 31 ---------------
 gcc/testsuite/gcc.target/powerpc/subfus-2.c | 31 ---------------
 gcc/testsuite/lib/target-supports.exp       | 16 --------
 7 files changed, 5 insertions(+), 196 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index 1ac00e4b26c..f4eba184db8 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -139,17 +139,6 @@ rs6000_invalid_builtin (enum rs6000_gen_builtins fncode)
     case ENB_MMA:
       error ("%qs requires the %qs option", name, "-mmma");
       break;
-    case ENB_FUTURE:
-      error ("%qs requires the %qs option", name, "-mcpu=future");
-      break;
-    case ENB_FUTURE_64:
-      error ("%qs requires the %qs option and either the %qs or %qs option",
-	     name, "-mcpu=future", "-m64", "-mpowerpc64");
-      break;
-    case ENB_DM:
-      error ("%qs requires the %qs or %qs options", name, "-mcpu=future",
-	     "-mdense-math");
-      break;
     default:
     case ENB_ALWAYS:
       gcc_unreachable ();
@@ -205,12 +194,6 @@ rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode)
       return TARGET_HTM;
     case ENB_MMA:
       return TARGET_MMA;
-    case ENB_FUTURE:
-      return TARGET_FUTURE;
-    case ENB_FUTURE_64:
-      return TARGET_FUTURE && TARGET_POWERPC64;
-    case ENB_DM:
-      return TARGET_DENSE_MATH;
     default:
       gcc_unreachable ();
     }
diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index ee141c1d99e..f76f54793d7 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -139,8 +139,6 @@
 ;   endian   Needs special handling for endianness
 ;   ibmld    Restrict usage to the case when TFmode is IBM-128
 ;   ibm128   Restrict usage to the case where __ibm128 is supported or if ibmld
-;   future   Restrict usage to future instructions
-;   dm       Restrict usage to dense math
 ;
 ; Each attribute corresponds to extra processing required when
 ; the built-in is expanded.  All such special processing should
@@ -4110,12 +4108,3 @@
 
   void __builtin_vsx_stxvp (v256, unsigned long, const v256 *);
     STXVP nothing {mma,pair}
-
-[future]
-  const signed int __builtin_saturate_subtract32 (signed int, signed int);
-  SAT_SUBSI sat_subsi3 {}
-
-[future-64]
-  const signed long __builtin_saturate_subtract64 (signed long, signed long);
-  SAT_SUBDI sat_subdi3 {}
-
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.cc b/gcc/config/rs6000/rs6000-gen-builtins.cc
index f4020141243..0bd7a535e5f 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.cc
+++ b/gcc/config/rs6000/rs6000-gen-builtins.cc
@@ -233,9 +233,6 @@ enum bif_stanza
  BSTZ_P10,
  BSTZ_P10_64,
  BSTZ_MMA,
- BSTZ_FUTURE,
- BSTZ_FUTURE_64,
- BSTZ_DM,
  NUMBIFSTANZAS
 };
 
@@ -269,10 +266,7 @@ static stanza_entry stanza_map[NUMBIFSTANZAS] =
     { "htm",		BSTZ_HTM	},
     { "power10",	BSTZ_P10	},
     { "power10-64",	BSTZ_P10_64	},
-    { "mma",		BSTZ_MMA	},
-    { "future",		BSTZ_FUTURE	},
-    { "future-64",	BSTZ_FUTURE_64	},
-    { "dm",		BSTZ_DM		},
+    { "mma",		BSTZ_MMA	}
   };
 
 static const char *enable_string[NUMBIFSTANZAS] =
@@ -297,10 +291,7 @@ static const char *enable_string[NUMBIFSTANZAS] =
     "ENB_HTM",
     "ENB_P10",
     "ENB_P10_64",
-    "ENB_MMA",
-    "ENB_FUTURE",
-    "ENB_FUTURE_64",
-    "ENB_DM",
+    "ENB_MMA"
   };
 
 /* Function modifiers provide special handling for const, pure, and fpmath
@@ -404,8 +395,6 @@ struct attrinfo
   bool isendian;
   bool isibmld;
   bool isibm128;
-  bool isfuture;
-  bool isdm;
 };
 
 /* Fields associated with a function prototype (bif or overload).  */
@@ -1488,8 +1477,7 @@ parse_bif_attrs (attrinfo *attrptr)
 	"ldvec = %d, stvec = %d, reve = %d, pred = %d, htm = %d, "
 	"htmspr = %d, htmcr = %d, mma = %d, quad = %d, pair = %d, "
 	"mmaint = %d, no32bit = %d, 32bit = %d, cpu = %d, ldstmask = %d, "
-	"lxvrse = %d, lxvrze = %d, endian = %d, ibmdld = %d, ibm128 = %d,",
-	"future = %d, dm = %d.\n",
+	"lxvrse = %d, lxvrze = %d, endian = %d, ibmdld = %d, ibm128 = %d.\n",
 	attrptr->isinit, attrptr->isset, attrptr->isextract,
 	attrptr->isnosoft, attrptr->isldvec, attrptr->isstvec,
 	attrptr->isreve, attrptr->ispred, attrptr->ishtm, attrptr->ishtmspr,
@@ -1497,7 +1485,7 @@ parse_bif_attrs (attrinfo *attrptr)
 	attrptr->ismmaint, attrptr->isno32bit, attrptr->is32bit,
 	attrptr->iscpu, attrptr->isldstmask, attrptr->islxvrse,
 	attrptr->islxvrze, attrptr->isendian, attrptr->isibmld,
-	attrptr->isibm128, attrptr->isfuture, attrptr->isdm);
+	attrptr->isibm128);
 #endif
 
   return PC_OK;
@@ -2269,10 +2257,7 @@ write_decls (void)
   fprintf (header_file, "  ENB_HTM,\n");
   fprintf (header_file, "  ENB_P10,\n");
   fprintf (header_file, "  ENB_P10_64,\n");
-  fprintf (header_file, "  ENB_MMA,\n");
-  fprintf (header_file, "  ENB_FUTURE,\n");
-  fprintf (header_file, "  ENB_FUTURE_64,\n");
-  fprintf (header_file, "  ENB_DM\n");
+  fprintf (header_file, "  ENB_MMA\n");
   fprintf (header_file, "};\n\n");
 
   fprintf (header_file, "#define PPC_MAXRESTROPNDS 3\n");
@@ -2316,8 +2301,6 @@ write_decls (void)
   fprintf (header_file, "#define bif_endian_bit\t\t(0x00200000)\n");
   fprintf (header_file, "#define bif_ibmld_bit\t\t(0x00400000)\n");
   fprintf (header_file, "#define bif_ibm128_bit\t\t(0x00800000)\n");
-  fprintf (header_file, "#define bif_future_bit\t\t(0x01000000)\n");
-  fprintf (header_file, "#define bif_dm_bit\t\t(0x02000000)\n");
   fprintf (header_file, "\n");
   fprintf (header_file,
 	   "#define bif_is_init(x)\t\t((x).bifattrs & bif_init_bit)\n");
@@ -2367,10 +2350,6 @@ write_decls (void)
 	   "#define bif_is_ibmld(x)\t((x).bifattrs & bif_ibmld_bit)\n");
   fprintf (header_file,
 	   "#define bif_is_ibm128(x)\t((x).bifattrs & bif_ibm128_bit)\n");
-  fprintf (header_file,
-	   "#define bif_is_future(x)\t((x).bifattrs & bif_future_bit)\n");
-  fprintf (header_file,
-	   "#define bif_is_dm(x)\t((x).bifattrs & bif_dm_bit)\n");
   fprintf (header_file, "\n");
 
   fprintf (header_file,
@@ -2569,10 +2548,6 @@ write_bif_static_init (void)
 	fprintf (init_file, " | bif_ibmld_bit");
       if (bifp->attrs.isibm128)
 	fprintf (init_file, " | bif_ibm128_bit");
-      if (bifp->attrs.isfuture)
-	fprintf (init_file, " | bif_future_bit");
-      if (bifp->attrs.isdm)
-	fprintf (init_file, " | bif_dm_bit");
       fprintf (init_file, ",\n");
       fprintf (init_file, "      /* restr_opnd */\t{%d, %d, %d},\n",
 	       bifp->proto.restr_opnd[0], bifp->proto.restr_opnd[1],
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index e9dfb138603..4a5007dc539 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -15499,66 +15499,6 @@
 }
   [(set_attr "type" "load")])
 \f
-;; Signed saturation.
-
-;; The subfus instruction is defined as: SUBFUS RT,L,RA,RB.  The extended
-;; mnemonic that we use (subdus and subwus) has the arguments RA and RB
-;; reversed (so it becomes a subtract instead of subtract from).
-
-(define_insn "sat_sub<mode>3"
-  [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
-	(ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")
-		      (match_operand:GPR 2 "gpc_reg_operand" "r")))]
-  "TARGET_FUTURE"
-  "sub<wd>us %0,%1,%2"
-  [(set_attr "type" "add")])
-
-(define_insn_and_split "*sat_sub<mode>3_dot"
-  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
-	(compare:CC (ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")
-				  (match_operand:GPR 2 "gpc_reg_operand" "r,r"))
-		    (const_int 0)))
-   (clobber (match_scratch:GPR 0 "=r,r"))]
-  "TARGET_FUTURE"
-  "@
-   sub<wd>us. %0,%1,%2
-   #"
-  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
-  [(set (match_dup 0)
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))
-   (set (match_dup 3)
-	(compare:CC (match_dup 0)
-		    (const_int 0)))]
-  ""
-  [(set_attr "type" "add")
-   (set_attr "dot" "yes")
-   (set_attr "length" "4,8")])
-
-(define_insn_and_split "*sat_sub<mode>3_dot2"
-  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
-	(compare:CC (ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")
-				  (match_operand:GPR 2 "gpc_reg_operand" "r,r"))
-		    (const_int 0)))
-   (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))]
-  "TARGET_FUTURE"
-  "@
-   sub<wd>us. %0,%1,%2
-   #"
-  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
-  [(set (match_dup 0)
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))
-   (set (match_dup 3)
-	(compare:CC (match_dup 0)
-		    (const_int 0)))]
-  ""
-  [(set_attr "type" "add")
-   (set_attr "dot" "yes")
-   (set_attr "length" "4,8")])
-\f
 
 (include "sync.md")
 (include "vector.md")
diff --git a/gcc/testsuite/gcc.target/powerpc/subfus-1.c b/gcc/testsuite/gcc.target/powerpc/subfus-1.c
deleted file mode 100644
index dd2cde47570..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/subfus-1.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_subfus_ok } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
-
-/* Test whether the saturating subtract built-in generates subwus for 32-bit
-   subtracts.  */
-
-int do_sat_int  (int  a, int  b)
-{
-  return __builtin_saturate_subtract32 (a, b);		/* subwus  */
-}
-
-int do_sat_int_dot  (int  a, int  b, int  *p)
-{
-  int  r = __builtin_saturate_subtract32 (a, b);	/* subwus.  */
-  if (r == 0)
-    *p = 0;
-  return r;
-}
-
-void do_sat_int_dot2  (int  a, int  b, int  *p, int *q)
-{
-  if (__builtin_saturate_subtract32 (a, b))		/* subwus.  */
-    *p = 0;
-  *q = a + b;
-  return;
-}
-
-/* { dg-final { scan-assembler-times {\msubwus\M}    1 } } */
-/* { dg-final { scan-assembler-times {\msubwus[.]\M} 2 } } */
-/* { dg-final { scan-assembler-not   {\msubf\M}        } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/subfus-2.c b/gcc/testsuite/gcc.target/powerpc/subfus-2.c
deleted file mode 100644
index c9511fe22cd..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/subfus-2.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-do compile { target lp64 } } */
-/* { dg-require-effective-target powerpc_subfus_ok } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
-
-/* Test whether the saturating subtract built-in generates subwus for 64-bit
-   subtracts.  */
-
-long do_sat_long  (long  a, long  b)
-{
-  return __builtin_saturate_subtract64 (a, b);		/* subwus  */
-}
-
-long do_sat_long_dot  (long  a, long  b, long  *p)
-{
-  long  r = __builtin_saturate_subtract64 (a, b);	/* subwus.  */
-  if (r == 0)
-    *p = 0;
-  return r;
-}
-
-void do_sat_long_dot2  (long  a, long  b, long  *p, long *q)
-{
-  if (__builtin_saturate_subtract64 (a, b))		/* subwus.  */
-    *p = 0;
-  *q = a + b;
-  return;
-}
-
-/* { dg-final { scan-assembler-times {\msubdus\M}    1 } } */
-/* { dg-final { scan-assembler-times {\msubdus[.]\M} 2 } } */
-/* { dg-final { scan-assembler-not   {\msubf\M}        } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8af840d1d3b..b70ebf963f9 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6553,22 +6553,6 @@ proc check_effective_target_powerpc_dense_math_ok { } {
 	} "-mcpu=future"]
 }
 
-# Return 1 if this is a PowerPC target supporting -mcpu=future which enables
-# the saturating subtract instruction.
-proc check_effective_target_powerpc_subfus_ok { } {
-	return [check_no_compiler_messages_nocache powerpc_subfus_ok assembly {
-		int test (int a, int b)
-		{
-		#ifndef _ARCH_PWR_FUTURE
-		#error "target does not have saturating subtract support."
-		#else
-		/* Make sure we have saturating subtract support.  */
-		  return __builtin_saturate_subtract32 (a, b);
-		#endif
-		}
-	} "-mcpu=future"]
-}
-
 # Return 1 if this is a PowerPC target supporting -mfloat128 via either
 # software emulation on power7/power8 systems or hardware support on power9.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-15  1:52 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-15  1:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8610efaa3f237b45314dfeb7393b8ea8f5029523

commit 8610efaa3f237b45314dfeb7393b8ea8f5029523
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Mon Nov 14 20:52:10 2022 -0500

    Revert patch.
    
    2022-11-14   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000-string.cc (expand_block_move): Add support for
            using lxvl and stxvl to move up to 16 bytes inline without calling
            memcpy.
            * config/rs6000/rs6000.md (cpymem<mode>): Expand cpymemsi to also
            provide cpymemdi to handle DImode sizes as well as SImode sizes.
            (movmem<mode>): Expand movmemsi to also provide movmemdi to handle
            DImode sizes as well as SImode sizes.

Diff:
---
 gcc/config/rs6000/rs6000-string.cc | 49 ++------------------------------------
 gcc/config/rs6000/rs6000.md        | 12 +++++-----
 2 files changed, 8 insertions(+), 53 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 596fbc634f4..cd8ee8c2f7e 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -2760,54 +2760,9 @@ expand_block_move (rtx operands[], bool might_overlap)
   rtx stores[MAX_MOVE_REG];
   int num_reg = 0;
 
-  /* If this is not a fixed size move, see if we can use load/store vector with
-     length to handle multiple bytes. Don't do the optimization if -Os.
-     Otherwise, just call memcpy.  */
+  /* If this is not a fixed size move, just call memcpy */
   if (! constp)
-    {
-      if (TARGET_BLOCK_OPS_UNALIGNED_VSX && TARGET_P9_VECTOR && TARGET_64BIT
-	  && !optimize_size)
-	{
-	  rtx join_label = gen_label_rtx ();
-	  rtx inline_label = gen_label_rtx ();
-	  rtx dest_addr = copy_addr_to_reg (XEXP (orig_dest, 0));
-	  rtx src_addr = copy_addr_to_reg (XEXP (orig_src, 0));
-
-	  /* Call memcpy if the size is too large.  */
-	  bytes_rtx = force_reg (Pmode, bytes_rtx);
-	  rtx cr = gen_reg_rtx (CCUNSmode);
-	  rtx max_size = GEN_INT (16);
-	  emit_insn (gen_rtx_SET (cr,
-				  gen_rtx_COMPARE (CCUNSmode, bytes_rtx,
-						   max_size)));
-				  
-	  do_ifelse (CCUNSmode, LEU, NULL_RTX, NULL_RTX, cr,
-		     inline_label, profile_probability::likely ());
-
-	  tree fun = builtin_decl_explicit (BUILT_IN_MEMCPY);
-	  emit_library_call_value (XEXP (DECL_RTL (fun), 0),
-				   NULL_RTX, LCT_NORMAL, Pmode,
-				   dest_addr, Pmode,
-				   src_addr, Pmode,
-				   bytes_rtx, Pmode);
-
-	  rtx join_ref = gen_rtx_LABEL_REF (VOIDmode, join_label);
-	  emit_jump_insn (gen_rtx_SET (pc_rtx, join_ref));
-	  emit_barrier ();
-
-	  emit_label (inline_label);
-
-	  /* Move the final 0..16 bytes.  */
-	  rtx vreg = gen_reg_rtx (V16QImode);
-	  emit_insn (gen_lxvl (vreg, src_addr, bytes_rtx));
-	  emit_insn (gen_stxvl (vreg, dest_addr, bytes_rtx));
-
-	  emit_label (join_label);
-	  return 1;
-	}
-
-      return 0;
-    }
+    return 0;
 
   /* This must be a fixed size alignment */
   gcc_assert (CONST_INT_P (align_rtx));
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 12bae0d32a7..e9dfb138603 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9880,11 +9880,11 @@
 ;; Argument 2 is the length
 ;; Argument 3 is the alignment
 
-(define_expand "cpymem<mode>"
+(define_expand "cpymemsi"
   [(parallel [(set (match_operand:BLK 0 "")
 		   (match_operand:BLK 1 ""))
-	      (use (match_operand:GPR 2 ""))
-	      (use (match_operand:GPR 3 ""))])]
+	      (use (match_operand:SI 2 ""))
+	      (use (match_operand:SI 3 ""))])]
   ""
 {
   if (expand_block_move (operands, false))
@@ -9899,11 +9899,11 @@
 ;; Argument 2 is the length
 ;; Argument 3 is the alignment
 
-(define_expand "movmem<mode>"
+(define_expand "movmemsi"
   [(parallel [(set (match_operand:BLK 0 "")
 		   (match_operand:BLK 1 ""))
-	      (use (match_operand:GPR 2 ""))
-	      (use (match_operand:GPR 3 ""))])]
+	      (use (match_operand:SI 2 ""))
+	      (use (match_operand:SI 3 ""))])]
   ""
 {
   if (expand_block_move (operands, true))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gcc(refs/users/meissner/heads/dmf004)] Revert patch.
@ 2022-11-12  0:42 Michael Meissner
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Meissner @ 2022-11-12  0:42 UTC (permalink / raw)
  To: gcc-cvs

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

commit ed4345414900e0e5cbc262f98724ecf0915f882e
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Fri Nov 11 19:41:36 2022 -0500

    Revert patch.
    
    2022-11-11   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            Revert patch.
            * config/rs6000/rs6000-builtin.cc (rs6000_invalid_builtin): Add support
            for flagging invalid use of future built-in functions.
            (rs6000_builtin_is_supported): Add support for future built-in
            functions.
            * config/rs6000/rs6000-builtins.def (__builtin_saturate_subtract32): New
            built-in function for -mcpu=future.
            (__builtin_saturate_subtract64): Likewise.
            * config/rs6000/rs6000-gen-builtins.cc (enum bif_stanza): Add stanzas
            for -mcpu=future built-ins.
            (stanza_map): Likewise.
            (enable_string): Likewise.
            (struct attrinfo): Likewise.
            (parse_bif_attrs): Likewise.
            (write_decls): Likewise.
            * config/rs6000/rs6000.md (sat_sub<mode>3): Add saturating subtract
            built-in insn declarations.
            (sat_sub<mode>3_dot): Likewise.
            (sat_sub<mode>3_dot2): Likewise.
    
    gcc/testsuite/
    
            * gcc.target/powerpc/subfus-1.c: New test.
            * gcc.target/powerpc/subfus-2.c: Likewise.
            * lib/target-supports.exp (check_effective_target_powerpc_subfus_ok):
            New effective target.

Diff:
---
 gcc/config/rs6000/rs6000-builtin.cc         | 17 --------
 gcc/config/rs6000/rs6000-builtins.def       | 11 ------
 gcc/config/rs6000/rs6000-gen-builtins.cc    | 35 +++--------------
 gcc/config/rs6000/rs6000.md                 | 60 -----------------------------
 gcc/testsuite/gcc.target/powerpc/subfus-1.c | 31 ---------------
 gcc/testsuite/gcc.target/powerpc/subfus-2.c | 31 ---------------
 gcc/testsuite/lib/target-supports.exp       | 16 --------
 7 files changed, 5 insertions(+), 196 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc
index 1ac00e4b26c..f4eba184db8 100644
--- a/gcc/config/rs6000/rs6000-builtin.cc
+++ b/gcc/config/rs6000/rs6000-builtin.cc
@@ -139,17 +139,6 @@ rs6000_invalid_builtin (enum rs6000_gen_builtins fncode)
     case ENB_MMA:
       error ("%qs requires the %qs option", name, "-mmma");
       break;
-    case ENB_FUTURE:
-      error ("%qs requires the %qs option", name, "-mcpu=future");
-      break;
-    case ENB_FUTURE_64:
-      error ("%qs requires the %qs option and either the %qs or %qs option",
-	     name, "-mcpu=future", "-m64", "-mpowerpc64");
-      break;
-    case ENB_DM:
-      error ("%qs requires the %qs or %qs options", name, "-mcpu=future",
-	     "-mdense-math");
-      break;
     default:
     case ENB_ALWAYS:
       gcc_unreachable ();
@@ -205,12 +194,6 @@ rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode)
       return TARGET_HTM;
     case ENB_MMA:
       return TARGET_MMA;
-    case ENB_FUTURE:
-      return TARGET_FUTURE;
-    case ENB_FUTURE_64:
-      return TARGET_FUTURE && TARGET_POWERPC64;
-    case ENB_DM:
-      return TARGET_DENSE_MATH;
     default:
       gcc_unreachable ();
     }
diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index ee141c1d99e..f76f54793d7 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -139,8 +139,6 @@
 ;   endian   Needs special handling for endianness
 ;   ibmld    Restrict usage to the case when TFmode is IBM-128
 ;   ibm128   Restrict usage to the case where __ibm128 is supported or if ibmld
-;   future   Restrict usage to future instructions
-;   dm       Restrict usage to dense math
 ;
 ; Each attribute corresponds to extra processing required when
 ; the built-in is expanded.  All such special processing should
@@ -4110,12 +4108,3 @@
 
   void __builtin_vsx_stxvp (v256, unsigned long, const v256 *);
     STXVP nothing {mma,pair}
-
-[future]
-  const signed int __builtin_saturate_subtract32 (signed int, signed int);
-  SAT_SUBSI sat_subsi3 {}
-
-[future-64]
-  const signed long __builtin_saturate_subtract64 (signed long, signed long);
-  SAT_SUBDI sat_subdi3 {}
-
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.cc b/gcc/config/rs6000/rs6000-gen-builtins.cc
index f4020141243..0bd7a535e5f 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.cc
+++ b/gcc/config/rs6000/rs6000-gen-builtins.cc
@@ -233,9 +233,6 @@ enum bif_stanza
  BSTZ_P10,
  BSTZ_P10_64,
  BSTZ_MMA,
- BSTZ_FUTURE,
- BSTZ_FUTURE_64,
- BSTZ_DM,
  NUMBIFSTANZAS
 };
 
@@ -269,10 +266,7 @@ static stanza_entry stanza_map[NUMBIFSTANZAS] =
     { "htm",		BSTZ_HTM	},
     { "power10",	BSTZ_P10	},
     { "power10-64",	BSTZ_P10_64	},
-    { "mma",		BSTZ_MMA	},
-    { "future",		BSTZ_FUTURE	},
-    { "future-64",	BSTZ_FUTURE_64	},
-    { "dm",		BSTZ_DM		},
+    { "mma",		BSTZ_MMA	}
   };
 
 static const char *enable_string[NUMBIFSTANZAS] =
@@ -297,10 +291,7 @@ static const char *enable_string[NUMBIFSTANZAS] =
     "ENB_HTM",
     "ENB_P10",
     "ENB_P10_64",
-    "ENB_MMA",
-    "ENB_FUTURE",
-    "ENB_FUTURE_64",
-    "ENB_DM",
+    "ENB_MMA"
   };
 
 /* Function modifiers provide special handling for const, pure, and fpmath
@@ -404,8 +395,6 @@ struct attrinfo
   bool isendian;
   bool isibmld;
   bool isibm128;
-  bool isfuture;
-  bool isdm;
 };
 
 /* Fields associated with a function prototype (bif or overload).  */
@@ -1488,8 +1477,7 @@ parse_bif_attrs (attrinfo *attrptr)
 	"ldvec = %d, stvec = %d, reve = %d, pred = %d, htm = %d, "
 	"htmspr = %d, htmcr = %d, mma = %d, quad = %d, pair = %d, "
 	"mmaint = %d, no32bit = %d, 32bit = %d, cpu = %d, ldstmask = %d, "
-	"lxvrse = %d, lxvrze = %d, endian = %d, ibmdld = %d, ibm128 = %d,",
-	"future = %d, dm = %d.\n",
+	"lxvrse = %d, lxvrze = %d, endian = %d, ibmdld = %d, ibm128 = %d.\n",
 	attrptr->isinit, attrptr->isset, attrptr->isextract,
 	attrptr->isnosoft, attrptr->isldvec, attrptr->isstvec,
 	attrptr->isreve, attrptr->ispred, attrptr->ishtm, attrptr->ishtmspr,
@@ -1497,7 +1485,7 @@ parse_bif_attrs (attrinfo *attrptr)
 	attrptr->ismmaint, attrptr->isno32bit, attrptr->is32bit,
 	attrptr->iscpu, attrptr->isldstmask, attrptr->islxvrse,
 	attrptr->islxvrze, attrptr->isendian, attrptr->isibmld,
-	attrptr->isibm128, attrptr->isfuture, attrptr->isdm);
+	attrptr->isibm128);
 #endif
 
   return PC_OK;
@@ -2269,10 +2257,7 @@ write_decls (void)
   fprintf (header_file, "  ENB_HTM,\n");
   fprintf (header_file, "  ENB_P10,\n");
   fprintf (header_file, "  ENB_P10_64,\n");
-  fprintf (header_file, "  ENB_MMA,\n");
-  fprintf (header_file, "  ENB_FUTURE,\n");
-  fprintf (header_file, "  ENB_FUTURE_64,\n");
-  fprintf (header_file, "  ENB_DM\n");
+  fprintf (header_file, "  ENB_MMA\n");
   fprintf (header_file, "};\n\n");
 
   fprintf (header_file, "#define PPC_MAXRESTROPNDS 3\n");
@@ -2316,8 +2301,6 @@ write_decls (void)
   fprintf (header_file, "#define bif_endian_bit\t\t(0x00200000)\n");
   fprintf (header_file, "#define bif_ibmld_bit\t\t(0x00400000)\n");
   fprintf (header_file, "#define bif_ibm128_bit\t\t(0x00800000)\n");
-  fprintf (header_file, "#define bif_future_bit\t\t(0x01000000)\n");
-  fprintf (header_file, "#define bif_dm_bit\t\t(0x02000000)\n");
   fprintf (header_file, "\n");
   fprintf (header_file,
 	   "#define bif_is_init(x)\t\t((x).bifattrs & bif_init_bit)\n");
@@ -2367,10 +2350,6 @@ write_decls (void)
 	   "#define bif_is_ibmld(x)\t((x).bifattrs & bif_ibmld_bit)\n");
   fprintf (header_file,
 	   "#define bif_is_ibm128(x)\t((x).bifattrs & bif_ibm128_bit)\n");
-  fprintf (header_file,
-	   "#define bif_is_future(x)\t((x).bifattrs & bif_future_bit)\n");
-  fprintf (header_file,
-	   "#define bif_is_dm(x)\t((x).bifattrs & bif_dm_bit)\n");
   fprintf (header_file, "\n");
 
   fprintf (header_file,
@@ -2569,10 +2548,6 @@ write_bif_static_init (void)
 	fprintf (init_file, " | bif_ibmld_bit");
       if (bifp->attrs.isibm128)
 	fprintf (init_file, " | bif_ibm128_bit");
-      if (bifp->attrs.isfuture)
-	fprintf (init_file, " | bif_future_bit");
-      if (bifp->attrs.isdm)
-	fprintf (init_file, " | bif_dm_bit");
       fprintf (init_file, ",\n");
       fprintf (init_file, "      /* restr_opnd */\t{%d, %d, %d},\n",
 	       bifp->proto.restr_opnd[0], bifp->proto.restr_opnd[1],
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index e9dfb138603..4a5007dc539 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -15499,66 +15499,6 @@
 }
   [(set_attr "type" "load")])
 \f
-;; Signed saturation.
-
-;; The subfus instruction is defined as: SUBFUS RT,L,RA,RB.  The extended
-;; mnemonic that we use (subdus and subwus) has the arguments RA and RB
-;; reversed (so it becomes a subtract instead of subtract from).
-
-(define_insn "sat_sub<mode>3"
-  [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
-	(ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")
-		      (match_operand:GPR 2 "gpc_reg_operand" "r")))]
-  "TARGET_FUTURE"
-  "sub<wd>us %0,%1,%2"
-  [(set_attr "type" "add")])
-
-(define_insn_and_split "*sat_sub<mode>3_dot"
-  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
-	(compare:CC (ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")
-				  (match_operand:GPR 2 "gpc_reg_operand" "r,r"))
-		    (const_int 0)))
-   (clobber (match_scratch:GPR 0 "=r,r"))]
-  "TARGET_FUTURE"
-  "@
-   sub<wd>us. %0,%1,%2
-   #"
-  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
-  [(set (match_dup 0)
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))
-   (set (match_dup 3)
-	(compare:CC (match_dup 0)
-		    (const_int 0)))]
-  ""
-  [(set_attr "type" "add")
-   (set_attr "dot" "yes")
-   (set_attr "length" "4,8")])
-
-(define_insn_and_split "*sat_sub<mode>3_dot2"
-  [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
-	(compare:CC (ss_minus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")
-				  (match_operand:GPR 2 "gpc_reg_operand" "r,r"))
-		    (const_int 0)))
-   (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))]
-  "TARGET_FUTURE"
-  "@
-   sub<wd>us. %0,%1,%2
-   #"
-  "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)"
-  [(set (match_dup 0)
-	(ss_minus:GPR (match_dup 1)
-		      (match_dup 2)))
-   (set (match_dup 3)
-	(compare:CC (match_dup 0)
-		    (const_int 0)))]
-  ""
-  [(set_attr "type" "add")
-   (set_attr "dot" "yes")
-   (set_attr "length" "4,8")])
-\f
 
 (include "sync.md")
 (include "vector.md")
diff --git a/gcc/testsuite/gcc.target/powerpc/subfus-1.c b/gcc/testsuite/gcc.target/powerpc/subfus-1.c
deleted file mode 100644
index dd2cde47570..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/subfus-1.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target powerpc_subfus_ok } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
-
-/* Test whether the saturating subtract built-in generates subwus for 32-bit
-   subtracts.  */
-
-int do_sat_int  (int  a, int  b)
-{
-  return __builtin_saturate_subtract32 (a, b);		/* subwus  */
-}
-
-int do_sat_int_dot  (int  a, int  b, int  *p)
-{
-  int  r = __builtin_saturate_subtract32 (a, b);	/* subwus.  */
-  if (r == 0)
-    *p = 0;
-  return r;
-}
-
-void do_sat_int_dot2  (int  a, int  b, int  *p, int *q)
-{
-  if (__builtin_saturate_subtract32 (a, b))		/* subwus.  */
-    *p = 0;
-  *q = a + b;
-  return;
-}
-
-/* { dg-final { scan-assembler-times {\msubwus\M}    1 } } */
-/* { dg-final { scan-assembler-times {\msubwus[.]\M} 2 } } */
-/* { dg-final { scan-assembler-not   {\msubf\M}        } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/subfus-2.c b/gcc/testsuite/gcc.target/powerpc/subfus-2.c
deleted file mode 100644
index c9511fe22cd..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/subfus-2.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-do compile { target lp64 } } */
-/* { dg-require-effective-target powerpc_subfus_ok } */
-/* { dg-options "-mdejagnu-cpu=future -O2" } */
-
-/* Test whether the saturating subtract built-in generates subwus for 64-bit
-   subtracts.  */
-
-long do_sat_long  (long  a, long  b)
-{
-  return __builtin_saturate_subtract64 (a, b);		/* subwus  */
-}
-
-long do_sat_long_dot  (long  a, long  b, long  *p)
-{
-  long  r = __builtin_saturate_subtract64 (a, b);	/* subwus.  */
-  if (r == 0)
-    *p = 0;
-  return r;
-}
-
-void do_sat_long_dot2  (long  a, long  b, long  *p, long *q)
-{
-  if (__builtin_saturate_subtract64 (a, b))		/* subwus.  */
-    *p = 0;
-  *q = a + b;
-  return;
-}
-
-/* { dg-final { scan-assembler-times {\msubdus\M}    1 } } */
-/* { dg-final { scan-assembler-times {\msubdus[.]\M} 2 } } */
-/* { dg-final { scan-assembler-not   {\msubf\M}        } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8af840d1d3b..b70ebf963f9 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6553,22 +6553,6 @@ proc check_effective_target_powerpc_dense_math_ok { } {
 	} "-mcpu=future"]
 }
 
-# Return 1 if this is a PowerPC target supporting -mcpu=future which enables
-# the saturating subtract instruction.
-proc check_effective_target_powerpc_subfus_ok { } {
-	return [check_no_compiler_messages_nocache powerpc_subfus_ok assembly {
-		int test (int a, int b)
-		{
-		#ifndef _ARCH_PWR_FUTURE
-		#error "target does not have saturating subtract support."
-		#else
-		/* Make sure we have saturating subtract support.  */
-		  return __builtin_saturate_subtract32 (a, b);
-		#endif
-		}
-	} "-mcpu=future"]
-}
-
 # Return 1 if this is a PowerPC target supporting -mfloat128 via either
 # software emulation on power7/power8 systems or hardware support on power9.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-17 22:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 18:43 [gcc(refs/users/meissner/heads/dmf004)] Revert patch Michael Meissner
  -- strict thread matches above, loose matches on Subject: below --
2022-11-17 22:08 Michael Meissner
2022-11-17 21:54 Michael Meissner
2022-11-17 21:54 Michael Meissner
2022-11-17 21:53 Michael Meissner
2022-11-15  1:52 Michael Meissner
2022-11-12  0:42 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).