summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-04-26 03:53:54 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-04-26 03:58:33 +0200
commite895a4e2d7ebf29fbafda7d950301cd7d03efdbb (patch)
tree57dc090aaf66908e213b10cd64fc184b286b4c8a /src
parentshader/arithmetic_integer: Change IAdd to UAdd to avoid signed overflow (diff)
downloadyuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar.gz
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar.bz2
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar.lz
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar.xz
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.tar.zst
yuzu-e895a4e2d7ebf29fbafda7d950301cd7d03efdbb.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/arithmetic_integer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp
index addd7f533..ced5c3dc1 100644
--- a/src/video_core/shader/decode/arithmetic_integer.cpp
+++ b/src/video_core/shader/decode/arithmetic_integer.cpp
@@ -35,7 +35,8 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
case OpCode::Id::IADD_C:
case OpCode::Id::IADD_R:
case OpCode::Id::IADD_IMM: {
- UNIMPLEMENTED_IF_MSG(instr.alu.saturate_d, "IADD saturation not implemented");
+ UNIMPLEMENTED_IF_MSG(instr.alu.saturate_d, "IADD.SAT");
+ UNIMPLEMENTED_IF_MSG(instr.iadd.x && instr.generates_cc, "IADD.X Rd.CC");
op_a = GetOperandAbsNegInteger(op_a, false, instr.alu_integer.negate_a, true);
op_b = GetOperandAbsNegInteger(op_b, false, instr.alu_integer.negate_b, true);
@@ -49,6 +50,10 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
}
if (instr.generates_cc) {
+ // Avoid changing result's carry flag
+ SetTemporary(bb, 0, std::move(value));
+ value = GetTemporary(0);
+
const Node i0 = Immediate(0);
Node zero = Operation(OperationCode::LogicalIEqual, value, i0);