print_insn_ppi (int field_b, struct disassemble_info *info)

{

  static const char *sx_tab[] = { "x0", "x1", "a0", "a1" };

  static const char *sy_tab[] = { "y0", "y1", "m0", "m1" };

  fprintf_ftype fprintf_fn = info->fprintf_func;

  void *stream = info->stream;

  unsigned int nib1, nib2, nib3;

  unsigned int altnib1, nib4;

  const char *dc = NULL;

  const sh_opcode_info *op;



  if ((field_b & 0xe800) == 0)

    {

      fprintf_fn (stream, "psh%c\t#%d,",

		  field_b & 0x1000 ? 'a' : 'l',

		  (field_b >> 4) & 127);

      print_dsp_reg (field_b & 0xf, fprintf_fn, stream);

      return;

    }

  if ((field_b & 0xc000) == 0x4000 && (field_b & 0x3000) != 0x1000)

    {

      static const char *du_tab[] = { "x0", "y0", "a0", "a1" };

      static const char *se_tab[] = { "x0", "x1", "y0", "a1" };

      static const char *sf_tab[] = { "y0", "y1", "x0", "a1" };

      static const char *sg_tab[] = { "m0", "m1", "a0", "a1" };



      if (field_b & 0x2000)

	{

	  fprintf_fn (stream, "p%s %s,%s,%s\t",

		      (field_b & 0x1000) ? "add" : "sub",

		      sx_tab[(field_b >> 6) & 3],

		      sy_tab[(field_b >> 4) & 3],

		      du_tab[(field_b >> 0) & 3]);

	}

      else if ((field_b & 0xf0) == 0x10

	       && info->mach != bfd_mach_sh_dsp

	       && info->mach != bfd_mach_sh3_dsp)

	{

	  fprintf_fn (stream, "pclr %s \t", du_tab[(field_b >> 0) & 3]);

	}

      else if ((field_b & 0xf3) != 0)

	{

	  fprintf_fn (stream, ".word 0x%x\t", field_b);

	}

      fprintf_fn (stream, "pmuls%c%s,%s,%s",

		  field_b & 0x2000 ? ' ' : '\t',

		  se_tab[(field_b >> 10) & 3],

		  sf_tab[(field_b >>  8) & 3],

		  sg_tab[(field_b >>  2) & 3]);

      return;

    }



  nib1 = PPIC;

  nib2 = field_b >> 12 & 0xf;

  nib3 = field_b >> 8 & 0xf;

  nib4 = field_b >> 4 & 0xf;

  switch (nib3 & 0x3)

    {

    case 0:

      dc = "";

      nib1 = PPI3;

      break;

    case 1:

      dc = "";

      break;

    case 2:

      dc = "dct ";

      nib3 -= 1;

      break;

    case 3:

      dc = "dcf ";

      nib3 -= 2;

      break;

    }

  if (nib1 == PPI3)

    altnib1 = PPI3NC;

  else

    altnib1 = nib1;

  for (op = sh_table; op->name; op++)

    {

      if ((op->nibbles[1] == nib1 || op->nibbles[1] == altnib1)

	  && op->nibbles[2] == nib2

	  && op->nibbles[3] == nib3)

	{

	  int n;



	  switch (op->nibbles[4])

	    {

	    case HEX_0:

	      break;

	    case HEX_XX00:

	      if ((nib4 & 3) != 0)

		continue;

	      break;

	    case HEX_1:

	      if ((nib4 & 3) != 1)

		continue;

	      break;

	    case HEX_00YY:

	      if ((nib4 & 0xc) != 0)

		continue;

	      break;

	    case HEX_4:

	      if ((nib4 & 0xc) != 4)

		continue;

	      break;

	    default:

	      abort ();

	    }

	  fprintf_fn (stream, "%s%s\t", dc, op->name);

	  for (n = 0; n < 3 && op->arg[n] != A_END; n++)

	    {

	      if (n && op->arg[1] != A_END)

		fprintf_fn (stream, ",");

	      switch (op->arg[n])

		{

		case DSP_REG_N:

		  print_dsp_reg (field_b & 0xf, fprintf_fn, stream);

		  break;

		case DSP_REG_X:

		  fprintf_fn (stream, sx_tab[(field_b >> 6) & 3]);

		  break;

		case DSP_REG_Y:

		  fprintf_fn (stream, sy_tab[(field_b >> 4) & 3]);

		  break;

		case A_MACH:

		  fprintf_fn (stream, "mach");

		  break;

		case A_MACL:

		  fprintf_fn (stream, "macl");

		  break;

		default:

		  abort ();

		}

	    }

	  return;

	}

    }

  /* Not found.  */

  fprintf_fn (stream, ".word 0x%x", field_b);

}

print_insn_ppi (int field_b, struct disassemble_info *info)

{

  static const char *sx_tab[] = { "x0", "x1", "a0", "a1" };

  static const char *sy_tab[] = { "y0", "y1", "m0", "m1" };

  fprintf_ftype fprintf_fn = info->fprintf_func;

  void *stream = info->stream;

  unsigned int nib1, nib2, nib3;

  unsigned int altnib1, nib4;

  const char *dc = NULL;

  const sh_opcode_info *op;



  if ((field_b & 0xe800) == 0)

    {

      fprintf_fn (stream, "psh%c\t#%d,",

		  field_b & 0x1000 ? 'a' : 'l',

		  (field_b >> 4) & 127);

      print_dsp_reg (field_b & 0xf, fprintf_fn, stream);

      return;

    }

  if ((field_b & 0xc000) == 0x4000 && (field_b & 0x3000) != 0x1000)

    {

      static const char *du_tab[] = { "x0", "y0", "a0", "a1" };

      static const char *se_tab[] = { "x0", "x1", "y0", "a1" };

      static const char *sf_tab[] = { "y0", "y1", "x0", "a1" };

      static const char *sg_tab[] = { "m0", "m1", "a0", "a1" };



      if (field_b & 0x2000)

	{

	  fprintf_fn (stream, "p%s %s,%s,%s\t",

		      (field_b & 0x1000) ? "add" : "sub",

		      sx_tab[(field_b >> 6) & 3],

		      sy_tab[(field_b >> 4) & 3],

		      du_tab[(field_b >> 0) & 3]);

	}

      else if ((field_b & 0xf0) == 0x10

	       && info->mach != bfd_mach_sh_dsp

	       && info->mach != bfd_mach_sh3_dsp)

	{

	  fprintf_fn (stream, "pclr %s \t", du_tab[(field_b >> 0) & 3]);

	}

      else if ((field_b & 0xf3) != 0)

	{

	  fprintf_fn (stream, ".word 0x%x\t", field_b);

	}

      fprintf_fn (stream, "pmuls%c%s,%s,%s",

		  field_b & 0x2000 ? ' ' : '\t',

		  se_tab[(field_b >> 10) & 3],

		  sf_tab[(field_b >>  8) & 3],

		  sg_tab[(field_b >>  2) & 3]);

      return;

    }



  nib1 = PPIC;

  nib2 = field_b >> 12 & 0xf;

  nib3 = field_b >> 8 & 0xf;

  nib4 = field_b >> 4 & 0xf;

  switch (nib3 & 0x3)

    {

    case 0:

      dc = "";

      nib1 = PPI3;

      break;

    case 1:

      dc = "";

      break;

    case 2:

      dc = "dct ";

      nib3 -= 1;

      break;

    case 3:

      dc = "dcf ";

      nib3 -= 2;

      break;

    }

  if (nib1 == PPI3)

    altnib1 = PPI3NC;

  else

    altnib1 = nib1;

  for (op = sh_table; op->name; op++)

    {

      if ((op->nibbles[1] == nib1 || op->nibbles[1] == altnib1)

	  && op->nibbles[2] == nib2

	  && op->nibbles[3] == nib3)

	{

	  int n;



	  switch (op->nibbles[4])

	    {

	    case HEX_0:

	      break;

	    case HEX_XX00:

	      if ((nib4 & 3) != 0)

		continue;

	      break;

	    case HEX_1:

	      if ((nib4 & 3) != 1)

		continue;

	      break;

	    case HEX_00YY:

	      if ((nib4 & 0xc) != 0)

		continue;

	      break;

	    case HEX_4:

	      if ((nib4 & 0xc) != 4)

		continue;

	      break;

	    default:

	      abort ();

	    }

	  fprintf_fn (stream, "%s%s\t", dc, op->name);

	  for (n = 0; n < 3 && op->arg[n] != A_END; n++)

	    {

	      if (n && op->arg[1] != A_END)

		fprintf_fn (stream, ",");

	      switch (op->arg[n])

		{

		case DSP_REG_N:

		  print_dsp_reg (field_b & 0xf, fprintf_fn, stream);

		  break;

		case DSP_REG_X:

		  fprintf_fn (stream, sx_tab[(field_b >> 6) & 3]);

		  break;

		case DSP_REG_Y:

		  fprintf_fn (stream, sy_tab[(field_b >> 4) & 3]);

		  break;

		case A_MACH:

		  fprintf_fn (stream, "mach");

		  break;

		case A_MACL:

		  fprintf_fn (stream, "macl");

		  break;

		default:

		  abort ();

		}

	    }

	  return;

	}

    }

  

  fprintf_fn (stream, ".word 0x%x", field_b);

}

