forked from Imagelibrary/binutils-gdb
* 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user