[Intel-gfx] [PATCH]intel-gen4asm: the offset of JMPI is in unit of 64bits on GEN5.

Xiang, Haihao haihao.xiang at intel.com
Mon Jul 20 21:46:44 CEST 2009


This fix is only used for JMPI label. Use a right offset
if JMPI imm32|reg is used in your program.
---
 src/main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index 95e48a9..2757e96 100644
--- a/src/main.c
+++ b/src/main.c
@@ -129,7 +129,12 @@ int main(int argc, char **argv)
 				    entry->instruction.reloc_target) == 0) {
 			    int offset = 
 				entry1->inst_offset - entry->inst_offset;
-			    entry->instruction.bits3.ud = offset - 1;
+
+                            if (gen_level == 5)
+                                    entry->instruction.bits3.ud = 2 * (offset - 1);
+                            else
+                                    entry->instruction.bits3.ud = offset - 1;
+
 			    break;
 			}
 		    }
-- 
1.5.6.3




More information about the Intel-gfx mailing list