From: Daniel R. Carvalho Date: Sat, 7 Sep 2019 08:23:21 +0000 (+0200) Subject: mem-ruby: Remove bitRemove X-Git-Tag: v19.0.0.0~507 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0219c49bdfab09c31ebae31669f0c1e65d525af6;p=gem5.git 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, 63, big + 1) << small) | bits(addr, small, 0)) Change-Id: I45fd3bc0271ccb659d6a94e3dd00ca095dfd6aa7 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21081 Reviewed-by: Nikos Nikoleris Reviewed-by: Anthony Gutierrez Maintainer: Jason Lowe-Power Tested-by: kokoro --- 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 @@ -45,31 +45,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) { 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);