mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
(EXTRACT_SIGNED,EXTRACT_UNSIGNED,HOST_LONGS_FOR_BITS): Move from
cgen-types.h to cgen-sim.h.
This commit is contained in:
parent
9f4b686cb5
commit
2c8f0de695
@ -42,6 +42,20 @@ enum sim_signal_type {
|
||||
void engine_halt PARAMS ((struct _sim_cpu *, enum exec_state, int));
|
||||
void engine_signal PARAMS ((struct _sim_cpu *, enum sim_signal_type));
|
||||
|
||||
/* Instruction field support macros. */
|
||||
|
||||
#define EXTRACT_SIGNED(val, total, start, length) \
|
||||
(((((val) >> ((total) - ((start) + (length)))) & ((1 << (length)) - 1)) \
|
||||
^ (1 << ((length) - 1))) \
|
||||
- (1 << ((length) - 1)))
|
||||
|
||||
#define EXTRACT_UNSIGNED(val, total, start, length) \
|
||||
(((val) >> ((total) - ((start) + (length)))) & ((1 << (length)) - 1))
|
||||
|
||||
/* Compute number of longs required to hold N bits. */
|
||||
#define HOST_LONGS_FOR_BITS(n) \
|
||||
(((n) + sizeof (long) * 8 - 1) / sizeof (long) * 8)
|
||||
|
||||
/* Decode,extract,semantics. */
|
||||
|
||||
typedef void (EXTRACT_FN) PARAMS ((SIM_CPU *, PCADDR, insn_t, struct argbuf *));
|
||||
|
Loading…
Reference in New Issue
Block a user