Add missing parentheses for explicit operator precedence
authorMikolaj Wielgus <wielgusmikolaj@gmail.com>
Mon, 27 Dec 2021 01:17:13 +0000 (01:17 +0000)
committerMikolaj Wielgus <wielgusmikolaj@gmail.com>
Mon, 27 Dec 2021 01:17:13 +0000 (01:17 +0000)
src/openpower/decoder/test/_pyrtl.py

index 366c73671b792ba7ef7961650e64330d5cd1e2b9..37f6936d2c89b983c99bf7b9f2dfc2b284ddb264 100644 (file)
@@ -291,8 +291,8 @@ class _LHSValueCompiler(_ValueCompiler):
     def on_Slice(self, value):
         def gen(arg):
             width_mask = (1 << (value.stop - value.start)) - 1
-            self(value.value)(f"({self.lrhs(value.value)} & " \
-                f"{~(width_mask << value.start)} | " \
+            self(value.value)(f"(({self.lrhs(value.value)} & " \
+                f"{~(width_mask << value.start)}) | " \
                 f"(({width_mask} & {arg}) << {value.start}))")
         return gen