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: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Cc: 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 12:23:12 +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>
On Fri, 6 Feb 2015, Matthew Fortune wrote:
> > Native systems have <sys/asm.h> for such ABI dependencies, including
> > stuff to set up $gp. Perhaps we could reuse these bits, the licence I
> > think allows us to.
>
> That's a good idea. Perhaps I should take that on as part of some cleanup
> of the MIPS backend in the next stage1. I'm looking to rework how the
> ISA_HAS logic works so perhaps there would be value in doing this mostly in
> a header that can also be used for assembly programmers. That would naturally
> mean we get all the other nice assembly macros available in the backend of
> GCC too.
This consideration made me realise I've had a patch outstanding for some
10 years to convert all the `BAL x' instructions there to `BLTZAL $0, x'.
This has always been a good idea in case implementations recognised the
special case and avoided involving branch prediction, and I believe it has
become even more apparent with r6 calling it NAL.
I'll see if I can submit it to glibc soon -- as you may have been aware
10 years ago wasn't exactly the most friendly period in glibc maintenance
and hence I wasn't very prompt with patch submissions.
Maciej