[Beignet] [PATCH] fix uniform case for ByteGather

Guo Yejun yejun.guo at intel.com
Tue Oct 13 14:28:51 PDT 2015


currently,the ByteGather generates IR as:
    BYTE_GATHER(16)     %109<0>:UD	:	%96<0,1,0>:UD	0x4:UD
    MOV(1)              %75<0>:UB	:	%109<32,8,4>:UB

Fix it to generate IR as:
    BYTE_GATHER(16)     %109<0>:UD      :       %96<0,1,0>:UD   0x4:UD
    MOV(1)              %75<0>:UB       :       %109<0,1,0>:UB

otherwise, there is regression issue of local copy propagation optimization
which uses %109<32,8,4>:UB

Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
 backend/src/backend/gen_insn_selection.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index da437d1..44cc473 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -3657,9 +3657,9 @@ namespace gbe
               sel.curr.execWidth = 1;
             }
             if (elemSize == GEN_BYTE_SCATTER_WORD)
-              sel.MOV(GenRegister::retype(value, GEN_TYPE_UW), GenRegister::unpacked_uw(dst));
+              sel.MOV(GenRegister::retype(value, GEN_TYPE_UW), GenRegister::unpacked_uw(dst, isUniform));
             else if (elemSize == GEN_BYTE_SCATTER_BYTE)
-              sel.MOV(GenRegister::retype(value, GEN_TYPE_UB), GenRegister::unpacked_ub(dst));
+              sel.MOV(GenRegister::retype(value, GEN_TYPE_UB), GenRegister::unpacked_ub(dst, isUniform));
           sel.pop();
         }
       }
-- 
1.9.1



More information about the Beignet mailing list