public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: gcc-patches@gcc.gnu.org
Subject: [1/8] Handle TRUNCATE in make_extraction
Date: Sat, 03 Nov 2012 11:13:00 -0000	[thread overview]
Message-ID: <87fw4rey7w.fsf@talisman.home> (raw)
In-Reply-To: <87k3u3eybu.fsf@talisman.home> (Richard Sandiford's message of	"Sat, 03 Nov 2012 11:10:45 +0000")

combine.c:make_extraction peels off truncating lowpart subregs
from the structure operand.  On !TRULY_NOOP_TRUNCATION targets,
truncations are represented as TRUNCATE instead, so this patch
handles them too.

As for why this patch is suddenly needed now: at the moment, we start
out with INNER being the original (truncate:SI (foo:DI)) expression,
but after having looked at the insv/ext(z)v pattern, we decide that
we want INNER to be word_mode (DImode) instead.  The truncation then
gets stripped by the force_to_mode call.

However, with optabs, an SImode INNER would cause us to use an SImode
operation instead.  That isn't what we want, because the explicit
TRUNCATE is there precisely because the DImode value needs to be
modified by active instructions before being acceptable in an
SImode operation.

Tested as described in the covering note.  OK to install?

Richard

gcc/
	* combine.c (make_extraction): Handle TRUNCATEd INNERs.

Index: gcc/combine.c
===================================================================
--- gcc/combine.c	2012-11-02 08:15:57.000000000 +0000
+++ gcc/combine.c	2012-11-02 08:22:07.702369220 +0000
@@ -7022,6 +7022,8 @@ make_extraction (enum machine_mode mode,
       if (new_rtx != 0)
 	return gen_rtx_ASHIFT (mode, new_rtx, XEXP (inner, 1));
     }
+  else if (GET_CODE (inner) == TRUNCATE)
+    inner = XEXP (inner, 0);
 
   inner_mode = GET_MODE (inner);
 

  reply	other threads:[~2012-11-03 11:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-03 11:10 [0/8] Add optabs alternatives for insv, extv and extzv Richard Sandiford
2012-11-03 11:13 ` Richard Sandiford [this message]
2012-11-10 15:52   ` [1/8] Handle TRUNCATE in make_extraction Eric Botcazou
2012-11-03 11:14 ` [2/8] Add adjust_bitfield_address_size Richard Sandiford
2012-11-10 15:53   ` Eric Botcazou
2012-11-03 11:16 ` [3/8] Add narrow_bit_field_mem Richard Sandiford
2012-11-10 16:02   ` Eric Botcazou
2012-11-03 11:21 ` [4/8] Add bit_field_mode_iterator Richard Sandiford
2012-11-13 12:44   ` Eric Botcazou
2012-11-13 21:46     ` Richard Henderson
2012-11-13 22:05       ` Eric Botcazou
2012-11-15 12:11         ` Richard Sandiford
2012-11-15 20:39           ` Richard Henderson
2012-11-18 17:34             ` Richard Sandiford
2012-11-18 17:36     ` Richard Sandiford
2012-11-03 11:27 ` [5/8] Tweak bitfield alignment handling Richard Sandiford
2012-11-13 13:52   ` Eric Botcazou
2012-11-18 17:36     ` Richard Sandiford
2012-11-20  2:57       ` John David Anglin
2012-11-20  8:21         ` Mikael Pettersson
2012-11-20 10:32           ` Richard Sandiford
2012-11-20 19:56             ` Richard Sandiford
2012-11-20 22:11             ` Eric Botcazou
2012-11-03 11:28 ` [6/8] Add strict volatile handling to bit_field_mode_iterator Richard Sandiford
2012-11-13 13:57   ` Eric Botcazou
2012-11-15 12:25     ` Richard Sandiford
2012-11-15 17:10       ` Eric Botcazou
2012-11-15 17:47         ` Richard Sandiford
2012-11-15 19:32           ` Eric Botcazou
2012-11-18 17:36             ` Richard Sandiford
2012-11-03 11:39 ` [7/8] Replace mode_for_extraction with new interface Richard Sandiford
2012-11-03 11:41 ` [8/8] Add new optabs and use them for MIPS Richard Sandiford
2012-11-27 17:11 ` [0/8] Add optabs alternatives for insv, extv and extzv Ramana Radhakrishnan
2012-11-27 20:22   ` Richard Sandiford
2012-11-27 22:45     ` Ramana Radhakrishnan
2012-11-28 10:25       ` Richard Biener
2012-11-28 12:06         ` Ramana Radhakrishnan
2012-11-28 12:51           ` Richard Biener
2012-11-28 13:58       ` Richard Sandiford
2012-11-28 23:19         ` Eric Botcazou
2012-11-29 10:31           ` Richard Sandiford
2012-11-29 15:31             ` Eric Botcazou

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=87fw4rey7w.fsf@talisman.home \
    --to=rdsandiford@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).