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