public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Sandiford <rdsandiford@googlemail.com>
Cc: gcc-patches@gcc.gnu.org,
	Andrew Pinski <andrew.pinski@caviumnetworks.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	Paul_Koning@dell.com, kkojima@gcc.gnu.org, aoliva@redhat.com,
	dje.gcc@gmail.com, uweigand@de.ibm.com, walt@tilera.com
Subject: Re: RFA: Simplifying truncation and integer lowpart subregs
Date: Sat, 06 Oct 2012 11:13:00 -0000	[thread overview]
Message-ID: <6083166.IsGSDDFhFR@polaris> (raw)
In-Reply-To: <87k3v3oq72.fsf_-_@talisman.home>

> Tested on x86_64-linux-gnu, mipsisa32-elf and mipsisa64-elf.  Also tested
> by making sure that there were no code differences for a set of gcc .ii
> files on gcc20 (-O2 -march=native).  OK to install?

Are you sure that generating TRUNCATEs out of nowhere in simplify_subreg is 
always correct?

> gcc/
> 	* machmode.h (GET_MODE_UNIT_PRECISION): New macro.
> 	* simplify-rtx.c (simplify_truncation): New function.

You should say where it comes from.

> 	(simplify_unary_operation_1): Use it.  Remove sign bit test
> 	for !TRULY_NOOP_TRUNCATION_MODES_P.

	(simplify_unary_operation_1) <TRUNCATE>: ...

> 	(simplify_subreg): Use simplify_int_lowpart for TRUNCATE.

This function doesn't exist.  And this is misleading, it's not just for 
TRUNCATE, it's for a truncation to the lowpart.

>  /* Try to simplify a unary operation CODE whose output mode is to be
>     MODE with input operand OP whose mode was originally OP_MODE.
>     Return zero if no simplification can be made.  */
> @@ -689,12 +850,6 @@ simplify_unary_operation_1 (enum rtx_cod
>  	    op_mode = mode;
>  	  in2 = simplify_gen_unary (NOT, op_mode, in2, op_mode);
> 
> -	  if (GET_CODE (in2) == NOT && GET_CODE (in1) != NOT)
> -	    {
> -	      rtx tem = in2;
> -	      in2 = in1; in1 = tem;
> -	    }
> -
>  	  return gen_rtx_fmt_ee (GET_CODE (op) == IOR ? AND : IOR,
>  				 mode, in1, in2);
>  	}

Why is this hunk here?

> @@ -5595,14 +5730,6 @@ simplify_subreg (enum machine_mode outer
>        return NULL_RTX;
>      }
> 
> -  /* Merge implicit and explicit truncations.  */
> -
> -  if (GET_CODE (op) == TRUNCATE
> -      && GET_MODE_SIZE (outermode) < GET_MODE_SIZE (innermode)
> -      && subreg_lowpart_offset (outermode, innermode) == byte)
> -    return simplify_gen_unary (TRUNCATE, outermode, XEXP (op, 0),
> -			       GET_MODE (XEXP (op, 0)));
> -
>    /* SUBREG of a hard register => just change the register number
>       and/or mode.  If the hard register is not valid in that mode,
>       suppress this simplification.  If the hard register is the stack,

Likewise.

-- 
Eric Botcazou

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

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25  8:04 [PATCH, rtl-optimization]: Fix PR54457, [x32] Fail to combine 64bit index + constant Uros Bizjak
2012-09-26 18:17 ` Richard Sandiford
2012-09-26 21:38   ` Eric Botcazou
2012-09-27 14:25     ` Uros Bizjak
2012-09-27 16:10       ` Richard Sandiford
2012-09-27 18:20         ` [PATCH v2, " Uros Bizjak
2012-09-27 18:35           ` Paul_Koning
2012-09-27 19:21             ` Uros Bizjak
2012-10-02  2:13               ` Andrew Pinski
2012-10-02 19:32                 ` Richard Sandiford
2012-10-06 10:22                   ` RFA: Simplifying truncation and integer lowpart subregs Richard Sandiford
2012-10-06 11:13                     ` Eric Botcazou [this message]
2012-10-06 12:39                       ` Richard Sandiford
2012-10-06 13:05                         ` Eric Botcazou
2012-10-07  8:56                           ` Richard Sandiford
2012-10-07 12:36                             ` Eric Botcazou
2012-11-28  2:27                             ` Ramana Radhakrishnan
2012-11-28 21:45                               ` Richard Sandiford
2012-09-27 20:33           ` [PATCH v2, rtl-optimization]: Fix PR54457, [x32] Fail to combine 64bit index + constant Jakub Jelinek
2012-09-27 22:37             ` Richard Sandiford
2012-09-28 15:39             ` Uros Bizjak
2012-09-30 11:40               ` Richard Sandiford
2012-10-03 11:07                 ` Paolo Bonzini

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=6083166.IsGSDDFhFR@polaris \
    --to=ebotcazou@adacore.com \
    --cc=Paul_Koning@dell.com \
    --cc=andrew.pinski@caviumnetworks.com \
    --cc=aoliva@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kkojima@gcc.gnu.org \
    --cc=rdsandiford@googlemail.com \
    --cc=ubizjak@gmail.com \
    --cc=uweigand@de.ibm.com \
    --cc=walt@tilera.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).