From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31615 invoked by alias); 5 Feb 2015 20:51:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31606 invoked by uid 89); 5 Feb 2015 20:51:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Feb 2015 20:51:35 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 9D6634EFE34DA; Thu, 5 Feb 2015 20:51:28 +0000 (GMT) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 5 Feb 2015 20:51:32 +0000 Received: from LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9]) by LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9%17]) with mapi id 14.03.0210.002; Thu, 5 Feb 2015 20:51:30 +0000 From: Matthew Fortune To: Petar Jovanovic , "gcc-patches@gcc.gnu.org" , "'Maciej W. Rozycki'" CC: "Moore, Catherine (Catherine_Moore@mentor.com)" Subject: RE: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro Date: Thu, 05 Feb 2015 20:51:00 -0000 Message-ID: <6D39441BF12EF246A7ABCE6654B0235320FCA3F1@LEMAIL01.le.imgtec.org> References: <003e01d04179$ccc38bc0$664aa340$@rt-rk.com> In-Reply-To: <003e01d04179$ccc38bc0$664aa340$@rt-rk.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00360.txt.bz2 Hi Petar, I've put your patch inline below and switched to plain text. I suspect your post was bounced by gcc-patches. I'm OK with this change but I'd like Catherine to comment before committing. It seems a shame to duplicate the block of code but it is probably just as ugly to define a macro for the la/dla instruction. For future reference, it is best not to include changelog content in a patch but instead just paste into the email. Also the ChangeLog you need for this change is gcc/ChangeLog (as confusing as that may be at first). Thanks, Matthew > From: Petar Jovanovic [mailto:petar.jovanovic@rt-rk.com]=20 > Sent: 05 February 2015 19:28 > To: gcc-patches@gcc.gnu.org; 'Maciej W. Rozycki'; Matthew Fortune > Subject: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro > > v2: > - add ChangeLog entry > - use DLA instead of LA for n64 > > PTAL. Thanks. > > Regards, > Petar --- ChangeLog | 5 +++++ gcc/config/mips/mips.h | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c61c66..3a15f4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-02-05 Petar Jovanovic + + * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Fix the macro to use + la/jalr instead of jal. + 2015-02-02 Janis Johnson =20 * MAINTAINERS (Various Maintainers: testsuite): Remove myself. diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index ec69ed5..4bd83f5 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3034,11 +3034,11 @@ while (0) nop\n\ 1: .cpload $31\n\ .set reorder\n\ - jal " USER_LABEL_PREFIX #FUNC "\n\ + la $25, " USER_LABEL_PREFIX #FUNC "\n\ + jalr $25\n\ .set pop\n\ " TEXT_SECTION_ASM_OP); -#elif ((defined _ABIN32 && _MIPS_SIM =3D=3D _ABIN32) \ - || (defined _ABI64 && _MIPS_SIM =3D=3D _ABI64)) +#elif (defined _ABIN32 && _MIPS_SIM =3D=3D _ABIN32) #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n\ .set push\n\ @@ -3048,7 +3048,22 @@ while (0) nop\n\ 1: .set reorder\n\ .cpsetup $31, $2, 1b\n\ - jal " USER_LABEL_PREFIX #FUNC "\n\ + la $25, " USER_LABEL_PREFIX #FUNC "\n\ + jalr $25\n\ + .set pop\n\ + " TEXT_SECTION_ASM_OP); +#elif (defined _ABI64 && _MIPS_SIM =3D=3D _ABI64) +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\ + .set push\n\ + .set nomips16\n\ + .set noreorder\n\ + bal 1f\n\ + nop\n\ +1: .set reorder\n\ + .cpsetup $31, $2, 1b\n\ + dla $25, " USER_LABEL_PREFIX #FUNC "\n\ + jalr $25\n\ .set pop\n\ " TEXT_SECTION_ASM_OP); #endif --=20 1.8.2.1