summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-05 23:48:38 -0400
committerGravatar bunnei2018-06-06 19:47:34 -0400
commit4b114e1b8a2a208d089f92f904573e9cace80fdf (patch)
treee4a7d6ae014d20a3e87c2b135d801594aa6fdb10
parentMerge pull request #534 from Subv/multitexturing (diff)
downloadyuzu-4b114e1b8a2a208d089f92f904573e9cace80fdf.tar.gz
yuzu-4b114e1b8a2a208d089f92f904573e9cace80fdf.tar.xz
yuzu-4b114e1b8a2a208d089f92f904573e9cace80fdf.zip
shader_bytecode: Add instruction decodings for BFE, IMNMX, and XMAD.
-rw-r--r--src/video_core/engines/shader_bytecode.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index af18c2d81..ab45cfbef 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -390,6 +390,9 @@ class OpCode {
390public: 390public:
391 enum class Id { 391 enum class Id {
392 KIL, 392 KIL,
393 BFE_C,
394 BFE_R,
395 BFE_IMM,
393 BRA, 396 BRA,
394 LD_A, 397 LD_A,
395 LD_C, 398 LD_C,
@@ -444,6 +447,9 @@ public:
444 FMNMX_C, 447 FMNMX_C,
445 FMNMX_R, 448 FMNMX_R,
446 FMNMX_IMM, 449 FMNMX_IMM,
450 IMNMX_C,
451 IMNMX_R,
452 IMNMX_IMM,
447 FSETP_C, // Set Predicate 453 FSETP_C, // Set Predicate
448 FSETP_R, 454 FSETP_R,
449 FSETP_IMM, 455 FSETP_IMM,
@@ -454,6 +460,10 @@ public:
454 ISETP_IMM, 460 ISETP_IMM,
455 ISETP_R, 461 ISETP_R,
456 PSETP, 462 PSETP,
463 XMAD_IMM,
464 XMAD_CR,
465 XMAD_RC,
466 XMAD_RR,
457 }; 467 };
458 468
459 enum class Type { 469 enum class Type {
@@ -565,6 +575,9 @@ private:
565 std::vector<Matcher> table = { 575 std::vector<Matcher> table = {
566#define INST(bitstring, op, type, name) Detail::GetMatcher(bitstring, op, type, name) 576#define INST(bitstring, op, type, name) Detail::GetMatcher(bitstring, op, type, name)
567 INST("111000110011----", Id::KIL, Type::Flow, "KIL"), 577 INST("111000110011----", Id::KIL, Type::Flow, "KIL"),
578 INST("0100110000000---", Id::BFE_C, Type::Flow, "BFE_C"),
579 INST("0101110000000---", Id::BFE_R, Type::Flow, "BFE_R"),
580 INST("0011100-00000---", Id::BFE_IMM, Type::Flow, "BFE_IMM"),
568 INST("111000100100----", Id::BRA, Type::Flow, "BRA"), 581 INST("111000100100----", Id::BRA, Type::Flow, "BRA"),
569 INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"), 582 INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"),
570 INST("1110111110010---", Id::LD_C, Type::Memory, "LD_C"), 583 INST("1110111110010---", Id::LD_C, Type::Memory, "LD_C"),
@@ -606,6 +619,9 @@ private:
606 INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"), 619 INST("0100110001100---", Id::FMNMX_C, Type::Arithmetic, "FMNMX_C"),
607 INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"), 620 INST("0101110001100---", Id::FMNMX_R, Type::Arithmetic, "FMNMX_R"),
608 INST("0011100-01100---", Id::FMNMX_IMM, Type::Arithmetic, "FMNMX_IMM"), 621 INST("0011100-01100---", Id::FMNMX_IMM, Type::Arithmetic, "FMNMX_IMM"),
622 INST("0100110000100---", Id::IMNMX_C, Type::Arithmetic, "FMNMX_IMM"),
623 INST("0101110000100---", Id::IMNMX_R, Type::Arithmetic, "FMNMX_IMM"),
624 INST("0011100-00100---", Id::IMNMX_IMM, Type::Arithmetic, "FMNMX_IMM"),
609 INST("000001----------", Id::LOP32I, Type::Logic, "LOP32I"), 625 INST("000001----------", Id::LOP32I, Type::Logic, "LOP32I"),
610 INST("0100110001001---", Id::SHL_C, Type::Shift, "SHL_C"), 626 INST("0100110001001---", Id::SHL_C, Type::Shift, "SHL_C"),
611 INST("0101110001001---", Id::SHL_R, Type::Shift, "SHL_R"), 627 INST("0101110001001---", Id::SHL_R, Type::Shift, "SHL_R"),
@@ -629,6 +645,10 @@ private:
629 INST("010110110110----", Id::ISETP_R, Type::IntegerSetPredicate, "ISETP_R"), 645 INST("010110110110----", Id::ISETP_R, Type::IntegerSetPredicate, "ISETP_R"),
630 INST("0011011-0110----", Id::ISETP_IMM, Type::IntegerSetPredicate, "ISETP_IMM"), 646 INST("0011011-0110----", Id::ISETP_IMM, Type::IntegerSetPredicate, "ISETP_IMM"),
631 INST("0101000010010---", Id::PSETP, Type::PredicateSetPredicate, "PSETP"), 647 INST("0101000010010---", Id::PSETP, Type::PredicateSetPredicate, "PSETP"),
648 INST("0011011-00------", Id::XMAD_IMM, Type::Arithmetic, "XMAD_IMM"),
649 INST("0100111---------", Id::XMAD_CR, Type::Arithmetic, "XMAD_CR"),
650 INST("010100010-------", Id::XMAD_RC, Type::Arithmetic, "XMAD_RC"),
651 INST("0101101100------", Id::XMAD_RR, Type::Arithmetic, "XMAD_RR"),
632 }; 652 };
633#undef INST 653#undef INST
634 std::stable_sort(table.begin(), table.end(), [](const auto& a, const auto& b) { 654 std::stable_sort(table.begin(), table.end(), [](const auto& a, const auto& b) {