copy_assign_rhs must retain subclasses of SelectableInt
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 7 Nov 2023 04:41:11 +0000 (20:41 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 14 Nov 2023 23:06:49 +0000 (15:06 -0800)
src/openpower/decoder/helpers.py

index 2c93713484dbde0da0c774db94ef518df70888a3..918a409eaf8e57762d7c67f692e6bd16d75dccba 100644 (file)
@@ -10,6 +10,9 @@ from openpower.decoder.selectable_int import selectltu as ltu
 from openpower.decoder.selectable_int import selectgtu as gtu
 from openpower.decoder.selectable_int import check_extsign
 from openpower.fpscr import FPSCRState
+from openpower.xer import XERState
+from openpower.decoder.isa.svshape import SVSHAPE
+from openpower.decoder.isa.svstate import SVP64State
 from openpower.decoder.fp_working_format import (
     BFPState, SelectableMSB0Fraction)
 
@@ -87,6 +90,14 @@ def copy_assign_rhs(inp):
     """
     if isinstance(inp, (str, int)):
         return inp
+    if isinstance(inp, FPSCRState):
+        return FPSCRState(inp)
+    if isinstance(inp, XERState):
+        return XERState(inp)
+    if isinstance(inp, SVSHAPE):
+        return SVSHAPE(inp)
+    if isinstance(inp, SVP64State):
+        return SVP64State(inp)
     if isinstance(inp, (SelectableInt, FieldSelectableInt)):
         return SelectableInt(inp)
     if isinstance(inp, BFPState):