sim: Add a function for decoding the field(s) of an m5op address.
authorGabe Black <gabeblack@google.com>
Tue, 26 Nov 2019 01:00:52 +0000 (17:00 -0800)
committerGabe Black <gabeblack@google.com>
Fri, 7 Feb 2020 07:41:07 +0000 (07:41 +0000)
These have at one time included both a func and subfunc, although the
subfunc was unused and is now excluded.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-187

Change-Id: Ic35ced7a012aa72af5454768f3cbd11b431b061a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23183
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Marjan Fariborz <mfariborz@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
src/sim/pseudo_inst.hh

index caada36c4c1314fb7adcfa818ea6b7965832e25e..44227aff178122e6dd5060ec0417019432bb3c96 100644 (file)
@@ -86,6 +86,12 @@ struct Argument<PseudoInstABI, uint64_t>
 namespace PseudoInst
 {
 
+static inline void
+decodeAddrOffset(Addr offset, uint8_t &func)
+{
+    func = bits(offset, 15, 8);
+}
+
 void arm(ThreadContext *tc);
 void quiesce(ThreadContext *tc);
 void quiesceSkip(ThreadContext *tc);