From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29755 invoked by alias); 26 Jun 2003 05:46:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30396 invoked from network); 26 Jun 2003 05:21:17 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 26 Jun 2003 05:21:17 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 865DA14477 for ; Thu, 26 Jun 2003 07:21:17 +0200 (MEST) Received: from aj by arthur.inka.de with local (Exim 4.12) id 19VOy3-0006Ps-00 for gdb-patches@sources.redhat.com; Thu, 26 Jun 2003 07:06:43 +0200 Resent-To: gdb-patches@sources.redhat.com Resent-From: Andreas Jaeger Resent-Date: Thu, 26 Jun 2003 07:06:43 +0200 X-From-Line: nobody Wed Jun 25 21:13:43 2003 To: gdb-patches@sourceware.cygnus.com Subject: Fix float/double return on x86-64 From: Andreas Jaeger Date: Thu, 26 Jun 2003 05:46:00 -0000 Message-ID: User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Portable Code, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-Id: Resent-Date: Thu, 26 Jun 2003 07:06:43 +0200 X-SW-Source: 2003-06/txt/msg00786.txt.bz2 The appended patch fixes these three failures on x86-64: FAIL: gdb.base/return.exp: correct value returned double test (known problem with sparc solaris) FAIL: gdb.base/return2.exp: float value returned successfully FAIL: gdb.base/return2.exp: double value returned successfully The code does not handle complex floating point values, I'm not sure that it's correct there but I decided to fix this issue first. Ok to commit for both branches? Andreas 2003-06-25 Andreas Jaeger * x86-64-tdep.c (x86_64_store_return_value): Return double and float values in SSE register. ============================================================ Index: src/gdb/x86-64-tdep.c --- src/gdb/x86-64-tdep.c 15 Jun 2003 11:01:46 -0000 1.79 +++ src/gdb/x86-64-tdep.c 25 Jun 2003 19:10:46 -0000 @@ -712,8 +727,9 @@ x86_64_store_return_value (struct type * { int len = TYPE_LENGTH (type); - if (TYPE_CODE_FLT == TYPE_CODE (type)) - { + /* First handle long doubles. */ + if (TYPE_CODE_FLT == TYPE_CODE (type) && len == 16) + { ULONGEST fstat; char buf[FPU_REG_RAW_SIZE]; @@ -741,6 +757,12 @@ x86_64_store_return_value (struct type * for the tag word is 0x3fff. */ regcache_raw_write_unsigned (regcache, FTAG_REGNUM, 0x3fff); } + else if (TYPE_CODE_FLT == TYPE_CODE (type)) + { + /* Handle double and float variables. */ + regcache_cooked_write (regcache, X86_64_XMM0_REGNUM, valbuf); + } + /* XXX: What about complex floating point types? */ else { int low_size = REGISTER_RAW_SIZE (0); -- Andreas Jaeger, SuSE Linux AG, aj@suse.de, http://www.suse.de/~aj GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126