aboutsummaryrefslogtreecommitdiff
path: root/sim/common/cgen-fpu.h
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-01-25 04:08:52 +0000
committerDoug Evans <dje@google.com>2010-01-25 04:08:52 +0000
commitd2c7a1a63b98c1add3d78ba71ffa9f2a105c1cd4 (patch)
tree316db26ddc7d8e6777c215b4fab82f90e7369a55 /sim/common/cgen-fpu.h
parent3fa5b97b27c907bf60b30bc0b7d7de56561b19c7 (diff)
downloadgdb-d2c7a1a63b98c1add3d78ba71ffa9f2a105c1cd4.zip
gdb-d2c7a1a63b98c1add3d78ba71ffa9f2a105c1cd4.tar.gz
gdb-d2c7a1a63b98c1add3d78ba71ffa9f2a105c1cd4.tar.bz2
common/
* cgen-accfp.c (fextsfdf): New arg how. All callers updated. (ftruncdfsf, floatsisf, flostsidf, ufloatsisf, fixsfsi, fixdfsi, ufixsfsi): Ditto. * cgen-fpu.h (CGEN_FPCONV_KIND): New enum. (struct cgen_fp_ops): Update signatures of floating point conversion operations. frv/ * sem.c: Regenerate. sh64/ * cpu.h: Regenerate.
Diffstat (limited to 'sim/common/cgen-fpu.h')
-rw-r--r--sim/common/cgen-fpu.h99
1 files changed, 56 insertions, 43 deletions
diff --git a/sim/common/cgen-fpu.h b/sim/common/cgen-fpu.h
index bc3364e..134b4d0 100644
--- a/sim/common/cgen-fpu.h
+++ b/sim/common/cgen-fpu.h
@@ -1,5 +1,6 @@
/* CGEN fpu support
- Copyright (C) 1999 Cygnus Solutions. */
+ Copyright (C) 1999 Cygnus Solutions.
+ Copyright (C) 2010 Doug Evans. */
#ifndef CGEN_FPU_H
#define CGEN_FPU_H
@@ -18,6 +19,18 @@ typedef struct { SI parts[4]; } TF;
#define TARGET_EXT_FP_WORDS 4
#endif
+/* Supported floating point conversion kinds (rounding modes).
+ FIXME: The IEEE rounding modes need to be implemented. */
+
+typedef enum {
+ FPCONV_DEFAULT = 0,
+ FPCONV_TIES_TO_EVEN = 1,
+ FPCONV_TIES_TO_AWAY = 2,
+ FPCONV_TOWARD_ZERO = 3,
+ FPCONV_TOWARD_POSITIVE = 4,
+ FPCONV_TOWARD_NEGATIVE = 5
+} CGEN_FPCONV_KIND;
+
/* forward decl */
typedef struct cgen_fp_ops CGEN_FP_OPS;
@@ -100,28 +113,28 @@ struct cgen_fp_ops {
/* SF/DF conversion ops */
- DF (*fextsfdf) (CGEN_FPU*, SF);
- SF (*ftruncdfsf) (CGEN_FPU*, DF);
+ DF (*fextsfdf) (CGEN_FPU*, int, SF);
+ SF (*ftruncdfsf) (CGEN_FPU*, int, DF);
- SF (*floatsisf) (CGEN_FPU*, SI);
- SF (*floatdisf) (CGEN_FPU*, DI);
- SF (*ufloatsisf) (CGEN_FPU*, USI);
- SF (*ufloatdisf) (CGEN_FPU*, UDI);
+ SF (*floatsisf) (CGEN_FPU*, int, SI);
+ SF (*floatdisf) (CGEN_FPU*, int, DI);
+ SF (*ufloatsisf) (CGEN_FPU*, int, USI);
+ SF (*ufloatdisf) (CGEN_FPU*, int, UDI);
- SI (*fixsfsi) (CGEN_FPU*, SF);
- DI (*fixsfdi) (CGEN_FPU*, SF);
- USI (*ufixsfsi) (CGEN_FPU*, SF);
- UDI (*ufixsfdi) (CGEN_FPU*, SF);
+ SI (*fixsfsi) (CGEN_FPU*, int, SF);
+ DI (*fixsfdi) (CGEN_FPU*, int, SF);
+ USI (*ufixsfsi) (CGEN_FPU*, int, SF);
+ UDI (*ufixsfdi) (CGEN_FPU*, int, SF);
- DF (*floatsidf) (CGEN_FPU*, SI);
- DF (*floatdidf) (CGEN_FPU*, DI);
- DF (*ufloatsidf) (CGEN_FPU*, USI);
- DF (*ufloatdidf) (CGEN_FPU*, UDI);
+ DF (*floatsidf) (CGEN_FPU*, int, SI);
+ DF (*floatdidf) (CGEN_FPU*, int, DI);
+ DF (*ufloatsidf) (CGEN_FPU*, int, USI);
+ DF (*ufloatdidf) (CGEN_FPU*, int, UDI);
- SI (*fixdfsi) (CGEN_FPU*, DF);
- DI (*fixdfdi) (CGEN_FPU*, DF);
- USI (*ufixdfsi) (CGEN_FPU*, DF);
- UDI (*ufixdfdi) (CGEN_FPU*, DF);
+ SI (*fixdfsi) (CGEN_FPU*, int, DF);
+ DI (*fixdfdi) (CGEN_FPU*, int, DF);
+ USI (*ufixdfsi) (CGEN_FPU*, int, DF);
+ UDI (*ufixdfdi) (CGEN_FPU*, int, DF);
/* XF mode support (kept separate 'cus not always present) */
@@ -146,20 +159,20 @@ struct cgen_fp_ops {
int (*gtxf) (CGEN_FPU*, XF, XF);
int (*gexf) (CGEN_FPU*, XF, XF);
- XF (*extsfxf) (CGEN_FPU*, SF);
- XF (*extdfxf) (CGEN_FPU*, DF);
- SF (*truncxfsf) (CGEN_FPU*, XF);
- DF (*truncxfdf) (CGEN_FPU*, XF);
+ XF (*extsfxf) (CGEN_FPU*, int, SF);
+ XF (*extdfxf) (CGEN_FPU*, int, DF);
+ SF (*truncxfsf) (CGEN_FPU*, int, XF);
+ DF (*truncxfdf) (CGEN_FPU*, int, XF);
- XF (*floatsixf) (CGEN_FPU*, SI);
- XF (*floatdixf) (CGEN_FPU*, DI);
- XF (*ufloatsixf) (CGEN_FPU*, USI);
- XF (*ufloatdixf) (CGEN_FPU*, UDI);
+ XF (*floatsixf) (CGEN_FPU*, int, SI);
+ XF (*floatdixf) (CGEN_FPU*, int, DI);
+ XF (*ufloatsixf) (CGEN_FPU*, int, USI);
+ XF (*ufloatdixf) (CGEN_FPU*, int, UDI);
- SI (*fixxfsi) (CGEN_FPU*, XF);
- DI (*fixxfdi) (CGEN_FPU*, XF);
- USI (*ufixxfsi) (CGEN_FPU*, XF);
- UDI (*ufixxfdi) (CGEN_FPU*, XF);
+ SI (*fixxfsi) (CGEN_FPU*, int, XF);
+ DI (*fixxfdi) (CGEN_FPU*, int, XF);
+ USI (*ufixxfsi) (CGEN_FPU*, int, XF);
+ UDI (*ufixxfdi) (CGEN_FPU*, int, XF);
/* TF mode support (kept separate 'cus not always present) */
@@ -184,20 +197,20 @@ struct cgen_fp_ops {
int (*gttf) (CGEN_FPU*, TF, TF);
int (*getf) (CGEN_FPU*, TF, TF);
- TF (*extsftf) (CGEN_FPU*, SF);
- TF (*extdftf) (CGEN_FPU*, DF);
- SF (*trunctfsf) (CGEN_FPU*, TF);
- DF (*trunctfdf) (CGEN_FPU*, TF);
+ TF (*extsftf) (CGEN_FPU*, int, SF);
+ TF (*extdftf) (CGEN_FPU*, int, DF);
+ SF (*trunctfsf) (CGEN_FPU*, int, TF);
+ DF (*trunctfdf) (CGEN_FPU*, int, TF);
- TF (*floatsitf) (CGEN_FPU*, SI);
- TF (*floatditf) (CGEN_FPU*, DI);
- TF (*ufloatsitf) (CGEN_FPU*, USI);
- TF (*ufloatditf) (CGEN_FPU*, UDI);
+ TF (*floatsitf) (CGEN_FPU*, int, SI);
+ TF (*floatditf) (CGEN_FPU*, int, DI);
+ TF (*ufloatsitf) (CGEN_FPU*, int, USI);
+ TF (*ufloatditf) (CGEN_FPU*, int, UDI);
- SI (*fixtfsi) (CGEN_FPU*, TF);
- DI (*fixtfdi) (CGEN_FPU*, TF);
- USI (*ufixtfsi) (CGEN_FPU*, TF);
- UDI (*ufixtfdi) (CGEN_FPU*, TF);
+ SI (*fixtfsi) (CGEN_FPU*, int, TF);
+ DI (*fixtfdi) (CGEN_FPU*, int, TF);
+ USI (*ufixtfsi) (CGEN_FPU*, int, TF);
+ UDI (*ufixtfdi) (CGEN_FPU*, int, TF);
};