Pass floating point structure address instead of the structure itself
[deliverable/binutils-gdb.git] / sim / tic80 / cpu.h
index e710364d0d1410bfb855549c0ea73f2896861b89..d8cfd0e12f92b88f4b6d5e37dbd9c319342339e3 100644 (file)
@@ -1,5 +1,5 @@
 /* TIc80 Simulator.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
@@ -151,7 +151,8 @@ struct _sim_cpu {
   sim_cpu_base base;
 };
 
-#define CPU_CIA(CPU) ((CPU)->cia)
+#define CIA_GET(CPU) ((CPU)->cia)
+#define CIA_SET(CPU,VAL) ((CPU)->cia = (VAL))
 
 #define GPR(N) ((CPU)->reg[N])
 #define GPR_SET(N, VAL) ((CPU)->reg[N] = (VAL))
@@ -162,12 +163,14 @@ struct _sim_cpu {
 
 #if defined(WITH_TRACE)
 extern char *tic80_trace_alu3    PARAMS ((int, unsigned32, unsigned32, unsigned32));
+extern char *tic80_trace_cmp     PARAMS ((int, unsigned32, unsigned32, unsigned32));
 extern char *tic80_trace_alu2    PARAMS ((int, unsigned32, unsigned32));
 extern char *tic80_trace_shift   PARAMS ((int, unsigned32, unsigned32, int, int, int, int, int));
-extern void tic80_trace_fpu3     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu, sim_fpu, sim_fpu));
-extern void tic80_trace_fpu2     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu, sim_fpu));
-extern void tic80_trace_fpu1     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu));
-extern void tic80_trace_fpu2i    PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, unsigned32, sim_fpu, sim_fpu));
+extern void tic80_trace_fpu3     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu *, sim_fpu *, sim_fpu *));
+extern void tic80_trace_fpu2     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu *, sim_fpu *));
+extern void tic80_trace_fpu1     PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, sim_fpu *));
+extern void tic80_trace_fpu2i    PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, unsigned32, sim_fpu *, sim_fpu *));
+extern void tic80_trace_fpu2cmp          PARAMS ((SIM_DESC, sim_cpu *, sim_cia, int, unsigned32, sim_fpu *, sim_fpu *));
 extern char *tic80_trace_nop     PARAMS ((int));
 extern char *tic80_trace_sink1   PARAMS ((int, unsigned32));
 extern char *tic80_trace_sink2   PARAMS ((int, unsigned32, unsigned32));
@@ -185,6 +188,15 @@ do {                                                                       \
   }                                                                    \
 } while (0)
 
+#define TRACE_CMP(indx, result, input1, input2)                                \
+do {                                                                   \
+  if (TRACE_ALU_P (CPU)) {                                             \
+    trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file,             \
+                   itable[indx].line_nr, "alu",                        \
+                   tic80_trace_cmp (indx, result, input1, input2));    \
+  }                                                                    \
+} while (0)
+
 #define TRACE_ALU2(indx, result, input)                                        \
 do {                                                                   \
   if (TRACE_ALU_P (CPU)) {                                             \
@@ -208,7 +220,7 @@ do {                                                                        \
 do {                                                                   \
   if (TRACE_FPU_P (CPU)) {                                             \
     tic80_trace_fpu3 (SD, CPU, cia, MY_INDEX,                          \
-                     result, input1, input2);                          \
+                     &result, &input1, &input2);                       \
   }                                                                    \
 } while (0)
 
@@ -216,7 +228,7 @@ do {                                                                        \
 do {                                                                   \
   if (TRACE_FPU_P (CPU)) {                                             \
     tic80_trace_fpu2 (SD, CPU, cia, MY_INDEX,                          \
-                     result, input);                                   \
+                     &result, &input);                                 \
   }                                                                    \
 } while (0)
 
@@ -224,7 +236,7 @@ do {                                                                        \
 do {                                                                   \
   if (TRACE_FPU_P (CPU)) {                                             \
     tic80_trace_fpu1 (SD, CPU, cia, MY_INDEX,                          \
-                     result);                                          \
+                     &result);                                         \
   }                                                                    \
 } while (0)
 
@@ -232,7 +244,15 @@ do {                                                                       \
 do {                                                                   \
   if (TRACE_FPU_P (CPU)) {                                             \
     tic80_trace_fpu2i (SD, CPU, cia, MY_INDEX,                                 \
-                     result, input1, input2);                          \
+                      result, &input1, &input2);                       \
+  }                                                                    \
+} while (0)
+
+#define TRACE_FPU2CMP(result, input1, input2)                          \
+do {                                                                   \
+  if (TRACE_FPU_P (CPU)) {                                             \
+    tic80_trace_fpu2cmp (SD, CPU, cia, MY_INDEX,                       \
+                        result, &input1, &input2);                     \
   }                                                                    \
 } while (0)
 
@@ -283,7 +303,7 @@ do {                                                                        \
 
 #define TRACE_UCOND_BR(indx, target)                                   \
 do {                                                                   \
-  if (TRACE_ALU_P (CPU)) {                                             \
+  if (TRACE_BRANCH_P (CPU)) {                                          \
     trace_one_insn (SD, CPU, cia.ip, 1, itable[indx].file,             \
                    itable[indx].line_nr, "branch",                     \
                    tic80_trace_ucond_br (indx, target));               \
This page took 0.024783 seconds and 4 git commands to generate.