aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v/d10v_sim.h
diff options
context:
space:
mode:
authorMartin Hunt <hunt@redhat.com>1996-08-29 00:35:11 +0000
committerMartin Hunt <hunt@redhat.com>1996-08-29 00:35:11 +0000
commitd70b4d426ba96845c0a40138c5d3ee05ac279ca5 (patch)
tree3608600955a1dde8fc42f76e745e760847636a4c /sim/d10v/d10v_sim.h
parente7dd77751d79943b39a1d2308678d28309a000e1 (diff)
downloadgdb-d70b4d426ba96845c0a40138c5d3ee05ac279ca5.zip
gdb-d70b4d426ba96845c0a40138c5d3ee05ac279ca5.tar.gz
gdb-d70b4d426ba96845c0a40138c5d3ee05ac279ca5.tar.bz2
Wed Aug 28 17:33:19 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* Makefile.in, d10v_sim.h, interp.c: Fix byte-order problems.
Diffstat (limited to 'sim/d10v/d10v_sim.h')
-rw-r--r--sim/d10v/d10v_sim.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/sim/d10v/d10v_sim.h b/sim/d10v/d10v_sim.h
index a2b4b2b..83c7aeb 100644
--- a/sim/d10v/d10v_sim.h
+++ b/sim/d10v/d10v_sim.h
@@ -81,6 +81,12 @@ extern struct simops Simops[];
/* sign extend a 40 bit number */
#define SEXT40(x) ((((x)&0xffffffffffLL)^(~0x7fffffffffLL))+0x8000000000LL)
+/* sign extend a 44 bit number */
+#define SEXT44(x) ((((x)&0xfffffffffffLL)^(~0x7ffffffffffLL))+0x80000000000LL)
+
+/* sign extend a 60 bit number */
+#define SEXT60(x) ((((x)&0xfffffffffffffffLL)^(~0x7ffffffffffffffLL))+0x800000000000000LL)
+
#define MAX32 0x7fffffffLL
#define MIN32 0xff80000000LL
#define MASK32 0xffffffffLL
@@ -93,17 +99,28 @@ extern struct simops Simops[];
#ifdef WORDS_BIGENDIAN
-#define RW(x) (*((uint16 *)((x)+State.imem)))
-#define RLW(x) (*((uint32 *)((x)+State.imem)))
-#define SW(addr,data) RW(addr)=data
+#define RW(x) (*((uint16 *)((x)+State.imem)))
+#define RLW(x) (*((uint32 *)((x)+State.imem)))
+#define SW(addr,data) RW(addr)=data
+#define READ_16(x) (*((int16 *)(x)))
+#define WRITE_16(addr,data) (*(int16 *)(addr)=data)
+#define READ_64(x) (*((int64 *)(x)))
+#define WRITE_64(addr,data) (*(int64 *)(addr)=data)
#else
-uint32 get_longword_swap PARAMS ((uint16 x));
-uint16 get_word_swap PARAMS ((uint16 x));
-void write_word_swap PARAMS ((uint16 addr, uint16 data));
-#define SW(addr,data) write_word_swap(addr,data)
-#define RW(x) get_word_swap(x)
-#define RLW(x) get_longword_swap(x)
+uint32 get_longword PARAMS ((uint8 *));
+uint16 get_word PARAMS ((uint8 *));
+int64 get_longlong PARAMS ((uint8 *));
+void write_word PARAMS ((uint8 *addr, uint16 data));
+void write_longlong PARAMS ((uint8 *addr, int64 data));
+
+#define SW(addr,data) write_word((long)(addr)+State.imem,data)
+#define RW(x) get_word((long)(x)+State.imem)
+#define RLW(x) get_longword((long)(x)+State.imem)
+#define READ_16(x) get_word(x)
+#define WRITE_16(addr,data) write_word(addr,data)
+#define READ_64(x) get_longlong(x)
+#define WRITE_64(addr,data) write_longlong(addr,data)
#endif /* not WORDS_BIGENDIAN */