From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5172 invoked by alias); 29 Oct 2014 20:01:53 -0000 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 Received: (qmail 5161 invoked by uid 89); 29 Oct 2014 20:01:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f43.google.com Received: from mail-qg0-f43.google.com (HELO mail-qg0-f43.google.com) (209.85.192.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 29 Oct 2014 20:01:52 +0000 Received: by mail-qg0-f43.google.com with SMTP id f51so2938275qge.30 for ; Wed, 29 Oct 2014 13:01:50 -0700 (PDT) X-Received: by 10.140.80.165 with SMTP id c34mr18497766qgd.96.1414612909887; Wed, 29 Oct 2014 13:01:49 -0700 (PDT) Received: from pike.twiddle.home (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id e49sm4968859qgf.15.2014.10.29.13.01.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Oct 2014 13:01:48 -0700 (PDT) Message-ID: <545147A9.9090401@twiddle.net> Date: Wed, 29 Oct 2014 20:01:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: David Miller CC: libffi-discuss@sourceware.org Subject: Re: [PATCH 3/8] sparc: Rewrite everything References: <1414525555-21256-1-git-send-email-rth@twiddle.net> <1414525555-21256-4-git-send-email-rth@twiddle.net> <20141029.141027.901195445453157818.davem@davemloft.net> In-Reply-To: <20141029.141027.901195445453157818.davem@davemloft.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014/txt/msg00159.txt.bz2 On 10/29/2014 11:10 AM, David Miller wrote: > From: Richard Henderson > Date: Tue, 28 Oct 2014 12:45:50 -0700 > >> + case FFI_TYPE_STRUCT: >> + if (rtype->size > 32) >> + { >> + flags = SPARC_RET_VOID | SPARC_FLAG_RET_IN_MEM; >> + bytes = 8; >> + } >> + else >> + flags = SPARC_RET_STRUCT; >> + break; > > Here you use a cutoff of 32 bytes. Return type. > >> + case FFI_TYPE_LONGDOUBLE: >> + case FFI_TYPE_STRUCT: >> + z = ty->size; >> + if (z > 16) >> + { >> + /* For structures larger than 16 bytes we pass reference. */ >> + *argp++ = (unsigned long)a; >> + break; >> + } >> + if (((unsigned long)argp & 15) && ty->alignment > 8) >> + argp++; >> + memcpy(argp, a, z); >> + argp += ALIGN(z, 8) / 8; >> + break; > > Yet here in args prep, the cutoff is 16. Parameter type. > Maybe I'm missing something? The two limits are in fact different. In gcc, see sparc_return_in_memory and sparc_pass_by_reference. r~