[Beignet] [PATCH] GBE: fix half immediate negate assert.

rong.r.yang at intel.com rong.r.yang at intel.com
Sun Sep 18 02:49:48 UTC 2016


From: Yang Rong <rong.r.yang at intel.com>

Also add double immediate negate support.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/backend/gen_register.hpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backend/src/backend/gen_register.hpp b/backend/src/backend/gen_register.hpp
index bbea761..a8eb2e4 100644
--- a/backend/src/backend/gen_register.hpp
+++ b/backend/src/backend/gen_register.hpp
@@ -1267,6 +1267,11 @@ namespace gbe
         } else if (reg.type == GEN_TYPE_W) {
           const uint16_t uw = reg.value.ud & 0xffff;
           reg = GenRegister::immw(-(int16_t)uw);
+        } else if (reg.type == GEN_TYPE_HF_IMM) {
+          const uint16_t uw = reg.value.ud & 0xffff;
+          reg = GenRegister::immh(uw ^ 0x8000);
+        } else if (reg.type == GEN_TYPE_DF_IMM) {
+          reg.value.df = -reg.value.df;
         } else
           NOT_SUPPORTED;
       }
-- 
1.9.1



More information about the Beignet mailing list