diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-26 03:41:20 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-26 03:56:11 +0200 |
commit | c788f9c0bd9cb0b0cb66f7424a65032cca3731cc (patch) | |
tree | 3dd3116449d8f00ea19ab4debe1fd39dffbe7973 | |
parent | shader/arithmetic_integer: Implement CC for IADD (diff) | |
download | yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar.gz yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar.bz2 yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar.lz yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar.xz yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.tar.zst yuzu-c788f9c0bd9cb0b0cb66f7424a65032cca3731cc.zip |
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 4 | ||||
-rw-r--r-- | src/video_core/shader/decode/arithmetic_integer.cpp | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index cde3a26b9..8dae754d4 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -814,6 +814,10 @@ union Instruction { } alu_integer; union { + BitField<43, 1, u64> x; + } iadd; + + union { BitField<39, 1, u64> ftz; BitField<32, 1, u64> saturate; BitField<49, 2, HalfMerge> merge; diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp index 99b4b6342..2a3311cb8 100644 --- a/src/video_core/shader/decode/arithmetic_integer.cpp +++ b/src/video_core/shader/decode/arithmetic_integer.cpp @@ -42,6 +42,12 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) { Node value = Operation(OperationCode::IAdd, op_a, op_b); + if (instr.iadd.x) { + Node carry = GetInternalFlag(InternalFlag::Carry); + Node x = Operation(OperationCode::Select, std::move(carry), Immediate(1), Immediate(0)); + value = Operation(OperationCode::IAdd, std::move(value), std::move(x)); + } + if (instr.generates_cc) { const Node i0 = Immediate(0); |