public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification
@ 2021-01-08  1:50 Maciej W. Rozycki
  2021-01-08  1:50 ` [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns Maciej W. Rozycki
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-08  1:50 UTC (permalink / raw)
  To: Jeff Law, Paul Koning, Richard Sandiford, gcc-patches

Hi,

 This patch series fixes an issue with `const_double_zero' use causing a 
build failure reported with the `pdp11-aout' target by Martin Liška: 
<https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561896.html>
superseding an earlier proposal discussed here:
<https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561972.html>.

 I have decided to split the fix into pieces so as to have targets bits as 
separate changes in order to make possible backports easier.

 In the course of investigation I have noticed a VAX iterator attribute I 
have recently introduced duplicates the standard `mode' attribute 
unnecessarily so I have decided to remove it along with the fix; it has a 
syntactic dependency on 3/4, so it has to be a part of the series.

 See individual changes for detailed descriptions.

 These changes have been regression-tested with the `vax-netbsdelf' target 
and verified manually with the `pdp11-aout' target.  For 4/4 I have also
verified that no change has been made to target library code produced.

 OK to apply?

  Maciej

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

* [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns
  2021-01-08  1:50 [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification Maciej W. Rozycki
@ 2021-01-08  1:50 ` Maciej W. Rozycki
  2021-01-08 20:11   ` Jeff Law
  2021-01-08  1:50 ` [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions Maciej W. Rozycki
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-08  1:50 UTC (permalink / raw)
  To: Jeff Law, Paul Koning, Richard Sandiford, gcc-patches

Handle machine mode specification with `const_double_zero' and handle 
the rtx with callable code produced from named insns.  Complementing 
commit 20ab43b5cad6 ("RTL: Add `const_double_zero' syntactic rtx") and 
removing a commit c60d0736dff7 ("PDP11: Use `const_double_zero' to 
express double zero constant") build regression observed with the 
`pdp11-aout' target:

genemit: Internal error: abort in gen_exp, at genemit.c:202
make[2]: *** [Makefile:2427: s-emit] Error 1

where a:

(const_double 0 [0] 0 [0] 0 [0] 0 [0])

rtx coming from:

(parallel [
        (set (reg:CC 16)
            (compare:CC (abs:DF (match_operand:DF 1 ("general_operand") ("0,0")))
                (const_double 0 [0] 0 [0] 0 [0] 0 [0])))
        (set (match_operand:DF 0 ("nonimmediate_operand") ("=fR,Q"))
            (abs:DF (match_dup 1)))
    ])

and ultimately `(const_double_zero)' referred in a named RTL insn cannot 
be interpreted.  Handle the rtx then by supplying the constant 0 double 
operand requested, resulting in the following update to insn-emit.c code 
produced for the `pdp11-aout' target, relative to before the triggering 
commit:

@@ -1514,7 +1514,7 @@ gen_absdf2_cc (rtx operand0 ATTRIBUTE_UN
 	gen_rtx_COMPARE (CCmode,
 	gen_rtx_ABS (DFmode,
 	operand1),
-	const0_rtx)),
+	CONST_DOUBLE_ATOF ("0", VOIDmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_ABS (DFmode,
 	copy_rtx (operand1)))));
@@ -1555,7 +1555,7 @@ gen_negdf2_cc (rtx operand0 ATTRIBUTE_UN
 	gen_rtx_COMPARE (CCmode,
 	gen_rtx_NEG (DFmode,
 	operand1),
-	const0_rtx)),
+	CONST_DOUBLE_ATOF ("0", VOIDmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_NEG (DFmode,
 	copy_rtx (operand1)))));
@@ -1790,7 +1790,7 @@ gen_muldf3_cc (rtx operand0 ATTRIBUTE_UN
 	gen_rtx_MULT (DFmode,
 	operand1,
 	operand2),
-	const0_rtx)),
+	CONST_DOUBLE_ATOF ("0", VOIDmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_MULT (DFmode,
 	copy_rtx (operand1),
@@ -1942,7 +1942,7 @@ gen_divdf3_cc (rtx operand0 ATTRIBUTE_UN
 	gen_rtx_DIV (DFmode,
 	operand1,
 	operand2),
-	const0_rtx)),
+	CONST_DOUBLE_ATOF ("0", VOIDmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_DIV (DFmode,
 	copy_rtx (operand1),

This does not (yet) remove VOIDmode CONST_DOUBLE use, as it is up to 
individual machine descriptions to choose.

	gcc/
	* genemit.c (gen_exp) <CONST_DOUBLE>: Handle `const_double_zero' 
	rtx.
	* read-rtl.c (rtx_reader::read_rtx_code): Handle machine mode 
	with `const_double_zero'.
	* doc/rtl.texi (Constant Expression Types): Document it.
---
 gcc/doc/rtl.texi |    4 ++--
 gcc/genemit.c    |    8 ++++++++
 gcc/read-rtl.c   |    9 +++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

gcc-const-double-zero-mode.diff
Index: gcc/gcc/doc/rtl.texi
===================================================================
--- gcc.orig/gcc/doc/rtl.texi
+++ gcc/gcc/doc/rtl.texi
@@ -1719,13 +1719,13 @@ of code @code{const_double} and therefor
 provided:
 
 @smallexample
-(const_double_zero)
+(const_double_zero:@var{m})
 @end smallexample
 
 standing for:
 
 @smallexample
-(const_double 0 0 @dots{})
+(const_double:@var{m} 0 0 @dots{})
 @end smallexample
 
 for matching the floating-point value zero, possibly the only useful one.
Index: gcc/gcc/genemit.c
===================================================================
--- gcc.orig/gcc/genemit.c
+++ gcc/gcc/genemit.c
@@ -195,6 +195,14 @@ gen_exp (rtx x, enum rtx_code subroutine
       return;
 
     case CONST_DOUBLE:
+      /* Handle `const_double_zero' rtx.  */
+      if (CONST_DOUBLE_REAL_VALUE (x)->cl == rvc_zero)
+	{
+	  printf ("CONST_DOUBLE_ATOF (\"0\", %smode)",
+		  GET_MODE_NAME (GET_MODE (x)));
+	  return;
+	}
+      /* Fall through.  */
     case CONST_FIXED:
     case CONST_WIDE_INT:
       /* These shouldn't be written in MD files.  Instead, the appropriate
Index: gcc/gcc/read-rtl.c
===================================================================
--- gcc.orig/gcc/read-rtl.c
+++ gcc/gcc/read-rtl.c
@@ -1658,6 +1658,15 @@ rtx_reader::read_rtx_code (const char *c
       return_rtx = rtx_alloc (code);
       memset (return_rtx, 0, RTX_CODE_SIZE (code));
       PUT_CODE (return_rtx, code);
+      c = read_skip_spaces ();
+      if (c == ':')
+	{
+	  file_location loc = read_name (&name);
+	  record_potential_iterator_use (&modes, loc, return_rtx, 0,
+					 name.string);
+	}
+      else
+	unread_char (c);
       return return_rtx;
     }
 

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

* [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions
  2021-01-08  1:50 [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification Maciej W. Rozycki
  2021-01-08  1:50 ` [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns Maciej W. Rozycki
@ 2021-01-08  1:50 ` Maciej W. Rozycki
  2021-01-08 15:04   ` Paul Koning
  2021-01-08  1:50 ` [PATCH 3/4] VAX: " Maciej W. Rozycki
  2021-01-08  1:51 ` [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute Maciej W. Rozycki
  3 siblings, 1 reply; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-08  1:50 UTC (permalink / raw)
  To: Jeff Law, Paul Koning, Richard Sandiford, gcc-patches

For predictable semantics propagate the mode from operands referred by 
FP substitutions to the `const_double_zero' expressions used with the 
associated condition code calculation, resulting in the following update 
to insn-emit.c code produced for the `pdp11-aout' target (with machine 
description line numbering change noise removed):

@@ -1514,7 +1514,7 @@
 	gen_rtx_COMPARE (CCmode,
 	gen_rtx_ABS (DFmode,
 	operand1),
-	CONST_DOUBLE_ATOF ("0", VOIDmode))),
+	CONST_DOUBLE_ATOF ("0", DFmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_ABS (DFmode,
 	copy_rtx (operand1)))));
@@ -1555,7 +1555,7 @@
 	gen_rtx_COMPARE (CCmode,
 	gen_rtx_NEG (DFmode,
 	operand1),
-	CONST_DOUBLE_ATOF ("0", VOIDmode))),
+	CONST_DOUBLE_ATOF ("0", DFmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_NEG (DFmode,
 	copy_rtx (operand1)))));
@@ -1790,7 +1790,7 @@
 	gen_rtx_MULT (DFmode,
 	operand1,
 	operand2),
-	CONST_DOUBLE_ATOF ("0", VOIDmode))),
+	CONST_DOUBLE_ATOF ("0", DFmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_MULT (DFmode,
 	copy_rtx (operand1),
@@ -1942,7 +1942,7 @@
 	gen_rtx_DIV (DFmode,
 	operand1,
 	operand2),
-	CONST_DOUBLE_ATOF ("0", VOIDmode))),
+	CONST_DOUBLE_ATOF ("0", DFmode))),
 		gen_rtx_SET (operand0,
 	gen_rtx_DIV (DFmode,
 	copy_rtx (operand1),

Provide a new iterator to provide copies of FP substitutions across the 
FP modes supported as the substitutions now need to match the mode of 
the operands.

	gcc/
	* config/pdp11/pdp11.md (PDPfp): New mode iterator.
	(fcc_cc, fcc_ccnz): Use it.  Add mode to `const_double_zero' and 
	operands.
---
 gcc/config/pdp11/pdp11.md |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

gcc-pdp11-const-double-zero-mode.diff
Index: gcc/gcc/config/pdp11/pdp11.md
===================================================================
--- gcc.orig/gcc/config/pdp11/pdp11.md
+++ gcc/gcc/config/pdp11/pdp11.md
@@ -82,6 +82,8 @@
 
 (define_code_iterator SHF [ashift ashiftrt lshiftrt])
 
+(define_mode_iterator PDPfp [SF DF])
+
 ;; Substitution to turn a CC clobber into a CC setter.  We have four of
 ;; these: for CCmode vs. CCNZmode, and for CC_REGNUM vs. FCC_REGNUM.
 (define_subst "cc_cc"
@@ -101,19 +103,19 @@
    (set (match_dup 0) (match_dup 1))])
 
 (define_subst "fcc_cc"
-  [(set (match_operand 0 "") (match_operand 1 ""))
+  [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 ""))
    (clobber (reg FCC_REGNUM))]
   ""
   [(set (reg:CC FCC_REGNUM)
-	(compare:CC (match_dup 1) (const_double_zero)))
+	(compare:CC (match_dup 1) (const_double_zero:PDPfp)))
    (set (match_dup 0) (match_dup 1))])
 
 (define_subst "fcc_ccnz"
-  [(set (match_operand 0 "") (match_operand 1 ""))
+  [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 ""))
    (clobber (reg FCC_REGNUM))]
   ""
   [(set (reg:CCNZ FCC_REGNUM)
-	(compare:CCNZ (match_dup 1) (const_double_zero)))
+	(compare:CCNZ (match_dup 1) (const_double_zero:PDPfp)))
    (set (match_dup 0) (match_dup 1))])
 
 (define_subst_attr "cc_cc" "cc_cc" "_nocc" "_cc")

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

* [PATCH 3/4] VAX: Use a mode with `const_double_zero' expressions
  2021-01-08  1:50 [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification Maciej W. Rozycki
  2021-01-08  1:50 ` [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns Maciej W. Rozycki
  2021-01-08  1:50 ` [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions Maciej W. Rozycki
@ 2021-01-08  1:50 ` Maciej W. Rozycki
  2021-01-08 20:11   ` Jeff Law
  2021-01-08  1:51 ` [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute Maciej W. Rozycki
  3 siblings, 1 reply; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-08  1:50 UTC (permalink / raw)
  To: Jeff Law, Paul Koning, Richard Sandiford, gcc-patches

For predictable semantics propagate the mode from operands referred by 
the FP substitution to the `const_double_zero' expressions used with the 
associated condition code calculation.  Use an iterator to make copies 
of the FP substitution across the FP modes supported as the substitution 
now has to match the mode of the operands.

	gcc/
	* config/pdp11/pdp11.md (subst_f<cc>): Add mode to operands and 
	`const_double_zero'.
---
 gcc/config/vax/vax.md |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

gcc-vax-const-double-zero-mode.diff
Index: gcc/gcc/config/vax/vax.md
===================================================================
--- gcc.orig/gcc/config/vax/vax.md
+++ gcc/gcc/config/vax/vax.md
@@ -79,13 +79,13 @@
 	(match_dup 1))])
 
 (define_subst "subst_f<cc>"
-  [(set (match_operand 0 "")
-	(match_operand 1 ""))
+  [(set (match_operand:VAXfp 0 "")
+	(match_operand:VAXfp 1 ""))
    (clobber (reg:CC VAX_PSL_REGNUM))]
   ""
   [(set (reg:VAXccnz VAX_PSL_REGNUM)
 	(compare:VAXccnz (match_dup 1)
-			 (const_double_zero)))
+			 (const_double_zero:VAXfp)))
    (set (match_dup 0)
 	(match_dup 1))])
 

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

* [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute
  2021-01-08  1:50 [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification Maciej W. Rozycki
                   ` (2 preceding siblings ...)
  2021-01-08  1:50 ` [PATCH 3/4] VAX: " Maciej W. Rozycki
@ 2021-01-08  1:51 ` Maciej W. Rozycki
  2021-01-08 20:11   ` Jeff Law
  3 siblings, 1 reply; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-08  1:51 UTC (permalink / raw)
  To: Jeff Law, Paul Koning, Richard Sandiford, gcc-patches

Remove the `cc' mode attribute that duplicates the implicitly defined 
`mode' attribute.  No change to semantics.

	gcc/
	* config/vax/vax.md (cc): Remove mode attribute.
	(subst_<cc>, subst_f<cc>): Rename to...
	(subst_<mode>, subst_f<VAXccnz:mode>): ... these respectively.
	(*cbranch<VAXint:mode>4_<VAXcc:mode>): Update for `cc' removal.
	(*cbranch<VAXfp:mode>4_<VAXccnz:mode>): Likewise.
	(*branch_<mode>, *branch_<mode>_reversed): Likewise.
---
 gcc/config/vax/vax.md |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

gcc-vax-cc-mode.diff
Index: gcc/gcc/config/vax/vax.md
===================================================================
--- gcc.orig/gcc/config/vax/vax.md
+++ gcc/gcc/config/vax/vax.md
@@ -58,7 +58,6 @@
 
 (define_mode_iterator VAXcc [CC CCN CCNZ CCZ])
 (define_mode_iterator VAXccnz [CCN CCNZ CCZ])
-(define_mode_attr cc [(CC "cc") (CCN "ccn") (CCNZ "ccnz") (CCZ "ccz")])
 
 (define_code_iterator any_extract [sign_extract zero_extract])
 
@@ -67,7 +66,7 @@
 (include "predicates.md")
 
 ;; Make instructions that set the N, N+Z, and Z condition codes respectively.
-(define_subst "subst_<cc>"
+(define_subst "subst_<mode>"
   [(set (match_operand 0 "")
 	(match_operand 1 ""))
    (clobber (reg:CC VAX_PSL_REGNUM))]
@@ -78,7 +77,7 @@
    (set (match_dup 0)
 	(match_dup 1))])
 
-(define_subst "subst_f<cc>"
+(define_subst "subst_f<VAXccnz:mode>"
   [(set (match_operand:VAXfp 0 "")
 	(match_operand:VAXfp 1 ""))
    (clobber (reg:CC VAX_PSL_REGNUM))]
@@ -2174,7 +2173,7 @@
 (define_insn_and_split "*cbranch<VAXint:mode>4_<VAXcc:mode>"
   [(set (pc)
 	(if_then_else
-	  (match_operator 0 "vax_<cc>_comparison_operator"
+	  (match_operator 0 "vax_<VAXcc:mode>_comparison_operator"
 			  [(match_operand:VAXint 1 "general_operand" "nrmT")
 			   (match_operand:VAXint 2 "general_operand" "nrmT")])
 	  (label_ref (match_operand 3 "" ""))
@@ -2206,7 +2205,7 @@
 (define_insn_and_split "*cbranch<VAXfp:mode>4_<VAXccnz:mode>"
   [(set (pc)
 	(if_then_else
-	  (match_operator 0 "vax_<cc>_comparison_operator"
+	  (match_operator 0 "vax_<VAXccnz:mode>_comparison_operator"
 			  [(match_operand:VAXfp 1 "general_operand" "gF")
 			   (match_operand:VAXfp 2 "general_operand" "gF")])
 	  (label_ref (match_operand 3 "" ""))
@@ -2226,7 +2225,7 @@
 
 (define_insn "*branch_<mode>"
   [(set (pc)
-	(if_then_else (match_operator 0 "vax_<cc>_comparison_operator"
+	(if_then_else (match_operator 0 "vax_<mode>_comparison_operator"
 				      [(reg:VAXcc VAX_PSL_REGNUM)
 				       (const_int 0)])
 		      (label_ref (match_operand 1 "" ""))
@@ -2237,7 +2236,7 @@
 ;; Recognize reversed jumps.
 (define_insn "*branch_<mode>_reversed"
   [(set (pc)
-	(if_then_else (match_operator 0 "vax_<cc>_comparison_operator"
+	(if_then_else (match_operator 0 "vax_<mode>_comparison_operator"
 				      [(reg:VAXcc VAX_PSL_REGNUM)
 				       (const_int 0)])
 		      (pc)

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

* Re: [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions
  2021-01-08  1:50 ` [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions Maciej W. Rozycki
@ 2021-01-08 15:04   ` Paul Koning
  2021-01-10 14:34     ` Maciej W. Rozycki
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Koning @ 2021-01-08 15:04 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Jeff Law, Richard Sandiford, GCC Patches



> On Jan 7, 2021, at 8:50 PM, Maciej W. Rozycki <macro@linux-mips.org> wrote:
> 
> ...
> 
> Provide a new iterator to provide copies of FP substitutions across the 
> FP modes supported as the substitutions now need to match the mode of 
> the operands.
> 
> 	gcc/
> 	* config/pdp11/pdp11.md (PDPfp): New mode iterator.
> 	(fcc_cc, fcc_ccnz): Use it.  Add mode to `const_double_zero' and 
> 	operands.
> ---
> gcc/config/pdp11/pdp11.md |   10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
> 
> gcc-pdp11-const-double-zero-mode.diff
> Index: gcc/gcc/config/pdp11/pdp11.md
> ===================================================================
> --- gcc.orig/gcc/config/pdp11/pdp11.md
> +++ gcc/gcc/config/pdp11/pdp11.md
> @@ -82,6 +82,8 @@
> 
> (define_code_iterator SHF [ashift ashiftrt lshiftrt])
> 
> +(define_mode_iterator PDPfp [SF DF])
> +
> ;; Substitution to turn a CC clobber into a CC setter.  We have four of
> ;; these: for CCmode vs. CCNZmode, and for CC_REGNUM vs. FCC_REGNUM.
> (define_subst "cc_cc"
> @@ -101,19 +103,19 @@
>    (set (match_dup 0) (match_dup 1))])
> 
> (define_subst "fcc_cc"
> -  [(set (match_operand 0 "") (match_operand 1 ""))
> +  [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 ""))
>    (clobber (reg FCC_REGNUM))]
>   ""
>   [(set (reg:CC FCC_REGNUM)
> -	(compare:CC (match_dup 1) (const_double_zero)))
> +	(compare:CC (match_dup 1) (const_double_zero:PDPfp)))
>    (set (match_dup 0) (match_dup 1))])
> 
> (define_subst "fcc_ccnz"
> -  [(set (match_operand 0 "") (match_operand 1 ""))
> +  [(set (match_operand:PDPfp 0 "") (match_operand:PDPfp 1 ""))
>    (clobber (reg FCC_REGNUM))]
>   ""
>   [(set (reg:CCNZ FCC_REGNUM)
> -	(compare:CCNZ (match_dup 1) (const_double_zero)))
> +	(compare:CCNZ (match_dup 1) (const_double_zero:PDPfp)))
>    (set (match_dup 0) (match_dup 1))])
> 
> (define_subst_attr "cc_cc" "cc_cc" "_nocc" "_cc")


Ok.  Thanks Maciej.

	paul


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

* Re: [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns
  2021-01-08  1:50 ` [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns Maciej W. Rozycki
@ 2021-01-08 20:11   ` Jeff Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Law @ 2021-01-08 20:11 UTC (permalink / raw)
  To: Maciej W. Rozycki, Paul Koning, Richard Sandiford, gcc-patches



On 1/7/21 6:50 PM, Maciej W. Rozycki wrote:
> Handle machine mode specification with `const_double_zero' and handle 
> the rtx with callable code produced from named insns.  Complementing 
> commit 20ab43b5cad6 ("RTL: Add `const_double_zero' syntactic rtx") and 
> removing a commit c60d0736dff7 ("PDP11: Use `const_double_zero' to 
> express double zero constant") build regression observed with the 
> `pdp11-aout' target:
>
> genemit: Internal error: abort in gen_exp, at genemit.c:202
> make[2]: *** [Makefile:2427: s-emit] Error 1
>
> where a:
>
> (const_double 0 [0] 0 [0] 0 [0] 0 [0])
>
> rtx coming from:
>
> (parallel [
>         (set (reg:CC 16)
>             (compare:CC (abs:DF (match_operand:DF 1 ("general_operand") ("0,0")))
>                 (const_double 0 [0] 0 [0] 0 [0] 0 [0])))
>         (set (match_operand:DF 0 ("nonimmediate_operand") ("=fR,Q"))
>             (abs:DF (match_dup 1)))
>     ])
>
> and ultimately `(const_double_zero)' referred in a named RTL insn cannot 
> be interpreted.  Handle the rtx then by supplying the constant 0 double 
> operand requested, resulting in the following update to insn-emit.c code 
> produced for the `pdp11-aout' target, relative to before the triggering 
> commit:
>
> @@ -1514,7 +1514,7 @@ gen_absdf2_cc (rtx operand0 ATTRIBUTE_UN
>  	gen_rtx_COMPARE (CCmode,
>  	gen_rtx_ABS (DFmode,
>  	operand1),
> -	const0_rtx)),
> +	CONST_DOUBLE_ATOF ("0", VOIDmode))),
>  		gen_rtx_SET (operand0,
>  	gen_rtx_ABS (DFmode,
>  	copy_rtx (operand1)))));
> @@ -1555,7 +1555,7 @@ gen_negdf2_cc (rtx operand0 ATTRIBUTE_UN
>  	gen_rtx_COMPARE (CCmode,
>  	gen_rtx_NEG (DFmode,
>  	operand1),
> -	const0_rtx)),
> +	CONST_DOUBLE_ATOF ("0", VOIDmode))),
>  		gen_rtx_SET (operand0,
>  	gen_rtx_NEG (DFmode,
>  	copy_rtx (operand1)))));
> @@ -1790,7 +1790,7 @@ gen_muldf3_cc (rtx operand0 ATTRIBUTE_UN
>  	gen_rtx_MULT (DFmode,
>  	operand1,
>  	operand2),
> -	const0_rtx)),
> +	CONST_DOUBLE_ATOF ("0", VOIDmode))),
>  		gen_rtx_SET (operand0,
>  	gen_rtx_MULT (DFmode,
>  	copy_rtx (operand1),
> @@ -1942,7 +1942,7 @@ gen_divdf3_cc (rtx operand0 ATTRIBUTE_UN
>  	gen_rtx_DIV (DFmode,
>  	operand1,
>  	operand2),
> -	const0_rtx)),
> +	CONST_DOUBLE_ATOF ("0", VOIDmode))),
>  		gen_rtx_SET (operand0,
>  	gen_rtx_DIV (DFmode,
>  	copy_rtx (operand1),
>
> This does not (yet) remove VOIDmode CONST_DOUBLE use, as it is up to 
> individual machine descriptions to choose.
>
> 	gcc/
> 	* genemit.c (gen_exp) <CONST_DOUBLE>: Handle `const_double_zero' 
> 	rtx.
> 	* read-rtl.c (rtx_reader::read_rtx_code): Handle machine mode 
> 	with `const_double_zero'.
> 	* doc/rtl.texi (Constant Expression Types): Document it.
OK
jeff


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

* Re: [PATCH 3/4] VAX: Use a mode with `const_double_zero' expressions
  2021-01-08  1:50 ` [PATCH 3/4] VAX: " Maciej W. Rozycki
@ 2021-01-08 20:11   ` Jeff Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Law @ 2021-01-08 20:11 UTC (permalink / raw)
  To: Maciej W. Rozycki, Paul Koning, Richard Sandiford, gcc-patches



On 1/7/21 6:50 PM, Maciej W. Rozycki wrote:
> For predictable semantics propagate the mode from operands referred by 
> the FP substitution to the `const_double_zero' expressions used with the 
> associated condition code calculation.  Use an iterator to make copies 
> of the FP substitution across the FP modes supported as the substitution 
> now has to match the mode of the operands.
>
> 	gcc/
> 	* config/pdp11/pdp11.md (subst_f<cc>): Add mode to operands and 
> 	`const_double_zero'.
OK
jeff


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

* Re: [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute
  2021-01-08  1:51 ` [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute Maciej W. Rozycki
@ 2021-01-08 20:11   ` Jeff Law
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Law @ 2021-01-08 20:11 UTC (permalink / raw)
  To: Maciej W. Rozycki, Paul Koning, Richard Sandiford, gcc-patches



On 1/7/21 6:51 PM, Maciej W. Rozycki wrote:
> Remove the `cc' mode attribute that duplicates the implicitly defined 
> `mode' attribute.  No change to semantics.
>
> 	gcc/
> 	* config/vax/vax.md (cc): Remove mode attribute.
> 	(subst_<cc>, subst_f<cc>): Rename to...
> 	(subst_<mode>, subst_f<VAXccnz:mode>): ... these respectively.
> 	(*cbranch<VAXint:mode>4_<VAXcc:mode>): Update for `cc' removal.
> 	(*cbranch<VAXfp:mode>4_<VAXccnz:mode>): Likewise.
> 	(*branch_<mode>, *branch_<mode>_reversed): Likewise.
OK
jeff


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

* Re: [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions
  2021-01-08 15:04   ` Paul Koning
@ 2021-01-10 14:34     ` Maciej W. Rozycki
  0 siblings, 0 replies; 10+ messages in thread
From: Maciej W. Rozycki @ 2021-01-10 14:34 UTC (permalink / raw)
  To: Paul Koning; +Cc: Jeff Law, Richard Sandiford, GCC Patches

On Fri, 8 Jan 2021, Paul Koning wrote:

> Ok.  Thanks Maciej.

 Thank you for your review.  I have applied this change now (and the 
remaining from the series, approved by Jeff).

  Maciej

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

end of thread, other threads:[~2021-01-10 14:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  1:50 [PATCH 0/4] Fixes for `const_double_zero' use + VAX iterator simplification Maciej W. Rozycki
2021-01-08  1:50 ` [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns Maciej W. Rozycki
2021-01-08 20:11   ` Jeff Law
2021-01-08  1:50 ` [PATCH 2/4] PDP11: Use a mode with `const_double_zero' expressions Maciej W. Rozycki
2021-01-08 15:04   ` Paul Koning
2021-01-10 14:34     ` Maciej W. Rozycki
2021-01-08  1:50 ` [PATCH 3/4] VAX: " Maciej W. Rozycki
2021-01-08 20:11   ` Jeff Law
2021-01-08  1:51 ` [PATCH 4/4] VAX: Remove a duplicate `cc' mode attribute Maciej W. Rozycki
2021-01-08 20:11   ` Jeff Law

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