This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add missing TRULY_NOOP_TRUNCATION
- From: Roger Sayle <roger at eyesopen dot com>
- To: Adam Nemet <anemet at sonic dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Jan 2006 07:33:25 -0700 (MST)
- Subject: Re: [PATCH] Add missing TRULY_NOOP_TRUNCATION
On Mon, 2 Jan 2006, Adam Nemet wrote:
>
> * combine.c (apply_distributive_law <SUBREG>): Check
> TRULY_NOOP_TRUNCATION.
This is OK for mainline.
At first glance, it's wasn't immediately obvious why converting
(plus:SI (subreg:SI (reg:DI)) (subreg:SI (reg:DI)))
into
(subreg:SI (plus:DI (reg:DI) (reg:DI)))
isn't always a win, it would appear to convert two truncations into
a single truncation and perform the operation in word_mode, but I can
imagine that given the semantics of TRULY_NOOP_TRUNCATION that we've
machine descriptions where the SUBREGs in the first pattern aren't
truncations and plus:SI is clever, but the SUBREG in the result needs
to become an explicit truncation.
It would be nice if you could find/provide a testcase affected by
this patch for the testsuite, to prevent us undoing your change in
future, or to investigate whether it would be beneficial to perform
this transformation but with an explicit TRUNCATE:SI instead.
Roger
--