diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-10-22 16:13:51 -0400 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-10-23 10:59:01 +0800 |
commit | d6366c4eeb4a11cac73eaf60446bfd2696ba6a1b (patch) | |
tree | b362ce93d34ce4cc0a97f34d27ded195d2e99e16 | |
parent | 7ef2e9719d148891d9786994cc529351e7c33eea (diff) |
Fix JMPI encoding for Haswell.
It uses the byte-aligned jump instead of 64-bit units.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -430,9 +430,13 @@ int main(int argc, char **argv) // this is a branch instruction with one offset argument int offset = inst->first_reloc_offset; /* bspec: Unlike other flow control instructions, the offset used by JMPI is relative to the incremented instruction pointer rather than the IP value for the instruction itself. */ - if(entry->instruction.header.opcode == BRW_OPCODE_JMPI) + + int is_jmpi = entry->instruction.header.opcode == BRW_OPCODE_JMPI; // target relative to the post-incremented IP, so delta == 1 if JMPI + if(is_jmpi) offset --; offset = jump_distance(offset); + if (is_jmpi && (gen_level == 75)) + offset = offset * 8; if(!IS_GENp(6)) { entry->instruction.bits3.JIP = offset; |