From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13346 invoked by alias); 30 May 2017 01:24:41 -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 13183 invoked by uid 89); 30 May 2017 01:24:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=suspected, plate, HTo:U*libffi-discuss, night X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 May 2017 01:24:19 +0000 Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP id FVtPdH6LsM9gtFVtQdW4VK; Mon, 29 May 2017 19:24:16 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=tJ8p9aeEuA8A:10 a=xGWB3w-mHHkA:10 a=2KUf1mbJAAAA:8 a=_QZPFLdNXHesEhBAYd4A:9 a=QEXdDO2ut3YA:10 a=IYO0QWCRswoA:10 a=LME9DoRMzU6P72L8X6EC:22 Received: from www-data by kylheku.com with local (Exim 4.72) (envelope-from <382-725-6798@kylheku.com>) id 1dFVtN-0005mg-Qz for libffi-discuss@sourceware.org; Mon, 29 May 2017 18:24:13 -0700 To: libffi-discuss@sourceware.org Subject: Re: Also: problem with return value in =?UTF-8?Q?ffi=5Fcall=20on?= =?UTF-8?Q?=20PPC=36=34=2E?= X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Tue, 30 May 2017 01:24:00 -0000 From: "Kaz Kylheku (libffi)" <382-725-6798@kylheku.com> In-Reply-To: <20170528192241.464e7ebe@sf> References: <3b9c322ddca2e20fa30c7eba0e5ebda2@mail.kylheku.com> <20170528192241.464e7ebe@sf> Message-ID: X-Sender: 382-725-6798@kylheku.com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfCcHkRFAdwLmKUSY62cUQLGTHLdXOFdVaxsfr+3pcorpYt8rKV1TNqaz0FUWGjNsbMwkLfNlo5bNt2ZK/IoUKLY0Bc3MnQ4YX5+3StBwlcUU+PRHhfga eqo6fVR8m/jSAzBEHQOKiqACyaDEk4Zpjj9Mh2Rxqi45oBKojFqflZw2hBJW0GssMVDE4OWEiM8YWQ== X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00013.txt.bz2 On 28.05.2017 11:22, Sergei Trofimovich wrote: > On Sat, 27 May 2017 19:15:35 -0700 > "Kaz Kylheku (libffi)" <382-725-6798@kylheku.com> wrote: >=20 >> > Are users supposed to assume that the return value has been widened to >> > a register-wide (8 byte) value regardless of its declared FFI type? >>=20 >> Indeed, it seems yes. >=20 > Confusingly yes. But only for integral types smaller that ffi_arg. Thanks for your response and everyone else's. I feverishly patched up all my code on Saturday night and got all my test cases to pass on PPC64 with clean Valgrind, without regressing on the little endian Intels. My OOP-in-C framework that wraps around libffi basically absorbed this change quite easily, with hardly much uglification. Just a proliferation of boiler plate code. (I never suspected it would be otherwise; but it was a question of understanding the requirements first; having already acted hastily on the somewhat wrong requirements already.)