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

2016-12-08 Thread Yang, Rong R
As discuss offline, can use extra = {0} to initialize the extra, it is more 
clearly, so push extra = {0} version patch.

> -Original Message-
> From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of
> Xiuli Pan
> Sent: Friday, December 9, 2016 11:09
> To: beignet@lists.freedesktop.org
> Cc: Pan, Xiuli <xiuli@intel.com>
> Subject: [Beignet] [PATCH V2] Backend: Initialize the extra value for 
> selection
> instruction
> 
> From: Pan Xiuli <xiuli@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.
> V2: Refine the value to be uint64_t to make sure all bits is set
> 
> Signed-off-by: Pan Xiuli <xiuli@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..7fc22fa 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 = 0ul;
>}
> 
>void SelectionInstruction::prepend(SelectionInstruction ) { diff 
> --git
> a/backend/src/backend/gen_insn_selection.hpp
> b/backend/src/backend/gen_insn_selection.hpp
> index 7ce2b94..1ba5253 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;
> +  uint64_t value;
>  } extra;
>  /*! Gen opcode */
>  uint8_t opcode;
> --
> 2.7.4
> 
> ___
> Beignet mailing list
> Beignet@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


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

2016-12-08 Thread Guo, Yejun
good catch, looks fine to me, thanks.

-Original Message-
From: Beignet [mailto:beignet-boun...@lists.freedesktop.org] On Behalf Of Xiuli 
Pan
Sent: Friday, December 09, 2016 11:09 AM
To: beignet@lists.freedesktop.org
Cc: Pan, Xiuli
Subject: [Beignet] [PATCH V2] Backend: Initialize the extra value for selection 
instruction

From: Pan Xiuli <xiuli@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.
V2: Refine the value to be uint64_t to make sure all bits is set

Signed-off-by: Pan Xiuli <xiuli@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..7fc22fa 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 = 0ul;
   }
 
   void SelectionInstruction::prepend(SelectionInstruction ) { diff --git 
a/backend/src/backend/gen_insn_selection.hpp 
b/backend/src/backend/gen_insn_selection.hpp
index 7ce2b94..1ba5253 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;
+  uint64_t value;
 } extra;
 /*! Gen opcode */
 uint8_t opcode;
--
2.7.4

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet
___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


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

2016-12-08 Thread Xiuli Pan
From: Pan Xiuli 

If we do not initialize the extra, we may get some random result when
just use some bits of the extra, ex splitSend.
V2: Refine the value to be uint64_t to make sure all bits is set

Signed-off-by: Pan Xiuli 
---
 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..7fc22fa 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 = 0ul;
   }
 
   void SelectionInstruction::prepend(SelectionInstruction ) {
diff --git a/backend/src/backend/gen_insn_selection.hpp 
b/backend/src/backend/gen_insn_selection.hpp
index 7ce2b94..1ba5253 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;
+  uint64_t value;
 } extra;
 /*! Gen opcode */
 uint8_t opcode;
-- 
2.7.4

___
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet