Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joern Rennecke <joern.rennecke@superh.com>
To: msnyder@redhat.com (Michael Snyder)
Cc: joern.rennecke@superh.com, amylaar@fairadsl.co.uk,
	andrew.stubbs@superh.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Add sh4a to sh-sim (2nd iteration)
Date: Thu, 08 Jan 2004 16:15:00 -0000	[thread overview]
Message-ID: <200401081615.i08GF1M05415@linsvr1.uk.superh.com> (raw)
In-Reply-To: <3FFC8098.7080000@redhat.com> from "Michael Snyder" at Jan 07, 2004 01:56:40

> 	(expand_ppi_code): Flatten loop for simplicity, tweak for 12-bit
> 	instead of 8-bit table (some insns are ambiguous to 8 bits).

You are converting iteration into recursion - I don't see what is flat about
deep recursion.


> --- gencode.c	7 Jan 2004 21:38:26 -0000
> ***************
> *** 1,4 ****
> ! /* Simulator/Opcode generator for the Hitachi Super-H architecture.
>   
>      Written by Steve Chamberlain of Cygnus Support.
>      sac@cygnus.com
> --- 1,5 ----
> ! /* Simulator/Opcode generator for the Renesas
> !    (formerly Hitachi) Super-H architecture.
>   
>      Written by Steve Chamberlain of Cygnus Support.
>      sac@cygnus.com

That should be Renesas (formerly Hitachi) / SuperH Inc SuperH architecture.

> +   /* sh4a */
> +   { "", "", "ftrv <FV_N>", "1111vv0111111101",
> +     "if (FPSCR_PR)",
> +     "  RAISE_EXCEPTION (SIGILL);",
> +     "else",
> +     "{", 
> +     "  /* FIXME not implemented.  */",
> +     "  printf (\"ftrv xmtrx, FV%d\\n\", v1);",
> +     "}", 
> +   },


ftrv is an sh4 instruction.

>     { "n", "n", "ldc.l @<REG_N>+,DBR", "0100nnnn11110110",
>       "MA (1);",
>       "DBR = RLAT (R[n]);",
>       "R[n] += 4;",
>       "/* FIXME: user mode */",
>     },
> !   { "n", "n", "ldc.l @<REG_N>+,DBR", "0100nnnn11110110",
> !     "if (SR_MD)",
> !     "{ /* priv mode */",
> !     "  MA (1);",
> !     "  DBR = RLAT (R[n]);",
> !     "  R[n] += 4;",
> !     "}",
> !     "else",
> !     "  RAISE_EXCEPTION (SIGILL); /* user mode */",
> !   },

Why do you keep the old "ldc.l @<REG_N>+,DBR" version around?

> !   { "", "mn", "mul.l <REG_M>,<REG_N>", "0000nnnnmmmm0111",
> !     "MACL = ((int) R[n]) * ((int) R[m]);",
>     },

The #if 0 was left there as a reminder that the casts to int are not fully
portable.  The casts should be replaced with the SEXT32 macro.

> !   { "", "n", "movx.w @<REG_xy>,<DSP_XY>",   "111100xyXY0001??",
>       "DSP_R (m) = RSWAT (R[n]) << 16;",
> !     "if (iword & 3)",
> !     "  {",
> !     "    iword &= 0xfd53; goto top;",
> !     "  }",
> !   },

I think I understand the way the new move instructions were added a bit
better now.
The implementation could be made faster by having the movx/nopy
patterns separate, but I suppose speed is not such an issue for sh-dsp
simulation, seeing that we don't have time-intensive testcases that
use dsp move instructions.

> *************** op ppi_tab[] =
> *** 1379,1385 ****
>       "COMPUTE_OVERFLOW;",
>       "greater_equal = 0;",
>     },
> !   { "","", "pmuls Se,Sf,Dg",	"0100eeffxxyygguu",
>       "res = (DSP_R (e) >> 16) * (DSP_R (f) >> 16) * 2;",
>       "if (res == 0x80000000)",
>       "  res = 0x7fffffff;",
> --- 1581,1587 ----
>       "COMPUTE_OVERFLOW;",
>       "greater_equal = 0;",
>     },
> !   { "","", "pmuls Se,Sf,Dg",	"0100eeff0000gguu",
>       "res = (DSP_R (e) >> 16) * (DSP_R (f) >> 16) * 2;",
>       "if (res == 0x80000000)",
>       "  res = 0x7fffffff;",

According to the sh2-dsp manual that is still at the Renesas web site,
the xx / yy fields are still present in the pmuls instruction.

>     printf ("ppi_insn (iword)\n");
>     printf ("     int iword;\n");
>     printf ("{\n");
> +   printf ("  /* 'ee' = [x0, x1, y0, a1] (FIXME [x0, x1, a1, m1]) */\n");
>     printf ("  static char e_tab[] = { 8,  9, 10,  5};\n");
> +   printf ("  /* 'ff' = [y0, y1, x0, a1] (FIXME [y0, y1, a1, m1]) */\n");
>     printf ("  static char f_tab[] = {10, 11,  8,  5};\n");
> +   printf ("  /* 'xx'(?) = [x0, x1, a0, a1]  */\n");
>     printf ("  static char x_tab[] = { 8,  9,  7,  5};\n");
> +   printf ("  /* 'yy'(?) = [y0, y1, m0, m1]  */\n");
>     printf ("  static char y_tab[] = {10, 11, 12, 14};\n");
> +   printf ("  /* 'gg' = [m0, m1, a0, a1]  */\n");
>     printf ("  static char g_tab[] = {12, 14,  7,  5};\n");
> +   printf ("  /* 'uu' = [x0, y0, a0, a1]  (FIXME [m1, x1, a0, a1]) */\n");
>     printf ("  static char u_tab[] = { 8, 10,  7,  5};\n");

What are theses FIXMEs supposed to mean?


  parent reply	other threads:[~2004-01-08 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-07 21:56 Michael Snyder
2004-01-07 22:04 ` [RFA] Add sh4a tests to sim/testsuite/sim/sh Michael Snyder
2004-01-08 15:07   ` Joern Rennecke
2004-01-08 22:04     ` Michael Snyder
2004-01-09 13:19   ` Joern Rennecke
2004-01-09 19:47     ` Michael Snyder
2004-01-10  0:46     ` [PATCH] sim/sh whitespace cleanup Michael Snyder
2004-01-13 20:00     ` [OB] fix array size in sh-dis.c Michael Snyder
2004-01-13 23:23       ` Andrew Cagney
2004-01-14 17:14       ` Joern Rennecke
2004-01-08 16:15 ` Joern Rennecke [this message]
2004-01-08 22:02   ` [RFA] Add sh4a to sh-sim (2nd iteration) Michael Snyder
2004-01-09 12:37     ` Joern Rennecke
2004-01-09 19:45       ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401081615.i08GF1M05415@linsvr1.uk.superh.com \
    --to=joern.rennecke@superh.com \
    --cc=amylaar@fairadsl.co.uk \
    --cc=andrew.stubbs@superh.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox