From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16763 invoked by alias); 24 Feb 2011 06:37:44 -0000 Received: (qmail 16753 invoked by uid 22791); 24 Feb 2011 06:37:43 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Feb 2011 06:37:38 +0000 Received: by pwi10 with SMTP id 10so187245pwi.0 for ; Wed, 23 Feb 2011 22:37:37 -0800 (PST) Received: by 10.142.225.4 with SMTP id x4mr390242wfg.215.1298529457106; Wed, 23 Feb 2011 22:37:37 -0800 (PST) Received: from [192.168.1.16] (59-104-108-116.adsl.dynamic.seed.net.tw [59.104.108.116]) by mx.google.com with ESMTPS id o11sm11857416wfa.12.2011.02.23.22.37.34 (version=SSLv3 cipher=OTHER); Wed, 23 Feb 2011 22:37:36 -0800 (PST) Message-ID: <4D65FCB7.9090909@linaro.org> Date: Thu, 24 Feb 2011 06:37:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: David Gilbert CC: Anthony Green , libffi-discuss@sourceware.org, Marcus.Shawcroft@arm.com Subject: Re: [PATCH] Add variadic support References: <20110222154022.GA29862@davesworkthinkpad> <4D650ADE.6040609@linaro.org> <4D653C3D.2050107@linaro.org> <4D654655.5000503@linaro.org> In-Reply-To: <4D654655.5000503@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org X-SW-Source: 2011/txt/msg00084.txt.bz2 On 2011/2/24, Chung-Lin Tang wrote: >>> I suggest moving the nfixedargs field into the ARM FFI_EXTRA_CIF_FIELDS, >>> >> placed after the current VFP fields; this means doing away with the >>> >> FFI_TARGET_SPECIFIC_VARIADIC symbol, and probably having a >>> >> machine-specific ffi_prep_cif_var_machdep() function, analogous to the >>> >> current ffi_prep_cif_machdep(). >> > >> > That would mean changing every back end to add that function or again > Okay, then we should keep the preprocessor symbol then; we can then use > the basic ffi_prep_cif() as the default ffi_prep_cif_var() implementation. > I just wanted to add that, instead of a new ffi_prep_cif_var_machdep() function for all backends to add, thus needing a preprocessor symbol to set a 'default' implementation (to avoid changing every port), we can do this: add a flag value, passed by cif->flags, into ffi_prep_cif_machdep() to indicate variadic function processing. We'll just need a new flag value CPP symbol, but avoid an ugly #ifndef in the machine-independent code. I'm suggesting this because I see cif->flags being overwritten anyways by the backend ffi_prep_cif_machdep() implementations I see, so it should be valid to pass in values for this use. Chung-Lin