FUNC_0 (int VAR_0, struct disassemble_info *VAR_1)

{

  static const char *VAR_2[] = { "x0", "x1", "a0", "a1" };

  static const char *VAR_3[] = { "y0", "y1", "m0", "m1" };

  fprintf_ftype fprintf_fn = VAR_1->fprintf_func;

  void *VAR_4 = VAR_1->VAR_4;

  unsigned int VAR_5, VAR_6, VAR_7;

  unsigned int VAR_8, VAR_9;

  const char *VAR_10 = NULL;

  const sh_opcode_info *VAR_11;



  if ((VAR_0 & 0xe800) == 0)

    {

      fprintf_fn (VAR_4, "psh%c\t#%d,",

		  VAR_0 & 0x1000 ? 'a' : 'l',

		  (VAR_0 >> 4) & 127);

      print_dsp_reg (VAR_0 & 0xf, fprintf_fn, VAR_4);

      return;

    }

  if ((VAR_0 & 0xc000) == 0x4000 && (VAR_0 & 0x3000) != 0x1000)

    {

      static const char *VAR_12[] = { "x0", "y0", "a0", "a1" };

      static const char *VAR_13[] = { "x0", "x1", "y0", "a1" };

      static const char *VAR_14[] = { "y0", "y1", "x0", "a1" };

      static const char *VAR_15[] = { "m0", "m1", "a0", "a1" };



      if (VAR_0 & 0x2000)

	{

	  fprintf_fn (VAR_4, "p%s %s,%s,%s\t",

		      (VAR_0 & 0x1000) ? "add" : "sub",

		      VAR_2[(VAR_0 >> 6) & 3],

		      VAR_3[(VAR_0 >> 4) & 3],

		      VAR_12[(VAR_0 >> 0) & 3]);

	}

      else if ((VAR_0 & 0xf0) == 0x10

	       && VAR_1->mach != bfd_mach_sh_dsp

	       && VAR_1->mach != bfd_mach_sh3_dsp)

	{

	  fprintf_fn (VAR_4, "pclr %s \t", VAR_12[(VAR_0 >> 0) & 3]);

	}

      else if ((VAR_0 & 0xf3) != 0)

	{

	  fprintf_fn (VAR_4, ".word 0x%x\t", VAR_0);

	}

      fprintf_fn (VAR_4, "pmuls%c%s,%s,%s",

		  VAR_0 & 0x2000 ? ' ' : '\t',

		  VAR_13[(VAR_0 >> 10) & 3],

		  VAR_14[(VAR_0 >>  8) & 3],

		  VAR_15[(VAR_0 >>  2) & 3]);

      return;

    }



  VAR_5 = PPIC;

  VAR_6 = VAR_0 >> 12 & 0xf;

  VAR_7 = VAR_0 >> 8 & 0xf;

  VAR_9 = VAR_0 >> 4 & 0xf;

  switch (VAR_7 & 0x3)

    {

    case 0:

      VAR_10 = "";

      VAR_5 = PPI3;

      break;

    case 1:

      VAR_10 = "";

      break;

    case 2:

      VAR_10 = "dct ";

      VAR_7 -= 1;

      break;

    case 3:

      VAR_10 = "dcf ";

      VAR_7 -= 2;

      break;

    }

  if (VAR_5 == PPI3)

    VAR_8 = PPI3NC;

  else

    VAR_8 = VAR_5;

  for (VAR_11 = sh_table; VAR_11->name; VAR_11++)

    {

      if ((VAR_11->nibbles[1] == VAR_5 || VAR_11->nibbles[1] == VAR_8)

	  && VAR_11->nibbles[2] == VAR_6

	  && VAR_11->nibbles[3] == VAR_7)

	{

	  int n;



	  switch (VAR_11->nibbles[4])

	    {

	    case HEX_0:

	      break;

	    case HEX_XX00:

	      if ((VAR_9 & 3) != 0)

		continue;

	      break;

	    case HEX_1:

	      if ((VAR_9 & 3) != 1)

		continue;

	      break;

	    case HEX_00YY:

	      if ((VAR_9 & 0xc) != 0)

		continue;

	      break;

	    case HEX_4:

	      if ((VAR_9 & 0xc) != 4)

		continue;

	      break;

	    default:

	      abort ();

	    }

	  fprintf_fn (VAR_4, "%s%s\t", VAR_10, VAR_11->name);

	  for (n = 0; n < 3 && VAR_11->arg[n] != A_END; n++)

	    {

	      if (n && VAR_11->arg[1] != A_END)

		fprintf_fn (VAR_4, ",");

	      switch (VAR_11->arg[n])

		{

		case DSP_REG_N:

		  print_dsp_reg (VAR_0 & 0xf, fprintf_fn, VAR_4);

		  break;

		case DSP_REG_X:

		  fprintf_fn (VAR_4, VAR_2[(VAR_0 >> 6) & 3]);

		  break;

		case DSP_REG_Y:

		  fprintf_fn (VAR_4, VAR_3[(VAR_0 >> 4) & 3]);

		  break;

		case A_MACH:

		  fprintf_fn (VAR_4, "mach");

		  break;

		case A_MACL:

		  fprintf_fn (VAR_4, "macl");

		  break;

		default:

		  abort ();

		}

	    }

	  return;

	}

    }

  

  fprintf_fn (VAR_4, ".word 0x%x", VAR_0);

}

