matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

Add support for `seb`/`seh` instructions from mips32r2 #273

Closed Xeeynamo closed 1 month ago

Xeeynamo commented 1 month ago

These instructions are found specifically on PlayStation Portable and they are backported to its processor from the mips32r2 specs.

SEH is a single instruction that replaces the combo sll DST_REG, SRC_REG, 0x10 and sra DST_REG, DST_REG, 0x10 to perform a s16 cast. Same concept for SEB but when a cast to s8 is required.

SEB instruction

SEH instruction