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

Pan, Xiuli xiuli.pan at intel.com
Thu Dec 8 06:30:05 UTC 2016


Ping for review.

-----Original Message-----
From: Pan, Xiuli 
Sent: Monday, November 7, 2016 4:06 PM
To: beignet at lists.freedesktop.org
Cc: Pan, Xiuli <xiuli.pan at intel.com>
Subject: [PATCH] Backend: Fix GenRegister::offset sub reg offset

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