From patchwork Mon Feb 4 15:28:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2093591 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id CD06D3FD56 for ; Mon, 4 Feb 2013 16:04:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B82BCE5D3F for ; Mon, 4 Feb 2013 08:04:43 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D647E60E3 for ; Mon, 4 Feb 2013 07:30:19 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 04 Feb 2013 07:29:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,600,1355126400"; d="scan'208";a="257442351" Received: from unknown (HELO dyon.amr.corp.intel.com) ([10.255.12.132]) by orsmga001.jf.intel.com with ESMTP; 04 Feb 2013 07:30:08 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Feb 2013 15:28:03 +0000 Message-Id: <1359991705-5254-69-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1359991705-5254-1-git-send-email-damien.lespiau@intel.com> References: <1359991705-5254-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH 68/90] assembler: Renamed the instruction field to insn X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org 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 --- assembler/disasm-main.c | 6 +++--- assembler/gen4asm.h | 4 ++-- assembler/gram.y | 6 +++--- assembler/main.c | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/assembler/disasm-main.c b/assembler/disasm-main.c index fbb6ae3..87e6737 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 332c8b9..0781eaf 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 8d81a04..67a5da9 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 269bc26..8579f96 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)