diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2019-09-07 10:23:21 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2019-09-30 20:58:46 +0000 |
commit | 0219c49bdfab09c31ebae31669f0c1e65d525af6 (patch) | |
tree | c5f090c8d1338d2a1da1977afe7c44b678e06ff2 /src/mem/ruby/common | |
parent | 4c4520ca00fd5ca87bba31544442cbb5e2db1df5 (diff) | |
download | gem5-0219c49bdfab09c31ebae31669f0c1e65d525af6.tar.xz |
mem-ruby: Remove bitRemove
bitRemove is not being used anywhere. If needed, can be used
as src/base/bitfield.hh's bits:
bitRemove(addr, small, big) ==
((bits<Addr>(addr, 63, big + 1) << small) |
bits<Addr>(addr, small, 0))
Change-Id: I45fd3bc0271ccb659d6a94e3dd00ca095dfd6aa7
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21081
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r-- | src/mem/ruby/common/Address.cc | 25 | ||||
-rw-r--r-- | src/mem/ruby/common/Address.hh | 1 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/mem/ruby/common/Address.cc b/src/mem/ruby/common/Address.cc index f0aa71ac6..edb417738 100644 --- a/src/mem/ruby/common/Address.cc +++ b/src/mem/ruby/common/Address.cc @@ -46,31 +46,6 @@ bitSelect(Addr addr, unsigned int small, unsigned int big) } Addr -bitRemove(Addr addr, unsigned int small, unsigned int big) -{ - assert(big >= small); - - if (small >= ADDRESS_WIDTH - 1) { - return addr; - } else if (big >= ADDRESS_WIDTH - 1) { - Addr mask = (Addr)~0 >> small; - return (addr & mask); - } else if (small == 0) { - Addr mask = (Addr)~0 << big; - return (addr & mask); - } else { - Addr mask = ~((Addr)~0 << small); - Addr lower_bits = addr & mask; - mask = (Addr)~0 << (big + 1); - Addr higher_bits = addr & mask; - - // Shift the valid high bits over the removed section - higher_bits = higher_bits >> (big - small + 1); - return (higher_bits | lower_bits); - } -} - -Addr maskLowOrderBits(Addr addr, unsigned int number) { Addr mask; diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh index ded6f6f12..17490c448 100644 --- a/src/mem/ruby/common/Address.hh +++ b/src/mem/ruby/common/Address.hh @@ -39,7 +39,6 @@ const uint32_t ADDRESS_WIDTH = 64; // address width in bytes // selects bits inclusive Addr bitSelect(Addr addr, unsigned int small, unsigned int big); -Addr bitRemove(Addr addr, unsigned int small, unsigned int big); Addr maskLowOrderBits(Addr addr, unsigned int number); Addr maskHighOrderBits(Addr addr, unsigned int number); Addr shiftLowOrderBits(Addr addr, unsigned int number); |