diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-12-21 05:53:05 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-15 21:54:51 +0100 |
commit | 8abe5ba2c8a5eb839849b6554782dfd455e85699 (patch) | |
tree | e7242a39f0b4d0e3100954d0b9aa44b7f3ceea7e | |
parent | shader_decode: Implement F2F (diff) | |
download | yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar.gz yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar.bz2 yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar.lz yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar.xz yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.tar.zst yuzu-8abe5ba2c8a5eb839849b6554782dfd455e85699.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/conversion.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/conversion.cpp b/src/video_core/shader/decode/conversion.cpp index 465c63a9e..7c691982d 100644 --- a/src/video_core/shader/decode/conversion.cpp +++ b/src/video_core/shader/decode/conversion.cpp @@ -18,6 +18,29 @@ u32 ShaderIR::DecodeConversion(BasicBlock& bb, u32 pc) { const auto opcode = OpCode::Decode(instr); switch (opcode->get().GetId()) { + case OpCode::Id::I2F_R: + case OpCode::Id::I2F_C: { + UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word); + UNIMPLEMENTED_IF(instr.conversion.selector); + UNIMPLEMENTED_IF_MSG(instr.generates_cc, + "Condition codes generation in I2F is not implemented"); + + Node value = [&]() { + if (instr.is_b_gpr) { + return GetRegister(instr.gpr20); + } else { + return GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset); + } + }(); + const bool input_signed = instr.conversion.is_input_signed; + value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed); + value = GetOperandAbsNegInteger(value, instr.conversion.abs_a, false, input_signed); + value = SignedOperation(OperationCode::FCastInteger, input_signed, PRECISE, value); + value = GetOperandAbsNegFloat(value, false, instr.conversion.negate_a); + + SetRegister(bb, instr.gpr0, value); + break; + } case OpCode::Id::F2F_R: { UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word); UNIMPLEMENTED_IF(instr.conversion.src_size != Register::Size::Word); |