diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-09-05 00:30:38 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-09-05 00:30:38 +0000 |
commit | 30efae3acdacbd3239bd7385a5b535abf5ed23e9 (patch) | |
tree | 4e7757304f2588b575f205ab3600c3fd05307af2 /sim/common/sim-bits.h | |
parent | c142a1f507edd58eaa3aa708baaf7ca49a5cf031 (diff) | |
download | gdb-30efae3acdacbd3239bd7385a5b535abf5ed23e9.zip gdb-30efae3acdacbd3239bd7385a5b535abf5ed23e9.tar.gz gdb-30efae3acdacbd3239bd7385a5b535abf5ed23e9.tar.bz2 |
Define SIGNED64 and UNSIGNED64 macros - handle MSC/GCC LL issue.
Diffstat (limited to 'sim/common/sim-bits.h')
-rw-r--r-- | sim/common/sim-bits.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/sim/common/sim-bits.h b/sim/common/sim-bits.h index 6461861..b3458ee 100644 --- a/sim/common/sim-bits.h +++ b/sim/common/sim-bits.h @@ -39,6 +39,9 @@ architectures ignoring the first 32bits leaving bit 32 as the most significant. + NB: Use EXTRACTED, MSEXTRACTED and LSEXTRACTED as a guideline for + naming. LSMASK and LSMASKED are wrong. + BIT*(POS): Constant with just 1 bit set. LSBIT*(OFFSET): Constant with just 1 bit set - LS bit is zero. @@ -66,6 +69,12 @@ also right shifts the masked value so that bit LAST becomes the least significant (right most). + LSEXTRACTED*(VALUE, FIRST, LAST): Same as extracted - LS bit is + zero. + + MSEXTRACTED*(VALUE, FIRST, LAST): Same as extracted - MS bit is + zero. + SHUFFLED**(VALUE, OLD, NEW): Mask then move a single bit from OLD new NEW. @@ -377,9 +386,26 @@ INLINE_SIM_BITS(unsigned_word) MSMASKED (unsigned_word word, unsigned nr_bits); /* extract the required bits aligning them with the lsb */ -INLINE_SIM_BITS(unsigned16) EXTRACTED16 (unsigned16 val, unsigned start, unsigned stop); -INLINE_SIM_BITS(unsigned32) EXTRACTED32 (unsigned32 val, unsigned start, unsigned stop); -INLINE_SIM_BITS(unsigned64) EXTRACTED64 (unsigned64 val, unsigned start, unsigned stop); +INLINE_SIM_BITS(unsigned16) LSEXTRACTED16 (unsigned16 val, unsigned start, unsigned stop); +INLINE_SIM_BITS(unsigned32) LSEXTRACTED32 (unsigned32 val, unsigned start, unsigned stop); +INLINE_SIM_BITS(unsigned64) LSEXTRACTED64 (unsigned64 val, unsigned start, unsigned stop); + +INLINE_SIM_BITS(unsigned16) MSEXTRACTED16 (unsigned16 val, unsigned start, unsigned stop); +INLINE_SIM_BITS(unsigned32) MSEXTRACTED32 (unsigned32 val, unsigned start, unsigned stop); +INLINE_SIM_BITS(unsigned64) MSEXTRACTED64 (unsigned64 val, unsigned start, unsigned stop); + +#if (WITH_TARGET_WORD_MSB == 0) +#define EXTRACTED16 MSEXTRACTED32 +#define EXTRACTED32 MSEXTRACTED32 +#define EXTRACTED64 MSEXTRACTED32 +#else +#define EXTRACTED16 LSEXTRACTED32 +#define EXTRACTED32 LSEXTRACTED32 +#define EXTRACTED64 LSEXTRACTED32 +#endif + + + INLINE_SIM_BITS(unsigned_word) EXTRACTED (unsigned_word val, unsigned start, unsigned stop); |