[01/15] Backend: Add a auxiliary function to convert GenReg to uniform.

Submitted by Pan Xiuli on Jan. 21, 2016, 6:51 a.m.

Details

Message ID 1453359115-28123-1-git-send-email-xiuli.pan@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Pan Xiuli Jan. 21, 2016, 6:51 a.m.
From: Junyan He <junyan.he@linux.intel.com>

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
---
 backend/src/backend/gen_register.hpp | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index f26dec4..2ae6cf1 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -280,6 +280,15 @@  namespace gbe
       return r;
     }
 
+    static INLINE GenRegister toUniform(GenRegister reg, uint32_t type) {
+      GenRegister r = reg;
+      r.type = type;
+      r.hstride = GEN_HORIZONTAL_STRIDE_0;
+      r.vstride = GEN_VERTICAL_STRIDE_0;
+      r.width = GEN_WIDTH_1;
+      return r;
+    }
+
     static INLINE uint32_t grfOffset(GenRegister reg) {
       return reg.nr * GEN_REG_SIZE + reg.subnr;
     }