From 1a3206243932c89556cafcdb2f278eac8f4a436d Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 15 Dec 2016 17:33:41 +0100 Subject: [PATCH] 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 --- pcsx2/x86/newVif_Dynarec.cpp | 3 ++- pcsx2/x86/newVif_HashBucket.h | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pcsx2/x86/newVif_Dynarec.cpp b/pcsx2/x86/newVif_Dynarec.cpp index b85a2e70d0..3d7fcaf31f 100644 --- a/pcsx2/x86/newVif_Dynarec.cpp +++ b/pcsx2/x86/newVif_Dynarec.cpp @@ -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) diff --git a/pcsx2/x86/newVif_HashBucket.h b/pcsx2/x86/newVif_HashBucket.h index e4f6fe79a0..f955f3e34d 100644 --- a/pcsx2/x86/newVif_HashBucket.h +++ b/pcsx2/x86/newVif_HashBucket.h @@ -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...