summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2018-11-22 05:35:00 -0300
committerGravatar ReinUsesLisp2018-11-22 16:12:27 -0300
commitc9ac23683b90fa097374d47d7f47ccdb050d8b2b (patch)
tree518ae3fda85c27fdbac8aea3a570761a8822d9ec /src
parentgl_shader_decompiler: Rename internal flag strings (diff)
downloadyuzu-c9ac23683b90fa097374d47d7f47ccdb050d8b2b.tar.gz
yuzu-c9ac23683b90fa097374d47d7f47ccdb050d8b2b.tar.xz
yuzu-c9ac23683b90fa097374d47d7f47ccdb050d8b2b.zip
gl_shader_decompiler: Add a message for unimplemented cc generation
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp69
1 files changed, 46 insertions, 23 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index e1ecabb2d..95d8e87c1 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1513,7 +1513,8 @@ private:
1513 instr.fmul.tab5c68_0 != 1, "FMUL tab5cb8_0({}) is not implemented", 1513 instr.fmul.tab5c68_0 != 1, "FMUL tab5cb8_0({}) is not implemented",
1514 instr.fmul.tab5c68_0 1514 instr.fmul.tab5c68_0
1515 .Value()); // SMO typical sends 1 here which seems to be the default 1515 .Value()); // SMO typical sends 1 here which seems to be the default
1516 UNIMPLEMENTED_IF(instr.generates_cc); 1516 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1517 "Condition codes generation in FMUL is not implemented");
1517 1518
1518 op_b = GetOperandAbsNeg(op_b, false, instr.fmul.negate_b); 1519 op_b = GetOperandAbsNeg(op_b, false, instr.fmul.negate_b);
1519 1520
@@ -1524,7 +1525,8 @@ private:
1524 case OpCode::Id::FADD_C: 1525 case OpCode::Id::FADD_C:
1525 case OpCode::Id::FADD_R: 1526 case OpCode::Id::FADD_R:
1526 case OpCode::Id::FADD_IMM: { 1527 case OpCode::Id::FADD_IMM: {
1527 UNIMPLEMENTED_IF(instr.generates_cc); 1528 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1529 "Condition codes generation in FADD is not implemented");
1528 1530
1529 op_a = GetOperandAbsNeg(op_a, instr.alu.abs_a, instr.alu.negate_a); 1531 op_a = GetOperandAbsNeg(op_a, instr.alu.abs_a, instr.alu.negate_a);
1530 op_b = GetOperandAbsNeg(op_b, instr.alu.abs_b, instr.alu.negate_b); 1532 op_b = GetOperandAbsNeg(op_b, instr.alu.abs_b, instr.alu.negate_b);
@@ -1573,7 +1575,8 @@ private:
1573 case OpCode::Id::FMNMX_C: 1575 case OpCode::Id::FMNMX_C:
1574 case OpCode::Id::FMNMX_R: 1576 case OpCode::Id::FMNMX_R:
1575 case OpCode::Id::FMNMX_IMM: { 1577 case OpCode::Id::FMNMX_IMM: {
1576 UNIMPLEMENTED_IF(instr.generates_cc); 1578 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1579 "Condition codes generation in FMNMX is not implemented");
1577 1580
1578 op_a = GetOperandAbsNeg(op_a, instr.alu.abs_a, instr.alu.negate_a); 1581 op_a = GetOperandAbsNeg(op_a, instr.alu.abs_a, instr.alu.negate_a);
1579 op_b = GetOperandAbsNeg(op_b, instr.alu.abs_b, instr.alu.negate_b); 1582 op_b = GetOperandAbsNeg(op_b, instr.alu.abs_b, instr.alu.negate_b);
@@ -1609,7 +1612,8 @@ private:
1609 break; 1612 break;
1610 } 1613 }
1611 case OpCode::Id::FMUL32_IMM: { 1614 case OpCode::Id::FMUL32_IMM: {
1612 UNIMPLEMENTED_IF(instr.op_32.generates_cc); 1615 UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
1616 "Condition codes generation in FMUL32 is not implemented");
1613 1617
1614 regs.SetRegisterToFloat(instr.gpr0, 0, 1618 regs.SetRegisterToFloat(instr.gpr0, 0,
1615 regs.GetRegisterAsFloat(instr.gpr8) + " * " + 1619 regs.GetRegisterAsFloat(instr.gpr8) + " * " +
@@ -1618,7 +1622,8 @@ private:
1618 break; 1622 break;
1619 } 1623 }
1620 case OpCode::Id::FADD32I: { 1624 case OpCode::Id::FADD32I: {
1621 UNIMPLEMENTED_IF(instr.op_32.generates_cc); 1625 UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
1626 "Condition codes generation in FADD32I is not implemented");
1622 1627
1623 std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); 1628 std::string op_a = regs.GetRegisterAsFloat(instr.gpr8);
1624 std::string op_b = GetImmediate32(instr); 1629 std::string op_b = GetImmediate32(instr);
@@ -1653,7 +1658,8 @@ private:
1653 1658
1654 switch (opcode->get().GetId()) { 1659 switch (opcode->get().GetId()) {
1655 case OpCode::Id::BFE_IMM: { 1660 case OpCode::Id::BFE_IMM: {
1656 UNIMPLEMENTED_IF(instr.generates_cc); 1661 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1662 "Condition codes generation in BFE is not implemented");
1657 1663
1658 std::string inner_shift = 1664 std::string inner_shift =
1659 '(' + op_a + " << " + std::to_string(instr.bfe.GetLeftShiftValue()) + ')'; 1665 '(' + op_a + " << " + std::to_string(instr.bfe.GetLeftShiftValue()) + ')';
@@ -1690,7 +1696,8 @@ private:
1690 case OpCode::Id::SHR_C: 1696 case OpCode::Id::SHR_C:
1691 case OpCode::Id::SHR_R: 1697 case OpCode::Id::SHR_R:
1692 case OpCode::Id::SHR_IMM: { 1698 case OpCode::Id::SHR_IMM: {
1693 UNIMPLEMENTED_IF(instr.generates_cc); 1699 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1700 "Condition codes generation in SHR is not implemented");
1694 1701
1695 if (!instr.shift.is_signed) { 1702 if (!instr.shift.is_signed) {
1696 // Logical shift right 1703 // Logical shift right
@@ -1705,7 +1712,8 @@ private:
1705 case OpCode::Id::SHL_C: 1712 case OpCode::Id::SHL_C:
1706 case OpCode::Id::SHL_R: 1713 case OpCode::Id::SHL_R:
1707 case OpCode::Id::SHL_IMM: 1714 case OpCode::Id::SHL_IMM:
1708 UNIMPLEMENTED_IF(instr.generates_cc); 1715 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1716 "Condition codes generation in SHL is not implemented");
1709 regs.SetRegisterToInteger(instr.gpr0, true, 0, op_a + " << " + op_b, 1, 1); 1717 regs.SetRegisterToInteger(instr.gpr0, true, 0, op_a + " << " + op_b, 1, 1);
1710 break; 1718 break;
1711 default: { 1719 default: {
@@ -1720,7 +1728,8 @@ private:
1720 1728
1721 switch (opcode->get().GetId()) { 1729 switch (opcode->get().GetId()) {
1722 case OpCode::Id::IADD32I: 1730 case OpCode::Id::IADD32I:
1723 UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc); 1731 UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
1732 "Condition codes generation in IADD32I is not implemented");
1724 1733
1725 if (instr.iadd32i.negate_a) 1734 if (instr.iadd32i.negate_a)
1726 op_a = "-(" + op_a + ')'; 1735 op_a = "-(" + op_a + ')';
@@ -1729,7 +1738,8 @@ private:
1729 instr.iadd32i.saturate != 0); 1738 instr.iadd32i.saturate != 0);
1730 break; 1739 break;
1731 case OpCode::Id::LOP32I: { 1740 case OpCode::Id::LOP32I: {
1732 UNIMPLEMENTED_IF(instr.op_32.generates_cc); 1741 UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
1742 "Condition codes generation in LOP32I is not implemented");
1733 1743
1734 if (instr.alu.lop32i.invert_a) 1744 if (instr.alu.lop32i.invert_a)
1735 op_a = "~(" + op_a + ')'; 1745 op_a = "~(" + op_a + ')';
@@ -1767,7 +1777,8 @@ private:
1767 case OpCode::Id::IADD_C: 1777 case OpCode::Id::IADD_C:
1768 case OpCode::Id::IADD_R: 1778 case OpCode::Id::IADD_R:
1769 case OpCode::Id::IADD_IMM: { 1779 case OpCode::Id::IADD_IMM: {
1770 UNIMPLEMENTED_IF(instr.generates_cc); 1780 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1781 "Condition codes generation in IADD is not implemented");
1771 1782
1772 if (instr.alu_integer.negate_a) 1783 if (instr.alu_integer.negate_a)
1773 op_a = "-(" + op_a + ')'; 1784 op_a = "-(" + op_a + ')';
@@ -1782,7 +1793,8 @@ private:
1782 case OpCode::Id::IADD3_C: 1793 case OpCode::Id::IADD3_C:
1783 case OpCode::Id::IADD3_R: 1794 case OpCode::Id::IADD3_R:
1784 case OpCode::Id::IADD3_IMM: { 1795 case OpCode::Id::IADD3_IMM: {
1785 UNIMPLEMENTED_IF(instr.generates_cc); 1796 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1797 "Condition codes generation in IADD3 is not implemented");
1786 1798
1787 std::string op_c = regs.GetRegisterAsInteger(instr.gpr39); 1799 std::string op_c = regs.GetRegisterAsInteger(instr.gpr39);
1788 1800
@@ -1844,7 +1856,8 @@ private:
1844 case OpCode::Id::ISCADD_C: 1856 case OpCode::Id::ISCADD_C:
1845 case OpCode::Id::ISCADD_R: 1857 case OpCode::Id::ISCADD_R:
1846 case OpCode::Id::ISCADD_IMM: { 1858 case OpCode::Id::ISCADD_IMM: {
1847 UNIMPLEMENTED_IF(instr.generates_cc); 1859 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1860 "Condition codes generation in ISCADD is not implemented");
1848 1861
1849 if (instr.alu_integer.negate_a) 1862 if (instr.alu_integer.negate_a)
1850 op_a = "-(" + op_a + ')'; 1863 op_a = "-(" + op_a + ')';
@@ -1879,7 +1892,8 @@ private:
1879 case OpCode::Id::LOP_C: 1892 case OpCode::Id::LOP_C:
1880 case OpCode::Id::LOP_R: 1893 case OpCode::Id::LOP_R:
1881 case OpCode::Id::LOP_IMM: { 1894 case OpCode::Id::LOP_IMM: {
1882 UNIMPLEMENTED_IF(instr.generates_cc); 1895 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1896 "Condition codes generation in LOP is not implemented");
1883 1897
1884 if (instr.alu.lop.invert_a) 1898 if (instr.alu.lop.invert_a)
1885 op_a = "~(" + op_a + ')'; 1899 op_a = "~(" + op_a + ')';
@@ -1894,7 +1908,8 @@ private:
1894 case OpCode::Id::LOP3_C: 1908 case OpCode::Id::LOP3_C:
1895 case OpCode::Id::LOP3_R: 1909 case OpCode::Id::LOP3_R:
1896 case OpCode::Id::LOP3_IMM: { 1910 case OpCode::Id::LOP3_IMM: {
1897 UNIMPLEMENTED_IF(instr.generates_cc); 1911 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1912 "Condition codes generation in LOP3 is not implemented");
1898 1913
1899 const std::string op_c = regs.GetRegisterAsInteger(instr.gpr39); 1914 const std::string op_c = regs.GetRegisterAsInteger(instr.gpr39);
1900 std::string lut; 1915 std::string lut;
@@ -1912,7 +1927,8 @@ private:
1912 case OpCode::Id::IMNMX_R: 1927 case OpCode::Id::IMNMX_R:
1913 case OpCode::Id::IMNMX_IMM: { 1928 case OpCode::Id::IMNMX_IMM: {
1914 UNIMPLEMENTED_IF(instr.imnmx.exchange != Tegra::Shader::IMinMaxExchange::None); 1929 UNIMPLEMENTED_IF(instr.imnmx.exchange != Tegra::Shader::IMinMaxExchange::None);
1915 UNIMPLEMENTED_IF(instr.generates_cc); 1930 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
1931 "Condition codes generation in IMNMX is not implemented");
1916 1932
1917 const std::string condition = 1933 const std::string condition =
1918 GetPredicateCondition(instr.imnmx.pred, instr.imnmx.negate_pred != 0); 1934 GetPredicateCondition(instr.imnmx.pred, instr.imnmx.negate_pred != 0);
@@ -2085,7 +2101,8 @@ private:
2085 instr.ffma.tab5980_0.Value()); // Seems to be 1 by default based on SMO 2101 instr.ffma.tab5980_0.Value()); // Seems to be 1 by default based on SMO
2086 UNIMPLEMENTED_IF_MSG(instr.ffma.tab5980_1 != 0, "FFMA tab5980_1({}) not implemented", 2102 UNIMPLEMENTED_IF_MSG(instr.ffma.tab5980_1 != 0, "FFMA tab5980_1({}) not implemented",
2087 instr.ffma.tab5980_1.Value()); 2103 instr.ffma.tab5980_1.Value());
2088 UNIMPLEMENTED_IF(instr.generates_cc); 2104 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
2105 "Condition codes generation in FFMA is not implemented");
2089 2106
2090 switch (opcode->get().GetId()) { 2107 switch (opcode->get().GetId()) {
2091 case OpCode::Id::FFMA_CR: { 2108 case OpCode::Id::FFMA_CR: {
@@ -2195,7 +2212,8 @@ private:
2195 case OpCode::Id::I2F_C: { 2212 case OpCode::Id::I2F_C: {
2196 UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word); 2213 UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word);
2197 UNIMPLEMENTED_IF(instr.conversion.selector); 2214 UNIMPLEMENTED_IF(instr.conversion.selector);
2198 UNIMPLEMENTED_IF(instr.generates_cc); 2215 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
2216 "Condition codes generation in I2F is not implemented");
2199 2217
2200 std::string op_a{}; 2218 std::string op_a{};
2201 2219
@@ -2225,7 +2243,8 @@ private:
2225 case OpCode::Id::F2F_R: { 2243 case OpCode::Id::F2F_R: {
2226 UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word); 2244 UNIMPLEMENTED_IF(instr.conversion.dest_size != Register::Size::Word);
2227 UNIMPLEMENTED_IF(instr.conversion.src_size != Register::Size::Word); 2245 UNIMPLEMENTED_IF(instr.conversion.src_size != Register::Size::Word);
2228 UNIMPLEMENTED_IF(instr.generates_cc); 2246 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
2247 "Condition codes generation in F2F is not implemented");
2229 std::string op_a = regs.GetRegisterAsFloat(instr.gpr20); 2248 std::string op_a = regs.GetRegisterAsFloat(instr.gpr20);
2230 2249
2231 if (instr.conversion.abs_a) { 2250 if (instr.conversion.abs_a) {
@@ -2263,7 +2282,8 @@ private:
2263 case OpCode::Id::F2I_R: 2282 case OpCode::Id::F2I_R:
2264 case OpCode::Id::F2I_C: { 2283 case OpCode::Id::F2I_C: {
2265 UNIMPLEMENTED_IF(instr.conversion.src_size != Register::Size::Word); 2284 UNIMPLEMENTED_IF(instr.conversion.src_size != Register::Size::Word);
2266 UNIMPLEMENTED_IF(instr.generates_cc); 2285 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
2286 "Condition codes generation in F2I is not implemented");
2267 std::string op_a{}; 2287 std::string op_a{};
2268 2288
2269 if (instr.is_b_gpr) { 2289 if (instr.is_b_gpr) {
@@ -3074,7 +3094,8 @@ private:
3074 break; 3094 break;
3075 } 3095 }
3076 case OpCode::Type::PredicateSetRegister: { 3096 case OpCode::Type::PredicateSetRegister: {
3077 UNIMPLEMENTED_IF(instr.generates_cc); 3097 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
3098 "Condition codes generation in PSET is not implemented");
3078 3099
3079 const std::string op_a = 3100 const std::string op_a =
3080 GetPredicateCondition(instr.pset.pred12, instr.pset.neg_pred12 != 0); 3101 GetPredicateCondition(instr.pset.pred12, instr.pset.neg_pred12 != 0);
@@ -3271,7 +3292,8 @@ private:
3271 case OpCode::Type::Xmad: { 3292 case OpCode::Type::Xmad: {
3272 UNIMPLEMENTED_IF(instr.xmad.sign_a); 3293 UNIMPLEMENTED_IF(instr.xmad.sign_a);
3273 UNIMPLEMENTED_IF(instr.xmad.sign_b); 3294 UNIMPLEMENTED_IF(instr.xmad.sign_b);
3274 UNIMPLEMENTED_IF(instr.generates_cc); 3295 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
3296 "Condition codes generation in XMAD is not implemented");
3275 3297
3276 std::string op_a{regs.GetRegisterAsInteger(instr.gpr8, 0, instr.xmad.sign_a)}; 3298 std::string op_a{regs.GetRegisterAsInteger(instr.gpr8, 0, instr.xmad.sign_a)};
3277 std::string op_b; 3299 std::string op_b;
@@ -3530,7 +3552,8 @@ private:
3530 break; 3552 break;
3531 } 3553 }
3532 case OpCode::Id::VMAD: { 3554 case OpCode::Id::VMAD: {
3533 UNIMPLEMENTED_IF(instr.generates_cc); 3555 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
3556 "Condition codes generation in VMAD is not implemented");
3534 3557
3535 const bool result_signed = instr.video.signed_a == 1 || instr.video.signed_b == 1; 3558 const bool result_signed = instr.video.signed_a == 1 || instr.video.signed_b == 1;
3536 const std::string op_a = GetVideoOperandA(instr); 3559 const std::string op_a = GetVideoOperandA(instr);