From patchwork Tue Jun 25 21:24:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 254416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 01F772C0079 for ; Wed, 26 Jun 2013 07:24:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=izpMb13T/gO2N+ldVJlM6DiD35C43IwE66cE+p/nc1nwTHtR/IyTp nCPhYjiqYiW67QYF0gOUlkHpaka/oZo+64yQXVLxuFVGFMrvFnrvnexclhA6JOqL fb0qwFrQqVMcRS10LixYkl8UIS+19n1x0mzfW2wkSlRvunpQNJ7IbY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=uLtThf3B3fRenBkIXZ6hMs+CrU8=; b=JJsaSgHpFasthJzsIcHZV9PUFMr0 rZTSyOIYn1lNyc6XqLw8ye4oSY8L8jQBJxHJKyQ27OThk48jaK90vLIHhlgzCzGG 1Ue/f+tty12M2tKTAcprLCYlnKx97OIv2buIBqHPJsqp+3vLT+YstAPUIVdNHNTj 9BH0FpM2dlY+WL0= Received: (qmail 13238 invoked by alias); 25 Jun 2013 21:24:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13200 invoked by uid 89); 25 Jun 2013 21:24:10 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_TP autolearn=ham version=3.3.1 Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com) (74.125.82.173) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 21:24:08 +0000 Received: by mail-we0-f173.google.com with SMTP id x54so9629384wes.18 for ; Tue, 25 Jun 2013 14:24:06 -0700 (PDT) X-Received: by 10.180.183.202 with SMTP id eo10mr8933470wic.2.1372195446605; Tue, 25 Jun 2013 14:24:06 -0700 (PDT) Received: from localhost ([2.26.203.46]) by mx.google.com with ESMTPSA id d8sm6885402wiz.0.2013.06.25.14.24.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Jun 2013 14:24:05 -0700 (PDT) From: Richard Sandiford To: =?utf-8?Q?J=C3=BCrgen?= Urban Mail-Followup-To: =?utf-8?Q?J=C3=BCrgen?= Urban , "gcc-patches\@gcc.gnu.org" , rdsandiford@googlemail.com Cc: "gcc-patches\@gcc.gnu.org" Subject: Re: [PATCH] Basic support for MIPS r5900 References: <87zjv77ygt.fsf@talisman.default> <87k3lz5ecn.fsf@talisman.default> <87li6b1aia.fsf@talisman.default> <878v2926p9.fsf@talisman.default> <87d2rc4lz4.fsf@talisman.default> <2FE7F40D-7A97-47EF-A2A8-38A0A3DB66D4@gmx.de> Date: Tue, 25 Jun 2013 22:24:04 +0100 In-Reply-To: <2FE7F40D-7A97-47EF-A2A8-38A0A3DB66D4@gmx.de> (=?utf-8?Q?=22J?= =?utf-8?Q?=C3=BCrgen?= Urban"'s message of "Mon, 24 Jun 2013 10:07:53 +0200") Message-ID: <878v1x51fv.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Jürgen Urban writes: > Am 23.06.2013 um 22:21 schrieb Richard Sandiford : >>> In the native PS2SDK (i.e. no Linux) I detected that there are undefined >>> references to `__fixtfsi', `__floatsitf', `__subtf3', `__multf3', >>> __extenddftf2', `__lttf2' and `__gttf2'. These are the functions for >>> handling "long double". >>> There is a fix needed for this in libgcc. I attached 2 patches to this >>> e-mail. There should be only one of the patches used to fix this. >>> The first one fixes the problem for all mips systems. The second one >>> fixes this only for r5900. I think it is a general problem. I assume the >>> undefined references could appear on all mips64 systems which are not >>> Linux. So the first patch should be applied. >> >> The second patch is right. Not all targets have 128-bit long doubles, >> so t-tpbit is intentionally an opt-in rather than opt-out thing. >> >> E.g. mips*-sde-elf and mips*-mti-elf both use: >> >> #undef LONG_DOUBLE_TYPE_SIZE >> #define LONG_DOUBLE_TYPE_SIZE 64 >> >> to get a form of n32 in which long doubles are the same as doubles. >> >> Do you want to stick with 128-bit long doubles for PS2, or would you >> prefer to do what SDE does? > > I prefer shorter long doubles because of the performance impact. For 32 > bit hard float we may need it. Can you change it or do I need to submit > a patch? OK, could you give this a go? Thanks, Richard gcc/ * config.gcc (mips*-mti-elf*, mips*-sde-elf*, mips64r5900-*-elf*) (mips64r5900el-*-elf*): Include mips/n32-elf.h. * config/mips/sde.h (LOCAL_LABEL_PREFIX, NO_DOLLAR_IN_LABEL) (LONG_DOUBLE_TYPE_SIZE, LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Move to... * config/mips/n32-elf.h: ...this new file. Index: gcc/config.gcc =================================================================== --- gcc/config.gcc 2013-06-25 22:15:25.414731542 +0100 +++ gcc/config.gcc 2013-06-25 22:15:29.076761150 +0100 @@ -1850,12 +1850,12 @@ mips*-*-linux*) # Linux MIPS, either esac ;; mips*-mti-elf*) - tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h mips/mti-elf.h" + tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h" tmake_file="mips/t-mti-elf" tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32" ;; mips*-sde-elf*) - tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h" + tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h" tmake_file="mips/t-sde" extra_options="${extra_options} mips/sde.opt" case "${with_newlib}" in @@ -1937,7 +1937,7 @@ mips-*-elf* | mipsel-*-elf* | mipsr5900- tmake_file="mips/t-elf" ;; mips64r5900-*-elf* | mips64r5900el-*-elf*) - tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h" + tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h" tmake_file="mips/t-elf" tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" ;; Index: gcc/config/mips/sde.h =================================================================== --- gcc/config/mips/sde.h 2013-06-25 22:15:27.563748916 +0100 +++ gcc/config/mips/sde.h 2013-06-25 22:15:33.443796467 +0100 @@ -89,23 +89,6 @@ #define SIZE_TYPE "long unsigned int" #undef PTRDIFF_TYPE #define PTRDIFF_TYPE "long int" -/* Use standard ELF-style local labels (not '$' as on early Irix). */ -#undef LOCAL_LABEL_PREFIX -#define LOCAL_LABEL_PREFIX "." - -/* Use periods rather than dollar signs in special g++ assembler names. */ -#define NO_DOLLAR_IN_LABEL - -/* Currently we don't support 128bit long doubles, so for now we force - n32 to be 64bit. */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -#ifdef IN_LIBGCC2 -#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE -#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 -#endif - /* Force all .init and .fini entries to be 32-bit, not mips16, so that in a mixed environment they are all the same mode. The crti.asm and crtn.asm files will also be compiled as 32-bit due to the Index: gcc/config/mips/n32-elf.h =================================================================== --- /dev/null 2013-06-17 18:11:16.259026486 +0100 +++ gcc/config/mips/n32-elf.h 2013-06-25 22:15:29.076761150 +0100 @@ -0,0 +1,35 @@ +/* Definitions of target machine for GNU compiler. + n32 for embedded systems. + Copyright (C) 2003-2013 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +/* Use standard ELF-style local labels (not '$' as on early Irix). */ +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* Use periods rather than dollar signs in special g++ assembler names. */ +#define NO_DOLLAR_IN_LABEL + +/* Force n32 to use 64-bit long doubles. */ +#undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 64 + +#ifdef IN_LIBGCC2 +#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE +#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 +#endif