FUNC_0 (int VAR_0, struct disassemble_info *VAR_1)
{ static const char *VAR_2[] = { "x0", "x1", "a0", "a1" }; static const char *VAR_3[] = { "y0", "y1", "m0", "m1" }; fprintf_ftype fprintf_fn = VAR_1->fprintf_func; void *VAR_4 = VAR_1->VAR_4; unsigned int VAR_5, VAR_6, VAR_7; unsigned int VAR_8, VAR_9; const char *VAR_10 = NULL; const sh_opcode_info *VAR_11; if ((VAR_0 & 0xe800) == 0)
{ fprintf_fn (VAR_4, "psh%c\t#%d,",
VAR_0 & 0x1000 ? 'a' : 'l',
(VAR_0 >> 4) & 127); print_dsp_reg (VAR_0 & 0xf, fprintf_fn, VAR_4); return; } if ((VAR_0 & 0xc000) == 0x4000 && (VAR_0 & 0x3000) != 0x1000)
{ static const char *VAR_12[] = { "x0", "y0", "a0", "a1" }; static const char *VAR_13[] = { "x0", "x1", "y0", "a1" }; static const char *VAR_14[] = { "y0", "y1", "x0", "a1" }; static const char *VAR_15[] = { "m0", "m1", "a0", "a1" }; if (VAR_0 & 0x2000)
{ fprintf_fn (VAR_4, "p%s %s,%s,%s\t",
(VAR_0 & 0x1000) ? "add" : "sub",
VAR_2[(VAR_0 >> 6) & 3],
VAR_3[(VAR_0 >> 4) & 3],
VAR_12[(VAR_0 >> 0) & 3]); } else if ((VAR_0 & 0xf0) == 0x10
&& VAR_1->mach != bfd_mach_sh_dsp
&& VAR_1->mach != bfd_mach_sh3_dsp)
{ fprintf_fn (VAR_4, "pclr %s \t", VAR_12[(VAR_0 >> 0) & 3]); } else if ((VAR_0 & 0xf3) != 0)
{ fprintf_fn (VAR_4, ".word 0x%x\t", VAR_0); } fprintf_fn (VAR_4, "pmuls%c%s,%s,%s",
VAR_0 & 0x2000 ? ' ' : '\t',
VAR_13[(VAR_0 >> 10) & 3],
VAR_14[(VAR_0 >>  8) & 3],
VAR_15[(VAR_0 >>  2) & 3]); return; } VAR_5 = PPIC; VAR_6 = VAR_0 >> 12 & 0xf; VAR_7 = VAR_0 >> 8 & 0xf; VAR_9 = VAR_0 >> 4 & 0xf; switch (VAR_7 & 0x3)
{ case 0:
VAR_10 = ""; VAR_5 = PPI3; break; case 1:
VAR_10 = ""; break; case 2:
VAR_10 = "dct "; VAR_7 -= 1; break; case 3:
VAR_10 = "dcf "; VAR_7 -= 2; break; } if (VAR_5 == PPI3)
VAR_8 = PPI3NC; else
VAR_8 = VAR_5; for (VAR_11 = sh_table; VAR_11->name; VAR_11++) { if ((VAR_11->nibbles[1] == VAR_5 || VAR_11->nibbles[1] == VAR_8)
&& VAR_11->nibbles[2] == VAR_6
&& VAR_11->nibbles[3] == VAR_7)
{ int n; switch (VAR_11->nibbles[4])
{ case HEX_0:
break; case HEX_XX00:
if ((VAR_9 & 3) != 0)
continue; break; case HEX_1:
if ((VAR_9 & 3) != 1)
continue; break; case HEX_00YY:
if ((VAR_9 & 0xc) != 0)
continue; break; case HEX_4:
if ((VAR_9 & 0xc) != 4)
continue; break; default:
abort (); } fprintf_fn (VAR_4, "%s%s\t", VAR_10, VAR_11->name); for (n = 0; n < 3 && VAR_11->arg[n] != A_END; n++) { if (n && VAR_11->arg[1] != A_END)
fprintf_fn (VAR_4, ","); switch (VAR_11->arg[n])
{ case DSP_REG_N:
print_dsp_reg (VAR_0 & 0xf, fprintf_fn, VAR_4); break; case DSP_REG_X:
fprintf_fn (VAR_4, VAR_2[(VAR_0 >> 6) & 3]); break; case DSP_REG_Y:
fprintf_fn (VAR_4, VAR_3[(VAR_0 >> 4) & 3]); break; case A_MACH:
fprintf_fn (VAR_4, "mach"); break; case A_MACL:
fprintf_fn (VAR_4, "macl"); break; default:
abort (); } } return; } } fprintf_fn (VAR_4, ".word 0x%x", VAR_0); }