36 Commits

Author SHA1 Message Date
Anghelo Carvajal
b51b62da45
ALLEGREX support (#60)
* setup ALLEGREX

* more setup

* clo

* fix

* Implement SPECIAL_RS and SPECIAL_SA instructions

* more table placeholders

* Implement bshfl instructions

* Rename to R4000Allegrex

* Implement SPECIAL instructions

* Add tests

* Remove some duplicated tests

* Implement SPECIAL3 instructions

* fix bug in test

* update

* Implement COPz

* Implement SPECIAL2 instructions

* Implement COP1

* Yeet cop3

* som tests

* bvf, bvfl, bvt, bvtl

* fix bshfl prefix

* need to implement the vfpu registers

* implement vt_7?

* R4000AllegrexVF -> R4000AllegrexVScalar

* Add test suite to compare with the sn toolchain decoding

* more vfpu test cases

* forgor this

* I can't decide how to name these registers

* Prepare tables for all register types

* Fix typo

* Implement vector scalar register operands

* Implement quad registers

* Fix tests?

* svl.q, svr.q

* Implement a bunch of vfpu0 instructions

* implement registers for `.t` and `.p` instructions

* Implement VFPU1 instructions

* bleh

* VFPU1, VFPU3 and `vcmp.`

* Fix wrong register type on some instructions

* start vfpu3

* Implement VFPU3 instructions

* start categorizing VFPU4

* Categorize VFPU5

* VFPU6 identification

* Identify VFPU7

* COP2 is weird

* organize COP2 a bit

* Add test cases for VFPU4 FMT

* VFPU4 FMT2 stuff

* VFPU4 FMT3 stuff

* VFPU5 stuff

* VFPU6 stuff

* VFPU7 stuff

* Implement COP2 instructions

* Implement vmov, vabs and vneg

* VPFU4 FMT0 FMT0 FMT0 implemented

* VFPU FMT0 FMT0 FMT2

* vnrcp, vnsin, vrexp2

* vrnds, vrndi, vrndf1, vrndf2

* Change tests a bit

* vf2h, vh2f, vsbz, vlgb

* vuc2ifs, vc2i, vus2i, vs2i, vi2uc, vi2c, vi2us, vi2s

* vsrt1, vsrt2, vbfy1, vbfy2, vocp, vsocp, vfad, vavg

* vsrt3, vsrt4, vsgn

* vmfvc and vmtvc placeholders

* vt4444, vt5551, vt5650

* vcst placeholder

* vf2in

* vf2iz

* vf2iu, vf2id, vi2f

* vcmovt, vcmovf

* vwbn.s, viim.s, vfim.s

* vpfxs, vpfxt, vpfxd, vnop, vsync, vflush

* vmmov, vmidt, vmzero, vmone

* vrot

* vmmul, vhtfm2, vtfm2, vhtfm3, vtfm3, vhtfm4, vtfm4, vmscl, vcrsp, vqmul

* Implement matrix operands

* fix matrix operands

* Fix `illegal` tests

* hack out a way to check the test cases are assemblable

* test-fixing: branches

* fix more test cases

* fix vmfvc and vmtvc

* more test fixing

* vdiv and fix operand R323

* more test fixing

* Fix matrix operands

* implement vcmp comparisons

* fix vsync2

* vsqrt and vrndf1 fixes

* Implement "constant" operand for `vcst`

* Add missing operand of vf2in, vf2iz, vf2iu, vf2id, vi2f

* Add missing vcmovt and vcmovf operands

* Add missing vwbn operand

* Tests cases for vmmul

* Fix vtfm2

* Implement "transpose matrix register"

* Add placeholders for the remaining missing operands

* Implement viim operand

* Implement vrot code operand

* placeholders for rp and wp operands

* test cases for vpfxs, vpfxt and vpfxd

* Properly implement rpx, rpy, rpz and rpw

* Properly implement wpx, wpy, wpz and wpw operands

* Implement vfim

* changelog

* readme

* some cleanup

* Restructure some tables

* more table restructure

* fix tests

* more table yeeting

* more cleanup

* more cleanup

* reanming

* moar

* fmt
2024-04-22 13:15:58 -04:00
angie
9bf73dd20b Fix typo 2024-04-13 15:04:04 -04:00
angie
16ab51f871 further test cleanup 2024-04-11 10:50:31 -04:00
angie
ef9c548249 modularize test files 2024-04-11 10:27:57 -04:00
angie
502fe43959 only remove warning on gcc 2024-04-03 12:43:12 -03:00
angie
f5d811f18e Avoid heap-allocating memory for calculating required buffer size on RabbitizerOperandType_getBufferSize 2024-04-03 12:41:26 -03:00
angie
7b35aa7a8c typo 2024-03-17 11:19:32 -03:00
angie
13d5c1b069 Fix c.seq.d 2024-03-11 09:17:29 -03:00
angie
e39f9534e2 Enable -Werror=type-limits because 2023-12-25 15:02:15 -03:00
angie
049b47b32c flag_disasmAsData 2023-11-11 13:19:56 -03:00
Angie
69f69357f7 Move all the tables into a tables folder 2023-05-02 19:01:54 -04:00
Angie
4681f1c20e Enable more warnings 2023-05-01 20:59:01 -04:00
angie
37b2ce06e2 Autogenerate pyi files 2023-04-30 17:39:05 -04:00
angie
3c8904b6fb Fix borken identation in tables 2023-04-30 15:58:01 -04:00
angie
39e081470e CI for checking format and tables 2023-04-30 08:48:47 -04:00
Anghelo Carvajal
8237818ff9
Add R3000GTE instruction set support (#31)
* initial gte setup

* starting to parse gte instructions

* R3000_GTE -> R3000GTE

* decode all the non-operand instructions

* remove printfs, whoops

* decode gte with operands

* cleanups

* bindings stuffs

* RabbitizerInstrId_isValid

* fix missing include
2023-04-29 23:07:07 -04:00
angie
5ca1106392 reorder stuff in readme 2022-12-23 21:41:45 -03:00
angie
8a9824bbd3 format tidy 2022-12-19 15:12:12 -03:00
angie
ef2acdb328 Remove jalr_rd hack 2022-12-19 15:04:59 -03:00
angie
3735d91fcc Pregenerate every table 2022-12-16 15:37:46 -03:00
angie
12537e6706 pre-geneate table system 2022-12-16 14:36:53 -03:00
angie
d5d1096e81 Version bump and remove setup.cfg 2022-12-16 11:04:16 -03:00
angie
363aff8e5d Fix descriptor logic errors 2022-12-15 16:55:31 -03:00
angie
cb8af37b43 move tests to tests folder 2022-10-12 11:26:28 -03:00
Angie
516b92f254 Fix building with g++ 2022-10-10 20:23:18 -03:00
Anghelo Carvajal
acee144578
C++ bindings (#9)
* start making c++ bindings

* Add sanity checks

* add descriptor methods

* setup making c++ library

* cpp test

* format (not tidy because it breaks everything and the result looks dumb)

* Fixes

* add missing alias

* move stuff to their own files

* InstructionRsp bindings

* r5900 bindings

* almost there

* binding for analysis stuff

* setters
2022-10-09 17:51:47 -03:00
angie
421e740014 Add building static lib to makefile and a header which includes every other header 2022-09-26 11:00:45 -03:00
angie
917a24808f Fix RabbitizerRegistersTracker_moveRegisters not considering gpGot 2022-09-14 15:12:00 -03:00
Anghelo Carvajal
136fb7a09a
Add R5900 support (#5)
* starting r5900 stuff

* operands of pmaddh

* expose R5900 to python

* fix merge issues

* move to subtables

* mmi0 and mmi3

* the rest of mmi instructions

* normal, special, regimm and cop0

* fpu_s

* cop2 special1

* starting cop2 special2

* the rest of special2

* operands for normal, special, mmi and mmi0

* mmi1 and mmi2

* Fix mmi

* sync.p

* mmi3 and cop1

* add r5900 opcodes to InstrId.pyi

* add invalid bits to unknown instruction comment

* progress on cop2 special1

* kinda finish cop2 special1

* cop2 special2 progress

* Special case for R5900 cvt.w.s -> trunc.w.s

* R5900 c.olt.s and c.ole.s

* Fix a bunch of VU0 instructions

* I'm getting tired of this bullshit

* vlqi, vsqi, vlqd, vsqd

* fix some operands

* fix div1

* lqc2 and sqc2

* sqrt.s and mult

* fix mtsa and bc2

* Remove redundant .instrType=RABBITIZER_INSTR_TYPE_UNKNOWN

* RabbitizerInstrSuffix

* Impleme instr suffix type

* add instr suffix to remaining instructions

* ifdef out xyzw suffix from registers

* format

* fix warnings

* uncomment stuff on InstrId.pyi

* readme
2022-08-27 12:22:48 -04:00
Angie
d4cb445cc1 Add -Wpedantic to makefile 2022-08-23 15:12:55 -04:00
Anghelo Carvajal
f8979ede3e
Fix RSP instruction decoding (#4)
* Use the proper registers on RSP GPR instructions

* Add IMM_base operand to RSP instructions

* Use `ra` on RSP GPR registers

* Fix RABBITIZER_OPERAND_TYPE_RSP_rd

* ??

* fix vector register element index

* fix RSP mfc2 and mtc2

* fix vmov and similar instructions

* format

* update readme

* version pump
2022-08-22 16:27:51 -04:00
Angie
a5ef766311 Utils.escapeString 2022-07-10 16:04:39 -04:00
angie
ef49315db0 tidy target on makefile 2022-07-09 17:55:57 -04:00
angie
baaef2f242 Format files with clang-format and add a format rule to makefile 2022-07-09 17:40:53 -04:00
angie
f17c0ee5dc setup header dependencies on makefile 2022-07-09 17:13:37 -04:00
angie
ecc8de8df2 Add a makefile for testing and fix one warning 2022-07-09 16:54:42 -04:00