vif: repack nVifBlock struct

cl/wl can fit in a single byte. Add a 2B length field instead.
It will contains the pre computed length to reduce dVifsetVUptr overhead
This commit is contained in:
Gregory Hainaut 2016-12-15 17:33:41 +01:00
parent d34e99b38b
commit 1a32062439
2 changed files with 11 additions and 9 deletions

View File

@ -326,10 +326,11 @@ _vifT __fi void dVifUnpack(const u8* data, bool isFill) {
__aligned16 nVifBlock block;
block.upkType = upkType;
block.num = (u8&)vifRegs.num;
block.length = 0;
block.mode = (u8&)vifRegs.mode;
block.aligned = vif.start_aligned; //MTVU doesn't have a packet size!
block.cl = vifRegs.cycle.cl;
block.wl = vifRegs.cycle.wl;
block.aligned = vif.start_aligned; //MTVU doesn't have a packet size!
block.startPtr = 0; // Ease the detection of the end of the hash bucket
if ((upkType & 0xf) != 9)

View File

@ -20,14 +20,15 @@
// nVifBlock - Ordered for Hashing; the 'num' field and the lower 6 bits of upkType are
// used as the hash bucket selector.
struct __aligned16 nVifBlock {
u8 num; // [00] Num Field
u8 upkType; // [01] Unpack Type [usn1:mask1:upk*4]
u8 mode; // [02] Mode Field
u8 aligned; // [03] Packet Alignment
u32 mask; // [04] Mask Field
u16 cl; // [08] CL Field
u16 wl; // [10] WL Field
uptr startPtr; // [12] Start Ptr of RecGen Code
u8 num; // [00] Num Field
u8 upkType; // [01] Unpack Type [usn1:mask1:upk*4]
u16 length; // [02] Extra: pre computed Length
u32 mask; // [04] Mask Field
u8 mode; // [08] Mode Field
u8 aligned; // [09] Packet Alignment
u8 cl; // [10] CL Field
u8 wl; // [11] WL Field
uptr startPtr; // [12] Start Ptr of RecGen Code
}; // 16 bytes
#define hSize 0x4000 // [usn*1:mask*1:upk*4:num*8] hash...