Decompollaborate / rabbitizer

MIPS instruction decoder
https://pypi.org/project/rabbitizer/
MIT License
148 stars 15 forks source link

[Frug]: R5900 `vsqrt` and `qmfc2` instructions are not being properly decoded #67

Open AngheloAlf opened 4 months ago

AngheloAlf commented 4 months ago

Explain the problem.

I was looking at KH1 assembly and noticed some instructions being decoded as .words instead of the actual instructions.

The examples I noticed

/* 151F4 00115174 BD03254A */  .word      0x4A2503BD                    # vsqrt      $Q, $vf5x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* 63B68 00163AE8 BD03244A */  .word      0x4A2403BD                    # vsqrt      $Q, $vf4x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* 63DF4 00163D74 01D02848 */  .word      0x4828D001                    # qmfc2      $t0, $vf26 # 00000001 <InstrIdType: R5900_COP2_NOHIGHBIT>
/* AB2FC 001AB27C BD033F4A */  .word      0x4A3F03BD                    # vsqrt      $Q, $vf31x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* AB40C 001AB38C BD03AA4A */  .word      0x4AAA03BD                    # vsqrt      $Q, $vf10y # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* AB440 001AB3C0 BD03294B */  .word      0x4B2903BD                    # vsqrt      $Q, $vf9z # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* AD65C 001AD5DC BD03214A */  .word      0x4A2103BD                    # vsqrt      $Q, $vf1x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* BBC20 001BBBA0 BD03324A */  .word      0x4A3203BD                    # vsqrt      $Q, $vf18x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* 8BD78 0018BCF8 BD03224A */  .word      0x4A2203BD                    # vsqrt      Q, $vf2x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* A468C 001A460C BD032A4B */  .word      0x4B2A03BD                    # vsqrt      Q, $vf10z # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>
/* A7994 001A7914 BD033A4A */  .word      0x4A3A03BD                    # vsqrt      Q, $vf26x # 00200000 <InstrIdType: R5900_COP2_SPECIAL2>

Reproducer

Clone the repo at https://github.com/ethteck/kh1, install dependencies listed on readme and run configure.py

Is this issue related to an specific MIPS extension?

R5900 EE (Emotion Engine, A Sony PlayStation 2 extension)

rabbitizer version

1.11.2

Optional: splat/spimdisasm version

splat: 0.24.6, spimdisasm: 1.27.0

Optional: Version of other stuff

No response

Extra comments?

No response