So for the past few days I've been working on libgcc, making sure the compiler covers all instructions up to 32-bit operations.
Count leading zero bits
Count trailing zero bits
Find index of least significant bit
Return one if an even number of bits set
__paritysi2, __parityhi2, __parityqi2
Return number of set bits
__popcountsi2, __popcounthi2, __popcountqi
Signed division of 32-bit values
Unsigned division of 32-bit values
Calculate modulus of 32-bit values
Calculate unsigned modulus of 32-bit values
Do both division and modulus calculations
Do both unsigned division and modulus calculations
Multiply 32-bit values
For now, the trapped arithmetic instructions will be implemented using the default code. These functions call "abort" when there is an overflow condition, and are only needed in rare cases. The TMS9900 updates an overflow flag which we can use for this, but we can do that work later.
The other routines in libgcc are for floating-point and fixed-point math, odds are they are too big to really use. But again, I can fix that later.