public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Richard Henderson <rth@redhat.com>
Cc: Bernd Schmidt <bernds@codesourcery.com>,
	"H.J. Lu" <hjl.tools@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	ubizjak@gmail.com
Subject: Re: x86_64 varargs setup jump table
Date: Mon, 19 Jul 2010 16:23:00 -0000	[thread overview]
Message-ID: <20100719162327.GD17201@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <4C447222.7080500@redhat.com>

> On 07/17/2010 07:25 AM, Bernd Schmidt wrote:
> >  	leaq	0(,%rax,4), %rcx
> >  	movl	$.L2, %eax
> >  	subq	%rcx, %rax
> >  	jmp	*%rax
> 
> I've often thought this was over-engineering in the x86_64 abi.
> This jump table is trading memory bandwidth for unpredictability
> in the branch target.
> 
> I've often wondered if we'd get better performance if we changed
> to a simple comparison against zero.  I.e.
> 
> 	test	%al,%al
> 	jz	1f
> 	// 8 xmm stores
> 1:
> 
> H.J., do you think you'd be able to measure performance on this?

THe orginal problem was the fact that early K8 chips had no way of effectively
storing SSE register to memory whithout knowing its type.  So the stores in
prologue executed very slow when reformating happent.  Same reason was
for not having callee saved/restored SSE regs.

On current chips this is not big issue, so I do not care what way we output.
In fact I used to have patch for doing the jz but lost it.  I think we might
keep supporting both to get some checking that ABI is not terribly broken
(i.e. that no other copmilers just feeds rax with random value, but always
by number of args).

Honza
> 
> 
> 
> r~

  parent reply	other threads:[~2010-07-19 16:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 10:35 New optimization for reload_combine Bernd Schmidt
2010-07-16 18:32 ` Jeff Law
2010-07-16 23:50   ` Bernd Schmidt
2010-07-17  2:38     ` H.J. Lu
2010-07-17 14:25       ` Bernd Schmidt
2010-07-17 15:03         ` H.J. Lu
2010-07-17 15:10           ` IainS
2010-07-17 16:00           ` Bernd Schmidt
2010-07-17 16:15             ` H.J. Lu
2010-07-17 17:18               ` Bernd Schmidt
2010-07-17 17:27                 ` H.J. Lu
2010-07-17 17:29                 ` IainS
2010-07-18 18:15             ` H.J. Lu
2010-07-19 10:01           ` Bernd Schmidt
2010-07-19 13:27             ` H.J. Lu
2010-07-20 11:46             ` Bernd Schmidt
2010-07-20 15:33               ` Jeff Law
2010-07-20 15:34               ` Bernd Schmidt
2010-07-20 15:40                 ` Jakub Jelinek
2010-07-19 15:41         ` x86_64 varargs setup jump table Richard Henderson
2010-07-19 15:56           ` H.J. Lu
2010-07-19 20:57             ` H.J. Lu
2010-07-19 21:14               ` Richard Henderson
2010-07-20 16:32                 ` Richard Henderson
2010-07-20 23:05                   ` Richard Henderson
2010-07-20 23:21                     ` Sebastian Pop
2010-07-22 13:52                     ` H.J. Lu
2010-07-22 18:03                       ` Sebastian Pop
2010-07-22 18:15                         ` Richard Henderson
2010-07-22 18:17                           ` Richard Henderson
2010-07-22 18:20                             ` Sebastian Pop
2010-07-21 23:15                   ` H.J. Lu
2010-07-22 21:53                     ` Fix target/45027 [was: x86_64 varargs setup jump table] Richard Henderson
2010-07-23  9:07                       ` Richard Guenther
2010-07-19 16:09           ` x86_64 varargs setup jump table Andi Kleen
2010-07-19 16:16             ` H.J. Lu
2010-07-19 16:26               ` Andi Kleen
2010-07-19 16:23           ` Jan Hubicka [this message]
2010-07-19 16:19         ` New optimization for reload_combine Jeff Law
2010-11-04  4:30       ` H.J. Lu
2010-07-16 19:45 ` Paolo Bonzini
2010-07-16 19:55   ` Bernd Schmidt
2010-07-16 20:24     ` Paolo Bonzini
2010-07-19 16:11   ` Mark Mitchell
2010-07-19 16:13     ` Jeff Law
2010-07-19 16:31     ` Paolo Bonzini
2010-07-26 10:13 ` IainS
2010-07-26 10:46   ` Bernd Schmidt
2010-07-27  0:53   ` Bernd Schmidt

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=20100719162327.GD17201@atrey.karlin.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=rth@redhat.com \
    --cc=ubizjak@gmail.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).