summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-11-17 07:40:12 +0800
committerYang Rong <rong.r.yang@intel.com>2015-11-17 16:23:37 +0800
commita6b318ce659e8843333566558e1e864359ce0d14 (patch)
tree8d5b35157b13b7b709836cee3b277c71668cdbcc
parenta0a6d82b95b7e57e48bfcc6c97d9e1c124f96c7d (diff)
Backend: Add a auxiliary function to convert GenReg to uniform.
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/backend/gen_register.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index bafff297..a56598f3 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -274,6 +274,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;
}