public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 00/12] rs6000: Use parameterised names
@ 2019-07-01 18:00 Segher Boessenkool
  2019-07-01 18:01 ` [PATCH 01/12] @neg<mode>2 Segher Boessenkool
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

This series makes the rs6000 backend use parameterised names.  This
means adding an "@" to the start of pattern names, removing the mode
from the gen_* names where you call them, and adding an extra mode
parameter to those calls (as the first argument).

The abs and neg patterns used to call FAIL for some unexpected modes,
they no longer do.  It should have maybe used gcc_unreachable there
instead.  These patches also remove such gcc_unreachable.

Tested all on powerpc64-linux {-m32,-m64} and on p9 powerpc64le-linux.
Committing to trunk.


Segher


Segher Boessenkool (12):
  @neg<mode>2
  @fix_trunc<mode>si2_fprs
  @abs<mode>2_internal
  @indirect_jump<mode>_nospec
  @ctr<mode>
  @eh_set_lr_<mode>
  @extenddf<mode>2_{fprs,vsx}
  @extenddf<mode>2
  @neg<mode>2_hw
  @abs<mode>2_hw
  @ieee_128bit_vsx_neg<mode>2
  @ieee_128bit_vsx_abs<mode>2

 gcc/config/rs6000/rs6000.md | 130 +++++++++++---------------------------------
 1 file changed, 33 insertions(+), 97 deletions(-)

-- 
1.8.3.1

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

* [PATCH 01/12] @neg<mode>2
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
@ 2019-07-01 18:01 ` Segher Boessenkool
  2019-07-01 18:24 ` [PATCH 02/12] @fix_trunc<mode>si2_fprs Segher Boessenkool
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (neg<mode>2): Make this a parameterized name.
	(allocate_stack): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index d0d272a..63823c4 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2249,7 +2249,7 @@ (define_insn "subf<mode>3_carry_in_xx"
   [(set_attr "type" "add")])
 
 
-(define_insn "neg<mode>2"
+(define_insn "@neg<mode>2"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))]
   ""
@@ -9810,10 +9810,7 @@ (define_expand "allocate_stack"
     {
       operands[1] = force_reg (Pmode, operands[1]);
       neg_op0 = gen_reg_rtx (Pmode);
-      if (TARGET_32BIT)
-	emit_insn (gen_negsi2 (neg_op0, operands[1]));
-      else
-	emit_insn (gen_negdi2 (neg_op0, operands[1]));
+      emit_insn (gen_neg2 (Pmode, neg_op0, operands[1]));
     }
   else
     neg_op0 = GEN_INT (-INTVAL (operands[1]));
-- 
1.8.3.1

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

* [PATCH 02/12] @fix_trunc<mode>si2_fprs
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
  2019-07-01 18:01 ` [PATCH 01/12] @neg<mode>2 Segher Boessenkool
@ 2019-07-01 18:24 ` Segher Boessenkool
  2019-07-01 18:25 ` [PATCH 03/12] @abs<mode>2_internal Segher Boessenkool
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (fix_trunc<mode>si2_fprs): Make this a
	parameterized name.
	(fix_trunc<mode>si2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 63823c4..48ead5e 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7969,17 +7969,13 @@ (define_expand "fix_trunc<mode>si2"
     {
       if (FLOAT128_IEEE_P (<MODE>mode))
 	rs6000_expand_float128_convert (op0, op1, false);
-      else if (<MODE>mode == TFmode)
-	emit_insn (gen_fix_trunctfsi2_fprs (op0, op1));
-      else if (<MODE>mode == IFmode)
-	emit_insn (gen_fix_truncifsi2_fprs (op0, op1));
       else
-	gcc_unreachable ();
+	emit_insn (gen_fix_truncsi2_fprs (<MODE>mode, op0, op1));
       DONE;
     }
 })
 
