aboutsummaryrefslogtreecommitdiff
path: root/sim/tic80/misc.c
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1997-05-11 14:32:32 +0000
committerMichael Meissner <gnu@the-meissners.org>1997-05-11 14:32:32 +0000
commit450be2349aa1beda81274be407713657f457ef50 (patch)
treefe98ee6fdf24fbef51e70df9717e9669aaf548ff /sim/tic80/misc.c
parent20b2f9bc83913de6065a40c14c7cb7c96e7bb8d1 (diff)
downloadgdb-450be2349aa1beda81274be407713657f457ef50.zip
gdb-450be2349aa1beda81274be407713657f457ef50.tar.gz
gdb-450be2349aa1beda81274be407713657f457ef50.tar.bz2
Fix shift/lmo insns; Subu does arithmetic unsigned
Diffstat (limited to 'sim/tic80/misc.c')
-rw-r--r--sim/tic80/misc.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/sim/tic80/misc.c b/sim/tic80/misc.c
index 9359fe2..b9af1b8 100644
--- a/sim/tic80/misc.c
+++ b/sim/tic80/misc.c
@@ -168,12 +168,62 @@ tic80_trace_alu2 (int indx,
sprintf (tic80_trace_buffer, "%-*s 0x%.*lx/%*ld %*s => 0x%.*lx/%*ld",
tic80_size_name, itable[indx].name,
SIZE_HEX, input, SIZE_DECIMAL, (long)(signed32)input,
- SIZE_HEX + SIZE_DECIMAL + 2, "",
+ SIZE_HEX + SIZE_DECIMAL + 3, "",
SIZE_HEX, result, SIZE_DECIMAL, (long)(signed32)result);
return tic80_trace_buffer;
}
+/* Trace the result of a shift instruction */
+char *
+tic80_trace_shift (int indx,
+ unsigned32 result,
+ unsigned32 input,
+ int i,
+ int n,
+ int merge,
+ int endmask,
+ int rotate)
+{
+ const char *merge_name;
+ char name[40];
+ char *p;
+
+ if (!tic80_size_name)
+ tic80_init_trace ();
+
+ switch (merge)
+ {
+ default: merge_name = ".??"; break;
+ case 0: merge_name = ".dz"; break;
+ case 1: merge_name = ".dm"; break;
+ case 2: merge_name = ".ds"; break;
+ case 3: merge_name = ".ez"; break;
+ case 4: merge_name = ".em"; break;
+ case 5: merge_name = ".es"; break;
+ case 6: merge_name = ".iz"; break;
+ case 7: merge_name = ".im"; break;
+ }
+
+ /* Don't use itable[indx].name, which is just sl {r,i}. Instead reconstruct
+ the name, using the i and n fields. */
+ p = strchr (itable[indx].name, ' ');
+ sprintf (name, "s%s%s%s%s",
+ (n) ? "r" : "l",
+ (i) ? "i" : "",
+ merge_name,
+ (p) ? p : "");
+
+ sprintf (tic80_trace_buffer, "%-*s 0x%.*lx/%*ld %*s%2d,%2d => 0x%.*lx/%*ld",
+ tic80_size_name, name,
+ SIZE_HEX, input, SIZE_DECIMAL, (long)(signed32)input,
+ SIZE_HEX + SIZE_DECIMAL - 2, "",
+ rotate, endmask,
+ SIZE_HEX, result, SIZE_DECIMAL, (long)(signed32)result);
+
+ return tic80_trace_buffer;
+}
+
/* Trace the result of an FPU operation with 2 floating point inputs and a floating point output */
void
tic80_trace_fpu3 (SIM_DESC sd,