Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-16 Thread Jeff Law
On 04/29/2016 03:35 AM, Dominik Vogt wrote: On Wed, Apr 27, 2016 at 10:24:21PM -0600, Jeff Law wrote: Instead you want insn 12 to use a zero-extend to extend (reg:SI 64) into (reg:DI 2)? Yes, because we get the zero extend for free in this case (through the constant in the AND or because the

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-10 Thread Richard Biener
On Tue, May 10, 2016 at 12:07 PM, Dominik Vogt wrote: > On Tue, May 10, 2016 at 11:14:35AM +0200, Richard Biener wrote: >> On Mon, May 9, 2016 at 3:36 PM, Marc Glisse wrote: >> > On Mon, 9 May 2016, Dominik Vogt wrote: >> > >> >> This turns out to

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-10 Thread Dominik Vogt
On Tue, May 10, 2016 at 11:14:35AM +0200, Richard Biener wrote: > On Mon, May 9, 2016 at 3:36 PM, Marc Glisse wrote: > > On Mon, 9 May 2016, Dominik Vogt wrote: > > > >> This turns out to be quite difficult. A small test function > >> effectively just returns the argument:

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-10 Thread Richard Biener
On Mon, May 9, 2016 at 3:36 PM, Marc Glisse wrote: > On Mon, 9 May 2016, Dominik Vogt wrote: > >> This turns out to be quite difficult. A small test function >> effectively just returns the argument: >> >> unsigned long bar (unsigned long in) >> { >>if ((in & 1) == 0)

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-09 Thread Marc Glisse
On Mon, 9 May 2016, Dominik Vogt wrote: This turns out to be quite difficult. A small test function effectively just returns the argument: unsigned long bar (unsigned long in) { if ((in & 1) == 0) in = (in & ~(unsigned long)1); return in; } However, Gcc does not notice that

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-05-09 Thread Dominik Vogt
On Wed, Apr 27, 2016 at 10:24:21PM -0600, Jeff Law wrote: > On 04/27/2016 02:20 AM, Dominik Vogt wrote: > >The attached patch is a result of discussing an S/390 issue with > >"and with complement" in some cases. > > > > https://gcc.gnu.org/ml/gcc/2016-03/msg00163.html > >

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-04-29 Thread Dominik Vogt
On Wed, Apr 27, 2016 at 10:24:21PM -0600, Jeff Law wrote: > On 04/27/2016 02:20 AM, Dominik Vogt wrote: > > * combine.c (make_compound_operation): Take known zero bits into > > account when checking for possible zero_extend. > I'd strongly recommend writing some tests for this. Extra

Re: [PATCH] Take known zero bits into account when checking extraction.

2016-04-27 Thread Jeff Law
On 04/27/2016 02:20 AM, Dominik Vogt wrote: The attached patch is a result of discussing an S/390 issue with "and with complement" in some cases. https://gcc.gnu.org/ml/gcc/2016-03/msg00163.html https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01586.html Combine would merge a ZERO_EXTEND and

[PATCH] Take known zero bits into account when checking extraction.

2016-04-27 Thread Dominik Vogt
for possible zero_extend. >From e70e6e469200b53b3f4ae52a766cdd322a4d365d Mon Sep 17 00:00:00 2001 From: Dominik Vogt <v...@linux.vnet.ibm.com> Date: Tue, 12 Apr 2016 09:53:46 +0100 Subject: [PATCH] Take known zero bits into account when checking extraction. Allows AND Insns wi