5 #include "opcode/v850.h"
7 extern host_callback *v850_callback;
9 /* FIXME: host defines */
10 typedef unsigned char uint8;
11 typedef unsigned short uint16;
12 typedef unsigned int uint32;
13 typedef signed char int8;
14 typedef signed short int16;
15 typedef signed int int32;
16 typedef signed long long int64;
18 /* FIXME: V850 defines */
32 reg_t regs[32]; /* general-purpose registers */
33 reg_t sregs[32]; /* system regsiters, including psw */
40 extern struct simops Simops[];
53 #define SEXT3(x) ((((x)&0x7)^(~3))+4)
55 /* sign-extend a 4-bit number */
56 #define SEXT4(x) ((((x)&0xf)^(~7))+8)
58 /* sign-extend an 8-bit number */
59 #define SEXT8(x) ((((x)&0xff)^(~0x7f))+0x80)
61 /* sign-extend a 16-bit number */
62 #define SEXT16(x) ((((x)&0xffff)^(~0x7fff))+0x8000)
64 /* sign-extend a 32-bit number */
65 #define SEXT32(x) ((((x)&0xffffffffLL)^(~0x7fffffffLL))+0x80000000LL)
67 /* sign extend a 40 bit number */
68 #define SEXT40(x) ((((x)&0xffffffffffLL)^(~0x7fffffffffLL))+0x8000000000LL)
70 /* sign extend a 44 bit number */
71 #define SEXT44(x) ((((x)&0xfffffffffffLL)^(~0x7ffffffffffLL))+0x80000000000LL)
73 /* sign extend a 60 bit number */
74 #define SEXT60(x) ((((x)&0xfffffffffffffffLL)^(~0x7ffffffffffffffLL))+0x800000000000000LL)
76 #define MAX32 0x7fffffffLL
77 #define MIN32 0xff80000000LL
78 #define MASK32 0xffffffffLL
79 #define MASK40 0xffffffffffLL
81 #define INC_ADDR(x,i) x = ((State.MD && x == MOD_E) ? MOD_S : (x)+(i))
83 #define RB(x) (*((uint8 *)((x)+State.mem)))
84 #define SB(addr,data) ( RB(addr) = (data & 0xff))
86 #ifdef WORDS_BIGENDIAN
88 uint32 get_word PARAMS ((uint8 *));
89 uint16 get_half PARAMS ((uint8 *));
90 uint8 get_byte PARAMS ((uint8 *));
91 #define RLW(x) (*((uint32 *)((x)+State.mem)))
95 uint32 get_word PARAMS ((uint8 *));
96 uint16 get_half PARAMS ((uint8 *));
97 uint8 get_byte PARAMS ((uint8 *));
99 #define RLW(x) get_word((long)(x)+State.mem)
101 #endif /* not WORDS_BIGENDIAN */