aboutsummaryrefslogtreecommitdiff
path: root/sim/common
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
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')
-rw-r--r--sim/common/ChangeLog7
-rw-r--r--sim/common/cgen-accfp.c16
-rw-r--r--sim/common/cgen-fpu.h99
3 files changed, 71 insertions, 51 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 2f62553..d30e8fd 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,12 @@
2010-01-24 Doug Evans <dje@sebabeach.org>
+ * 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.
+
* Make-common.in (CGEN_SIM_DEPS): Define.
(CGEN_INCLUDE_DEPS): Use it.
(CGEN_MAIN_CPU_DEPS): Simplify.
diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c
index 929dd22..afbca6d 100644
--- a/sim/common/cgen-accfp.c
+++ b/sim/common/cgen-accfp.c
@@ -285,7 +285,7 @@ gesf (CGEN_FPU* fpu, SF x, SF y)
}
static DF
-fextsfdf (CGEN_FPU* fpu, SF x)
+fextsfdf (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
unsigned64 res;
@@ -297,7 +297,7 @@ fextsfdf (CGEN_FPU* fpu, SF x)
}
static SF
-ftruncdfsf (CGEN_FPU* fpu, DF x)
+ftruncdfsf (CGEN_FPU* fpu, int how UNUSED, DF x)
{
sim_fpu op1;
unsigned32 res;
@@ -309,7 +309,7 @@ ftruncdfsf (CGEN_FPU* fpu, DF x)
}
static SF
-floatsisf (CGEN_FPU* fpu, SI x)
+floatsisf (CGEN_FPU* fpu, int how UNUSED, SI x)
{
sim_fpu ans;
unsigned32 res;
@@ -320,7 +320,7 @@ floatsisf (CGEN_FPU* fpu, SI x)
}
static DF
-floatsidf (CGEN_FPU* fpu, SI x)
+floatsidf (CGEN_FPU* fpu, int how UNUSED, SI x)
{
sim_fpu ans;
unsigned64 res;
@@ -331,7 +331,7 @@ floatsidf (CGEN_FPU* fpu, SI x)
}
static SF
-ufloatsisf (CGEN_FPU* fpu, USI x)
+ufloatsisf (CGEN_FPU* fpu, int how UNUSED, USI x)
{
sim_fpu ans;
unsigned32 res;
@@ -342,7 +342,7 @@ ufloatsisf (CGEN_FPU* fpu, USI x)
}
static SI
-fixsfsi (CGEN_FPU* fpu, SF x)
+fixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
unsigned32 res;
@@ -353,7 +353,7 @@ fixsfsi (CGEN_FPU* fpu, SF x)
}
static SI
-fixdfsi (CGEN_FPU* fpu, DF x)
+fixdfsi (CGEN_FPU* fpu, int how UNUSED, DF x)
{
sim_fpu op1;
unsigned32 res;
@@ -364,7 +364,7 @@ fixdfsi (CGEN_FPU* fpu, DF x)
}
static USI
-ufixsfsi (CGEN_FPU* fpu, SF x)
+ufixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x)
{
sim_fpu op1;
unsigned32 res;
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);
};