public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>,
	Paul Koning <paulkoning@comcast.net>,
	Richard Sandiford <richard.sandiford@arm.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/4] RTL: Update `const_double_zero' handling for mode and callable insns
Date: Fri, 8 Jan 2021 13:11:00 -0700	[thread overview]
Message-ID: <d95e0bba-44fe-28c6-1b15-62183fe0be3e@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.21.2101072205360.1637534@eddie.linux-mips.org>



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


  reply	other threads:[~2021-01-08 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d95e0bba-44fe-28c6-1b15-62183fe0be3e@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=macro@linux-mips.org \
    --cc=paulkoning@comcast.net \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).