From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22956 invoked by alias); 15 Jan 2008 14:44:35 -0000 Received: (qmail 22946 invoked by uid 22791); 15 Jan 2008 14:44:34 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 Jan 2008 14:44:07 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.1/8.14.0) with ESMTP id m0FEi0Qp027352; Tue, 15 Jan 2008 15:44:00 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1/Submit) id m0FEhxN3021953; Tue, 15 Jan 2008 15:43:59 +0100 (CET) Date: Tue, 15 Jan 2008 14:44:00 -0000 Message-Id: <200801151443.m0FEhxN3021953@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: bauerman@br.ibm.com CC: gdb-patches@sourceware.org In-reply-to: <1200400434.3158.64.camel@localhost.localdomain> (message from Thiago Jung Bauermann on Tue, 15 Jan 2008 10:33:53 -0200) Subject: Re: [RFA] Fix float argument passing in inferior function calls for ppc64 References: <1200400434.3158.64.camel@localhost.localdomain> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00350.txt.bz2 > From: Thiago Jung Bauermann > Date: Tue, 15 Jan 2008 10:33:53 -0200 > > Hi, > > The 64-bit PowerPC ELF ABI version 1.9 says that "single precision > floating point values are mapped to the second word in a single > doubleword". The ppc64_sysv_abi_push_dummy_call function in > ppc-sysv-tdep.c, however, implements version 1.7 of the ABI which says > that they should go in the first doubleword. Aren't ABI changes fun? Is the first word used for anything in the new ABI? If not, you could support both ABIs by copying the value into both the first and the second word. > Because of this, if you are calling a function with many arguments and > some need to be passed on the stack, GDB will get it wrong for 32-bit > floats. This is why in Linux/ppc64 GDB fails the "Call function with > many float arguments" test posted here: > > http://sourceware.org/ml/gdb-patches/2008-01/msg00291.html > > This patch fixes the test. It makes GDB pass 32-bit floats in the second > word when passing them in the stack as stated in the current ABI. > > I didn't touch the code which writes the float to a general register in > the first word because I'm not sure how to test it. It is probably > related to soft-float, I guess. Actually, it may be related to varargs. Or perhaps it is a leftover from the 32-bit ABI code that was copied. > Tested on Linux/ppc64 with no regressions. I believe this will also fix > other operating systems supported by GDB on ppc64 since they use the > same push_dummy_call implementation (assuming they also follow the > current SysV ABI), but I don't have the means to test them either. > > Maybe someone could test the patch and the testcase in *BSD? Luis' patch > which has the testcases would also need this testing. There's no 64-bit OpenBSD/powerpc port; we only run on Apple hardware and we run the G5 machines in 32-bit mode. It doesn't look like NetBSD and FreeBSD have a working 64-bit powerpc port either. I'm fairly certain Linux/ppc64 used the old ABI for a while. Are you certain GDB doesn't need to support any people running those older installs anymore?