-(define_expand "fix_trunc<mode>si2_fprs"
+(define_expand "@fix_trunc<mode>si2_fprs"
   [(parallel [(set (match_operand:SI 0 "gpc_reg_operand")
 		   (fix:SI (match_operand:IBM128 1 "gpc_reg_operand")))
 	      (clobber (match_dup 2))
-- 
1.8.3.1

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

* [PATCH 03/12] @abs<mode>2_internal
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
  2019-07-01 18:01 ` [PATCH 01/12] @neg<mode>2 Segher Boessenkool
  2019-07-01 18:24 ` [PATCH 02/12] @fix_trunc<mode>si2_fprs Segher Boessenkool
@ 2019-07-01 18:25 ` Segher Boessenkool
  2019-07-01 18:26 ` [PATCH 05/12] @ctr<mode> Segher Boessenkool
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (abs<mode>2_internal): Make this a
	parameterized name.
	(abs<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 48ead5e..ca8b0c0 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8163,17 +8163,12 @@ (define_expand "abs<mode>2"
     }
 
   label = gen_label_rtx ();
-  if (<MODE>mode == TFmode)
-    emit_insn (gen_abstf2_internal (operands[0], operands[1], label));
-  else if (<MODE>mode == IFmode)
-    emit_insn (gen_absif2_internal (operands[0], operands[1], label));
-  else
-    FAIL;
+  emit_insn (gen_abs2_internal (<MODE>mode, operands[0], operands[1], label));
   emit_label (label);
   DONE;
 })
 
-(define_expand "abs<mode>2_internal"
+(define_expand "@abs<mode>2_internal"
   [(set (match_operand:IBM128 0 "gpc_reg_operand")
 	(match_operand:IBM128 1 "gpc_reg_operand"))
    (set (match_dup 3) (match_dup 5))
-- 
1.8.3.1

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

* [PATCH 05/12] @ctr<mode>
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (2 preceding siblings ...)
  2019-07-01 18:25 ` [PATCH 03/12] @abs<mode>2_internal Segher Boessenkool
@ 2019-07-01 18:26 ` Segher Boessenkool
  2019-07-01 18:26 ` [PATCH 08/12] @extenddf<mode>2 Segher Boessenkool
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (ctr<mode>): Make this a parameterized name.
	(doloop_end): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index d665316..381f140 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -12566,22 +12566,14 @@ (define_expand "doloop_end"
    (use (match_operand 1))]	; label
   ""
 {
-  if (TARGET_64BIT)
-    {
-      if (GET_MODE (operands[0]) != DImode)
-	FAIL;
-      emit_jump_insn (gen_ctrdi (operands[0], operands[1]));
-    }
-  else
-    {
-      if (GET_MODE (operands[0]) != SImode)
-	FAIL;
-      emit_jump_insn (gen_ctrsi (operands[0], operands[1]));
-    }
+  if (GET_MODE (operands[0]) != Pmode)
+    FAIL;
+
+  emit_jump_insn (gen_ctr (Pmode, operands[0], operands[1]));
   DONE;
 })
 
-(define_expand "ctr<mode>"
+(define_expand "@ctr<mode>"
   [(parallel [(set (pc)
 		   (if_then_else (ne (match_operand:P 0 "register_operand")
 				     (const_int 1))
-- 
1.8.3.1

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

* [PATCH 04/12] @indirect_jump<mode>_nospec
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (6 preceding siblings ...)
  2019-07-01 18:26 ` [PATCH 06/12] @eh_set_lr_<mode> Segher Boessenkool
@ 2019-07-01 18:26 ` Segher Boessenkool
  2019-07-01 18:27 ` [PATCH 09/12] @neg<mode>2_hw Segher Boessenkool
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (indirect_jump<mode>_nospec): Make this a
	parameterized name.
	(indirect_jump): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index ca8b0c0..d665316 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -12410,10 +12410,7 @@ (define_expand "indirect_jump"
 {
   if (!rs6000_speculate_indirect_jumps) {
     rtx ccreg = gen_reg_rtx (CCmode);
-    if (Pmode == DImode)
-      emit_jump_insn (gen_indirect_jumpdi_nospec (operands[0], ccreg));
-    else
-      emit_jump_insn (gen_indirect_jumpsi_nospec (operands[0], ccreg));
+    emit_jump_insn (gen_indirect_jump_nospec (Pmode, operands[0], ccreg));
     DONE;
   }
 })
@@ -12425,7 +12422,7 @@ (define_insn "*indirect_jump<mode>"
   "b%T0"
   [(set_attr "type" "jmpreg")])
 
-(define_insn "indirect_jump<mode>_nospec"
+(define_insn "@indirect_jump<mode>_nospec"
   [(set (pc) (match_operand:P 0 "register_operand" "c,*l"))
    (clobber (match_operand:CC 1 "cc_reg_operand" "=y,y"))]
   "!rs6000_speculate_indirect_jumps"
-- 
1.8.3.1

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

* [PATCH 07/12] @extenddf<mode>2_{fprs,vsx}
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (4 preceding siblings ...)
  2019-07-01 18:26 ` [PATCH 08/12] @extenddf<mode>2 Segher Boessenkool
@ 2019-07-01 18:26 ` Segher Boessenkool
  2019-07-01 18:26 ` [PATCH 06/12] @eh_set_lr_<mode> Segher Boessenkool
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (extenddf<mode>2_fprs): Make this a
	parameterized name.
	(extenddf<mode>2_vsx): Make this a parameterized name.
	(extenddf<mode>2): Use those names.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 881efe1..3235eb2 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7783,31 +7783,20 @@ (define_expand "extenddf<mode>2"
   if (FLOAT128_IEEE_P (<MODE>mode))
     rs6000_expand_float128_convert (operands[0], operands[1], false);
   else if (TARGET_VSX)
-    {
-      if (<MODE>mode == TFmode)
-	emit_insn (gen_extenddftf2_vsx (operands[0], operands[1]));
-      else if (<MODE>mode == IFmode)
-	emit_insn (gen_extenddfif2_vsx (operands[0], operands[1]));
-      else
-	gcc_unreachable ();
-    }
-   else
+    emit_insn (gen_extenddf2_vsx (<MODE>mode, operands[0], operands[1]));
+  else
     {
       rtx zero = gen_reg_rtx (DFmode);
       rs6000_emit_move (zero, CONST0_RTX (DFmode), DFmode);
 
-      if (<MODE>mode == TFmode)
-	emit_insn (gen_extenddftf2_fprs (operands[0], operands[1], zero));
-      else if (<MODE>mode == IFmode)
-	emit_insn (gen_extenddfif2_fprs (operands[0], operands[1], zero));
-      else
-	gcc_unreachable ();
+      emit_insn (gen_extenddf2_fprs (<MODE>mode,
+				     operands[0], operands[1], zero));
     }
   DONE;
 })
 
 ;; Allow memory operands for the source to be created by the combiner.
-(define_insn_and_split "extenddf<mode>2_fprs"
+(define_insn_and_split "@extenddf<mode>2_fprs"
   [(set (match_operand:IBM128 0 "gpc_reg_operand" "=d,d,&d")
 	(float_extend:IBM128
 	 (match_operand:DF 1 "nonimmediate_operand" "d,m,d")))
@@ -7826,7 +7815,7 @@ (define_insn_and_split "extenddf<mode>2_fprs"
   operands[4] = simplify_gen_subreg (DFmode, operands[0], <MODE>mode, lo_word);
 })
 
-(define_insn_and_split "extenddf<mode>2_vsx"
+(define_insn_and_split "@extenddf<mode>2_vsx"
   [(set (match_operand:IBM128 0 "gpc_reg_operand" "=d,d")
 	(float_extend:IBM128
 	 (match_operand:DF 1 "nonimmediate_operand" "wa,m")))]
-- 
1.8.3.1

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

* [PATCH 06/12] @eh_set_lr_<mode>
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (5 preceding siblings ...)
  2019-07-01 18:26 ` [PATCH 07/12] @extenddf<mode>2_{fprs,vsx} Segher Boessenkool
@ 2019-07-01 18:26 ` Segher Boessenkool
  2019-07-01 18:26 ` [PATCH 04/12] @indirect_jump<mode>_nospec Segher Boessenkool
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (eh_set_lr_<mode>): Make this a parameterized
	name.
	(eh_return): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 381f140..881efe1 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -13184,15 +13184,12 @@ (define_expand "eh_return"
   [(use (match_operand 0 "general_operand"))]
   ""
 {
-  if (TARGET_32BIT)
-    emit_insn (gen_eh_set_lr_si (operands[0]));
-  else
-    emit_insn (gen_eh_set_lr_di (operands[0]));
+  emit_insn (gen_eh_set_lr (Pmode, operands[0]));
   DONE;
 })
 
 ; We can't expand this before we know where the link register is stored.
-(define_insn_and_split "eh_set_lr_<mode>"
+(define_insn_and_split "@eh_set_lr_<mode>"
   [(unspec_volatile [(match_operand:P 0 "register_operand" "r")] UNSPECV_EH_RR)
    (clobber (match_scratch:P 1 "=&b"))]
   ""
-- 
1.8.3.1

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

* [PATCH 08/12] @extenddf<mode>2
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (3 preceding siblings ...)
  2019-07-01 18:26 ` [PATCH 05/12] @ctr<mode> Segher Boessenkool
@ 2019-07-01 18:26 ` Segher Boessenkool
  2019-07-01 18:26 ` [PATCH 07/12] @extenddf<mode>2_{fprs,vsx} Segher Boessenkool
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (extenddf<mode>2): Make this a parameterized
	name.
	(floatsi<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 3235eb2..5b3e458 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7775,7 +7775,7 @@ (define_insn_and_split "*mov<mode>_softfloat"
 	    (const_string "8")
 	    (const_string "16"))])])
 
-(define_expand "extenddf<mode>2"
+(define_expand "@extenddf<mode>2"
   [(set (match_operand:FLOAT128 0 "gpc_reg_operand")
 	(float_extend:FLOAT128 (match_operand:DF 1 "gpc_reg_operand")))]
   "TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
@@ -7922,12 +7922,7 @@ (define_expand "floatsi<mode>2"
     {
       rtx tmp = gen_reg_rtx (DFmode);
       expand_float (tmp, op1, false);
-      if (<MODE>mode == TFmode)
-	emit_insn (gen_extenddftf2 (op0, tmp));
-      else if (<MODE>mode == IFmode)
-	emit_insn (gen_extenddfif2 (op0, tmp));
-      else
-	gcc_unreachable ();
+      emit_insn (gen_extenddf2 (<MODE>mode, op0, tmp));
       DONE;
     }
 })
-- 
1.8.3.1

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

* [PATCH 12/12] @ieee_128bit_vsx_abs<mode>2
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (9 preceding siblings ...)
  2019-07-01 18:27 ` [PATCH 11/12] @ieee_128bit_vsx_neg<mode>2 Segher Boessenkool
@ 2019-07-01 18:27 ` Segher Boessenkool
  2019-07-01 18:27 ` [PATCH 10/12] @abs<mode>2_hw Segher Boessenkool
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (ieee_128bit_vsx_abs<mode>2): Make this a
	parameterized name.
	(abs<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 86acaae..9e81df9 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8116,12 +8116,8 @@ (define_expand "abs<mode>2"
 	}
       else if (TARGET_FLOAT128_TYPE)
 	{
-	  if (<MODE>mode == TFmode)
-	    emit_insn (gen_ieee_128bit_vsx_abstf2 (operands[0], operands[1]));
-	  else if (<MODE>mode == KFmode)
-	    emit_insn (gen_ieee_128bit_vsx_abskf2 (operands[0], operands[1]));
-	  else
-	    FAIL;
+	  emit_insn (gen_ieee_128bit_vsx_abs2 (<MODE>mode,
+					       operands[0], operands[1]));
 	  DONE;
 	}
       else
@@ -8212,7 +8208,7 @@ (define_insn "*ieee_128bit_vsx_neg<mode>2_internal"
   [(set_attr "type" "veclogical")])
 
 ;; IEEE 128-bit absolute value
-(define_insn_and_split "ieee_128bit_vsx_abs<mode>2"
+(define_insn_and_split "@ieee_128bit_vsx_abs<mode>2"
   [(set (match_operand:IEEE128 0 "register_operand" "=wa")
 	(abs:IEEE128 (match_operand:IEEE128 1 "register_operand" "wa")))
    (clobber (match_scratch:V16QI 2 "=v"))]
-- 
1.8.3.1

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

* [PATCH 10/12] @abs<mode>2_hw
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (10 preceding siblings ...)
  2019-07-01 18:27 ` [PATCH 12/12] @ieee_128bit_vsx_abs<mode>2 Segher Boessenkool
@ 2019-07-01 18:27 ` Segher Boessenkool
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (abs<mode>2_hw): Make this a parameterized
	name.
	(abs<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 27fdc4f..974f0b1 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8117,12 +8117,7 @@ (define_expand "abs<mode>2"
     {
       if (TARGET_FLOAT128_HW)
 	{
-	  if (<MODE>mode == TFmode)
-	    emit_insn (gen_abstf2_hw (operands[0], operands[1]));
-	  else if (<MODE>mode == KFmode)
-	    emit_insn (gen_abskf2_hw (operands[0], operands[1]));
-	  else
-	    FAIL;
+	  emit_insn (gen_abs2_hw (<MODE>mode, operands[0], operands[1]));
 	  DONE;
 	}
       else if (TARGET_FLOAT128_TYPE)
@@ -13908,7 +13903,7 @@ (define_insn "@neg<mode>2_hw"
    (set_attr "size" "128")])
 
 
-(define_insn "abs<mode>2_hw"
+(define_insn "@abs<mode>2_hw"
   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
 	(abs:IEEE128
 	 (match_operand:IEEE128 1 "altivec_register_operand" "v")))]
-- 
1.8.3.1

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

* [PATCH 11/12] @ieee_128bit_vsx_neg<mode>2
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (8 preceding siblings ...)
  2019-07-01 18:27 ` [PATCH 09/12] @neg<mode>2_hw Segher Boessenkool
@ 2019-07-01 18:27 ` Segher Boessenkool
  2019-07-01 18:27 ` [PATCH 12/12] @ieee_128bit_vsx_abs<mode>2 Segher Boessenkool
  2019-07-01 18:27 ` [PATCH 10/12] @abs<mode>2_hw Segher Boessenkool
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (ieee_128bit_vsx_neg<mode>2): Make this a
	parameterized name.
	(neg<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 974f0b1..86acaae 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8070,14 +8070,8 @@ (define_expand "neg<mode>2"
       if (TARGET_FLOAT128_HW)
 	emit_insn (gen_neg2_hw (<MODE>mode, operands[0], operands[1]));
       else if (TARGET_FLOAT128_TYPE)
-	{
-	  if (<MODE>mode == TFmode)
-	    emit_insn (gen_ieee_128bit_vsx_negtf2 (operands[0], operands[1]));
-	  else if (<MODE>mode == KFmode)
-	    emit_insn (gen_ieee_128bit_vsx_negkf2 (operands[0], operands[1]));
-	  else
-	    gcc_unreachable ();
-	}
+	emit_insn (gen_ieee_128bit_vsx_neg2 (<MODE>mode,
+					     operands[0], operands[1]));
       else
 	{
 	  rtx libfunc = optab_libfunc (neg_optab, <MODE>mode);
@@ -8189,7 +8183,7 @@ (define_expand "ieee_128bit_negative_zero"
 ;; twiddle the sign bit.  Later GCSE passes can then combine multiple uses of
 ;; neg/abs to create the constant just once.
 
-(define_insn_and_split "ieee_128bit_vsx_neg<mode>2"
+(define_insn_and_split "@ieee_128bit_vsx_neg<mode>2"
   [(set (match_operand:IEEE128 0 "register_operand" "=wa")
 	(neg:IEEE128 (match_operand:IEEE128 1 "register_operand" "wa")))
    (clobber (match_scratch:V16QI 2 "=v"))]
-- 
1.8.3.1

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

* [PATCH 09/12] @neg<mode>2_hw
  2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
                   ` (7 preceding siblings ...)
  2019-07-01 18:26 ` [PATCH 04/12] @indirect_jump<mode>_nospec Segher Boessenkool
@ 2019-07-01 18:27 ` Segher Boessenkool
  2019-07-01 18:27 ` [PATCH 11/12] @ieee_128bit_vsx_neg<mode>2 Segher Boessenkool
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Segher Boessenkool @ 2019-07-01 18:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

2019-07-01  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (neg<mode>2_hw): Make this a parameterized
	name.
	(neg<mode>2): Use that name.  Simplify.

---
 gcc/config/rs6000/rs6000.md | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 5b3e458..27fdc4f 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8068,14 +8068,7 @@ (define_expand "neg<mode>2"
   if (FLOAT128_IEEE_P (<MODE>mode))
     {
       if (TARGET_FLOAT128_HW)
-	{
-	  if (<MODE>mode == TFmode)
-	    emit_insn (gen_negtf2_hw (operands[0], operands[1]));
-	  else if (<MODE>mode == KFmode)
-	    emit_insn (gen_negkf2_hw (operands[0], operands[1]));
-	  else
-	    gcc_unreachable ();
-	}
+	emit_insn (gen_neg2_hw (<MODE>mode, operands[0], operands[1]));
       else if (TARGET_FLOAT128_TYPE)
 	{
 	  if (<MODE>mode == TFmode)
@@ -13905,7 +13898,7 @@ (define_insn "copysign<mode>3_soft"
   [(set_attr "type" "veccomplex")
    (set_attr "length" "8")])
 
-(define_insn "neg<mode>2_hw"
+(define_insn "@neg<mode>2_hw"
   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
 	(neg:IEEE128
 	 (match_operand:IEEE128 1 "altivec_register_operand" "v")))]
-- 
1.8.3.1

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

end of thread, other threads:[~2019-07-01 18:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 18:00 [PATCH 00/12] rs6000: Use parameterised names Segher Boessenkool
2019-07-01 18:01 ` [PATCH 01/12] @neg<mode>2 Segher Boessenkool
2019-07-01 18:24 ` [PATCH 02/12] @fix_trunc<mode>si2_fprs Segher Boessenkool
2019-07-01 18:25 ` [PATCH 03/12] @abs<mode>2_internal Segher Boessenkool
2019-07-01 18:26 ` [PATCH 05/12] @ctr<mode> Segher Boessenkool
2019-07-01 18:26 ` [PATCH 08/12] @extenddf<mode>2 Segher Boessenkool
2019-07-01 18:26 ` [PATCH 07/12] @extenddf<mode>2_{fprs,vsx} Segher Boessenkool
2019-07-01 18:26 ` [PATCH 06/12] @eh_set_lr_<mode> Segher Boessenkool
2019-07-01 18:26 ` [PATCH 04/12] @indirect_jump<mode>_nospec Segher Boessenkool
2019-07-01 18:27 ` [PATCH 09/12] @neg<mode>2_hw Segher Boessenkool
2019-07-01 18:27 ` [PATCH 11/12] @ieee_128bit_vsx_neg<mode>2 Segher Boessenkool
2019-07-01 18:27 ` [PATCH 12/12] @ieee_128bit_vsx_abs<mode>2 Segher Boessenkool
2019-07-01 18:27 ` [PATCH 10/12] @abs<mode>2_hw Segher Boessenkool

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).