diff options
author | Ryan Gambord <gambordr@oregonstate.edu> | 2019-04-04 12:25:07 -0400 |
---|---|---|
committer | Ryan Gambord <gambordr@oregonstate.edu> | 2019-04-05 18:10:04 +0000 |
commit | 271f2aea84a280b68c234a57438b94629f254e7f (patch) | |
tree | afede1e2f1e1fdc54e060fb636ad25c0227f1f04 /src/mem/cache/prefetch/pif.hh | |
parent | 529d0cdbfe77a4ad655fe57f2d5320dbb760ef13 (diff) | |
download | gem5-271f2aea84a280b68c234a57438b94629f254e7f.tar.xz |
mem-cache: ambiguous use of abs function
std::abs doesn't accept unsigned long long, generating the error:
error: call to 'abs' is ambiguous
Use instead a compare-and-subtract idiom.
Also, Changed return type of distanceFromTrigger from unsigned int to Addr to
prevent overflow problems.
Change-Id: Ia7752c1c7a838f98e8c7ed6ade9f586f31bbcf7d
Signed-off-by: Ryan Gambord <gambordr@oregonstate.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17788
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/prefetch/pif.hh')
-rw-r--r-- | src/mem/cache/prefetch/pif.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mem/cache/prefetch/pif.hh b/src/mem/cache/prefetch/pif.hh index 6516b2c6a..abff4fafb 100644 --- a/src/mem/cache/prefetch/pif.hh +++ b/src/mem/cache/prefetch/pif.hh @@ -116,8 +116,8 @@ class PIFPrefetcher : public QueuedPrefetcher * @param log_blk_distance log_2(block size of the cache) * @result distance in cache blocks from the address to the trigger */ - unsigned int distanceFromTrigger(Addr addr, - unsigned int log_blk_size) const; + Addr distanceFromTrigger(Addr addr, + unsigned int log_blk_size) const; }; CompactorEntry spatialCompactor; |