diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-10-22 16:13:51 -0400 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-03-04 15:54:35 +0000 |
commit | 495c4e14e7417610bf75ca397450b4b8447e29a3 (patch) | |
tree | 78cfb4cd4f0158194594835d7766ea84f61276dc /assembler | |
parent | 8aa952873cbf3449815e75318c4807e43e74004e (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>
Diffstat (limited to 'assembler')
-rw-r--r-- | assembler/src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/assembler/src/main.c b/assembler/src/main.c index 80705065..15ed5179 100644 --- a/assembler/src/main.c +++ b/assembler/src/main.c @@ -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; |