Merge pull request #3799 from ReinUsesLisp/iadd-cc

shader: Implement P2R CC, IADD Rd.CC and IADD.X
This commit is contained in:
bunnei 2020-04-30 12:56:36 -04:00 committed by GitHub
commit c7b5a87c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 84 additions and 28 deletions

View file

@ -1870,6 +1870,14 @@ private:
return GenerateBinaryInfix(operation, ">=", Type::Bool, type, type);
}
Expression LogicalAddCarry(Operation operation) {
const std::string carry = code.GenerateTemporary();
code.AddLine("uint {};", carry);
code.AddLine("uaddCarry({}, {}, {});", VisitOperand(operation, 0).AsUint(),
VisitOperand(operation, 1).AsUint(), carry);
return {fmt::format("({} != 0)", carry), Type::Bool};
}
Expression LogicalFIsNan(Operation operation) {
return GenerateUnary(operation, "isnan", Type::Bool, Type::Float);
}
@ -2441,6 +2449,8 @@ private:
&GLSLDecompiler::LogicalNotEqual<Type::Uint>,
&GLSLDecompiler::LogicalGreaterEqual<Type::Uint>,
&GLSLDecompiler::LogicalAddCarry,
&GLSLDecompiler::Logical2HLessThan<false>,
&GLSLDecompiler::Logical2HEqual<false>,
&GLSLDecompiler::Logical2HLessEqual<false>,