mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-20 22:36:24 +00:00
Add second_reloc_target in the data structure.
Since Gen6+, some branching instructions have two relocation targets.
This commit is contained in:
parent
d6f02c181f
commit
751838e809
@ -1559,7 +1559,9 @@ struct brw_instruction
|
|||||||
GLint id;
|
GLint id;
|
||||||
GLfloat fd;
|
GLfloat fd;
|
||||||
} bits3;
|
} 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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -845,7 +845,7 @@ jumpinstruction: predicate JMPI execsize relativelocation2
|
|||||||
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
|
set_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
|
||||||
set_instruction_src0(&$$, &ip_src);
|
set_instruction_src0(&$$, &ip_src);
|
||||||
set_instruction_src1(&$$, &imm);
|
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_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
|
||||||
set_instruction_src0(&$$, &ip_src);
|
set_instruction_src0(&$$, &ip_src);
|
||||||
set_instruction_src1(&$$, &imm);
|
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_direct_src_operand(&ip_src, &dst, BRW_REGISTER_TYPE_UD);
|
||||||
set_instruction_src0(&$$, &ip_src);
|
set_instruction_src0(&$$, &ip_src);
|
||||||
set_instruction_src1(&$$, &imm);
|
set_instruction_src1(&$$, &imm);
|
||||||
$$.reloc_target = $3;
|
$$.first_reloc_target = $3;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -340,13 +340,13 @@ int main(int argc, char **argv)
|
|||||||
for (entry = compiled_program.first;
|
for (entry = compiled_program.first;
|
||||||
entry != NULL; entry = entry->next) {
|
entry != NULL; entry = entry->next) {
|
||||||
if (!entry->islabel) {
|
if (!entry->islabel) {
|
||||||
if (entry->instruction.reloc_target) {
|
if (entry->instruction.first_reloc_target) {
|
||||||
entry1 = entry;
|
entry1 = entry;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
do {
|
do {
|
||||||
if (entry1->islabel &&
|
if (entry1->islabel &&
|
||||||
strcmp(entry1->string,
|
strcmp(entry1->string,
|
||||||
entry->instruction.reloc_target) == 0) {
|
entry->instruction.first_reloc_target) == 0) {
|
||||||
int offset =
|
int offset =
|
||||||
entry1->inst_offset - entry->inst_offset;
|
entry1->inst_offset - entry->inst_offset;
|
||||||
int delta = (entry->instruction.header.opcode == BRW_OPCODE_JMPI ? 1 : 0);
|
int delta = (entry->instruction.header.opcode == BRW_OPCODE_JMPI ? 1 : 0);
|
||||||
@ -366,7 +366,7 @@ int main(int argc, char **argv)
|
|||||||
} while (entry1 != entry);
|
} while (entry1 != entry);
|
||||||
if (found == 0)
|
if (found == 0)
|
||||||
fprintf(stderr, "can not find label %s\n",
|
fprintf(stderr, "can not find label %s\n",
|
||||||
entry->instruction.reloc_target);
|
entry->instruction.first_reloc_target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user