From: Dave Airlie Date: Wed, 10 Jan 2018 03:52:50 +0000 (+0000) Subject: r600/sb: introduce special register values for lds support. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09c1c13c4442148e45a4aeac3425382bbe90e8cd;p=mesa.git r600/sb: introduce special register values for lds support. For LDS read/write ordering we use the LDS_RW value, reads will wait on previous writes. For LDS read/read from LDS queue ordering we use the LDS_OQ values, we define two for now, though initially we'll just support OQA. Also add the check for the lds oq values Acked-By: Roland Scheidegger Signed-off-by: Dave Airlie --- diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h index fc3fa5082d0..3a3bae9d445 100644 --- a/src/gallium/drivers/r600/sb/sb_bc.h +++ b/src/gallium/drivers/r600/sb/sb_bc.h @@ -722,6 +722,10 @@ public: return ((sel >= 128 && sel < 192) || (sel >= 256 && sel < 320)); } + bool is_lds_oq(unsigned sel) { + return (sel >= 0xdb && sel <= 0xde); + } + const char * get_hw_class_name(); const char * get_hw_chip_name(); diff --git a/src/gallium/drivers/r600/sb/sb_ir.h b/src/gallium/drivers/r600/sb/sb_ir.h index 2390babfcfe..bee947504ed 100644 --- a/src/gallium/drivers/r600/sb/sb_ir.h +++ b/src/gallium/drivers/r600/sb/sb_ir.h @@ -42,7 +42,10 @@ enum special_regs { SV_EXEC_MASK, SV_AR_INDEX, SV_VALID_MASK, - SV_GEOMETRY_EMIT + SV_GEOMETRY_EMIT, + SV_LDS_RW, + SV_LDS_OQA, + SV_LDS_OQB, }; class node; @@ -495,6 +498,12 @@ public: bool is_geometry_emit() { return is_special_reg() && select == sel_chan(SV_GEOMETRY_EMIT, 0); } + bool is_lds_access() { + return is_special_reg() && select == sel_chan(SV_LDS_RW, 0); + } + bool is_lds_oq() { + return is_special_reg() && (select == sel_chan(SV_LDS_OQA, 0) || select == sel_chan(SV_LDS_OQB, 0)); + } node* any_def() { assert(!(def && adef)); @@ -833,6 +842,22 @@ public: return vec_uses_ar(dst) || vec_uses_ar(src); } + bool vec_uses_lds_oq(vvec &vv) { + for (vvec::iterator I = vv.begin(), E = vv.end(); I != E; ++I) { + value *v = *I; + if (v && v->is_lds_oq()) + return true; + } + return false; + } + + bool consumes_lds_oq() { + return vec_uses_lds_oq(src); + } + + bool produces_lds_oq() { + return vec_uses_lds_oq(dst); + } region_node* get_parent_region(); diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp b/src/gallium/drivers/r600/sb/sb_valtable.cpp index a85537c2ad6..41cfbf0946a 100644 --- a/src/gallium/drivers/r600/sb/sb_valtable.cpp +++ b/src/gallium/drivers/r600/sb/sb_valtable.cpp @@ -56,6 +56,9 @@ sb_ostream& operator << (sb_ostream &o, value &v) { case SV_EXEC_MASK: o << "EM"; break; case SV_VALID_MASK: o << "VM"; break; case SV_GEOMETRY_EMIT: o << "GEOMETRY_EMIT"; break; + case SV_LDS_RW: o << "LDS_RW"; break; + case SV_LDS_OQA: o << "LDS_OQA"; break; + case SV_LDS_OQB: o << "LDS_OQB"; break; default: o << "???specialreg"; break; } break;