mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-11-23 03:09:55 +00:00
fix lane inst decoding (#1051)
This commit is contained in:
parent
1620eea37b
commit
7f9bc0abbd
@ -503,9 +503,8 @@ void GcnDecodeContext::decodeInstructionVOP1(u32 hexInstruction) {
|
||||
|
||||
OpcodeVOP1 vop1Op = static_cast<OpcodeVOP1>(op);
|
||||
if (vop1Op == OpcodeVOP1::V_READFIRSTLANE_B32) {
|
||||
m_instruction.dst[1].field = getOperandField(vdst);
|
||||
m_instruction.dst[1].type = ScalarType::Uint32;
|
||||
m_instruction.dst[1].code = vdst;
|
||||
m_instruction.dst[0].field = getOperandField(vdst);
|
||||
m_instruction.dst[0].type = ScalarType::Uint32;
|
||||
}
|
||||
}
|
||||
|
||||
@ -547,13 +546,15 @@ void GcnDecodeContext::decodeInstructionVOP2(u32 hexInstruction) {
|
||||
m_instruction.dst_count = 1;
|
||||
|
||||
OpcodeVOP2 vop2Op = static_cast<OpcodeVOP2>(op);
|
||||
if (vop2Op == OpcodeVOP2::V_READLANE_B32 || vop2Op == OpcodeVOP2::V_WRITELANE_B32) {
|
||||
if (vop2Op == OpcodeVOP2::V_READLANE_B32) {
|
||||
// vsrc1 is scalar for lane instructions
|
||||
m_instruction.src[1].field = getOperandField(vsrc1);
|
||||
// dst is sgpr
|
||||
m_instruction.dst[1].field = OperandField::ScalarGPR;
|
||||
m_instruction.dst[1].type = ScalarType::Uint32;
|
||||
m_instruction.dst[1].code = vdst;
|
||||
m_instruction.dst[0].field = getOperandField(vdst);
|
||||
m_instruction.dst[0].type = ScalarType::Uint32;
|
||||
} else if (vop2Op == OpcodeVOP2::V_WRITELANE_B32) {
|
||||
m_instruction.src[1].field = getOperandField(vsrc1);
|
||||
// dst is vgpr, as normal
|
||||
} else if (IsVop3BEncoding(m_instruction.opcode)) {
|
||||
m_instruction.dst[1].field = OperandField::VccLo;
|
||||
m_instruction.dst[1].type = ScalarType::Uint64;
|
||||
@ -660,13 +661,11 @@ void GcnDecodeContext::decodeInstructionVOP3(uint64_t hexInstruction) {
|
||||
m_instruction.dst[1].field = getOperandField(vdst);
|
||||
m_instruction.dst[1].type = ScalarType::Uint64;
|
||||
m_instruction.dst[1].code = vdst;
|
||||
} else if (vop3Op >= OpcodeVOP3::V_READLANE_B32 && vop3Op <= OpcodeVOP3::V_WRITELANE_B32) {
|
||||
// vsrc1 is scalar for lane instructions
|
||||
m_instruction.src[1].field = getOperandField(src1);
|
||||
// dst is sgpr for lane instruction
|
||||
m_instruction.dst[1].field = OperandField::ScalarGPR;
|
||||
m_instruction.dst[1].type = ScalarType::Uint32;
|
||||
m_instruction.dst[1].code = vdst;
|
||||
} else if (vop3Op == OpcodeVOP3::V_READLANE_B32 ||
|
||||
vop3Op == OpcodeVOP3::V_READFIRSTLANE_B32) {
|
||||
m_instruction.dst[0].field = getOperandField(vdst);
|
||||
m_instruction.dst[0].type = ScalarType::Uint32;
|
||||
// WRITELANE can be decoded like other VOP3's
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@ void Translator::S_BARRIER() {
|
||||
// VOP2
|
||||
|
||||
void Translator::V_READFIRSTLANE_B32(const GcnInst& inst) {
|
||||
const IR::ScalarReg dst{inst.dst[0].code};
|
||||
const IR::U32 value{GetSrc(inst.src[0])};
|
||||
|
||||
if (info.stage != Stage::Compute) {
|
||||
|
Loading…
Reference in New Issue
Block a user