mem-cache: ambiguous use of abs function
authorRyan Gambord <gambordr@oregonstate.edu>
Thu, 4 Apr 2019 16:25:07 +0000 (12:25 -0400)
committerRyan Gambord <gambordr@oregonstate.edu>
Fri, 5 Apr 2019 18:10:04 +0000 (18:10 +0000)
commit271f2aea84a280b68c234a57438b94629f254e7f
treeafede1e2f1e1fdc54e060fb636ad25c0227f1f04
parent529d0cdbfe77a4ad655fe57f2d5320dbb760ef13
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>
src/mem/cache/prefetch/pif.cc
src/mem/cache/prefetch/pif.hh