From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31929 invoked by alias); 6 Feb 2008 03:57:04 -0000 Received: (qmail 31919 invoked by uid 22791); 6 Feb 2008 03:57:03 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Feb 2008 03:56:42 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw1.br.ibm.com (Postfix) with ESMTP id F18ED32C087 for ; Wed, 6 Feb 2008 01:34:22 -0200 (BRDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m163uaAZ4522210 for ; Wed, 6 Feb 2008 01:56:36 -0200 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m163uaHM008125 for ; Wed, 6 Feb 2008 01:56:36 -0200 Received: from [9.12.235.82] ([9.12.235.82]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m163uWWS008108; Wed, 6 Feb 2008 01:56:33 -0200 Subject: Re: [RFC] Linux-specific ppc32 ABI From: Thiago Jung Bauermann To: Mark Kettenis Cc: brobecker@adacore.com, luisgpm@linux.vnet.ibm.com, drow@false.org, gdb-patches@sourceware.org In-Reply-To: <200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl> References: <1199991624.3343.19.camel@gargoyle> <20080111060629.GC12954@adacore.com> <1200066920.26270.9.camel@gargoyle> <20080111155733.GA3240@caradoc.them.org> <1200086736.26270.35.camel@gargoyle> <1201277155.11950.134.camel@localhost.localdomain> <200801261535.m0QFZddH026156@brahms.sibelius.xs4all.nl> <20080201223839.GA27578@adacore.com> <200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl> Content-Type: multipart/mixed; boundary="=-G/kb/MAIFcJ/8VuQWVaE" Date: Wed, 06 Feb 2008 03:57:00 -0000 Message-Id: <1202270167.21596.23.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 X-IsSubscribed: yes 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-02/txt/msg00122.txt.bz2 --=-G/kb/MAIFcJ/8VuQWVaE Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 224 On Sat, 2008-02-02 at 01:08 +0100, Mark Kettenis wrote: > Thiago/Luis, can you commit the testsuite change? Sure. I committed the attached patch. -- []'s Thiago Jung Bauermann Software Engineer IBM Linux Technology Center --=-G/kb/MAIFcJ/8VuQWVaE Content-Disposition: attachment; filename=ppc32-float-abi-testcases.diff Content-Type: text/x-patch; name=ppc32-float-abi-testcases.diff; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 6316 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v retrieving revision 1.1567 diff -u -r1.1567 ChangeLog --- ChangeLog 5 Feb 2008 22:20:51 -0000 1.1567 +++ ChangeLog 6 Feb 2008 03:52:41 -0000 @@ -1,3 +1,10 @@ +2008-02-06 Thiago Jung Bauermann + + * gdb.base/callfuncs.c (t_float_many_args): New function. + (t_double_many_args): New function. + * gdb.base/callfuncs.exp: Add tests for exceeding float + and double parameters passed through the stack. + 2008-02-05 Joel Brobecker * gdb.ada/complete/pck.ads, gdb.ada/complete/pck.adb, Index: gdb.base/callfuncs.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.c,v retrieving revision 1.10 diff -u -r1.10 callfuncs.c --- gdb.base/callfuncs.c 1 Jan 2008 22:53:18 -0000 1.10 +++ gdb.base/callfuncs.c 6 Feb 2008 03:52:41 -0000 @@ -46,9 +46,35 @@ float float_val1 = 3.14159; float float_val2 = -2.3765; +float float_val3 = 0.25; +float float_val4 = 1.25; +float float_val5 = 2.25; +float float_val6 = 3.25; +float float_val7 = 4.25; +float float_val8 = 5.25; +float float_val9 = 6.25; +float float_val10 = 7.25; +float float_val11 = 8.25; +float float_val12 = 9.25; +float float_val13 = 10.25; +float float_val14 = 11.25; +float float_val15 = 12.25; double double_val1 = 45.654; double double_val2 = -67.66; +double double_val3 = 0.25; +double double_val4 = 1.25; +double double_val5 = 2.25; +double double_val6 = 3.25; +double double_val7 = 4.25; +double double_val8 = 5.25; +double double_val9 = 6.25; +double double_val10 = 7.25; +double double_val11 = 8.25; +double double_val12 = 9.25; +double double_val13 = 10.25; +double double_val14 = 11.25; +double double_val15 = 12.25; #define DELTA (0.001) @@ -298,6 +324,39 @@ && (float_arg2 - float_val2) > -DELTA); } +/* This function has many arguments to force some of them to be passed via + the stack instead of registers, to test that GDB can construct correctly + the parameter save area. Note that Linux/ppc32 has 8 float registers to use + for float parameter passing and Linux/ppc64 has 13, so the number of + arguments has to be at least 14 to contemplate these platforms. */ + +float +#ifdef NO_PROTOTYPES +t_float_many_args (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, + f14, f15) + float f1, float f2, float f3, float f4, float f5, float f6, float f7, + float f8, float f9, float f10, float f11, float f12, float f13, float f14, + float f15; +#else +t_float_many_args (float f1, float f2, float f3, float f4, float f5, float f6, + float f7, float f8, float f9, float f10, float f11, + float f12, float f13, float f14, float f15) +#endif +{ + float sum_args; + float sum_values; + + sum_args = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + + f13 + f14 + f15; + sum_values = float_val1 + float_val2 + float_val3 + float_val4 + float_val5 + + float_val6 + float_val7 + float_val8 + float_val9 + + float_val10 + float_val11 + float_val12 + float_val13 + + float_val14 + float_val15; + + return ((sum_args - sum_values) < DELTA + && (sum_args - sum_values) > -DELTA); +} + #ifdef PROTOTYPES int t_double_values (double double_arg1, double double_arg2) #else @@ -311,6 +370,39 @@ && (double_arg2 - double_val2) > -DELTA); } +/* This function has many arguments to force some of them to be passed via + the stack instead of registers, to test that GDB can construct correctly + the parameter save area. Note that Linux/ppc32 has 8 float registers to use + for float parameter passing and Linux/ppc64 has 13, so the number of + arguments has to be at least 14 to contemplate these platforms. */ + +double +#ifdef NO_PROTOTYPES +t_double_many_args (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, + f14, f15) + double f1, double f2, double f3, double f4, double f5, double f6, + double f7, double f8, double f9, double f10, double f11, double f12, + double f13, double f14, double f15; +#else +t_double_many_args (double f1, double f2, double f3, double f4, double f5, + double f6, double f7, double f8, double f9, double f10, + double f11, double f12, double f13, double f14, double f15) +#endif +{ + double sum_args; + double sum_values; + + sum_args = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + + f13 + f14 + f15; + sum_values = double_val1 + double_val2 + double_val3 + double_val4 + + double_val5 + double_val6 + double_val7 + double_val8 + + double_val9 + double_val10 + double_val11 + double_val12 + + double_val13 + double_val14 + double_val15; + + return ((sum_args - sum_values) < DELTA + && (sum_args - sum_values) > -DELTA); +} + #ifdef PROTOTYPES int t_string_values (char *string_arg1, char *string_arg2) #else Index: gdb.base/callfuncs.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v retrieving revision 1.23 diff -u -r1.23 callfuncs.exp --- gdb.base/callfuncs.exp 1 Jan 2008 22:53:18 -0000 1.23 +++ gdb.base/callfuncs.exp 6 Feb 2008 03:52:41 -0000 @@ -155,6 +155,8 @@ gdb_test "p t_float_values2(3.14159,float_val2)" " = 1" + gdb_test "p t_float_many_args (float_val1, float_val2, float_val3, float_val4, float_val5, float_val6, float_val7, float_val8, float_val9, float_val10, float_val11, float_val12, float_val13, float_val14, float_val15)" " = 1" "Call function with many float arguments." + gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55" gdb_test "p t_double_values(0.0,0.0)" " = 0" @@ -163,6 +165,8 @@ gdb_test "p t_double_values(45.654,double_val2)" " = 1" gdb_test "p t_double_values(double_val1,-67.66)" " = 1" + gdb_test "p t_double_many_args (double_val1, double_val2, double_val3, double_val4, double_val5, double_val6, double_val7, double_val8, double_val9, double_val10, double_val11, double_val12, double_val13, double_val14, double_val15)" " = 1" "Call function with many double arguments." + gdb_test "p t_double_int(99.0, 1)" " = 0" gdb_test "p t_double_int(99.0, 99)" " = 1" gdb_test "p t_int_double(99, 1.0)" " = 0" --=-G/kb/MAIFcJ/8VuQWVaE--