diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-12-18 01:14:25 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-15 21:54:52 +0100 |
commit | e8235c0215d51236c5b968de971435b7cf74dc81 (patch) | |
tree | 5e9bc0ac44ad3c6e4e0648139f25478444eb5eb2 /src/video_core/shader/decode | |
parent | shader_decode: Implement BRA internal flag (diff) | |
download | yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar.gz yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar.bz2 yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar.lz yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar.xz yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.tar.zst yuzu-e8235c0215d51236c5b968de971435b7cf74dc81.zip |
Diffstat (limited to 'src/video_core/shader/decode')
-rw-r--r-- | src/video_core/shader/decode/conversion.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/conversion.cpp b/src/video_core/shader/decode/conversion.cpp index 82fe5e21a..b823b6119 100644 --- a/src/video_core/shader/decode/conversion.cpp +++ b/src/video_core/shader/decode/conversion.cpp @@ -18,6 +18,32 @@ u32 ShaderIR::DecodeConversion(BasicBlock& bb, u32 pc) { const auto opcode = OpCode::Decode(instr); switch (opcode->get().GetId()) { + case OpCode::Id::I2I_R: { + UNIMPLEMENTED_IF(instr.conversion.selector); + + const bool input_signed = instr.conversion.is_input_signed; + const bool output_signed = instr.conversion.is_output_signed; + + Node value = GetRegister(instr.gpr20); + value = ConvertIntegerSize(value, instr.conversion.src_size, input_signed); + + value = GetOperandAbsNegInteger(value, instr.conversion.abs_a, instr.conversion.negate_a, + input_signed); + if (input_signed != output_signed) { + value = SignedOperation(OperationCode::ICastUnsigned, output_signed, NO_PRECISE, value); + } + + SetRegister(bb, instr.gpr0, value); + + if (instr.generates_cc) { + const Node zero_condition = + SignedOperation(OperationCode::LogicalIEqual, output_signed, value, Immediate(0)); + SetInternalFlag(bb, InternalFlag::Zero, zero_condition); + LOG_WARNING(HW_GPU, "I2I Condition codes implementation is incomplete."); + } + + break; + } case OpCode::Id::I2F_R: case OpCode::Id::I2F_C: { UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word); |