From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28879 invoked by alias); 6 Feb 2015 19:19:27 -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 28870 invoked by uid 89); 6 Feb 2015 19:19:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 X-HELO: cvs.linux-mips.org Received: from eddie.linux-mips.org (HELO cvs.linux-mips.org) (148.251.95.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Feb 2015 19:19:25 +0000 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S27012772AbbBFTTXSPn0c (ORCPT ); Fri, 6 Feb 2015 20:19:23 +0100 Date: Fri, 06 Feb 2015 19:19:00 -0000 From: "Maciej W. Rozycki" To: Mike Stump cc: Matthew Fortune , Petar Jovanovic , "gcc-patches@gcc.gnu.org" , "Moore, Catherine (Catherine_Moore@mentor.com)" Subject: Re: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro In-Reply-To: Message-ID: References: <003e01d04179$ccc38bc0$664aa340$@rt-rk.com> <6D39441BF12EF246A7ABCE6654B0235320FCA3F1@LEMAIL01.le.imgtec.org> <6D39441BF12EF246A7ABCE6654B0235320FCAD06@LEMAIL01.le.imgtec.org> <6D39441BF12EF246A7ABCE6654B0235320FCB901@LEMAIL01.le.imgtec.org> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=windows-1252 Content-Transfer-Encoding: 8BIT X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00424.txt.bz2 On Fri, 6 Feb 2015, Mike Stump wrote: > Personally, the call form of bal in my book should be called call, and > the non-call form of it should be called bal, but, I realize it is > likely to late to do much about now. If one went down this path, then > even changing it away from bal is wrong. ThatÂ’s the basis of why I > fired up the first email. Maybe more a lament at this point. I'm confused, these all are conditional short-distance calls. And I suspect that they were included in the original MIPS architecture for the very purpose of letting relocatable code find its own position in memory at the run time -- and the rest was added to maximise the benefit of the opcode(s) that had to be there anyway. And it's just, owing to how the architecture has been structured, that there are exactly two cases (of the 64 encodings available) where the condition is fixed to either `true' or `false', respectively. And if anyhow, I'd call any assembly-language idiom of `BLTZAL $0, foo' just `MOVE $31, $pc' or maybe to avoid confusion `[D]ADDIU $31, $pc, 8'. Note that `foo' is never used in that operation (and that the MIPS16 and microMIPS, and now also r6 instruction sets actually have such direct operations that have a wider range of immediates available; although care has to be taken about them as they may have unusual alignment or other restrictions). Maciej