sv_binutils: wrap SVP64_FIELD_SET macro
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Mon, 25 Apr 2022 19:50:13 +0000 (19:50 +0000)
committerDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Mon, 25 Apr 2022 19:50:13 +0000 (19:50 +0000)
src/openpower/sv/sv_binutils.py

index 1775aa963f994d9b861e4108cad034db4811eeea..e3ed5549423bb770101545b22c8a451bb61137e8 100644 (file)
@@ -588,10 +588,10 @@ class Codegen(_enum.Enum):
                 (
                     "SVP64_FIELD_SET",
                     ("RESULT", "VALUE", "SRC", "DST"),
-                    " = ".join(["*(RESULT)", bit_or(
+                    ("do { (*RESULT) = " + bit_or(
                         lhs="SVP64_FIELD_CLEAR(*(RESULT), DST)",
                         rhs="SVP64_FIELD_REMAP(VALUE, SRC, DST)",
-                    )]),
+                    ) + "; } while (0)"),
                 ),
             )
             for (name, args, body) in macros: