From patchwork Fri Feb 22 16:02:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 222552 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]) by ozlabs.org (Postfix) with SMTP id 6CE652C007E for ; Sat, 23 Feb 2013 03:02:43 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1362153764; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=bN5WdXMmDaxJDhYijGugyAvS6ZU=; b=RgY/Mre3ColEwaP 0C4PGIMwLF3LnOJS/nylplbql6sfHkjQE+f3qIYiUSf28LtO7sHKL6VLanJXHPKX mU1jOdkUAtvaVrCGyV5e+SjolLQlx6LRhogsKo54duwwir6CGfWRdLe4V3rTUNec 7j7ubauzF9gmY3zjzPra01fPeiqQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:X-MC-Unique:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=eS/lhlGVmIhVasQGtwVC0+K1H4WbGLmVMUbG2sS7qQr3Ba18BEIEkfCOrMnkj2 7M5PLbJVL5RK6V1aoQojum+9l7qssphb0l2OJBLb84ISvkRSQ/obPk8bS8HI/WnF xA52+mUEGArjcXZphMbJZsq/h2OAb5YTbBydJOUUIzkWc=; Received: (qmail 11980 invoked by alias); 22 Feb 2013 16:02:38 -0000 Received: (qmail 11972 invoked by uid 22791); 22 Feb 2013 16:02:38 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, KHOP_THREADED, RCVD_IN_DNSWL_LOW, TW_IV X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Feb 2013 16:02:31 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 22 Feb 2013 16:02:30 +0000 Received: from [10.1.69.67] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Feb 2013 16:02:27 +0000 Message-ID: <51279692.8080106@arm.com> Date: Fri, 22 Feb 2013 16:02:26 +0000 From: Richard Earnshaw User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Seth LaForge CC: Mike Stump , "gcc-patches@gcc.gnu.org" Subject: Re: PATCH: Correctly configure all big-endian ARM archs, not just arm*-*-linux-*. References: <511E7E4D.4080609@arm.com> <511E8148.8060709@arm.com> <20057EED-0F19-434E-AF8F-8D53DD9D3F9E@comcast.net> In-Reply-To: X-MC-Unique: 113022216023001401 X-IsSubscribed: yes 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 On 20/02/13 23:21, Seth LaForge wrote: > On Fri, Feb 15, 2013 at 3:29 PM, Mike Stump wrote: >> No. Counter proposal, let's handle the cases that don't work. So, you said in your original email that armeb-unknown-eabi doesn't work. >> >> So, in the existing case statement for: >> >> arm*-*-eabi*) >> >> let's just add: >> >> case ${target} in >> armeb-*-eabi*) >> tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" >> esac >> >> Is this not exactly what you want? Doesn't this solve exactly what you stated was the problem? > > OK, attached patch > 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-armeb-eabi-a.patch does > as you describe, and works for my particular use-case. > >>> I could inline the test into all >>> of the ARM cases below, but I don't like that approach since it's what >>> caused this problem in the first place (somebody adding BE support to >>> one ARM arch without adding it to the others). >> >> And does it work on uclinux? Does it work on rtems? Does it work on every arm that every existed and will exist? If the answer is no, then it is less ideal than putting this in the config for eabi*). > > Well, the current config is certainly broken when giving a big-endian > spec for uclinux, rtems, and every other arm that ever existed or will > exist. It's possible there are other issues with using a big-endian > processor for uclinux, rtems, etc, but adding > TARGET_BIG_ENDIAN_DEFAULT=1 certainly gets those targets closer to > working. > >> If it always works, then moving the existing on up to the existing: >> >> case ${target} in >> i[34567]86-*-*) >> >> would be the right approach. x86 uses this location already to set tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1" for example. The documentation above that group can state that this is the location for things that are cpu specific and os and vendor neutral. > > I like that solution better. Following your suggested list of > big-endian architectures, attached patch > 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch adds > TARGET_BIG_ENDIAN_DEFAULT=1 for $target matching "armeb-* | armbe-* | > armv[3-8]b-*". I left out xscaleeb, since config.sub canonicalizes > xscaleeb-* to armeb-*. > > Please, pick whichever patch pleases you most. I prefer > 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch. > > Changelog entry for > 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch: > > gcc/ > * config.gcc: Add TARGET_BIG_ENDIAN_DEFAULT=1 for all arm big-endian archs. > > Changelog entry for > 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-armeb-eabi-a.patch: > > gcc/ > * config.gcc: Add TARGET_BIG_ENDIAN_DEFAULT=1 for all armeb-*-eabi* archs. > This is what I've put in. Which is a slight relaxation on your second version. R. Index: ChangeLog =================================================================== --- ChangeLog (revision 196220) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2013-02-22 Seth LaForge + + * config.gcc (arm*-*-eabi*): Treat arm*eb as big-endian. + 2013-02-22 Greta Yorsh * config/arm/arm.md (split for extendsidi): Update condition. Index: config.gcc =================================================================== --- config.gcc (revision 196220) +++ config.gcc (working copy) @@ -900,6 +900,10 @@ arm*-*-uclinux*eabi*) # ARM ucLinux default_use_cxa_atexit=yes ;; arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) + case ${target} in + arm*eb-*-eabi*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" + esac # The BPABI long long divmod functions return a 128-bit value in # registers r0-r3. Correctly modeling that requires the use of # TImode.