matt-kempster / m2c

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

Common PPC instructions #187

Open zbanks opened 2 years ago

zbanks commented 2 years ago

This issue is just used to track progress on implementing common PPC instructions using github's checklist feature. This is a list of instructions used in SMS sorted by popularity (with their associated count).

Generated with:

$ git clone https://github.com/doldecomp/sms
$ rg '^/[*].*[*]/\t\w' sms/asm | cut -f2 | cut -d ' ' -f1 | sort | uniq -c | sort -k1,1nr | sed -e 's/ *\([0-9]\+\) \(.*\)/- [ ] `\2` (\1)/'

Edit: This issue was used for tracking progress on the ppc2cpp branch, but that branch has now been merged.

zbanks commented 2 years ago

PPC Resources & Info:

[...] the doldisasm script will name the sections numerically based on the "section headers" in the dol, the proper section names correspond to those numerical names like so:

.init      = .text0
.text      = .text1
extab      = .data0
extabindex = .data1
.ctors     = .data2
.dtors     = .data3
.rodata    = .data4
.data      = .data5
.bss       = .bss
.sdata     = .data6
.sbss      = .bss
.sdata2    = .data7
.sbss2     = .bss

(bss is all the same, because the dol only states where the first bss region starts, and there is no section header entries for the bss sections, so projects using doldisasm usually have to split that out manually, so the bss sections are likely to always be named correctly else the project disassembly probably doesn't build matching yet)

simonlindholm commented 2 years ago

re psq_st and psq_l, in the decompme discord: https://discord.com/channels/897066363951128586/897077740476448768/931259634185027605