summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-09-21 08:39:57 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-09-28 04:05:59 -0400
commit08927f16756564182d81ba394e27cf95e488bbe9 (patch)
treea79da198b25d852e4d74705092fa5c51e5699674
parent3c3aa718512d725870707722b6afd13b77f26aa9 (diff)
Add second_reloc_target in the data structure.
Since Gen6+, some branching instructions have two relocation targets.
-rw-r--r--src/brw_structs.h4
-rw-r--r--src/gram.y6
-rw-r--r--src/main.c6
3 files changed, 9 insertions, 7 deletions
diff --git a/src/brw_structs.h b/src/brw_structs.h
index b60f8b7..c01c032 100644
--- a/src/brw_structs.h
+++ b/src/brw_structs.h
@@ -1559,7 +1559,9 @@ struct brw_instruction
GLint id;
GLfloat fd;
} bits3;
- char *reloc_target;
+
+ char *first_reloc_target, *second_reloc_target; // first for JIP, second for UIP
+ GLint first_reloc_offset, second_reloc_offset; // in number of instructions
};
diff --git a/src/gram.y b/src/gram.y
index 01a3c0b..3a85b75 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -845,7 +845,7 @@ jumpinstruction: predicate JMPI execsize relativelocation2
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
set_instruction_src0(&$$, &ip_src);
set_instruction_src1(&$$, &imm);
- $$.reloc_target = $4;
+ $$.first_reloc_target = $4;
}
;
@@ -902,7 +902,7 @@ branchloopinstruction:
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
set_instruction_src0(&$$, &ip_src);
set_instruction_src1(&$$, &imm);
- $$.reloc_target = $4;
+ $$.first_reloc_target = $4;
}
;
@@ -962,7 +962,7 @@ elseinstruction: ELSE execsize relativelocation
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
set_instruction_src0(&$$, &ip_src);
set_instruction_src1(&$$, &imm);
- $$.reloc_target = $3;
+ $$.first_reloc_target = $3;
}
;
diff --git a/src/main.c b/src/main.c
index f534112..cd54ff3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -340,13 +340,13 @@ int main(int argc, char **argv)
for (entry = compiled_program.first;
entry != NULL; entry = entry->next) {
if (!entry->islabel) {
- if (entry->instruction.reloc_target) {
+ if (entry->instruction.first_reloc_target) {
entry1 = entry;
int found = 0;
do {
if (entry1->islabel &&
strcmp(entry1->string,
- entry->instruction.reloc_target) == 0) {
+ entry->instruction.first_reloc_target) == 0) {
int offset =
entry1->inst_offset - entry->inst_offset;
int delta = (entry->instruction.header.opcode == BRW_OPCODE_JMPI ? 1 : 0);
@@ -366,7 +366,7 @@ int main(int argc, char **argv)
} while (entry1 != entry);
if (found == 0)
fprintf(stderr, "can not find label %s\n",
- entry->instruction.reloc_target);
+ entry->instruction.first_reloc_target);
}
}
}