[Beignet] [PATCH] Backend: Fix GenRegister::offset sub reg offset

Xiuli Pan xiuli.pan at intel.com
Mon Nov 7 08:06:12 UTC 2016


From: Pan Xiuli <xiuli.pan at intel.com>

We used to ignore the reg.nr for subreg offset, but after GenRegister offset
is refined, we need to calculate the suboffset with nr and subnr.

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 backend/src/backend/gen_reg_allocation.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/backend/gen_reg_allocation.cpp b/backend/src/backend/gen_reg_allocation.cpp
index 4451efb..d1c53f7 100644
--- a/backend/src/backend/gen_reg_allocation.cpp
+++ b/backend/src/backend/gen_reg_allocation.cpp
@@ -1472,7 +1472,7 @@ do { \
       }
       GBE_ASSERT(RA.contains(reg.reg()) != false);
       const uint32_t grfOffset = RA.find(reg.reg())->second;
-      const uint32_t suboffset = reg.subphysical ? reg.subnr : 0;
+      const uint32_t suboffset = reg.subphysical ? reg.nr * GEN_REG_SIZE + reg.subnr : 0;
       const GenRegister dst = setGenReg(reg, grfOffset + suboffset);
       if (reg.quarter != 0)
         return GenRegister::Qn(dst, reg.quarter);
-- 
2.7.4



More information about the Beignet mailing list