From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1213 invoked by alias); 19 Jul 2010 16:16:09 -0000 Received: (qmail 1179 invoked by uid 22791); 19 Jul 2010 16:15:57 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pz0-f47.google.com (HELO mail-pz0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Jul 2010 16:15:51 +0000 Received: by pzk2 with SMTP id 2so2097527pzk.20 for ; Mon, 19 Jul 2010 09:15:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.147.7 with SMTP id u7mr7206709wfd.219.1279556147866; Mon, 19 Jul 2010 09:15:47 -0700 (PDT) Received: by 10.142.226.18 with HTTP; Mon, 19 Jul 2010 09:15:47 -0700 (PDT) In-Reply-To: <87oce3lagn.fsf@basil.nowhere.org> References: <4C4035C3.9080305@codesourcery.com> <4C40A5BD.9080208@redhat.com> <4C40F005.3060507@codesourcery.com> <4C41BD52.5040905@codesourcery.com> <4C447222.7080500@redhat.com> <87oce3lagn.fsf@basil.nowhere.org> Date: Mon, 19 Jul 2010 16:16:00 -0000 Message-ID: Subject: Re: x86_64 varargs setup jump table From: "H.J. Lu" To: Andi Kleen Cc: Richard Henderson , Bernd Schmidt , GCC Patches , ubizjak@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg01503.txt.bz2 On Mon, Jul 19, 2010 at 9:09 AM, Andi Kleen wrote: > Richard Henderson writes: > >> On 07/17/2010 07:25 AM, Bernd Schmidt wrote: >>> =A0 =A0 =A0leaq =A0 =A00(,%rax,4), %rcx >>> =A0 =A0 =A0movl =A0 =A0$.L2, %eax >>> =A0 =A0 =A0subq =A0 =A0%rcx, %rax >>> =A0 =A0 =A0jmp =A0 =A0 *%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. > > The other problem with the jump is that if you misdeclare > the prototype and nothing correct is passed in %eax FWIW, we DON'T support varargs without correct prototype on x86-64. See AVX support in x86-64 psABI for details. --=20 H.J.