cpu: constexpr most of RegId's methods, and add a RegIndex operator.
cpu: constexpr most of RegId's methods, and add a RegIndex operator.

That will let a RegId be used where a RegId is required, but also let it
be downconverted into a scalar RegIndex if using an older API. Note that
this does *not* let you automatically upconvert from a RegIndex into a
RegId, since there would be no way to know what class of register to
use.

Change-Id: I5fff224dce5e02959d5fc3e717014bf7eaa9c022
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49753
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Maintainer: Giacomo Travaglini <8eef13a4f970e2e9372c8d26ad0737b760f99c02@arm.com>
Reviewed-by: Giacomo Travaglini <8eef13a4f970e2e9372c8d26ad0737b760f99c02@arm.com>

gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5,gem5/gem5