projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc1c9e0
)
Fix insertBits so it doesn't shift things into oblivion
author
Gabe Black
<gblack@eecs.umich.edu>
Tue, 8 May 2007 17:19:33 +0000
(17:19 +0000)
committer
Gabe Black
<gblack@eecs.umich.edu>
Tue, 8 May 2007 17:19:33 +0000
(17:19 +0000)
--HG--
extra : convert_revision :
8833b60e3fc94c917fbdb7a99f3d90155907b44e
src/base/bitfield.hh
patch
|
blob
|
history
diff --git
a/src/base/bitfield.hh
b/src/base/bitfield.hh
index 69cce22459aa11014958ef6c78a39d176ce27e72..518bad6b87ad64fcbcad7203f8dc3364974ac01f 100644
(file)
--- a/
src/base/bitfield.hh
+++ b/
src/base/bitfield.hh
@@
-96,8
+96,9
@@
inline
T
insertBits(T val, int first, int last, B bit_val)
{
+ T t_bit_val = bit_val;
T bmask = mask(first - last + 1) << last;
- return ((bit_val << last) & bmask) | (val & ~bmask);
+ return ((
t_
bit_val << last) & bmask) | (val & ~bmask);
}
/**