summaryrefslogtreecommitdiff
path: root/assembler
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-01-30 12:31:45 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2013-03-04 15:54:41 +0000
commitd008064b3ef6a85181a61e97f51a9b4c9319ddc8 (patch)
tree842ddfbb7e7dedf5ff32cafdab2ce8abd99ed1a8 /assembler
parent888b2dcae60cb2db0eb95adddfd894f58dc6dc89 (diff)
assembler: Renamed the instruction field to insn
This will be less typing for the refactoring to come (which is use struct brw_program_instruction in gram.y for the type of all the instructions). Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'assembler')
-rw-r--r--assembler/disasm-main.c6
-rw-r--r--assembler/gen4asm.h4
-rw-r--r--assembler/gram.y6
-rw-r--r--assembler/main.c10
4 files changed, 13 insertions, 13 deletions
diff --git a/assembler/disasm-main.c b/assembler/disasm-main.c
index fbb6ae33..87e67377 100644
--- a/assembler/disasm-main.c
+++ b/assembler/disasm-main.c
@@ -51,7 +51,7 @@ read_program (FILE *input)
++n;
if (n == 4) {
entry = malloc (sizeof (struct brw_program_instruction));
- memcpy (&entry->instruction, inst, 4 * sizeof (uint32_t));
+ memcpy (&entry->insn, inst, 4 * sizeof (uint32_t));
entry->next = NULL;
*prev = entry;
prev = &entry->next;
@@ -82,7 +82,7 @@ read_program_binary (FILE *input)
inst[n++] = (uint8_t)temp;
if (n == 16) {
entry = malloc (sizeof (struct brw_program_instruction));
- memcpy (&entry->instruction, inst, 16 * sizeof (uint8_t));
+ memcpy (&entry->insn, inst, 16 * sizeof (uint8_t));
entry->next = NULL;
*prev = entry;
prev = &entry->next;
@@ -167,6 +167,6 @@ int main(int argc, char **argv)
}
for (inst = program->first; inst; inst = inst->next)
- brw_disasm (output, &inst->instruction.gen, gen);
+ brw_disasm (output, &inst->insn.gen, gen);
exit (0);
}
diff --git a/assembler/gen4asm.h b/assembler/gen4asm.h
index 332c8b9e..0781eaf4 100644
--- a/assembler/gen4asm.h
+++ b/assembler/gen4asm.h
@@ -143,7 +143,7 @@ struct brw_program_instruction {
struct brw_instruction gen;
struct relocatable_instruction reloc;
struct label_instruction label;
- } instruction;
+ } insn;
struct brw_program_instruction *next;
};
@@ -155,7 +155,7 @@ static inline bool is_label(struct brw_program_instruction *instruction)
static inline char *label_name(struct brw_program_instruction *i)
{
assert(is_label(i));
- return i->instruction.label.name;
+ return i->insn.label.name;
}
static inline bool is_relocatable(struct brw_program_instruction *intruction)
diff --git a/assembler/gram.y b/assembler/gram.y
index 8d81a04c..67a5da97 100644
--- a/assembler/gram.y
+++ b/assembler/gram.y
@@ -201,7 +201,7 @@ static void brw_program_add_instruction(struct brw_program *p,
list_entry = calloc(sizeof(struct brw_program_instruction), 1);
list_entry->type = GEN4ASM_INSTRUCTION_GEN;
- list_entry->instruction.gen = *instruction;
+ list_entry->insn.gen = *instruction;
brw_program_append_entry(p, list_entry);
}
@@ -212,7 +212,7 @@ static void brw_program_add_relocatable(struct brw_program *p,
list_entry = calloc(sizeof(struct brw_program_instruction), 1);
list_entry->type = GEN4ASM_INSTRUCTION_GEN_RELOCATABLE;
- list_entry->instruction.reloc = *reloc;
+ list_entry->insn.reloc = *reloc;
brw_program_append_entry(p, list_entry);
}
@@ -222,7 +222,7 @@ static void brw_program_add_label(struct brw_program *p, const char *label)
list_entry = calloc(sizeof(struct brw_program_instruction), 1);
list_entry->type = GEN4ASM_INSTRUCTION_LABEL;
- list_entry->instruction.label.name = strdup(label);
+ list_entry->insn.label.name = strdup(label);
brw_program_append_entry(p, list_entry);
}
diff --git a/assembler/main.c b/assembler/main.c
index 269bc264..8579f963 100644
--- a/assembler/main.c
+++ b/assembler/main.c
@@ -237,7 +237,7 @@ static int is_entry_point(struct brw_program_instruction *i)
assert(i->type == GEN4ASM_INSTRUCTION_LABEL);
for (p = entry_point_table; p; p = p->next) {
- if (strcmp(p->str, i->instruction.label.name) == 0)
+ if (strcmp(p->str, i->insn.label.name) == 0)
return 1;
}
return 0;
@@ -406,7 +406,7 @@ int main(int argc, char **argv)
// insert NOP instructions until (inst_offset+1) % 4 == 0
while (((inst_offset+1) % 4) != 0) {
tmp_entry = calloc(sizeof(*tmp_entry), 1);
- tmp_entry->instruction.gen.header.opcode = BRW_OPCODE_NOP;
+ tmp_entry->insn.gen.header.opcode = BRW_OPCODE_NOP;
entry->next = tmp_entry;
tmp_entry->next = entry1;
entry = tmp_entry;
@@ -437,7 +437,7 @@ int main(int argc, char **argv)
}
for (entry = compiled_program.first; entry; entry = entry->next) {
- struct relocatable_instruction *reloc = &entry->instruction.reloc;
+ struct relocatable_instruction *reloc = &entry->insn.reloc;
struct brw_instruction *inst = &reloc->gen;
if (!is_relocatable(entry))
@@ -497,9 +497,9 @@ int main(int argc, char **argv)
entry = entry1) {
entry1 = entry->next;
if (!is_label(entry))
- print_instruction(output, &entry->instruction.gen);
+ print_instruction(output, &entry->insn.gen);
else
- free(entry->instruction.label.name);
+ free(entry->insn.label.name);
free(entry);
}
if (binary_like_output)