This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: Matthew Fortune <Matthew dot Fortune at imgtec dot com>, Petar Jovanovic <petar dot jovanovic at rt-rk dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Moore, Catherine (Catherine_Moore at mentor dot com)" <Catherine_Moore at mentor dot com>
- Date: Fri, 6 Feb 2015 19:19:23 +0000 (GMT)
- Subject: Re: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
- Authentication-results: sourceware.org; auth=none
- References: <003e01d04179$ccc38bc0$664aa340$ at rt-rk dot com> <6D39441BF12EF246A7ABCE6654B0235320FCA3F1 at LEMAIL01 dot le dot imgtec dot org> <alpine dot LFD dot 2 dot 11 dot 1502061033300 dot 22715 at eddie dot linux-mips dot org> <6D39441BF12EF246A7ABCE6654B0235320FCAD06 at LEMAIL01 dot le dot imgtec dot org> <alpine dot LFD dot 2 dot 11 dot 1502061210200 dot 22715 at eddie dot linux-mips dot org> <CAD0D5D4-8D49-4B4B-B59A-E4E6B932B067 at comcast dot net> <6D39441BF12EF246A7ABCE6654B0235320FCB901 at LEMAIL01 dot le dot imgtec dot org> <AF463DB4-9079-4C6A-BBFE-3D12B5FBE42F at comcast dot net>
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