arch: Add a mechanism to override methods of the Operand classes.

The classes defined by the ISA description are actually just descriptors
which are used to make more specialized Operand classes, and then those
classes are instantiated to represent actual operands in a given
instruction. There they encode the actual index of the register, any
extensions used, etc.

To make defining operand types in the ISA more flexible and to take less
explicit machinery, this change defines a mechanism to allow overriding
individual methods of the operand class. This should for instance make
the read_code and write_code members of those classes unnecessary.

Change-Id: I1a1f787970ba56bd2884a80df4618a77eb454605
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49740
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2 files changed