rust-psp
rust-psp copied to clipboard
Add more vfpu instructions
From http://hlide.free.fr Tracking:
- [x] mfv
- [x] mtv
- [ ] bvf
- [ ] bvt
- [ ] bvfl
- [ ] bvtl
- [x] vadd
- [x] vsub
- [x] vsbn
- [x] vdiv
- [x] vmul
- [x] vdot
- [x] vscl
- [x] vhdp
- [x] vcrs
- [ ] vcmp
- [x] vmin
- [x] vmax
- [x] vscmp
- [x] vsge
- [x] vslt
- [x] lvs
- [x] vmov
- [x] vabs
- [x] vneg
- [x] vidt
- [x] vsat0
- [x] vsat1
- [x] vzero
- [x] vone
- [x] vrcp
- [x] vrsq
- [x] vsin
- [x] vcos
- [x] vexp2
- [x] vlog2
- [x] vsqrt
- [x] vasin
- [x] vnrcp
- [x] vnsin
- [x] vrexp2
- [x] vrnds
- [x] vrndi
- [x] vrndf1
- [x] vrndf2
- [x] vf2h
- [x] vh2f
- [x] vsbz
- [x] vlgb
- [x] vuc2i
- [x] vc2i
- [x] vus2i
- [x] vs2i
- [x] vi2c
- [x] vi2us
- [x] vsrt1
- [x] vsrt2
- [x] vsrt3
- [x] vsrt4
- [x] vbfy1
- [x] vbfy2
- [x] vocp
- [x] vsocp
- [x] vfad
- [x] vavg
- [x] vsrt3
- [x] vsrt4
- [ ] vmfvc
- [ ] vmtvc
- [x] vt4444
- [x] vt5551
- [x] vt5650
- [x] vcst
- [x] vf2iz
- [x] vf2iu
- [x] vf2id
- [x] vi2f
- [ ] vcmovt
- [ ] vcmovf
- [ ] vwbn
- [ ] ulvq
- [x] lvq
- [x] vpfxs
- [x] vpfxt
- [x] vpfxd
- [x] viim
- [ ] vfim
- [x] svs
- [ ] usvq
- [x] lvq
There is a difference in what we have and what hlide says for vf2in and vi2f.
I left the remainder for you @overdrivenpotato because I'm not exactly sure how to do their encodings.
Hi, is the list complete? I'm a little rusty.
The list is what was missing when this PR was created, not a complete list, and the ones without checkmarks are what remain. I think it should be complete when all these are done.
There is a difference in what we have and what hlide says for vf2in and vi2f.
What do you mean?
There is a difference in what we have and what hlide says for vf2in and vi2f.
What do you mean?
I don't remember. Looks the same now. Either I fixed it or I was confused.
Ok, I believe it is the "scale" which is missing in my tables (they are set as 00000).
bvf bvt bvfl bvtlcan be encoded if you know how to pass a label jump as an argumentvcmpwill set VFPU conditional flags as a result. Since those flags are not touched by the compiler and the normal MIPS instructions, it is almost safe to use it as long as the rest of the code is using those flags inside the same function body.vcmov vcmovfwill act according to VFPU conditional flags so if there is a prior VFPU instruction setting those flags in the same function body, it is okay to use them.
I believe MTVC/MFVC are missing. While MTV/MTF allow transferring between scalar VFPU registers and MIPS registers. MTVC/MFVC allow transferring between control VFPU register (like RND or conditional flags registers) and MIPS registers. VMTVC/VMFVC allow transferring between control VFPU register (like RND or conditional flags registers) and scalar VFPU registers.
@overdrivenpotato should we close this?
No, these instructions should definitely still be implemented. I think it's possible to implement them with the current asm!-based trickery, but ultimately if not, we can write a procedural macro.
Yeah, the main question was whether the work done here is transferrable to the new macro or if we need to just redo it.
superceded by #160