Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-30 Thread Paolo Bonzini
Il 29/05/2014 19:20, pins...@gmail.com ha scritto: What is your Pmode? Pmode is dimode while ptr_mode is simode. Pointers are zero extended when converting between si and di modes. As you noted, the fundamental difference between x32 and aarch64 is that aarch64 will still use 64-bit

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-29 Thread H.J. Lu
On Wed, May 28, 2014 at 9:52 PM, Andrew Pinski pins...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:39 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:13 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 05:54 PM, H.J. Lu wrote: The key is the XEXP (x, 1) ==

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-29 Thread pinskia
On May 29, 2014, at 9:13 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, May 28, 2014 at 9:52 PM, Andrew Pinski pins...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:39 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:13 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-29 Thread H.J. Lu
On Thu, May 29, 2014 at 9:23 AM, pins...@gmail.com wrote: On May 29, 2014, at 9:13 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, May 28, 2014 at 9:52 PM, Andrew Pinski pins...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:39 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:13

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-29 Thread pinskia
On May 29, 2014, at 10:09 AM, H.J. Lu hjl.to...@gmail.com wrote: On Thu, May 29, 2014 at 9:23 AM, pins...@gmail.com wrote: On May 29, 2014, at 9:13 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, May 28, 2014 at 9:52 PM, Andrew Pinski pins...@gmail.com wrote: On Wed, Jul 13, 2011 at

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2014-05-28 Thread Andrew Pinski
On Wed, Jul 13, 2011 at 9:39 AM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, Jul 13, 2011 at 9:13 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 05:54 PM, H.J. Lu wrote: The key is the XEXP (x, 1) == convert_memory_address_addr_space (to_mode, XEXP (x, 1),

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-29 Thread Paolo Bonzini
Ok, you removed ignore_address_wrap_around, so we're almost there. On 07/28/2011 07:59 PM, H.J. Lu wrote: @@ -712,7 +715,16 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns if (GET_CODE (x) == SUBREG SUBREG_PROMOTED_VAR_P (x) GET_MODE_SIZE

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-29 Thread Paolo Bonzini
On 07/29/2011 08:34 AM, Paolo Bonzini wrote: + temp = rtl_hooks.gen_lowpart_no_emit (mode, x); This line is obviously spurious, sorry. + if (no_emit) + return rtl_hooks.gen_lowpart_no_emit (mode, x); + else +return gen_lowpart (mode, x); Paolo

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-29 Thread H.J. Lu
On Thu, Jul 28, 2011 at 11:34 PM, Paolo Bonzini bonz...@gnu.org wrote: Ok, you removed ignore_address_wrap_around, so we're almost there. On 07/28/2011 07:59 PM, H.J. Lu wrote: @@ -712,7 +715,16 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns    if

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-28 Thread Paolo Bonzini
On 07/28/2011 12:59 AM, H.J. Lu wrote: Regarding correctness: you're converting a SImode operation to DImode by pushing in the zero_extend operation. What makes you think that base + constant offset won't overflow in any case? You have not answered this. And also: what are you

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-28 Thread Uros Bizjak
Hello! convert_memory_address_addr_space has a special PLUS/MULT case for POINTERS_EXTEND_UNSIGNED 0. ?It turns out that it is also needed for all Pmode != ptr_mode cases. ?OK for trunk? 2011-06-11 ?H.J. Lu ?hongjiu...@intel.com ? ? ? ?PR middle-end/47727 ? ? ? ?* explow.c

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-28 Thread Paolo Bonzini
On 07/28/2011 11:30 AM, Uros Bizjak wrote: convert_memory_address_addr_space has a special PLUS/MULT case for POINTERS_EXTEND_UNSIGNED 0. ?It turns out that it is also needed for all Pmode != ptr_mode cases. ?OK for trunk? 2011-06-11 ?H.J. Lu ?hongjiu...@intel.com ? ? ? ?PR

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-28 Thread Uros Bizjak
On Thu, Jul 28, 2011 at 7:59 PM, H.J. Lu hjl.to...@gmail.com wrote:  convert_memory_address_addr_space has a special PLUS/MULT case for  POINTERS_EXTEND_UNSIGNED  0. ?It turns out that it is also needed  for all Pmode != ptr_mode cases. ?OK for trunk?  2011-06-11 ?H.J. Lu

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-27 Thread H.J. Lu
On Mon, Jul 25, 2011 at 2:58 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/13/2011 07:48 PM, H.J. Lu wrote: Here is the patch.  OK for trunk? Again, at least you should explain clearly _why_ you need ignore_address_wrap_around.  You said elsewhere x32 should be first clean, then fast.  

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-27 Thread Paolo Bonzini
On 07/27/2011 07:29 PM, H.J. Lu wrote: If IRNORE_ADDRESS_WRAP_AROUND is TRUE, we + also permute the conversion and addition of a constant. It is used to + optimize cases where overflow of base + constant offset won't happen or + its behavior is implementation-defined for a given target.

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-27 Thread H.J. Lu
On Wed, Jul 27, 2011 at 1:25 PM, Paolo Bonzini bonz...@gnu.org wrote: On 07/27/2011 07:29 PM, H.J. Lu wrote: If IRNORE_ADDRESS_WRAP_AROUND is TRUE, we +   also permute the conversion and addition of a constant.  It is used to +   optimize cases where overflow of base + constant offset won't

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-25 Thread Paolo Bonzini
On 07/13/2011 07:48 PM, H.J. Lu wrote: Here is the patch. OK for trunk? Again, at least you should explain clearly _why_ you need ignore_address_wrap_around. You said elsewhere x32 should be first clean, then fast. if (GET_CODE (x) == SUBREG SUBREG_PROMOTED_VAR_P (x)

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-13 Thread Paolo Bonzini
On 07/11/2011 05:54 PM, H.J. Lu wrote: The key is the XEXP (x, 1) == convert_memory_address_addr_space (to_mode, XEXP (x, 1), as) test. It ensures basically that the constant has 31-bit precision, because otherwise the constant would change from e.g. (const_int

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-13 Thread H.J. Lu
On Wed, Jul 13, 2011 at 9:13 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 05:54 PM, H.J. Lu wrote: The key is the     XEXP (x, 1) == convert_memory_address_addr_space                    (to_mode, XEXP (x, 1), as)  test.  It ensures basically that the constant has 31-bit

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-13 Thread Paolo Bonzini
On Wed, Jul 13, 2011 at 18:39, H.J. Lu hjl.to...@gmail.com wrote: Why?  Certainly Y = 8 has 31-bit (or less) precision.  So it has the same representation in SImode and DImode, and the test above on XEXP (x, 1) succeeds. And then we permute conversion and addition, which leads to the issue

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-13 Thread Paolo Bonzini
Why?  Certainly Y = 8 has 31-bit (or less) precision.  So it has the same representation in SImode and DImode, and the test above on XEXP (x, 1) succeeds. And then we permute conversion and addition, which leads to the issue you raised above.  In another word, the current code permutes

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-13 Thread H.J. Lu
On Wed, Jul 13, 2011 at 9:54 AM, Paolo Bonzini bonz...@gnu.org wrote: Why?  Certainly Y = 8 has 31-bit (or less) precision.  So it has the same representation in SImode and DImode, and the test above on XEXP (x, 1) succeeds. And then we permute conversion and addition, which leads to the

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-11 Thread Paolo Bonzini
On 07/11/2011 02:04 AM, H.J. Lu wrote: With my original change, I got (const:DI (plus:DI (symbol_ref:DI (iplane.1577) [flags 0x2] var_decl 0x70857960 iplane) (const_int -4 [0xfffc]))) I think it is safe to permute the conversion and addition operation if one operand

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-11 Thread H.J. Lu
On Mon, Jul 11, 2011 at 4:03 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 02:04 AM, H.J. Lu wrote: With my original change,  I got (const:DI (plus:DI (symbol_ref:DI (iplane.1577) [flags 0x2] var_decl 0x70857960 iplane)         (const_int -4 [0xfffc]))) I think it

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-11 Thread H.J. Lu
On Mon, Jul 11, 2011 at 8:54 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Jul 11, 2011 at 4:03 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 02:04 AM, H.J. Lu wrote: With my original change,  I got (const:DI (plus:DI (symbol_ref:DI (iplane.1577) [flags 0x2] var_decl

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-11 Thread H.J. Lu
On Mon, Jul 11, 2011 at 9:55 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Jul 11, 2011 at 8:54 AM, H.J. Lu hjl.to...@gmail.com wrote: On Mon, Jul 11, 2011 at 4:03 AM, Paolo Bonzini bonz...@gnu.org wrote: On 07/11/2011 02:04 AM, H.J. Lu wrote: With my original change,  I got (const:DI

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-10 Thread Paolo Bonzini
On Sat, Jul 9, 2011 at 23:31, H.J. Lu hjl.to...@gmail.com wrote: On Sat, Jul 9, 2011 at 2:18 PM, Paolo Bonzini bonz...@gnu.org wrote: On 07/05/2011 04:27 PM, H.J. Lu wrote:  diff --git a/gcc/explow.c b/gcc/explow.c  index 7387dad..b343bf8 100644  --- a/gcc/explow.c  +++ b/gcc/explow.c  @@

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-10 Thread H.J. Lu
On Sun, Jul 10, 2011 at 9:36 AM, Paolo Bonzini bonz...@gnu.org wrote: On Sat, Jul 9, 2011 at 23:31, H.J. Lu hjl.to...@gmail.com wrote: On Sat, Jul 9, 2011 at 2:18 PM, Paolo Bonzini bonz...@gnu.org wrote: On 07/05/2011 04:27 PM, H.J. Lu wrote:  diff --git a/gcc/explow.c b/gcc/explow.c  index

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-10 Thread H.J. Lu
On Sun, Jul 10, 2011 at 5:04 PM, H.J. Lu hjl.to...@gmail.com wrote: On Sun, Jul 10, 2011 at 4:51 PM, H.J. Lu hjl.to...@gmail.com wrote: On Sun, Jul 10, 2011 at 2:04 PM, H.J. Lu hjl.to...@gmail.com wrote: On Sun, Jul 10, 2011 at 9:36 AM, Paolo Bonzini bonz...@gnu.org wrote: On Sat, Jul 9, 2011

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-09 Thread H.J. Lu
Hi Jeff, Can you take a look at this? Thanks. H.J. On Tue, Jul 5, 2011 at 7:27 AM, H.J. Lu hjl.to...@gmail.com wrote: Ping. On Sat, Jun 11, 2011 at 8:58 AM, H.J. Lu hongjiu...@intel.com wrote: Hi, convert_memory_address_addr_space has a special PLUS/MULT case for POINTERS_EXTEND_UNSIGNED

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-09 Thread Paolo Bonzini
On 07/05/2011 04:27 PM, H.J. Lu wrote: diff --git a/gcc/explow.c b/gcc/explow.c index 7387dad..b343bf8 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -383,18 +383,13 @@ convert_memory_address_addr_space (enum machine_mode to_mode ATTRIBUTE_UNUSED, case PLUS: case MULT: -

Re: PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-09 Thread H.J. Lu
On Sat, Jul 9, 2011 at 2:18 PM, Paolo Bonzini bonz...@gnu.org wrote: On 07/05/2011 04:27 PM, H.J. Lu wrote:  diff --git a/gcc/explow.c b/gcc/explow.c  index 7387dad..b343bf8 100644  --- a/gcc/explow.c  +++ b/gcc/explow.c  @@ -383,18 +383,13 @@ convert_memory_address_addr_space (enum

PING: PATCH [4/n]: Prepare x32: Permute the conversion and addition if one operand is a constant

2011-07-05 Thread H.J. Lu
Ping. On Sat, Jun 11, 2011 at 8:58 AM, H.J. Lu hongjiu...@intel.com wrote: Hi, convert_memory_address_addr_space has a special PLUS/MULT case for POINTERS_EXTEND_UNSIGNED 0.  It turns out that it is also needed for all Pmode != ptr_mode cases.  OK for trunk? Thanks. H.J. ---