Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-06 Thread H.J. Lu
On Mon, Mar 5, 2012 at 9:11 AM, H.J. Lu hjl.to...@gmail.com wrote: On Sun, Mar 4, 2012 at 11:47 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Mar 5, 2012 at 4:53 AM, H.J. Lu hjl.to...@gmail.com wrote: and compiler does generate the same output. i386.c also has        xasm = jmp\t%A0;    

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread Uros Bizjak
On Mon, Mar 5, 2012 at 9:01 AM, Uros Bizjak ubiz...@gmail.com wrote: @@ -11388,6 +11400,11 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)   else     disp = addr;                       /* displacement */ +  /* Since address override works only on the (reg) part in fs:(reg),

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread H.J. Lu
On Sun, Mar 4, 2012 at 11:47 PM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Mar 5, 2012 at 4:53 AM, H.J. Lu hjl.to...@gmail.com wrote: and compiler does generate the same output. i386.c also has        xasm = jmp\t%A0;    xasm = call\t%A0; for calls.  There are no separate indirect call

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread H.J. Lu
On Mon, Mar 5, 2012 at 12:01 AM, Uros Bizjak ubiz...@gmail.com wrote: On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu hjl.to...@gmail.com wrote: @@ -11388,6 +11400,11 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)   else     disp = addr;                       /* displacement */ +  

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread H.J. Lu
On Mon, Mar 5, 2012 at 12:24 AM, Uros Bizjak ubiz...@gmail.com wrote: On Mon, Mar 5, 2012 at 9:01 AM, Uros Bizjak ubiz...@gmail.com wrote: @@ -11388,6 +11400,11 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)   else     disp = addr;                       /* displacement */ +

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread Jakub Jelinek
On Mon, Mar 05, 2012 at 09:13:49AM -0800, H.J. Lu wrote: We are expecting address to be 0x1001 - 1 == 0x1000.  But, what we get is 0x1000 + 0x, not 0x1000 since 0x67 address prefix only applies to base register to zero-extend 0x to 64bit. I would call this a bug in the

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread H.J. Lu
On Mon, Mar 5, 2012 at 9:20 AM, Jakub Jelinek ja...@redhat.com wrote: On Mon, Mar 05, 2012 at 09:13:49AM -0800, H.J. Lu wrote: We are expecting address to be 0x1001 - 1 == 0x1000.  But, what we get is 0x1000 + 0x, not 0x1000 since 0x67 address prefix only applies to base register

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread Jakub Jelinek
On Mon, Mar 05, 2012 at 09:26:20AM -0800, H.J. Lu wrote: On Mon, Mar 5, 2012 at 9:20 AM, Jakub Jelinek ja...@redhat.com wrote: On Mon, Mar 05, 2012 at 09:13:49AM -0800, H.J. Lu wrote: We are expecting address to be 0x1001 - 1 == 0x1000.  But, what we get is 0x1000 + 0x, not 0x1000

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread H.J. Lu
On Mon, Mar 5, 2012 at 9:31 AM, Jakub Jelinek ja...@redhat.com wrote: On Mon, Mar 05, 2012 at 09:26:20AM -0800, H.J. Lu wrote: On Mon, Mar 5, 2012 at 9:20 AM, Jakub Jelinek ja...@redhat.com wrote: On Mon, Mar 05, 2012 at 09:13:49AM -0800, H.J. Lu wrote: We are expecting address to be 0x1001

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-05 Thread Uros Bizjak
On Tue, Mar 6, 2012 at 6:40 AM, H.J. Lu hjl.to...@gmail.com wrote: We are expecting address to be 0x1001 - 1 == 0x1000.  But, what we get is 0x1000 + 0x, not 0x1000 since 0x67 address prefix only applies to base register to zero-extend 0x to 64bit. I would call

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread Uros Bizjak
On Sat, Nov 12, 2011 at 3:19 AM, H.J. Lu hongjiu...@intel.com wrote: The current x32 implementation uses LEAs to convert 32bit address to 64bit.  However, we can use addr32 prefix to use 32bit address directly. It improves performance by 5% in SPEC CPU 2K/2006.  All changes are done in x86

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread H.J. Lu
On Sun, Mar 4, 2012 at 12:09 PM, Uros Bizjak ubiz...@gmail.com wrote: On Sat, Nov 12, 2011 at 3:19 AM, H.J. Lu hongjiu...@intel.com wrote: The current x32 implementation uses LEAs to convert 32bit address to 64bit.  However, we can use addr32 prefix to use 32bit address directly. It improves

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread Uros Bizjak
On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu hjl.to...@gmail.com wrote: @@ -13637,7 +13665,8 @@ ix86_print_operand (FILE *file, rtx x, int code)              gcc_unreachable ();            } -         ix86_print_operand (file, x, 0); +         ix86_print_operand (file, x, +                    

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread H.J. Lu
On Sun, Mar 4, 2012 at 2:40 PM, Uros Bizjak ubiz...@gmail.com wrote: On Sun, Mar 4, 2012 at 11:01 PM, H.J. Lu hjl.to...@gmail.com wrote: @@ -13637,7 +13665,8 @@ ix86_print_operand (FILE *file, rtx x, int code)              gcc_unreachable ();            } -         ix86_print_operand (file,

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread Ian Lance Taylor
H.J. Lu hjl.to...@gmail.com writes: @@ -11060,8 +11072,8 @@ ix86_expand_split_stack_prologue (void)        {          rtx rax; -         rax = gen_rtx_REG (Pmode, AX_REG); -         emit_move_insn (rax, reg10); +         rax = gen_rtx_REG (word_mode, AX_REG); +         emit_move_insn

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-04 Thread Uros Bizjak
On Mon, Mar 5, 2012 at 4:53 AM, H.J. Lu hjl.to...@gmail.com wrote: and compiler does generate the same output. i386.c also has        xasm = jmp\t%A0;    xasm = call\t%A0; for calls.  There are no separate indirect call patterns.  For x32, only indirect register calls have to be in DImode.

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2012-03-02 Thread H.J. Lu
On Sat, Nov 12, 2011 at 9:32 AM, Uros Bizjak ubiz...@gmail.com wrote: On Sat, Nov 12, 2011 at 3:19 AM, H.J. Lu hongjiu...@intel.com wrote: The current x32 implementation uses LEAs to convert 32bit address to 64bit.  However, we can use addr32 prefix to use 32bit address directly. It improves

Re: PATCH [1/n] addr32: Properly use Pmode and word_mode

2011-11-12 Thread Uros Bizjak
On Sat, Nov 12, 2011 at 3:19 AM, H.J. Lu hongjiu...@intel.com wrote: The current x32 implementation uses LEAs to convert 32bit address to 64bit.  However, we can use addr32 prefix to use 32bit address directly. It improves performance by 5% in SPEC CPU 2K/2006.  All changes are done in x86

PATCH [1/n] addr32: Properly use Pmode and word_mode

2011-11-11 Thread H.J. Lu
Hi, The current x32 implementation uses LEAs to convert 32bit address to 64bit. However, we can use addr32 prefix to use 32bit address directly. It improves performance by 5% in SPEC CPU 2K/2006. All changes are done in x86 backend, except for a smaill unwind library assert change: