From 1548b4e11c399f50fd4b6b9ec693d784248b5ced Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Sun, 19 Oct 2025 13:56:23 +0900 Subject: [PATCH] [CPU/PPC] Add VX128_2 VC field support for vperm128 Add 3-bit VC field to VX128_2 format structure to support instructions like vperm128 that use 4 distinct vector operands. The VC field occupies bits 6-8 of the instruction encoding. --- src/xenia/cpu/ppc/ppc_decode_data.h | 4 +++- src/xenia/cpu/ppc/ppc_instr.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/ppc/ppc_decode_data.h b/src/xenia/cpu/ppc/ppc_decode_data.h index 1845848d4..06a1d92f6 100644 --- a/src/xenia/cpu/ppc/ppc_decode_data.h +++ b/src/xenia/cpu/ppc/ppc_decode_data.h @@ -487,6 +487,7 @@ struct PPCDecodeData { return bits_.VA128l | (bits_.VA128h << 5) | (bits_.VA128H << 6); } uint32_t VB() const { return bits_.VB128l | (bits_.VB128h << 5); } + uint32_t VC() const { return bits_.VC; } private: XE_MAYBE_UNUSED @@ -498,7 +499,8 @@ struct PPCDecodeData { uint32_t VD128h : 2; uint32_t : 1; uint32_t VA128h : 1; - uint32_t : 4; + uint32_t VC : 3; + uint32_t : 1; uint32_t VA128H : 1; uint32_t VB128l : 5; uint32_t VA128l : 5; diff --git a/src/xenia/cpu/ppc/ppc_instr.h b/src/xenia/cpu/ppc/ppc_instr.h index a65f1b638..b00fa225e 100644 --- a/src/xenia/cpu/ppc/ppc_instr.h +++ b/src/xenia/cpu/ppc/ppc_instr.h @@ -208,7 +208,8 @@ struct PPCOpcodeBits { uint32_t VD128h : 2; uint32_t : 1; uint32_t VA128h : 1; - uint32_t : 4; + uint32_t VC : 3; + uint32_t : 1; uint32_t VA128H : 1; uint32_t VB128l : 5; uint32_t VA128l : 5;