From f7e0115882321a5d63450aa6d1354c1de04afca9 Mon Sep 17 00:00:00 2001 From: David Schall Date: Thu, 18 Jun 2020 16:14:44 +0100 Subject: [PATCH] base: Add XOR and modulo operator to ChannelAddr Channel address class did not offer bitwise XOR and modulo operation. These two functions where now added to the ChannelAddr class. Change-Id: I02a5e49e9700cc5283415c921a25989a130e5d07 Reviewed-by: Andreas Sandberg Reviewed-by: Ciro Santilli Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39235 Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Reviewed-by: Bobby R. Bruce Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/base/channel_addr.hh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/base/channel_addr.hh b/src/base/channel_addr.hh index 2cfe38027..55d227bee 100644 --- a/src/base/channel_addr.hh +++ b/src/base/channel_addr.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ARM Limited + * Copyright (c) 2019, 2021 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -93,6 +93,14 @@ class ChannelAddr return ChannelAddr(a << b); } + constexpr ChannelAddr operator^(const int b) const { + return ChannelAddr(a ^ b); + } + + constexpr ChannelAddr operator%(const int b) const { + return ChannelAddr(a % b); + } + constexpr ChannelAddr operator*(const Type &b) const { return ChannelAddr(a * b); } -- 2.30.2