[Beignet] [PATCH] Backend: Initialize the extra value for selection instruction

Xiuli Pan xiuli.pan at intel.com
Thu Dec 8 09:40:07 UTC 2016


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

If we do not initialize the extra, we may get some random result when
just use some bits of the extra, ex splitSend.

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

diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 6624337..86ed5c3 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -169,7 +169,7 @@ namespace gbe
   SelectionInstruction::SelectionInstruction(SelectionOpcode op, uint32_t dst, uint32_t src) :
     parent(NULL), opcode(op), dstNum(dst), srcNum(src)
   {
-    extra.function = 0;
+    extra.value = 0;
   }
 
   void SelectionInstruction::prepend(SelectionInstruction &other) {
diff --git a/backend/src/backend/gen_insn_selection.hpp b/backend/src/backend/gen_insn_selection.hpp
index 7ce2b94..b72b42e 100644
--- a/backend/src/backend/gen_insn_selection.hpp
+++ b/backend/src/backend/gen_insn_selection.hpp
@@ -157,6 +157,7 @@ namespace gbe
         uint16_t printfSize;
       };
       uint32_t workgroupOp;
+      uint32_t value;
     } extra;
     /*! Gen opcode */
     uint8_t opcode;
-- 
2.7.4



More information about the Beignet mailing list