aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2002-01-31 17:55:16 +0000
committerHans-Peter Nilsson <hp@axis.com>2002-01-31 17:55:16 +0000
commitdea03d4e101d4d52a1fda4680794d4ceec1cfc55 (patch)
tree4ad85e60547aa571cd19ab060dfad5ae2f46b44e
parent3b16e843f2a75ccf8e7ecc5102e1217a122a05ad (diff)
downloadgdb-dea03d4e101d4d52a1fda4680794d4ceec1cfc55.zip
gdb-dea03d4e101d4d52a1fda4680794d4ceec1cfc55.tar.gz
gdb-dea03d4e101d4d52a1fda4680794d4ceec1cfc55.tar.bz2
* cgen-ops.h (ADDCQI, ADDCFQI, ADDOFQI, SUBCQI, SUBCFQI, SUBOFQI):
New functions.
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/cgen-ops.h55
2 files changed, 59 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 7da3724..967feb6 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-31 Hans-Peter Nilsson <hp@axis.com>
+
+ * cgen-ops.h (ADDCQI, ADDCFQI, ADDOFQI, SUBCQI, SUBCFQI, SUBOFQI):
+ New functions.
+
2002-01-20 Ben Elliston <bje@redhat.com>
* sim-fpu.h (SIM_FPU_IS_QNAN): Replace "Quite" with "Quiet" in
diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h
index 2ce1b12..9a8c909 100644
--- a/sim/common/cgen-ops.h
+++ b/sim/common/cgen-ops.h
@@ -1,5 +1,5 @@
/* Semantics ops support for CGEN-based simulators.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This file is part of the GNU Simulators.
@@ -581,6 +581,53 @@ SUBOFHI (HI a, HI b, BI c)
return res;
}
+SEMOPS_INLINE QI
+ADDCQI (QI a, QI b, BI c)
+{
+ QI res = ADDQI (a, ADDQI (b, c));
+ return res;
+}
+
+SEMOPS_INLINE BI
+ADDCFQI (QI a, QI b, BI c)
+{
+ QI tmp = ADDQI (a, ADDQI (b, c));
+ BI res = ((UQI) tmp < (UQI) a) || (c && tmp == a);
+ return res;
+}
+
+SEMOPS_INLINE BI
+ADDOFQI (QI a, QI b, BI c)
+{
+ QI tmp = ADDQI (a, ADDQI (b, c));
+ BI res = (((a < 0) == (b < 0))
+ && ((a < 0) != (tmp < 0)));
+ return res;
+}
+
+SEMOPS_INLINE QI
+SUBCQI (QI a, QI b, BI c)
+{
+ QI res = SUBQI (a, ADDQI (b, c));
+ return res;
+}
+
+SEMOPS_INLINE BI
+SUBCFQI (QI a, QI b, BI c)
+{
+ BI res = ((UQI) a < (UQI) b) || (c && a == b);
+ return res;
+}
+
+SEMOPS_INLINE BI
+SUBOFQI (QI a, QI b, BI c)
+{
+ QI tmp = SUBQI (a, ADDQI (b, c));
+ BI res = (((a < 0) != (b < 0))
+ && ((a < 0) != (tmp < 0)));
+ return res;
+}
+
#else
SI ADDCSI (SI, SI, BI);
@@ -595,6 +642,12 @@ UBI ADDOFHI (HI, HI, BI);
HI SUBCHI (HI, HI, BI);
UBI SUBCFHI (HI, HI, BI);
UBI SUBOFHI (HI, HI, BI);
+QI ADDCQI (QI, QI, BI);
+UBI ADDCFQI (QI, QI, BI);
+UBI ADDOFQI (QI, QI, BI);
+QI SUBCQI (QI, QI, BI);
+UBI SUBCFQI (QI, QI, BI);
+UBI SUBOFQI (QI, QI, BI);
#endif