From patchwork Mon Feb 4 15:27:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2093001 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 B3EA13FC23 for ; Mon, 4 Feb 2013 15:47:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A41F3E609D for ; Mon, 4 Feb 2013 07:47:57 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id A8DD5E60BF for ; Mon, 4 Feb 2013 07:29:31 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 04 Feb 2013 07:29:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,600,1355126400"; d="scan'208";a="257441895" Received: from unknown (HELO dyon.amr.corp.intel.com) ([10.255.12.132]) by orsmga001.jf.intel.com with ESMTP; 04 Feb 2013 07:29:30 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Feb 2013 15:27:31 +0000 Message-Id: <1359991705-5254-37-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 36/90] assembler: Make print_instruction() take an instruction 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 No need to use a brw_program_instruction there as a brw_instruction is what you really dump anyway, espcially when the plan is to use brw_compile from Mesa sooner rather than later. Signed-off-by: Damien Lespiau --- assembler/main.c | 44 ++++++++++++++++++++++---------------------- 1 files changed, 22 insertions(+), 22 deletions(-) diff --git a/assembler/main.c b/assembler/main.c index 1b411c7..28daf3e 100644 --- a/assembler/main.c +++ b/assembler/main.c @@ -239,35 +239,35 @@ static void free_entry_point_table(struct entry_point_item *p) { } static void -print_instruction(FILE *output, struct brw_program_instruction *entry) +print_instruction(FILE *output, struct brw_instruction *instruction) { if (binary_like_output) { fprintf(output, "\t0x%02x, 0x%02x, 0x%02x, 0x%02x, " "0x%02x, 0x%02x, 0x%02x, 0x%02x,\n" "\t0x%02x, 0x%02x, 0x%02x, 0x%02x, " "0x%02x, 0x%02x, 0x%02x, 0x%02x,\n", - ((unsigned char *)(&entry->instruction))[0], - ((unsigned char *)(&entry->instruction))[1], - ((unsigned char *)(&entry->instruction))[2], - ((unsigned char *)(&entry->instruction))[3], - ((unsigned char *)(&entry->instruction))[4], - ((unsigned char *)(&entry->instruction))[5], - ((unsigned char *)(&entry->instruction))[6], - ((unsigned char *)(&entry->instruction))[7], - ((unsigned char *)(&entry->instruction))[8], - ((unsigned char *)(&entry->instruction))[9], - ((unsigned char *)(&entry->instruction))[10], - ((unsigned char *)(&entry->instruction))[11], - ((unsigned char *)(&entry->instruction))[12], - ((unsigned char *)(&entry->instruction))[13], - ((unsigned char *)(&entry->instruction))[14], - ((unsigned char *)(&entry->instruction))[15]); + ((unsigned char *)instruction)[0], + ((unsigned char *)instruction)[1], + ((unsigned char *)instruction)[2], + ((unsigned char *)instruction)[3], + ((unsigned char *)instruction)[4], + ((unsigned char *)instruction)[5], + ((unsigned char *)instruction)[6], + ((unsigned char *)instruction)[7], + ((unsigned char *)instruction)[8], + ((unsigned char *)instruction)[9], + ((unsigned char *)instruction)[10], + ((unsigned char *)instruction)[11], + ((unsigned char *)instruction)[12], + ((unsigned char *)instruction)[13], + ((unsigned char *)instruction)[14], + ((unsigned char *)instruction)[15]); } else { fprintf(output, " { 0x%08x, 0x%08x, 0x%08x, 0x%08x },\n", - ((int *)(&entry->instruction))[0], - ((int *)(&entry->instruction))[1], - ((int *)(&entry->instruction))[2], - ((int *)(&entry->instruction))[3]); + ((int *)instruction)[0], + ((int *)instruction)[1], + ((int *)instruction)[2], + ((int *)instruction)[3]); } } int main(int argc, char **argv) @@ -470,7 +470,7 @@ int main(int argc, char **argv) entry = entry1) { entry1 = entry->next; if (!entry->islabel) - print_instruction(output, entry); + print_instruction(output, &entry->instruction); else free(entry->string); free(entry);