pspdev / psptoolchain-allegrex

This program will automatically build and install an Allegrex compiler which is used in the creation of homebrew software for the Sony PlayStation® Portable videogame system.
MIT License
11 stars 10 forks source link

Bump binutils to version v2.37.0 #2

Closed davidgfnet closed 2 years ago

davidgfnet commented 2 years ago

This is a rebase of psp binutils (namely allegrex) to the latest binutils version 2.37.0 It is pretty much a rewrite of the original patches since binutils MIPS backend has changed dramatically. It should remain compatible with the old version expect for vpfxs/t/d instructions (which are almost never used directly but in the form of a register prefix, thus users should not care). Also using raw register numbers is not supported (ie. $0 instead of S000.s or C000.q) since nobody uses it and causes too many collisions with already existing MIPS registers. I tried to ensure that binary output is also as close as possible for all those instructions with ambiguous encodings.

To test this I created a set of tools to compare with the old fork (see https://github.com/davidgfnet/psp-binutils-playground) and also to test error reporting and such corner cases. So far we (+ @fjtrujy) tested this with gcc 9.3.0 and seems to work fine with a few homebrews we tested. Of course there could be errors but I'd be more than happy to fix them if reported here.