* bits.c (LSMASKED64): New inline function.

(LSEXTRACTED64): Likewise.
* bits.h (_LSB_POS, _LSMASKn, LSMASK64): New macros from
sim/common/sim-bits.h
(LSMASKED64, LSEXTRACTED64): New functions definitions.
* Makefile.in (sim-bits.o): Remove target.

* main.c (zalloc): Fix typo in error message.
This commit is contained in:
Matthew Green
2002-01-04 00:00:54 +00:00
parent c7b3d5aa45
commit 5c8844646d
5 changed files with 63 additions and 4 deletions

View File

@@ -24,7 +24,27 @@
#include "basics.h"
INLINE_BITS\
(unsigned64)
LSMASKED64 (unsigned64 word,
int start,
int stop)
{
word &= LSMASK64 (start, stop);
return word;
}
INLINE_BITS\
(unsigned64)
LSEXTRACTED64 (unsigned64 val,
int start,
int stop)
{
val <<= (64 - 1 - start); /* drop high bits */
val >>= (64 - 1 - start) + (stop); /* drop low bits */
return val;
}
INLINE_BITS\
(unsigned32)
MASKED32(unsigned32 word,