diff options
Diffstat (limited to 'sim/common/cgen-accfp.c')
-rw-r--r-- | sim/common/cgen-accfp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c index e917522..929dd22 100644 --- a/sim/common/cgen-accfp.c +++ b/sim/common/cgen-accfp.c @@ -284,6 +284,30 @@ gesf (CGEN_FPU* fpu, SF x, SF y) return sim_fpu_is_ge (&op1, &op2); } +static DF +fextsfdf (CGEN_FPU* fpu, SF x) +{ + sim_fpu op1; + unsigned64 res; + + sim_fpu_32to (&op1, x); + sim_fpu_to64 (&res, &op1); + + return res; +} + +static SF +ftruncdfsf (CGEN_FPU* fpu, DF x) +{ + sim_fpu op1; + unsigned32 res; + + sim_fpu_64to (&op1, x); + sim_fpu_to32 (&res, &op1); + + return res; +} + static SF floatsisf (CGEN_FPU* fpu, SI x) { @@ -671,6 +695,8 @@ cgen_init_accurate_fpu (SIM_CPU* cpu, CGEN_FPU* fpu, CGEN_FPU_ERROR_FN* error) o->ledf = ledf; o->gtdf = gtdf; o->gedf = gedf; + o->fextsfdf = fextsfdf; + o->ftruncdfsf = ftruncdfsf; o->floatsisf = floatsisf; o->floatsidf = floatsidf; o->ufloatsisf = ufloatsisf; |