r600/sfn: Make the pin_to_channel generic

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>
This commit is contained in:
Gert Wollny
2020-07-05 16:49:56 +02:00
committed by Marge Bot
parent 3ea847e6d1
commit 21d296a481
3 changed files with 11 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ public:
uint32_t chan() const {return m_chan;}
void set_chan(uint32_t chan);
virtual void set_pin_to_channel() { assert(0 && "Only GPRs can be pinned to a channel ");}
void print(std::ostream& os, const PrintFlags& flags) const;
void print(std::ostream& os) const;

View File

@@ -152,6 +152,14 @@ void GPRVector::pin_to_channel(int i)
v.set_pin_to_channel();
}
void GPRVector::pin_all_to_channel()
{
for (auto& v: m_elms) {
auto& c = static_cast<GPRValue&>(*v);
c.set_pin_to_channel();
}
}
void GPRVector::do_print(std::ostream& os) const
{
os << "R" << sel() << ".";

View File

@@ -54,7 +54,7 @@ public:
void set_as_input(){ m_input = true; }
bool is_input() const {return m_input; }
void set_pin_to_channel() { m_pin_to_channel = true;}
void set_pin_to_channel() override { m_pin_to_channel = true;}
bool pin_to_channel() const { return m_pin_to_channel;}
private:
@@ -94,6 +94,7 @@ public:
PValue& operator [] (int i) {return m_elms[i];}
void pin_to_channel(int i);
void pin_all_to_channel();
PValue x() const {return m_elms[0];}
PValue y() const {return m_elms[1];}