diff options
author | Doug Evans <dje@google.com> | 2009-11-23 04:12:17 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2009-11-23 04:12:17 +0000 |
commit | 197fa1aa2ca7f943805196c37031b44f7b87d5a7 (patch) | |
tree | 2094056b2e6e8bf0319e70b89af8c9c4b2be2b5a /sim/common/cgen-engine.h | |
parent | 1fbb9298a46e1bf9eca8fe24027102cf2fcf01fc (diff) | |
download | gdb-197fa1aa2ca7f943805196c37031b44f7b87d5a7.zip gdb-197fa1aa2ca7f943805196c37031b44f7b87d5a7.tar.gz gdb-197fa1aa2ca7f943805196c37031b44f7b87d5a7.tar.bz2 |
* cgen-engine.h (EXTRACT_MSB0_LGSINT, EXTRACT_MSB0_LGUINT): Define.
(EXTRACT_LSB0_LGSINT, EXTRACT_LSB0_LGUINT): Define.
(EXTRACT_FN, SEMANTIC_FN): Use CGEN_INSN_WORD in prototype
instead of CGEN_INSN_INT.
plus, cgen files: Regenerate.
Diffstat (limited to 'sim/common/cgen-engine.h')
-rw-r--r-- | sim/common/cgen-engine.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sim/common/cgen-engine.h b/sim/common/cgen-engine.h index 2433104..69f2ef6 100644 --- a/sim/common/cgen-engine.h +++ b/sim/common/cgen-engine.h @@ -17,9 +17,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* This file must be included after eng.h and before ${cpu}.h. +/* This file is included by ${cpu}.h. + It needs CGEN_INSN_WORD which is defined by ${cpu}.h. ??? A lot of this could be moved to genmloop.sh to be put in eng.h - and thus remove some conditional compilation. Worth it? */ + and thus remove some conditional compilation. We'd still need + CGEN_INSN_WORD though. */ /* Semantic functions come in six versions on two axes: fast/full-featured, and using one of the simple/scache/compilation engines. @@ -62,12 +64,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define EXTRACT_LSB0_UINT(val, total, start, length) \ (((UINT) (val) << ((sizeof (UINT) * 8) - (start) - 1)) \ >> ((sizeof (UINT) * 8) - (length))) + +#define EXTRACT_MSB0_LGSINT(val, total, start, length) \ +(((CGEN_INSN_LGSINT) (val) << ((sizeof (CGEN_INSN_LGSINT) * 8) - (total) + (start))) \ + >> ((sizeof (CGEN_INSN_LGSINT) * 8) - (length))) +#define EXTRACT_MSB0_LGUINT(val, total, start, length) \ +(((CGEN_INSN_UINT) (val) << ((sizeof (CGEN_INSN_LGUINT) * 8) - (total) + (start))) \ + >> ((sizeof (CGEN_INSN_LGUINT) * 8) - (length))) + +#define EXTRACT_LSB0_LGSINT(val, total, start, length) \ +(((CGEN_INSN_LGSINT) (val) << ((sizeof (CGEN_INSN_LGSINT) * 8) - (start) - 1)) \ + >> ((sizeof (CGEN_INSN_LGSINT) * 8) - (length))) +#define EXTRACT_LSB0_LGUINT(val, total, start, length) \ +(((CGEN_INSN_LGUINT) (val) << ((sizeof (CGEN_INSN_LGUINT) * 8) - (start) - 1)) \ + >> ((sizeof (CGEN_INSN_LGUINT) * 8) - (length))) /* Semantic routines. */ /* Type of the machine generated extraction fns. */ /* ??? No longer used. */ -typedef void (EXTRACT_FN) (SIM_CPU *, IADDR, CGEN_INSN_INT, ARGBUF *); +typedef void (EXTRACT_FN) (SIM_CPU *, IADDR, CGEN_INSN_WORD, ARGBUF *); /* Type of the machine generated semantic fns. */ @@ -89,9 +105,9 @@ typedef unsigned int SEM_STATUS; /* Instruction fields are extracted by the semantic routine. ??? TODO: multi word insns. */ #if HAVE_PARALLEL_INSNS && ! WITH_PARALLEL_GENWRITE -typedef SEM_STATUS (SEMANTIC_FN) (SIM_CPU *, SEM_ARG, PAREXEC *, CGEN_INSN_INT); +typedef SEM_STATUS (SEMANTIC_FN) (SIM_CPU *, SEM_ARG, PAREXEC *, CGEN_INSN_WORD); #else -typedef SEM_STATUS (SEMANTIC_FN) (SIM_CPU *, SEM_ARG, CGEN_INSN_INT); +typedef SEM_STATUS (SEMANTIC_FN) (SIM_CPU *, SEM_ARG, CGEN_INSN_WORD); #endif #endif |