mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-12-14 22:02:27 +00:00
shader_decode: Implement MOV_C and MOV_R
This commit is contained in:
parent
a4f052f6b3
commit
4c70d5b8eb
1 changed files with 23 additions and 1 deletions
|
@ -11,12 +11,34 @@ namespace VideoCommon::Shader {
|
||||||
|
|
||||||
using Tegra::Shader::Instruction;
|
using Tegra::Shader::Instruction;
|
||||||
using Tegra::Shader::OpCode;
|
using Tegra::Shader::OpCode;
|
||||||
|
using Tegra::Shader::SubOp;
|
||||||
|
|
||||||
u32 ShaderIR::DecodeArithmetic(BasicBlock& bb, u32 pc) {
|
u32 ShaderIR::DecodeArithmetic(BasicBlock& bb, u32 pc) {
|
||||||
const Instruction instr = {program_code[pc]};
|
const Instruction instr = {program_code[pc]};
|
||||||
const auto opcode = OpCode::Decode(instr);
|
const auto opcode = OpCode::Decode(instr);
|
||||||
|
|
||||||
UNIMPLEMENTED();
|
Node op_a = GetRegister(instr.gpr8);
|
||||||
|
|
||||||
|
Node op_b = [&]() -> Node {
|
||||||
|
if (instr.is_b_imm) {
|
||||||
|
return GetImmediate19(instr);
|
||||||
|
} else if (instr.is_b_gpr) {
|
||||||
|
return GetRegister(instr.gpr20);
|
||||||
|
} else {
|
||||||
|
return GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset);
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
||||||
|
switch (opcode->get().GetId()) {
|
||||||
|
case OpCode::Id::MOV_C:
|
||||||
|
case OpCode::Id::MOV_R: {
|
||||||
|
// MOV does not have neither 'abs' nor 'neg' bits.
|
||||||
|
SetRegister(bb, instr.gpr0, op_b);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
UNIMPLEMENTED_MSG("Unhandled arithmetic instruction: {}", opcode->get().GetName());
|
||||||
|
}
|
||||||
|
|
||||||
return pc;
|
return pc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue