From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 969BDC88CB9 for ; Tue, 13 Jun 2023 04:25:08 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="unknown key version" header.d=208.org header.i=@208.org header.a=rsa-sha256 header.s=dkim header.b=GlBxJrJi; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4QgFpB6gcHz30fY for ; Tue, 13 Jun 2023 14:25:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="unknown key version" header.d=208.org header.i=@208.org header.a=rsa-sha256 header.s=dkim header.b=GlBxJrJi; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=208suo.com (client-ip=183.242.55.162; helo=mail.208.org; envelope-from=wuyonggang001@208suo.com; receiver=lists.ozlabs.org) X-Greylist: delayed 528 seconds by postgrey-1.37 at boromir; Tue, 13 Jun 2023 13:47:42 AEST Received: from mail.208.org (unknown [183.242.55.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4QgDz23XlDz308s for ; Tue, 13 Jun 2023 13:47:42 +1000 (AEST) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4QgDmg6C2TzBJJD5 for ; Tue, 13 Jun 2023 11:38:43 +0800 (CST) Authentication-Results: mail.208.org (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=208.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=208.org; h= content-type:message-id:user-agent:references:in-reply-to :subject:to:from:date:mime-version; s=dkim; t=1686627523; x= 1689219524; bh=u3hyetLWhhJpivUIqk6NvJA7BrKqmfg6hdIa0Zi/AeA=; b=G lBxJrJi4ZNgMEjFWUJRky26g3jCPckpQ4EfWx+BuJYaldfErKEpklBHzgWmgiCYK B1DcxuHgw9z8BUzAurWXb4867a+vWten/DrMI1TFCGBBBHr2cSqyStjpAdovIyPW vmNsnX5OURr8XQ/N8GOOIf5Jep6Si5kKFjfDwH3EZoVh3DbxafNu8jxbTHuaYZ+i 3rRJDNp3l/nhNOwunaJjUcxdmqhOKYCC+JiJp74H6xwK+nbKd9Z9V3iGLrYen54y ikjgoLwSAWOMpx734Q1B3AVR4K8HO9tTtAu/Qvsyvzv4CkKuHvX1kch7YySQwmQ1 bJZpTe+slsmccqK6Fmqqw== X-Virus-Scanned: amavisd-new at mail.208.org Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id z3H6TJ34rFPD for ; Tue, 13 Jun 2023 11:38:43 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4QgDmg3TwMzBJCMY; Tue, 13 Jun 2023 11:38:43 +0800 (CST) MIME-Version: 1.0 Date: Tue, 13 Jun 2023 11:38:43 +0800 From: wuyonggang001@208suo.com To: mpe@ellerman.id.au, npiggin@gmail.com Subject: [PATCH] powerpc/xmon: Fix comparing pointer In-Reply-To: <20230613033455.44992-1-zhanglibing@cdjrlc.com> References: <20230613033455.44992-1-zhanglibing@cdjrlc.com> User-Agent: Roundcube Webmail Message-ID: <8adeeee071d085cac905d5752c2b7632@208suo.com> X-Sender: wuyonggang001@208suo.com Content-Type: multipart/alternative; boundary="=_84557b650920df78480584e40fad0713" X-Mailman-Approved-At: Tue, 13 Jun 2023 14:20:24 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --=_84557b650920df78480584e40fad0713 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Fix the following coccicheck warning: arch/powerpc/xmon/spu-dis.c:51:34-35: WARNING comparing pointer to 0 Signed-off-by: Yonggang Wu --- arch/powerpc/xmon/spu-dis.c | 384 ++++++++++++++++++------------------ 1 file changed, 193 insertions(+), 191 deletions(-) diff --git a/arch/powerpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c index 4b0a4e640f08..f48a2ddd7440 100644 --- a/arch/powerpc/xmon/spu-dis.c +++ b/arch/powerpc/xmon/spu-dis.c @@ -22,216 +22,218 @@ extern const int spu_num_opcodes; #define SPU_DISASM_TBL_SIZE (1 << 11) static const struct spu_opcode *spu_disassemble_table[SPU_DISASM_TBL_SIZE]; -static void -init_spu_disassemble (void) +static void init_spu_disassemble(void) { - int i; - - /* If two instructions have the same opcode then we prefer the first - * one. In most cases it is just an alternate mnemonic. */ - for (i = 0; i < spu_num_opcodes; i++) - { - int o = spu_opcodes[i].opcode; - if (o >= SPU_DISASM_TBL_SIZE) - continue; /* abort (); */ - if (spu_disassemble_table[o] == 0) - spu_disassemble_table[o] = &spu_opcodes[i]; - } + int i; + + /* + * If two instructions have the same opcode then we prefer the first + * one. In most cases it is just an alternate mnemonic. + */ + for (i = 0; i < spu_num_opcodes; i++) { + int o = spu_opcodes[i].opcode; + + if (o >= SPU_DISASM_TBL_SIZE) + continue; /* abort(); */ + if (spu_disassemble_table[o] == NULL) + spu_disassemble_table[o] = &spu_opcodes[i]; + } } /* Determine the instruction from the 10 least significant bits. */ -static const struct spu_opcode * -get_index_for_opcode (unsigned int insn) +static const struct spu_opcode *get_index_for_opcode(unsigned int insn) { - const struct spu_opcode *index; - unsigned int opcode = insn >> (32-11); - - /* Init the table. This assumes that element 0/opcode 0 (currently - * NOP) is always used */ - if (spu_disassemble_table[0] == 0) - init_spu_disassemble (); - - if ((index = spu_disassemble_table[opcode & 0x780]) != 0 - && index->insn_type == RRR) - return index; - - if ((index = spu_disassemble_table[opcode & 0x7f0]) != 0 - && (index->insn_type == RI18 || index->insn_type == LBT)) - return index; - - if ((index = spu_disassemble_table[opcode & 0x7f8]) != 0 - && index->insn_type == RI10) - return index; - - if ((index = spu_disassemble_table[opcode & 0x7fc]) != 0 - && (index->insn_type == RI16)) - return index; - - if ((index = spu_disassemble_table[opcode & 0x7fe]) != 0 - && (index->insn_type == RI8)) - return index; - - if ((index = spu_disassemble_table[opcode & 0x7ff]) != 0) - return index; - - return NULL; + const struct spu_opcode *index; + unsigned int opcode = insn >> (32-11); + + /* + * Init the table. This assumes that element 0/opcode 0 (currently + * NOP) is always used + */ + if (spu_disassemble_table[0] == NULL) + init_spu_disassemble(); + + index = spu_disassemble_table[opcode & 0x780]; + if (index != NULL && index->insn_type == RRR) + return index; + + index = spu_disassemble_table[opcode & 0x7f0]; + if (index != NULL + && (index->insn_type == RI18 || index->insn_type == LBT)) + return index; + + index = spu_disassemble_table[opcode & 0x7f8]; + if (index != NULL + && index->insn_type == RI10) + return index; + + index = spu_disassemble_table[opcode & 0x7fc] + if (index != NULL && (index->insn_type == RI16)) + return index; + + index = spu_disassemble_table[opcode & 0x7fe]; + if (index != NULL && (index->insn_type == RI8)) + return index; + + index = spu_disassemble_table[opcode & 0x7ff]; + if (index != NULL) + return index; + + return NULL; } /* Print a Spu instruction. */ -int -print_insn_spu (unsigned long insn, unsigned long memaddr) +int print_insn_spu(unsigned long insn, unsigned long memaddr) { - int value; - int hex_value; - const struct spu_opcode *index; - enum spu_insns tag; + int value; + int hex_value; + const struct spu_opcode *index; + enum spu_insns tag; - index = get_index_for_opcode (insn); + index = get_index_for_opcode(insn); - if (index == 0) - { - printf(".long 0x%lx", insn); - } - else - { - int i; - int paren = 0; - tag = (enum spu_insns)(index - spu_opcodes); - printf("%s", index->mnemonic); - if (tag == M_BI || tag == M_BISL || tag == M_IRET || tag == M_BISLED - || tag == M_BIHNZ || tag == M_BIHZ || tag == M_BINZ || tag == M_BIZ - || tag == M_SYNC || tag == M_HBR) + if (index == NULL) { - int fb = (insn >> (32-18)) & 0x7f; - if (fb & 0x40) - printf(tag == M_SYNC ? "c" : "p"); - if (fb & 0x20) - printf("d"); - if (fb & 0x10) - printf("e"); - } - if (index->arg[0] != 0) - printf("\t"); - hex_value = 0; - for (i = 1; i <= index->arg[0]; i++) + printf(".long 0x%lx", insn); + } else { - int arg = index->arg[i]; - if (arg != A_P && !paren && i > 1) - printf(","); - - switch (arg) - { - case A_T: - printf("$%lu", - DECODE_INSN_RT (insn)); - break; - case A_A: - printf("$%lu", - DECODE_INSN_RA (insn)); - break; - case A_B: - printf("$%lu", - DECODE_INSN_RB (insn)); - break; - case A_C: - printf("$%lu", - DECODE_INSN_RC (insn)); - break; - case A_S: - printf("$sp%lu", - DECODE_INSN_RA (insn)); - break; - case A_H: - printf("$ch%lu", - DECODE_INSN_RA (insn)); - break; - case A_P: - paren++; - printf("("); - break; - case A_U7A: - printf("%lu", - 173 - DECODE_INSN_U8 (insn)); - break; - case A_U7B: - printf("%lu", - 155 - DECODE_INSN_U8 (insn)); - break; - case A_S3: - case A_S6: - case A_S7: - case A_S7N: - case A_U3: - case A_U5: - case A_U6: - case A_U7: - hex_value = DECODE_INSN_I7 (insn); - printf("%d", hex_value); - break; - case A_S11: - print_address(memaddr + DECODE_INSN_I9a (insn) * 4); - break; - case A_S11I: - print_address(memaddr + DECODE_INSN_I9b (insn) * 4); - break; - case A_S10: - case A_S10B: - hex_value = DECODE_INSN_I10 (insn); - printf("%d", hex_value); - break; - case A_S14: - hex_value = DECODE_INSN_I10 (insn) * 16; - printf("%d", hex_value); - break; - case A_S16: - hex_value = DECODE_INSN_I16 (insn); - printf("%d", hex_value); - break; - case A_X16: - hex_value = DECODE_INSN_U16 (insn); - printf("%u", hex_value); - break; - case A_R18: - value = DECODE_INSN_I16 (insn) * 4; - if (value == 0) - printf("%d", value); - else + int i; + int paren = 0; + + tag = (enum spu_insns)(index - spu_opcodes); + + printf("%s", index->mnemonic); + if (tag == M_BI || tag == M_BISL || tag == M_IRET || tag == M_BISLED + || tag == M_BIHNZ || tag == M_BIHZ || tag == M_BINZ || tag == M_BIZ + || tag == M_SYNC || tag == M_HBR) { - hex_value = memaddr + value; - print_address(hex_value & 0x3ffff); + int fb = (insn >> (32-18)) & 0x7f; + + if (fb & 0x40) + printf(tag == M_SYNC ? "c" : "p"); + if (fb & 0x20) + printf("d"); + if (fb & 0x10) + printf("e"); } - break; - case A_S18: - value = DECODE_INSN_U16 (insn) * 4; - if (value == 0) - printf("%d", value); - else - print_address(value); - break; - case A_U18: - value = DECODE_INSN_U18 (insn); - if (value == 0 || 1) + if (index->arg[0] != 0) + printf("\t"); + hex_value = 0; + for (i = 1; i <= index->arg[0]; i++) { + int arg = index->arg[i]; + + if (arg != A_P && !paren && i > 1) + printf(","); + + switch (arg) { + case A_T: + printf("$%lu", + DECODE_INSN_RT(insn)); + break; + case A_A: + printf("$%lu", + DECODE_INSN_RA(insn)); + break; + case A_B: + printf("$%lu", + DECODE_INSN_RB(insn)); + break; + case A_C: + printf("$%lu", + DECODE_INSN_RC(insn)); + break; + case A_S: + printf("$sp%lu", + DECODE_INSN_RA(insn)); + break; + case A_H: + printf("$ch%lu", + DECODE_INSN_RA(insn)); + break; + case A_P: + paren++; + printf("("); + break; + case A_U7A: + printf("%lu", + 173 - DECODE_INSN_U8(insn)); + break; + case A_U7B: + printf("%lu", + 155 - DECODE_INSN_U8(insn)); + break; + case A_S3: + case A_S6: + case A_S7: + case A_S7N: + case A_U3: + case A_U5: + case A_U6: + case A_U7: + hex_value = DECODE_INSN_I7(insn); + printf("%d", hex_value); + break; + case A_S11: + print_address(memaddr + DECODE_INSN_I9a(insn) * 4); + break; + case A_S11I: + print_address(memaddr + DECODE_INSN_I9b(insn) * 4); + break; + case A_S10: + case A_S10B: + hex_value = DECODE_INSN_I10(insn); + printf("%d", hex_value); + break; + case A_S14: + hex_value = DECODE_INSN_I10(insn) * 16; + printf("%d", hex_value); + break; + case A_S16: + hex_value = DECODE_INSN_I16(insn); + printf("%d", hex_value); + break; + case A_X16: + hex_value = DECODE_INSN_U16(insn); + printf("%u", hex_value); + break; + case A_R18: + value = DECODE_INSN_I16(insn) * 4; + if (value == 0) + printf("%d", value); + else { + hex_value = memaddr + value; + print_address(hex_value & 0x3ffff); + } + break; + case A_S18: + value = DECODE_INSN_U16(insn) * 4; + if (value == 0) + printf("%d", value); + else + print_address(value); + break; + case A_U18: + value = DECODE_INSN_U18(insn); + if (value == 0 || 1) { + hex_value = value; + printf("%u", value); + } else + print_address(value); + break; + case A_U14: + hex_value = DECODE_INSN_U14(insn); + printf("%u", hex_value); + break; + } + if (arg != A_P && paren) { - hex_value = value; - printf("%u", value); + printf(")"); + paren--; } - else - print_address(value); - break; - case A_U14: - hex_value = DECODE_INSN_U14 (insn); - printf("%u", hex_value); - break; - } - if (arg != A_P && paren) - { - printf(")"); - paren--; - } } - if (hex_value > 16) - printf("\t# %x", hex_value); + if (hex_value > 16) + printf("\t# %x", hex_value); } return 4; } --=_84557b650920df78480584e40fad0713 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8
= Fix the following coccicheck warning:

arch/powerpc/xmon/spu-dis.= c:51:34-35: WARNING comparing pointer to 0

Signed-off-by: Yongga= ng Wu <wuyonggang001@208suo.com>
---
 arch/powerpc/xmo= n/spu-dis.c | 384 ++++++++++++++++++------------------
 1 file ch= anged, 193 insertions(+), 191 deletions(-)

diff --git a/arch/pow= erpc/xmon/spu-dis.c b/arch/powerpc/xmon/spu-dis.c
index 4b0a4e640f08..= f48a2ddd7440 100644
--- a/arch/powerpc/xmon/spu-dis.c
+++ b/arch/= powerpc/xmon/spu-dis.c
@@ -22,216 +22,218 @@ extern const int spu_num_= opcodes;
 #define SPU_DISASM_TBL_SIZE (1 << 11)
 = static const struct spu_opcode *spu_disassemble_table[SPU_DISASM_TBL_SIZE];=
 
-static void
-init_spu_disassemble (void)
+stat= ic void init_spu_disassemble(void)
 {
-  int i;
-<= br />-  /* If two instructions have the same opcode then we prefer the= first
-   * one.  In most cases it is just an alternat= e mnemonic. */
-  for (i =3D 0; i < spu_num_opcodes; i++)
-    {
-      int o =3D spu_o= pcodes[i].opcode;
-      if (o >=3D SPU_DI= SASM_TBL_SIZE)
-    continue; /* abort (); */
- &n= bsp;    if (spu_disassemble_table[o] =3D=3D 0)
- &= nbsp;  spu_disassemble_table[o] =3D &spu_opcodes[i];
- &= nbsp;  }
+    int i;
+
+  &nbs= p; /*
+     * If two instructions have the sa= me opcode then we prefer the first
+     * one. &n= bsp;In most cases it is just an alternate mnemonic.
+   &nbs= p; */
+    for (i =3D 0; i < spu_num_opcodes; i= ++) {
+        int o =3D spu_opcode= s[i].opcode;
+
+        if (o = >=3D SPU_DISASM_TBL_SIZE)
+       &nb= sp;    continue; /* abort(); */
+   &nbs= p;    if (spu_disassemble_table[o] =3D=3D NULL)
+ =            spu_disas= semble_table[o] =3D &spu_opcodes[i];
+    }
&n= bsp;}
 
 /* Determine the instruction from the 10 least= significant bits. */
-static const struct spu_opcode *
-get_inde= x_for_opcode (unsigned int insn)
+static const struct spu_opcode *get_= index_for_opcode(unsigned int insn)
 {
-  const struct = spu_opcode *index;
-  unsigned int opcode =3D insn >> (32-1= 1);
-
-  /* Init the table.  This assumes that element = 0/opcode 0 (currently
-   * NOP) is always used */
- &n= bsp;if (spu_disassemble_table[0] =3D=3D 0)
-    init_sp= u_disassemble ();
-
-  if ((index =3D spu_disassemble_table[= opcode & 0x780]) !=3D 0
-      &&= index->insn_type =3D=3D RRR)
-    return index;
-
-  if ((index =3D spu_disassemble_table[opcode & 0x7f0]) = !=3D 0
-      && (index->insn_type= =3D=3D RI18 || index->insn_type =3D=3D LBT))
-    r= eturn index;
-
-  if ((index =3D spu_disassemble_table[opcod= e & 0x7f8]) !=3D 0
-      && inde= x->insn_type =3D=3D RI10)
-    return index;
-<= br />-  if ((index =3D spu_disassemble_table[opcode & 0x7fc]) !=3D= 0
-      && (index->insn_type =3D= =3D RI16))
-    return index;
-
-  if ((= index =3D spu_disassemble_table[opcode & 0x7fe]) !=3D 0
-  &n= bsp;   && (index->insn_type =3D=3D RI8))
- &= nbsp;  return index;
-
-  if ((index =3D spu_disas= semble_table[opcode & 0x7ff]) !=3D 0)
-    return i= ndex;
-
-  return NULL;
+    const struc= t spu_opcode *index;
+    unsigned int opcode =3D insn = >> (32-11);
+
+    /*
+   &nb= sp; * Init the table.  This assumes that element 0/opcode 0 (curr= ently
+     * NOP) is always used
+  &nb= sp;  */
+    if (spu_disassemble_table[0] =3D= =3D NULL)
+        init_spu_disasse= mble();
+
+    index =3D spu_disassemble_table[opc= ode & 0x780];
+    if (index !=3D NULL && i= ndex->insn_type =3D=3D RRR)
+       &= nbsp;return index;
+
+    index =3D spu_disassembl= e_table[opcode & 0x7f0];
+    if (index !=3D NULL+      && (index->insn_type =3D=3D = RI18 || index->insn_type =3D=3D LBT))
+     &nb= sp;  return index;
+
+    index =3D spu_= disassemble_table[opcode & 0x7f8];
+    if (index != =3D NULL
+      && index->insn_typ= e =3D=3D RI10)
+        return inde= x;
+
+    index =3D spu_disassemble_table[opcode &= amp; 0x7fc]
+    if (index !=3D NULL && (index-= >insn_type =3D=3D RI16))
+       &nbs= p;return index;
+
+    index =3D spu_disassemble_t= able[opcode & 0x7fe];
+    if (index !=3D NULL &= ;& (index->insn_type =3D=3D RI8))
+     &nb= sp;  return index;
+
+    index =3D spu_= disassemble_table[opcode & 0x7ff];
+    if (index != =3D NULL)
+        return index;+
+    return NULL;
 }
 
&n= bsp;/* Print a Spu instruction.  */
 
-int
-print_= insn_spu (unsigned long insn, unsigned long memaddr)
+int print_insn_s= pu(unsigned long insn, unsigned long memaddr)
 {
-  int= value;
-  int hex_value;
-  const struct spu_opcode *i= ndex;
-  enum spu_insns tag;
+    int value;<= br />+    int hex_value;
+    const stru= ct spu_opcode *index;
+    enum spu_insns tag;
&nb= sp;
-  index =3D get_index_for_opcode (insn);
+   =  index =3D get_index_for_opcode(insn);
 
-  if (in= dex =3D=3D 0)
-    {
-     &nb= sp;printf(".long 0x%lx", insn);
-    }
-  els= e
-    {
-      int i;-      int paren =3D 0;
-   &nbs= p;  tag =3D (enum spu_insns)(index - spu_opcodes);
-  &= nbsp;   printf("%s", index->mnemonic);
-   = ;   if (tag =3D=3D M_BI || tag =3D=3D M_BISL || tag =3D=3D M= _IRET || tag =3D=3D M_BISLED
-      || tag = =3D=3D M_BIHNZ || tag =3D=3D M_BIHZ || tag =3D=3D M_BINZ || tag =3D=3D M_BI= Z
-          || tag =3D= =3D M_SYNC || tag =3D=3D M_HBR)
+    if (index =3D=3D N= ULL)
     {
-     &n= bsp;int fb =3D (insn >> (32-18)) & 0x7f;
-    = ;  if (fb & 0x40)
-       =  printf(tag =3D=3D M_SYNC ? "c" : "p");
-     = ; if (fb & 0x20)
-        = printf("d");
-      if (fb & 0x10)
-=        printf("e");
-   =  }
-      if (index->arg[0] !=3D 0)-    printf("\t");
-      = hex_value =3D 0;
-      for (i =3D 1;  i= <=3D index->arg[0]; i++)
+       =  printf(".long 0x%lx", insn);
+    } else
&nb= sp;    {
-      int arg = =3D index->arg[i];
-      if (arg !=3D A_P= && !paren && i > 1)
-     &nbs= p;  printf(",");
-
-      swit= ch (arg)
-        {
-  &n= bsp;     case A_T:
-     =      printf("$%lu",
-     = ;            &n= bsp;   DECODE_INSN_RT (insn));
-    &nbs= p;     break;
-      = ;  case A_A:
-        &nb= sp; printf("$%lu",
-        &n= bsp;            = ;DECODE_INSN_RA (insn));
-        &= nbsp; break;
-        case A_B= :
-          printf("$%lu= ",
-            = ;         DECODE_INSN_RB (insn= ));
-          break;
-        case A_C:
-   =        printf("$%lu",
-   = ;            &n= bsp;     DECODE_INSN_RC (insn));
-  &nbs= p;       break;
-    = ;    case A_S:
-      &nb= sp;   printf("$sp%lu",
-      =             &nb= sp;  DECODE_INSN_RA (insn));
-      = ;    break;
-       =  case A_H:
-         &nbs= p;printf("$ch%lu",
-         &= nbsp;           DECO= DE_INSN_RA (insn));
-         =  break;
-        case A_P:
-          paren++;
- &= nbsp;        printf("(");
- &n= bsp;        break;
-  &nb= sp;     case A_U7A:
-     = ;     printf("%lu",
-     = ;            &n= bsp;   173 - DECODE_INSN_U8 (insn));
-   &nbs= p;      break;
-     = ;   case A_U7B:
-       &= nbsp;  printf("%lu",
-       &= nbsp;           &nbs= p; 155 - DECODE_INSN_U8 (insn));
-      =     break;
-       &= nbsp;case A_S3:
-        case A_S6:=
-        case A_S7:
-  &= nbsp;     case A_S7N:
-    &nb= sp;   case A_U3:
-       =  case A_U5:
-        case A_U6= :
-        case A_U7:
-  =         hex_value =3D DECODE_INSN_I= 7 (insn);
-          prin= tf("%d", hex_value);
-         = ; break;
-        case A_S11:<= br />-          print_address(= memaddr + DECODE_INSN_I9a (insn) * 4);
-      = ;    break;
-       =  case A_S11I:
-         &= nbsp;print_address(memaddr + DECODE_INSN_I9b (insn) * 4);
-  &nbs= p;       break;
-    = ;    case A_S10:
-      &= nbsp; case A_S10B:
-        &n= bsp; hex_value =3D DECODE_INSN_I10 (insn);
-    &n= bsp;     printf("%d", hex_value);
-  &nb= sp;       break;
-   &nbs= p;    case A_S14:
-      =     hex_value =3D DECODE_INSN_I10 (insn) * 16;
- &= nbsp;        printf("%d", hex_value= );
-          break;
-        case A_S16:
-   = ;       hex_value =3D DECODE_INSN_I16 (i= nsn);
-          printf("= %d", hex_value);
-         &nb= sp;break;
-        case A_X16:
-          hex_value =3D DECO= DE_INSN_U16 (insn);
-         =  printf("%u", hex_value);
-       &= nbsp;  break;
-        ca= se A_R18:
-          valu= e =3D DECODE_INSN_I16 (insn) * 4;
-      &nbs= p;   if (value =3D=3D 0)
-     &nbs= p;  printf("%d", value);
-      &nb= sp;   else
+        = int i;
+        int paren =3D 0;+
+        tag =3D (enum spu_ins= ns)(index - spu_opcodes);
+
+       = ; printf("%s", index->mnemonic);
+     &nb= sp;  if (tag =3D=3D M_BI || tag =3D=3D M_BISL || tag =3D=3D M_IRE= T || tag =3D=3D M_BISLED
+        |= | tag =3D=3D M_BIHNZ || tag =3D=3D M_BIHZ || tag =3D=3D M_BINZ || tag =3D= =3D M_BIZ
+          || t= ag =3D=3D M_SYNC || tag =3D=3D M_HBR)
     &n= bsp;   {
-        &n= bsp; hex_value =3D memaddr + value;
-     &nb= sp;    print_address(hex_value & 0x3ffff);
+ &= nbsp;          int fb =3D= (insn >> (32-18)) & 0x7f;
+
+     =        if (fb & 0x40)
+  &= nbsp;           &nbs= p; printf(tag =3D=3D M_SYNC ? "c" : "p");
+    &nb= sp;       if (fb & 0x20)
+ &nbs= p;            &= nbsp; printf("d");
+        &n= bsp;   if (fb & 0x10)
+     &nb= sp;          printf("e");=
         }
-  =         break;
-   &= nbsp;    case A_S18:
-     &nb= sp;    value =3D DECODE_INSN_U16 (insn) * 4;
- &nb= sp;        if (value =3D=3D 0)
-        printf("%d", value);
- &n= bsp;        else
-   = ;     print_address(value);
-   &nb= sp;      break;
-    &nbs= p;   case A_U18:
-       =    value =3D DECODE_INSN_U18 (insn);
-   &nbs= p;      if (value =3D=3D 0 || 1)
+  = ;      if (index->arg[0] !=3D 0)
+ &n= bsp;          printf("\t"= );
+        hex_value =3D 0;
+=        for (i =3D 1;  i <=3D in= dex->arg[0]; i++) {
+        &nb= sp;   int arg =3D index->arg[i];
+
+  &nbs= p;         if (arg !=3D A_P &a= mp;& !paren && i > 1)
+      &= nbsp;         printf(",");
+
+           &nbs= p;switch (arg) {
+         &nb= sp;  case A_T:
+        &= nbsp;       printf("$%lu",
+  =             &nb= sp;         DECODE_INSN_RT(ins= n));
+           &nb= sp;    break;
+      &nbs= p;     case A_A:
+     &n= bsp;          printf("$%l= u",
+           &nbs= p;            D= ECODE_INSN_RA(insn));
+        &nbs= p;       break;
+    = ;        case A_B:
+  &nb= sp;            =  printf("$%lu",
+         = ;            &n= bsp;  DECODE_INSN_RB(insn));
+      = ;          break;
+ =            case A_C:=
+            &= nbsp;   printf("$%lu",
+      =             &nb= sp;     DECODE_INSN_RC(insn));
+   =             &nb= sp;break;
+          &nbs= p; case A_S:
+         &n= bsp;      printf("$sp%lu",
+   = ;            &n= bsp;        DECODE_INSN_RA(insn));<= br />+            &n= bsp;   break;
+       &nb= sp;    case A_H:
+      &= nbsp;         printf("$ch%lu",=
+            &= nbsp;           DECO= DE_INSN_RA(insn));
+         &= nbsp;      break;
+    &n= bsp;       case A_P:
+   =             &nb= sp;paren++;
+          &n= bsp;     printf("(");
+    &nb= sp;           break;=
+            c= ase A_U7A:
+          &nb= sp;     printf("%lu",
+    &nb= sp;            =        173 - DECODE_INSN_U8(insn));
+             =    break;
+        &= nbsp;   case A_U7B:
+      &nb= sp;         printf("%lu",
+             =            155 - DEC= ODE_INSN_U8(insn));
+         =        break;
+    &= nbsp;       case A_S3:
+  &nbs= p;         case A_S6:
+ &= nbsp;          case A_S7:=
+            c= ase A_S7N:
+          &nb= sp; case A_U3:
+         =    case A_U5:
+       &nb= sp;    case A_U6:
+      =       case A_U7:
+    &nb= sp;           hex_va= lue =3D DECODE_INSN_I7(insn);
+       &n= bsp;        printf("%d", hex_value)= ;
+            =     break;
+       &= nbsp;    case A_S11:
+     &nb= sp;          print_addres= s(memaddr + DECODE_INSN_I9a(insn) * 4);
+     &nbs= p;          break;
+=            case A_S= 11I:
+           &nb= sp;    print_address(memaddr + DECODE_INSN_I9b(insn) * = 4);
+           &nbs= p;    break;
+       = ;     case A_S10:
+     &= nbsp;      case A_S10B:
+   &n= bsp;            = ;hex_value =3D DECODE_INSN_I10(insn);
+      =           printf("%d", he= x_value);
+          &nbs= p;     break;
+      = ;      case A_S14:
+    &= nbsp;           hex_= value =3D DECODE_INSN_I10(insn) * 16;
+      =           printf("%d", he= x_value);
+          &nbs= p;     break;
+      = ;      case A_S16:
+    &= nbsp;           hex_= value =3D DECODE_INSN_I16(insn);
+       = ;         printf("%d", hex_val= ue);
+           &nb= sp;    break;
+      &nbs= p;     case A_X16:
+     =            hex_value= =3D DECODE_INSN_U16(insn);
+       &nbs= p;        printf("%u", hex_value);<= br />+            &n= bsp;   break;
+       &nb= sp;    case A_R18:
+      = ;          value =3D DECO= DE_INSN_I16(insn) * 4;
+        &nb= sp;       if (value =3D=3D 0)
+ &nb= sp;            =       printf("%d", value);
+   = ;            &n= bsp;else {
+          &nb= sp;         hex_value =3D mema= ddr + value;
+          &= nbsp;         print_address(he= x_value & 0x3ffff);
+        &n= bsp;       }
+    &n= bsp;           break= ;
+            = case A_S18:
+          &n= bsp;     value =3D DECODE_INSN_U16(insn) * 4;
+             =    if (value =3D=3D 0)
+      =             &nb= sp; printf("%d", value);
+       &n= bsp;        else
+   = ;            &n= bsp;    print_address(value);
+    =             bre= ak;
+           &nbs= p;case A_U18:
+          =       value =3D DECODE_INSN_U18(insn);
+=             &n= bsp;  if (value =3D=3D 0 || 1) {
+     &= nbsp;           &nbs= p;  hex_value =3D value;
+      &nb= sp;            =  printf("%u", value);
+        = ;        } else
+   =             &nb= sp;    print_address(value);
+    &= nbsp;           brea= k;
+            = ;case A_U14:
+          &= nbsp;     hex_value =3D DECODE_INSN_U14(insn);
+             = ;   printf("%u", hex_value);
+     =            break;+            }+        if (arg !=3D A_P && = paren)
         {
- =          hex_value =3D value;<= br />-          printf("%u", v= alue);
+           &= nbsp;printf(")");
+         &n= bsp;  paren--;
       &nb= sp; }
-          els= e
-        print_address(value);-          break;
- &n= bsp;      case A_U14:
-   &nbs= p;      hex_value =3D DECODE_INSN_U14 (insn);=
-          printf("%u", = hex_value);
-          br= eak;
-        }
-   =    if (arg !=3D A_P && paren)
-   &nb= sp;    {
-       &nb= sp;  printf(")");
-       &nbs= p;  paren--;
-        }     }
-      if= (hex_value > 16)
-    printf("\t# %x", hex_value);<= br />+        if (hex_value > 16)
+            print= f("\t# %x", hex_value);
     }
 &nb= sp; return 4;
 }
--=_84557b650920df78480584e40fad0713--