aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-07-07 17:31:57 +0000
committerJason Molenda <jmolenda@apple.com>1999-07-07 17:31:57 +0000
commit9846de1bb5d61521885ef51fa6b99121ec1be577 (patch)
tree56c938421752cf160876766aaee7e729a8e47050 /sim/common
parentf04894943e847e4c9dec6a7a73b9e03a3c0aa90a (diff)
downloadgdb-9846de1bb5d61521885ef51fa6b99121ec1be577.zip
gdb-9846de1bb5d61521885ef51fa6b99121ec1be577.tar.gz
gdb-9846de1bb5d61521885ef51fa6b99121ec1be577.tar.bz2
import gdb-1999-07-07 pre reformat
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog13
-rw-r--r--sim/common/cgen-accfp.c24
-rw-r--r--sim/common/dv-sockser.c1
-rw-r--r--sim/common/sim-model.c7
4 files changed, 45 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index d8847c6..5f702b0 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,16 @@
+Wed Jul 7 19:56:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * dv-sockser.c (connected_p): Initialize addrlen.
+
+1999-07-06 Dave Brolley <brolley@cygnus.com>
+
+ * cgen-accfp.c (floatsidf): New function.
+ (fixdfsi): New function.
+
+1999-07-06 Doug Evans <devans@casey.cygnus.com>
+
+ * sim-model.c (sim_model_init): Issue error if machine is unsupported.
+
1999-07-05 Doug Evans <devans@casey.cygnus.com>
* Make-common.in (CGEN_MAIN_CPU_DEPS): Add cgen-fpu.h.
diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c
index 8c7b4f4..9ce204f 100644
--- a/sim/common/cgen-accfp.c
+++ b/sim/common/cgen-accfp.c
@@ -268,6 +268,17 @@ floatsisf (CGEN_FPU* fpu, SI x)
return res;
}
+static DF
+floatsidf (CGEN_FPU* fpu, SI x)
+{
+ sim_fpu ans;
+ unsigned64 res;
+
+ sim_fpu_i32to (&ans, x, sim_fpu_round_near);
+ sim_fpu_to64 (&res, &ans);
+ return res;
+}
+
static SF
ufloatsisf (CGEN_FPU* fpu, USI x)
{
@@ -290,6 +301,17 @@ fixsfsi (CGEN_FPU* fpu, SF x)
return res;
}
+static SI
+fixdfsi (CGEN_FPU* fpu, DF x)
+{
+ sim_fpu op1;
+ unsigned32 res;
+
+ sim_fpu_64to (&op1, x);
+ sim_fpu_to32i (&res, &op1, sim_fpu_round_near);
+ return res;
+}
+
static USI
ufixsfsi (CGEN_FPU* fpu, SF x)
{
@@ -596,7 +618,9 @@ cgen_init_accurate_fpu (SIM_CPU* cpu, CGEN_FPU* fpu, CGEN_FPU_ERROR_FN* error)
o->gtdf = gtdf;
o->gedf = gedf;
o->floatsisf = floatsisf;
+ o->floatsidf = floatsidf;
o->ufloatsisf = ufloatsisf;
o->fixsfsi = fixsfsi;
+ o->fixdfsi = fixdfsi;
o->ufixsfsi = ufixsfsi;
}
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index c95288c..fb457d4 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -268,6 +268,7 @@ connected_p (SIM_DESC sd)
if (numfds <= 0)
return 0;
+ addrlen = sizeof (sockaddr);
sockser_fd = accept (sockser_listen_fd, &sockaddr, &addrlen);
if (sockser_fd < 0)
return 0;
diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c
index a126fb1..8037dcd 100644
--- a/sim/common/sim-model.c
+++ b/sim/common/sim-model.c
@@ -197,6 +197,13 @@ sim_model_init (SIM_DESC sd)
/* Use the default model for the selected machine.
The default model is the first one in the list. */
const MACH *mach = sim_mach_lookup_bfd_name (STATE_ARCHITECTURE (sd)->printable_name);
+
+ if (mach == NULL)
+ {
+ sim_io_eprintf (sd, "unsupported machine `%s'\n",
+ STATE_ARCHITECTURE (sd)->printable_name);
+ return SIM_RC_FAIL;
+ }
sim_model_set (sd, NULL, MACH_MODELS (mach));
}
else