shader_recompiler: added V_TRUNC VOP1/3 (496)

This commit is contained in:
psucien 2024-06-16 23:39:45 +02:00
parent d3ab612bdc
commit 396812bab6
3 changed files with 9 additions and 0 deletions

View File

@ -657,6 +657,9 @@ void Translate(IR::Block* block, std::span<const GcnInst> inst_list, Info& info)
case Opcode::S_BFM_B32:
translator.S_BFM_B32(inst);
break;
case Opcode::V_TRUNC_F32:
translator.V_TRUNC_F32(inst);
break;
case Opcode::S_NOP:
case Opcode::S_CBRANCH_EXECZ:
case Opcode::S_CBRANCH_SCC0:

View File

@ -114,6 +114,7 @@ public:
void V_CVT_I32_F32(const GcnInst& inst);
void V_MIN_I32(const GcnInst& inst);
void V_MUL_LO_U32(const GcnInst& inst);
void V_TRUNC_F32(const GcnInst& inst);
// Vector Memory
void BUFFER_LOAD_FORMAT(u32 num_dwords, bool is_typed, const GcnInst& inst);

View File

@ -425,4 +425,9 @@ void Translator::V_MUL_LO_U32(const GcnInst& inst) {
SetDst(inst.dst[0], ir.IMul(src0, src1));
}
void Translator::V_TRUNC_F32(const GcnInst& inst) {
const IR::F32 src0{GetSrc(inst.src[0], true)};
SetDst(inst.dst[0], ir.FPTrunc(src0));
}
} // namespace Shader::Gcn