aboutsummaryrefslogtreecommitdiff
path: root/sim/common/cgen-accfp.c
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/cgen-accfp.c
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/cgen-accfp.c')
-rw-r--r--sim/common/cgen-accfp.c24
1 files changed, 24 insertions, 0 deletions
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;
}