From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10863 invoked by alias); 14 Nov 2005 22:18:50 -0000 Received: (qmail 10848 invoked by uid 22791); 14 Nov 2005 22:18:46 -0000 Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.153) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 14 Nov 2005 22:18:46 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id jAEMIj17028698 for ; Mon, 14 Nov 2005 17:18:45 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jAEMK07W064814 for ; Mon, 14 Nov 2005 15:20:00 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id jAEMIib5031642 for ; Mon, 14 Nov 2005 15:18:44 -0700 Received: from dyn9047022123-009047022095.beaverton.ibm.com (dyn9047022123-009047022095.beaverton.ibm.com [9.47.22.95]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id jAEMIiI7031636; Mon, 14 Nov 2005 15:18:44 -0700 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb-patches@sourceware.org Subject: [COMMIT (6.4)] deal with vector return value for ppc68 Date: Tue, 15 Nov 2005 04:10:00 -0000 User-Agent: KMail/1.6.2 Cc: Kevin Buettner , gdb-patches@sources.redhat.com References: <200510241606.10304.pgilliam@us.ibm.com> <20051108172835.GO1635@adacore.com> <20051108104628.524ef74e@ironwood.lan> In-Reply-To: <20051108104628.524ef74e@ironwood.lan> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200511141420.31452.pgilliam@us.ibm.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00196.txt.bz2 Here is what got committed to the 6.4 branch: 2005-11-14 Paul Gilliam * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from ppc_sysv_abi_return_value() to handle a vector return value. Index: ppc-sysv-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v retrieving revision 1.31 diff -a -u -p -r1.31 ppc-sysv-tdep.c --- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31 +++ ppc-sysv-tdep.c 14 Nov 2005 22:14:37 -0000 @@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba } return RETURN_VALUE_REGISTER_CONVENTION; } + /* Integers in r3. */ if ((TYPE_CODE (valtype) =3D=3D TYPE_CODE_INT || TYPE_CODE (valtype) =3D=3D TYPE_CODE_ENUM) && TYPE_LENGTH (valtype) <=3D 8) { - /* Integers in r3. */ if (writebuf !=3D NULL) { /* Be careful to sign extend the value. */ @@ -938,24 +938,36 @@ ppc64_sysv_abi_return_value (struct gdba regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf); return RETURN_VALUE_REGISTER_CONVENTION; } - if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_ARRAY - && TYPE_LENGTH (valtype) <=3D 8 - && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) =3D=3D TYPE_CODE_INT - && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) =3D=3D 1) + /* Array type has more than one use. =A0*/ + if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_ARRAY) { /* Small character arrays are returned, right justified, in r3. */ - int offset =3D (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) - - TYPE_LENGTH (valtype)); - if (writebuf !=3D NULL) - regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), writebuf= ); - if (readbuf !=3D NULL) - regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), readbuf); - return RETURN_VALUE_REGISTER_CONVENTION; + if (TYPE_LENGTH (valtype) <=3D 8 + && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) =3D=3D TYPE_CODE_INT + && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) =3D=3D 1) + { + int offset =3D (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) + - TYPE_LENGTH (valtype)); + if (writebuf !=3D NULL) + regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), write= buf); + if (readbuf !=3D NULL) + regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), readb= uf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + /* A VMX vector is returned in v2. =A0*/ + if (TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >=3D 0) + { + if (readbuf) + regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readb= uf); + if (writebuf) + regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writ= ebuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } } /* Big floating point values get stored in adjacent floating - point registers. */ + point registers, starting with F1. */ if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_FLT && (TYPE_LENGTH (valtype) =3D=3D 16 || TYPE_LENGTH (valtype) =3D=3D = 32)) { From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10866 invoked by alias); 14 Nov 2005 22:18:50 -0000 Received: (qmail 10847 invoked by uid 22791); 14 Nov 2005 22:18:46 -0000 Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.149) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 14 Nov 2005 22:18:46 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id jAEMIjX0001515 for ; Mon, 14 Nov 2005 17:18:45 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id jAEMIYge050288 for ; Mon, 14 Nov 2005 15:18:34 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id jAEMIib3031642 for ; Mon, 14 Nov 2005 15:18:44 -0700 Received: from dyn9047022123-009047022095.beaverton.ibm.com (dyn9047022123-009047022095.beaverton.ibm.com [9.47.22.95]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id jAEMIiI7031636; Mon, 14 Nov 2005 15:18:44 -0700 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb-patches@sourceware.org Subject: [COMMIT (6.4)] deal with vector return value for ppc68 Date: Tue, 15 Nov 2005 04:40:00 -0000 User-Agent: KMail/1.6.2 Cc: Kevin Buettner , gdb-patches@sources.redhat.com References: <200510241606.10304.pgilliam@us.ibm.com> <20051108172835.GO1635@adacore.com> <20051108104628.524ef74e@ironwood.lan> In-Reply-To: <20051108104628.524ef74e@ironwood.lan> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: <200511141420.31452.pgilliam@us.ibm.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00197.txt.bz2 Message-ID: <20051115044000._TPo3BLBVfHXpAGW_HavV0QpMn0giszZn2Tm4wWbeFQ@z> Here is what got committed to the 6.4 branch: 2005-11-14 Paul Gilliam * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from ppc_sysv_abi_return_value() to handle a vector return value. Index: ppc-sysv-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v retrieving revision 1.31 diff -a -u -p -r1.31 ppc-sysv-tdep.c --- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31 +++ ppc-sysv-tdep.c 14 Nov 2005 22:14:37 -0000 @@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba } return RETURN_VALUE_REGISTER_CONVENTION; } + /* Integers in r3. */ if ((TYPE_CODE (valtype) =3D=3D TYPE_CODE_INT || TYPE_CODE (valtype) =3D=3D TYPE_CODE_ENUM) && TYPE_LENGTH (valtype) <=3D 8) { - /* Integers in r3. */ if (writebuf !=3D NULL) { /* Be careful to sign extend the value. */ @@ -938,24 +938,36 @@ ppc64_sysv_abi_return_value (struct gdba regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf); return RETURN_VALUE_REGISTER_CONVENTION; } - if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_ARRAY - && TYPE_LENGTH (valtype) <=3D 8 - && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) =3D=3D TYPE_CODE_INT - && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) =3D=3D 1) + /* Array type has more than one use. =A0*/ + if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_ARRAY) { /* Small character arrays are returned, right justified, in r3. */ - int offset =3D (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) - - TYPE_LENGTH (valtype)); - if (writebuf !=3D NULL) - regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), writebuf= ); - if (readbuf !=3D NULL) - regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), readbuf); - return RETURN_VALUE_REGISTER_CONVENTION; + if (TYPE_LENGTH (valtype) <=3D 8 + && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) =3D=3D TYPE_CODE_INT + && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) =3D=3D 1) + { + int offset =3D (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) + - TYPE_LENGTH (valtype)); + if (writebuf !=3D NULL) + regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), write= buf); + if (readbuf !=3D NULL) + regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), readb= uf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + /* A VMX vector is returned in v2. =A0*/ + if (TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >=3D 0) + { + if (readbuf) + regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readb= uf); + if (writebuf) + regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writ= ebuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } } /* Big floating point values get stored in adjacent floating - point registers. */ + point registers, starting with F1. */ if (TYPE_CODE (valtype) =3D=3D TYPE_CODE_FLT && (TYPE_LENGTH (valtype) =3D=3D 16 || TYPE_LENGTH (valtype) =3D=3D = 32)) {