aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-07-19 23:30:11 +0000
committerJason Molenda <jmolenda@apple.com>1999-07-19 23:30:11 +0000
commitadf40b2e16832f7382ee79e498d43a70ad22e305 (patch)
tree933de2a465a4003b9016471a466079459693ae3e /sim/common
parentdc9e099fc0eced486ae2b49455c9da113c11f4ff (diff)
downloadgdb-adf40b2e16832f7382ee79e498d43a70ad22e305.zip
gdb-adf40b2e16832f7382ee79e498d43a70ad22e305.tar.gz
gdb-adf40b2e16832f7382ee79e498d43a70ad22e305.tar.bz2
import gdb-1999-07-19 snapshot
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog10
-rw-r--r--sim/common/Makefile.in4
-rw-r--r--sim/common/cgen-mem.h104
-rw-r--r--sim/common/cgen-utils.c35
4 files changed, 99 insertions, 54 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 3c6a9f0..bc2bb01 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,13 @@
+Fri Jul 16 14:47:53 1999 Dave Brolley <brolley@cygnus.com>
+
+ * cgen-utils.c (RORSI): New function.
+ (ROLSI): New function.
+
+1999-07-14 Doug Evans <devans@casey.cygnus.com>
+
+ * Makefile.in (TAGS): Tweak TAGS regex.
+ * cgen-mem.h (*): Add TAGS markers.
+
Sun Jul 11 23:47:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
* sim-resume.c (sim_resume): Ensure that the siggnal [sic] is only
diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
index dd7c5e0..6428082 100644
--- a/sim/common/Makefile.in
+++ b/sim/common/Makefile.in
@@ -103,8 +103,8 @@ tags etags: TAGS
# And the sim-n-foo.h files create functions that can't be found either.
TAGS: force
cd $(srcdir) && \
- etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
- *.[ch]
+ etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^.*\/[*] TAGS: .*/' \
+ *.c *.h
clean:
rm -f *.[oa] *~ core
diff --git a/sim/common/cgen-mem.h b/sim/common/cgen-mem.h
index b424bba..186adc6 100644
--- a/sim/common/cgen-mem.h
+++ b/sim/common/cgen-mem.h
@@ -47,14 +47,14 @@ XCONCAT2 (GETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a) \
extern mode XCONCAT2 (GETMEM,mode) (SIM_CPU *, IADDR, ADDR);
#endif
-DECLARE_GETMEM (QI, 1)
-DECLARE_GETMEM (UQI, 1)
-DECLARE_GETMEM (HI, 2)
-DECLARE_GETMEM (UHI, 2)
-DECLARE_GETMEM (SI, 4)
-DECLARE_GETMEM (USI, 4)
-DECLARE_GETMEM (DI, 8)
-DECLARE_GETMEM (UDI, 8)
+DECLARE_GETMEM (QI, 1) /* TAGS: GETMEMQI */
+DECLARE_GETMEM (UQI, 1) /* TAGS: GETMEMUQI */
+DECLARE_GETMEM (HI, 2) /* TAGS: GETMEMHI */
+DECLARE_GETMEM (UHI, 2) /* TAGS: GETMEMUHI */
+DECLARE_GETMEM (SI, 4) /* TAGS: GETMEMSI */
+DECLARE_GETMEM (USI, 4) /* TAGS: GETMEMUSI */
+DECLARE_GETMEM (DI, 8) /* TAGS: GETMEMDI */
+DECLARE_GETMEM (UDI, 8) /* TAGS: GETMEMUDI */
#undef DECLARE_GETMEM
@@ -74,14 +74,14 @@ XCONCAT2 (SETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a, mode val) \
extern void XCONCAT2 (SETMEM,mode) (SIM_CPU *, IADDR, ADDR, mode);
#endif
-DECLARE_SETMEM (QI, 1)
-DECLARE_SETMEM (UQI, 1)
-DECLARE_SETMEM (HI, 2)
-DECLARE_SETMEM (UHI, 2)
-DECLARE_SETMEM (SI, 4)
-DECLARE_SETMEM (USI, 4)
-DECLARE_SETMEM (DI, 8)
-DECLARE_SETMEM (UDI, 8)
+DECLARE_SETMEM (QI, 1) /* TAGS: SETMEMQI */
+DECLARE_SETMEM (UQI, 1) /* TAGS: SETMEMUQI */
+DECLARE_SETMEM (HI, 2) /* TAGS: SETMEMHI */
+DECLARE_SETMEM (UHI, 2) /* TAGS: SETMEMUHI */
+DECLARE_SETMEM (SI, 4) /* TAGS: SETMEMSI */
+DECLARE_SETMEM (USI, 4) /* TAGS: SETMEMUSI */
+DECLARE_SETMEM (DI, 8) /* TAGS: SETMEMDI */
+DECLARE_SETMEM (UDI, 8) /* TAGS: SETMEMUDI */
#undef DECLARE_SETMEM
@@ -101,10 +101,10 @@ XCONCAT2 (GETIMEM,mode) (SIM_CPU *cpu, IADDR a) \
extern mode XCONCAT2 (GETIMEM,mode) (SIM_CPU *, ADDR);
#endif
-DECLARE_GETIMEM (UQI, 1)
-DECLARE_GETIMEM (UHI, 2)
-DECLARE_GETIMEM (USI, 4)
-DECLARE_GETIMEM (UDI, 8)
+DECLARE_GETIMEM (UQI, 1) /* TAGS: GETIMEMUQI */
+DECLARE_GETIMEM (UHI, 2) /* TAGS: GETIMEMUHI */
+DECLARE_GETIMEM (USI, 4) /* TAGS: GETIMEMUSI */
+DECLARE_GETIMEM (UDI, 8) /* TAGS: GETIMEMUDI */
#undef DECLARE_GETIMEM
@@ -132,8 +132,8 @@ XCONCAT2 (GETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a) \
extern mode XCONCAT2 (GETMEM,mode) (SIM_CPU *, IADDR, ADDR);
#endif
-DECLARE_GETMEM (SF, 4)
-DECLARE_GETMEM (DF, 8)
+DECLARE_GETMEM (SF, 4) /* TAGS: GETMEMSF */
+DECLARE_GETMEM (DF, 8) /* TAGS: GETMEMDF */
#undef DECLARE_GETMEM
@@ -151,8 +151,8 @@ XCONCAT2 (SETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a, mode val) \
extern void XCONCAT2 (SETMEM,mode) (SIM_CPU *, IADDR, ADDR, mode);
#endif
-DECLARE_SETMEM (SF, 4)
-DECLARE_SETMEM (DF, 8)
+DECLARE_SETMEM (SF, 4) /* TAGS: SETMEMSF */
+DECLARE_SETMEM (DF, 8) /* TAGS: SETMEMDF */
#undef DECLARE_SETMEM
@@ -174,20 +174,20 @@ XCONCAT2 (GETT,mode) (unsigned char *p) \
extern mode XCONCAT2 (GETT,mode) (unsigned char *);
#endif
-DECLARE_GETT (QI, 1)
-DECLARE_GETT (UQI, 1)
-DECLARE_GETT (HI, 2)
-DECLARE_GETT (UHI, 2)
-DECLARE_GETT (SI, 4)
-DECLARE_GETT (USI, 4)
-DECLARE_GETT (DI, 8)
-DECLARE_GETT (UDI, 8)
-
-/* ??? defered until necessary
-DECLARE_GETT (SF, 4)
-DECLARE_GETT (DF, 8)
-DECLARE_GETT (TF, 16)
-*/
+DECLARE_GETT (QI, 1) /* TAGS: GETTQI */
+DECLARE_GETT (UQI, 1) /* TAGS: GETTUQI */
+DECLARE_GETT (HI, 2) /* TAGS: GETTHI */
+DECLARE_GETT (UHI, 2) /* TAGS: GETTUHI */
+DECLARE_GETT (SI, 4) /* TAGS: GETTSI */
+DECLARE_GETT (USI, 4) /* TAGS: GETTUSI */
+DECLARE_GETT (DI, 8) /* TAGS: GETTDI */
+DECLARE_GETT (UDI, 8) /* TAGS: GETTUDI */
+
+#if 0 /* ??? defered until necessary */
+DECLARE_GETT (SF, 4) /* TAGS: GETTSF */
+DECLARE_GETT (DF, 8) /* TAGS: GETTDF */
+DECLARE_GETT (TF, 16) /* TAGS: GETTTF */
+#endif
#undef DECLARE_GETT
@@ -209,20 +209,20 @@ XCONCAT2 (SETT,mode) (unsigned char *buf, mode val) \
extern mode XCONCAT2 (GETT,mode) (unsigned char *, mode);
#endif
-DECLARE_SETT (QI, 1)
-DECLARE_SETT (UQI, 1)
-DECLARE_SETT (HI, 2)
-DECLARE_SETT (UHI, 2)
-DECLARE_SETT (SI, 4)
-DECLARE_SETT (USI, 4)
-DECLARE_SETT (DI, 8)
-DECLARE_SETT (UDI, 8)
-
-/* ??? defered until necessary
-DECLARE_SETT (SF, 4)
-DECLARE_SETT (DF, 8)
-DECLARE_SETT (TF, 16)
-*/
+DECLARE_SETT (QI, 1) /* TAGS: SETTQI */
+DECLARE_SETT (UQI, 1) /* TAGS: SETTUQI */
+DECLARE_SETT (HI, 2) /* TAGS: SETTHI */
+DECLARE_SETT (UHI, 2) /* TAGS: SETTUHI */
+DECLARE_SETT (SI, 4) /* TAGS: SETTSI */
+DECLARE_SETT (USI, 4) /* TAGS: SETTUSI */
+DECLARE_SETT (DI, 8) /* TAGS: SETTDI */
+DECLARE_SETT (UDI, 8) /* TAGS: SETTUDI */
+
+#if 0 /* ??? defered until necessary */
+DECLARE_SETT (SF, 4) /* TAGS: SETTSF */
+DECLARE_SETT (DF, 8) /* TAGS: SETTDF */
+DECLARE_SETT (TF, 16) /* TAGS: SETTTF */
+#endif
#undef DECLARE_SETT
diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c
index b1c9f02..1ad5ce7 100644
--- a/sim/common/cgen-utils.c
+++ b/sim/common/cgen-utils.c
@@ -320,3 +320,38 @@ CONVDISI (val)
}
#endif /* DI_FN_SUPPORT */
+
+SI
+RORSI (val, shift)
+ SI val;
+ int shift;
+{
+ if (shift != 0)
+ {
+ int remain = 32 - shift;
+ int mask = (1 << shift) - 1;
+ SI result = (val & mask) << remain;
+ mask = (1 << remain) - 1;
+ result |= (val >> shift) & mask;
+ return result;
+ }
+ return val;
+}
+
+SI
+ROLSI (val, shift)
+ SI val;
+ int shift;
+{
+ if (shift != 0)
+ {
+ int remain = 32 - shift;
+ int mask = (1 << remain) - 1;
+ SI result = (val & mask) << shift;
+ mask = (1 << shift) - 1;
+ result |= (val >> remain) & mask;
+ return result;
+ }
+
+ return val;
+}