sim: cgen: add remainder functions (needed for OR1K lf.rem.[sd])

* sim/common/ChangeLog:

2017-12-12  Peter Gavin  <pgavin@gmail.com>
	    Stafford Horne <shorne@gmail.com>

	* cgen-accfp.c (remsf, remdf): New function.
	(cgen_init_accurate_fpu): Add remsf and remdf.
	* cgen-fpu.h (cgen_fp_ops): Add remsf, remdf, remxf and remtf.
	* sim-fpu.c (sim_fpu_rem): New function.
	* sim-fpu.h (sim_fpu_status_invalid_irx): New enum.
	(sim_fpu_rem): New function.
	(sim_fpu_print_status): Add case for sim_fpu_status_invalid_irx.
This commit is contained in:
Peter Gavin
2017-12-09 05:57:25 +09:00
committed by Stafford Horne
parent 638d913757
commit 07b95864f3
5 changed files with 149 additions and 5 deletions

View File

@ -146,11 +146,12 @@ typedef enum
sim_fpu_status_invalid_div0 = 128, /* (X / 0) */
sim_fpu_status_invalid_cmp = 256, /* compare */
sim_fpu_status_invalid_sqrt = 512,
sim_fpu_status_rounded = 1024,
sim_fpu_status_inexact = 2048,
sim_fpu_status_overflow = 4096,
sim_fpu_status_underflow = 8192,
sim_fpu_status_denorm = 16384,
sim_fpu_status_invalid_irx = 1024, /* (inf % X) */
sim_fpu_status_rounded = 2048,
sim_fpu_status_inexact = 4096,
sim_fpu_status_overflow = 8192,
sim_fpu_status_underflow = 16384,
sim_fpu_status_denorm = 32768,
} sim_fpu_status;
@ -230,6 +231,8 @@ INLINE_SIM_FPU (int) sim_fpu_mul (sim_fpu *f,
const sim_fpu *l, const sim_fpu *r);
INLINE_SIM_FPU (int) sim_fpu_div (sim_fpu *f,
const sim_fpu *l, const sim_fpu *r);
INLINE_SIM_FPU (int) sim_fpu_rem (sim_fpu *f,
const sim_fpu *l, const sim_fpu *r);
INLINE_SIM_FPU (int) sim_fpu_max (sim_fpu *f,
const sim_fpu *l, const sim_fpu *r);
INLINE_SIM_FPU (int) sim_fpu_min (sim_fpu *f,