From 49540d2c31bbbf0291f8cd7266e873e31f87aae4 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 31 May 2023 23:40:39 +0300 Subject: [PATCH] power_enums: introduce register aliases --- src/openpower/decoder/power_enums.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index 56518d86..3b529434 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -304,6 +304,28 @@ class SVExtraReg(Enum): return cls.__members__.get(desc) + @property + def alias(self): + alias = { + Reg.RSp: Reg.RS, + Reg.RTp: Reg.RT, + Reg.FRAp: Reg.FRA, + Reg.FRBp: Reg.FRB, + Reg.FRSp: Reg.FRS, + Reg.FRTp: Reg.FRT, + }.get(self) + if alias is not None: + return alias + + alias = { + Reg.RA_OR_ZERO: Reg.RA, + Reg.RT_OR_ZERO: Reg.RT, + }.get(self) + if alias is not None: + return alias + + return self + @unique class SVP64PredMode(Enum): -- 2.30.2