[Beignet] [PATCH] Fix a HSW regression.

Yang Rong rong.r.yang at intel.com
Sun Oct 12 23:48:06 PDT 2014


HSW's JMPI instruction has 32bits JIP, can't merge JIP and UIP as other jump instruction.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/backend/gen75_encoder.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen75_encoder.cpp b/backend/src/backend/gen75_encoder.cpp
index 10a9b5c..6a357c2 100644
--- a/backend/src/backend/gen75_encoder.cpp
+++ b/backend/src/backend/gen75_encoder.cpp
@@ -270,11 +270,13 @@ namespace gbe
       }
     }
 
-    if (insn.header.opcode == GEN_OPCODE_JMPI) {
+    if (insn.header.opcode != GEN_OPCODE_JMPI)
+      this->setSrc1(&insn, GenRegister::immd((jip & 0xffff) | (uip<<16)));
+    else if (insn.header.opcode == GEN_OPCODE_JMPI) {
       //jumpDistance'unit is Qword, and the HSW's JMPI offset of jmpi is in byte, so multi 8
       jip = (jip - 2) * 8;
+      this->setSrc1(&insn, GenRegister::immd(jip));
     }
-    this->setSrc1(&insn, GenRegister::immd((jip & 0xffff) | uip<<16));
     return;
   }
 } /* End of the name space. */
-- 
1.8.3.2



More information about the Beignet mailing list