From patchwork Sun Jan 26 16:15:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 314212 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 29E132C0040 for ; Mon, 27 Jan 2014 03:15:48 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:from:to:content-type:subject:mime-version:date; q= dns; s=default; b=o+9Oc/T3izxUSjlT16ThetNMIxwjRWQoPG7vJA5sztJQSE Ni17jc5Dz6uotAI/UVTBGzozHAJD1woFMK5JLCpkDqUmiZALqriAnpd9v3xMCAWZ gnRCMMRzgLypYP4m8iqU9jXnbCHRCDEQfXbQgLc9pGRHVrsgqaTN7R7DDJdfg= 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 :message-id:from:to:content-type:subject:mime-version:date; s= default; bh=tsBVredzphRf+iSWj5YmV5MKepw=; b=RhF6EftaCf2whXIHnyVF BJwbsid1PVXpmubjtppUdaYcldjJXQg5jeX98H6xqJfshVoQG7RZNKCMSj3LVIRV +yXkeSboUERkznD1wfbiINEgIcKKYzL4mk4TNVAne1mwvvnbEEYZ24eGLTg7iW5A B7/r+ZWGYpAYEzsxV9Y78sQ= Received: (qmail 24962 invoked by alias); 26 Jan 2014 16:15:40 -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 24948 invoked by uid 89); 26 Jan 2014 16:15:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: blu0-omc3-s2.blu0.hotmail.com Received: from blu0-omc3-s2.blu0.hotmail.com (HELO blu0-omc3-s2.blu0.hotmail.com) (65.55.116.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 26 Jan 2014 16:15:35 +0000 Received: from BLU0-SMTP45 ([65.55.116.73]) by blu0-omc3-s2.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 26 Jan 2014 08:15:34 -0800 X-TMN: [BUmznZ4/ad3NWlDXMSxD0DJPreQEVvLM] Message-ID: Received: from [192.168.2.10] ([69.158.170.59]) by BLU0-SMTP45.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 26 Jan 2014 08:15:33 -0800 From: John David Anglin To: GCC Patches Subject: [committed] Slightly improve some indirect call sequences on PA MIME-Version: 1.0 (Apple Message framework v936) Date: Sun, 26 Jan 2014 11:15:16 -0500 The attached change removes an unnecessary nop from two indirect call sequences. I also revised the long PIC sequence to use the ldo instruction to compute the return pointer. Think it's better to use an integer arithmetic operation instead of a branch for this. Tested on hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp- hpux11.11. Committed to trunk. Dave --- John David Anglin dave.anglin@bell.net 2014-01-26 John David Anglin * config/pa/pa.c (pa_attr_length_indirect_call): Adjust length of portable runtime and PIC indirect calls. (pa_output_indirect_call): Remove unnecessary nop from portable runtime and PIC call sequences. Use ldo instead of blr to set return register in PIC call sequence. Index: config/pa/pa.c =================================================================== --- config/pa/pa.c (revision 206844) +++ config/pa/pa.c (working copy) @@ -8106,10 +8100,10 @@ return 8; if (flag_pic) - return 24; + return 20; if (TARGET_PORTABLE_RUNTIME) - return 20; + return 16; /* Out of reach, can use ble. */ return 12; @@ -8154,28 +8148,28 @@ return ".CALL\tARGW0=GR\n\tldil L'$$dyncall,%%r2\n\tble R'$$dyncall(%%sr4,%%r2)\n\tcopy %%r31,%%r2"; /* Long millicode call for portable runtime. */ - if (pa_attr_length_indirect_call (insn) == 20) - return "ldil L'$$dyncall,%%r31\n\tldo R'$$dyncall(%%r31),%%r31\n\tblr %%r0,%%r2\n\tbv,n %%r0(%%r31)\n\tnop"; + if (pa_attr_length_indirect_call (insn) == 16) + return "ldil L'$$dyncall,%%r31\n\tldo R'$$dyncall(%%r31),%%r31\n\tblr %%r0,%%r2\n\tbv,n %%r0(%%r31)"; /* We need a long PIC call to $$dyncall. */ xoperands[0] = NULL_RTX; - output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands); + output_asm_insn ("{bl|b,l} .+8,%%r2", xoperands); if (TARGET_SOM || !TARGET_GAS) { xoperands[0] = gen_label_rtx (); - output_asm_insn ("addil L'$$dyncall-%0,%%r1", xoperands); + output_asm_insn ("addil L'$$dyncall-%0,%%r2", xoperands); targetm.asm_out.internal_label (asm_out_file, "L", CODE_LABEL_NUMBER (xoperands[0])); output_asm_insn ("ldo R'$$dyncall-%0(%%r1),%%r1", xoperands); } else { - output_asm_insn ("addil L'$$dyncall-$PIC_pcrel$0+4,%%r1", xoperands); + output_asm_insn ("addil L'$$dyncall-$PIC_pcrel$0+4,%%r2", xoperands); output_asm_insn ("ldo R'$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1", xoperands); } - output_asm_insn ("blr %%r0,%%r2", xoperands); - output_asm_insn ("bv,n %%r0(%%r1)\n\tnop", xoperands); + output_asm_insn ("bv %%r0(%%r1)", xoperands); + output_asm_insn ("ldo 12(%%r2),%%r2", xoperands); return ""; }