From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51217 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKb1S-0007Dc-QX for qemu-devel@nongnu.org; Fri, 04 Jun 2010 13:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKaxq-000488-Gi for qemu-devel@nongnu.org; Fri, 04 Jun 2010 13:45:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42034) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKaxq-00047n-96 for qemu-devel@nongnu.org; Fri, 04 Jun 2010 13:45:50 -0400 Message-ID: <4C093BBC.6060509@redhat.com> Date: Fri, 04 Jun 2010 10:45:32 -0700 From: Richard Henderson MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 03/10] target-mips: add enum constants for various invocations of FOP References: <1274717984-25887-1-git-send-email-froydnj@codesourcery.com> <1274717984-25887-4-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1274717984-25887-4-git-send-email-froydnj@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Froyd Cc: qemu-devel@nongnu.org, aurelien@aurel32.net On 05/24/2010 09:19 AM, Nathan Froyd wrote: > +enum { > + OPC_ADD_S = FOP(0, FMT_S), Adding the enumeration is good. Naming the enumeration and using it in appropriate places is even better. > @@ -5937,8 +6031,8 @@ static void gen_farith (DisasContext *ctx, uint32_t op1, > enum { BINOP, CMPOP, OTHEROP } optype = OTHEROP; > uint32_t func = ctx->opcode & 0x3f; > > - switch (ctx->opcode & FOP(0x3f, 0x1f)) { > - case FOP(0, 16): > + switch (opc) { > + case OPC_ADD_S: For instance, "opc" would seem to be a good candidate for a variable to be switched to the enumeration type. ... Except that I can't seem to find the definition of "opc" at this point in patch 3? It looks like the argument "op1" should be what's used here. Is this a case of patches being split incorrectly? r~