From 4b937c24b4024c2adc0181ba231c15d6b905a270 Mon Sep 17 00:00:00 2001 From: Yang Rong Date: Mon, 13 Oct 2014 14:48:06 +0800 Subject: [PATCH] Fix a HSW regression. HSW's JMPI instruction has 32bits JIP, can't merge JIP and UIP as other jump instruction. Signed-off-by: Yang Rong Reviewed-by: Zhigang Gong --- 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. */ -- 2.7.4