From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24361 invoked by alias); 7 Nov 2005 20:43:36 -0000 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 Received: (qmail 24340 invoked by uid 22791); 7 Nov 2005 20:43:33 -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, 07 Nov 2005 20:43:33 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id jA7KhVen002646 for ; Mon, 7 Nov 2005 15:43:31 -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 jA7KhUEp049146 for ; Mon, 7 Nov 2005 13:43:30 -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 jA7KhVW5026702 for ; Mon, 7 Nov 2005 13:43:31 -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 jA7KhVT6026667 for ; Mon, 7 Nov 2005 13:43:31 -0700 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb-patches@sources.redhat.com Subject: [COMMIT] deal with vector return value for ppc68 Date: Mon, 07 Nov 2005 21:42:00 -0000 User-Agent: KMail/1.6.2 References: <200510241606.10304.pgilliam@us.ibm.com> <20051102204359.GA6755@nevyn.them.org> <200511022304.jA2N4IXD016588@elgar.sibelius.xs4all.nl> In-Reply-To: <200511022304.jA2N4IXD016588@elgar.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200511071244.48624.pgilliam@us.ibm.com> X-SW-Source: 2005-11/txt/msg00087.txt.bz2 Here is what I committed: It has all the corrections requestd by Danial and Mark. 2005-11-07 Paul Gilliam ppc_gp0_regnum + 3, readbuf); return RETURN_VALUE_REGISTER_CONVENTION; } - if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY - && TYPE_LENGTH (valtype) <= 8 - && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT - && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) + /* Array type has more than one use. */ + if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY) { /* Small character arrays are returned, right justified, in r3. */ - int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) - - TYPE_LENGTH (valtype)); - if (writebuf != NULL) - regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, - offset, TYPE_LENGTH (valtype), writebuf); - if (readbuf != 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) <= 8 + && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT + && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) + { + int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3) + - TYPE_LENGTH (valtype)); + if (writebuf != NULL) + regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), writebuf); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3, + offset, TYPE_LENGTH (valtype), readbuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + /* A VMX vector is returned in v2. */ + if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY + && TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >= 0) + { + if (readbuf) + regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf); + if (writebuf) + regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf); + 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) == TYPE_CODE_FLT && (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32)) {