From patchwork Mon Feb 4 15:28:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 2093791 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id A48AFDFE82 for ; Mon, 4 Feb 2013 16:12:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92182E6210 for ; Mon, 4 Feb 2013 08:12:01 -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 08E2FE60E7 for ; Mon, 4 Feb 2013 07:30:31 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 04 Feb 2013 07:30:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,600,1355126400"; d="scan'208";a="257442547" 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:30 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Feb 2013 15:28:20 +0000 Message-Id: <1359991705-5254-86-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 85/90] assembler: Use defines for width 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 Instead of just using hardcoded numbers or resorting to ffs(). Signed-off-by: Damien Lespiau --- assembler/gram.y | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/assembler/gram.y b/assembler/gram.y index aa6d709..9d58fe6 100644 --- a/assembler/gram.y +++ b/assembler/gram.y @@ -618,7 +618,7 @@ declare_srcregion: /* empty */ /* XXX is this default correct?*/ memset (&$$, '\0', sizeof ($$)); $$.vert_stride = ffs(0); - $$.width = ffs(1) - 1; + $$.width = BRW_WIDTH_1; $$.horiz_stride = ffs(0); } | SRCREGION EQ region @@ -955,7 +955,7 @@ subroutineinstruction: set_instruction_opcode(&$$, $2); $4.type = BRW_REGISTER_TYPE_D; /* dest type should be DWORD */ - $4.width = 1; /* execution size must be 2. Here 1 is encoded 2. */ + $4.width = BRW_WIDTH_2; /* execution size must be 2. */ set_instruction_dest(&$$, &$4); struct src_operand src0; @@ -963,7 +963,7 @@ subroutineinstruction: src0.reg.type = BRW_REGISTER_TYPE_D; /* source type should be DWORD */ /* source0 region control must be <2,2,1>. */ src0.reg.hstride = 1; /*encoded 1*/ - src0.reg.width = 1; /*encoded 2*/ + src0.reg.width = BRW_WIDTH_2; src0.reg.vstride = 2; /*encoded 2*/ set_instruction_src0(&$$, &src0, NULL); @@ -981,11 +981,11 @@ subroutineinstruction: memset(&$$, 0, sizeof($$)); set_instruction_predicate(&$$, &$1); set_instruction_opcode(&$$, $2); - dst_null_reg.width = 1; /* execution size of RET should be 2 */ + dst_null_reg.width = BRW_WIDTH_2; /* execution size of RET should be 2 */ set_instruction_dest(&$$, &dst_null_reg); $5.reg.type = BRW_REGISTER_TYPE_D; $5.reg.hstride = 1; /*encoded 1*/ - $5.reg.width = 1; /*encoded 2*/ + $5.reg.width = BRW_WIDTH_2; $5.reg.vstride = 2; /*encoded 2*/ set_instruction_src0(&$$, &$5, NULL); } @@ -1351,7 +1351,7 @@ jumpinstruction: predicate JMPI execsize relativelocation2 if(advanced_flag) GEN(&$$)->header.mask_control = BRW_MASK_DISABLE; set_instruction_predicate(&$$, &$1); - ip_dst.width = ffs(1) - 1; + ip_dst.width = BRW_WIDTH_1; set_instruction_dest(&$$, &ip_dst); set_instruction_src0(&$$, &ip_src, NULL); set_instruction_src1(&$$, &$4, NULL); @@ -1407,7 +1407,7 @@ syncinstruction: predicate WAIT notifyreg memset(&$$, 0, sizeof($$)); set_instruction_opcode(&$$, $2); set_direct_dst_operand(¬ify_dst, &$3, BRW_REGISTER_TYPE_D); - notify_dst.width = ffs(1) - 1; + notify_dst.width = BRW_WIDTH_1; set_instruction_dest(&$$, ¬ify_dst); set_direct_src_operand(¬ify_src, &$3, BRW_REGISTER_TYPE_D); set_instruction_src0(&$$, ¬ify_src, NULL); @@ -2473,7 +2473,7 @@ region: /* empty */ /* XXX is this default value correct?*/ memset (&$$, '\0', sizeof ($$)); $$.vert_stride = ffs(0); - $$.width = ffs(1) - 1; + $$.width = BRW_WIDTH_1; $$.horiz_stride = ffs(0); $$.is_default = 1; } @@ -2482,7 +2482,7 @@ region: /* empty */ /* XXX is this default value correct for accreg?*/ memset (&$$, '\0', sizeof ($$)); $$.vert_stride = ffs($2); - $$.width = ffs(1) - 1; + $$.width = BRW_WIDTH_1; $$.horiz_stride = ffs(0); } |LANGLE exp COMMA exp COMMA exp RANGLE @@ -2783,7 +2783,7 @@ static void reset_instruction_src_region(struct brw_instruction *instr, if (src->reg.file == BRW_ARCHITECTURE_REGISTER_FILE && ((src->reg.nr & 0xF0) == BRW_ARF_ADDRESS)) { src->reg.vstride = ffs(0); - src->reg.width = ffs(1) - 1; + src->reg.width = BRW_WIDTH_1; src->reg.hstride = ffs(0); } else if (src->reg.file == BRW_ARCHITECTURE_REGISTER_FILE && ((src->reg.nr & 0xF0) == BRW_ARF_ACCUMULATOR)) { @@ -2805,7 +2805,7 @@ static void reset_instruction_src_region(struct brw_instruction *instr, (src->reg.nr == BRW_ARF_NULL) && (instr->header.opcode == BRW_OPCODE_SEND)) { src->reg.vstride = ffs(8); - src->reg.width = ffs(8) - 1; + src->reg.width = BRW_WIDTH_8; src->reg.hstride = ffs(1); } else {