allow assigning BFPState and SelectableMSB0Fraction values in pseudo-code
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 12 May 2023 06:38:09 +0000 (23:38 -0700)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:18 +0000 (19:51 +0100)
src/openpower/decoder/helpers.py

index a7d8a37d10a43208ad3a0cd7f8da900f53caa32c..6d4c6d9a4d352267b2fde808b38aa44379c33720 100644 (file)
@@ -10,6 +10,8 @@ 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.decoder.fp_working_format import (
+    BFPState, SelectableMSB0Fraction)
 
 from openpower.util import log
 import math
@@ -87,6 +89,10 @@ def copy_assign_rhs(inp):
         return inp
     if isinstance(inp, (SelectableInt, FieldSelectableInt)):
         return SelectableInt(inp)
+    if isinstance(inp, BFPState):
+        return BFPState(inp)
+    if isinstance(inp, SelectableMSB0Fraction):
+        return SelectableMSB0Fraction(inp)
     if isinstance(inp, tuple):
         return tuple(map(copy_assign_rhs, inp))
     if isinstance(inp, dict):