I also add two check about the subnr compare, after refine we need check both 
nr and subnr to check if the regs are the same.

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of Yang 
Rong
Sent: Wednesday, January 4, 2017 2:56 PM
To: [email protected]
Cc: Yang, Rong R <[email protected]>
Subject: [Beignet] [PATCH] Backend: Fix the selection optimize element 
calculate.

After GenRegister offset  refined, we need to calculate the suboffset with nr 
and subnr.

Signed-off-by: Yang Rong <[email protected]>
---
 backend/src/backend/gen_insn_selection_optimize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/backend/gen_insn_selection_optimize.cpp 
b/backend/src/backend/gen_insn_selection_optimize.cpp
index b8aa776..a0778ed 100644
--- a/backend/src/backend/gen_insn_selection_optimize.cpp
+++ b/backend/src/backend/gen_insn_selection_optimize.cpp
@@ -22,7 +22,7 @@ namespace gbe
     uint32_t height = execWidth / width;
     uint32_t vstride = GenRegister::vstride_size(reg);
     uint32_t hstride = GenRegister::hstride_size(reg);
-    uint32_t base = reg.subnr;
+    uint32_t base = reg.nr * GEN_REG_SIZE + reg.subnr;
     for (uint32_t i = 0; i < height; ++i) {
       uint32_t offsetInByte = base;
       for (uint32_t j = 0; j < width; ++j) {
-- 
2.1.4

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to