Module: Mesa
Branch: main
Commit: 2028465bd86b5a08ab0df43eea2b2abaca3ab546
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2028465bd86b5a08ab0df43eea2b2abaca3ab546

Author: Gert Wollny <[email protected]>
Date:   Tue Feb 28 17:52:45 2023 +0100

r600/sfn: Add print method to AluReadportValidation

Signed-off-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>

---

 .../drivers/r600/sfn/sfn_alu_readport_validation.cpp       | 14 ++++++++++++++
 src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h |  8 ++++++++
 2 files changed, 22 insertions(+)

diff --git a/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.cpp 
b/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.cpp
index d79cd7a190b..b752b9e5fee 100644
--- a/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.cpp
@@ -150,6 +150,20 @@ AluReadportReservation::schedule_trans_instruction(const 
AluInstr& alu,
    return visitor2.success;
 }
 
+void AluReadportReservation::print(std::ostream& os) const
+{
+   os << "AluReadportReservation\n";
+   for (int i = 0; i < max_chan_channels; ++i) {
+      os << "  chan " << i << ":";
+      for (int j = 0; j < max_gpr_readports; ++j) {
+         os << m_hw_gpr[j][i] << " ";
+      }
+      os << "\n";
+   }
+   os << "\n";
+
+}
+
 AluReadportReservation::AluReadportReservation()
 {
    for (int i = 0; i < max_chan_channels; ++i) {
diff --git a/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h 
b/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h
index ce924aa8a98..96501d03652 100644
--- a/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h
+++ b/src/gallium/drivers/r600/sfn/sfn_alu_readport_validation.h
@@ -50,6 +50,8 @@ public:
    static int cycle_vec(AluBankSwizzle swz, int src);
    static int cycle_trans(AluBankSwizzle swz, int src);
 
+   void print(std::ostream& os) const;
+
    static const int max_chan_channels = 4;
    static const int max_gpr_readports = 3;
 
@@ -61,6 +63,12 @@ public:
    uint32_t m_nliterals{0};
 };
 
+inline std::ostream&
+operator << (std::ostream& os, const AluReadportReservation& arp) {
+   arp.print(os);
+   return os;
+}
+
 } // namespace r600
 
 #endif // ALUREADPORTVALIDATION_H

Reply via email to