bool() is !!() for integers
authorMikolaj Wielgus <wielgusmikolaj@gmail.com>
Mon, 27 Dec 2021 01:25:04 +0000 (01:25 +0000)
committerMikolaj Wielgus <wielgusmikolaj@gmail.com>
Mon, 27 Dec 2021 01:25:04 +0000 (01:25 +0000)
src/openpower/decoder/test/_pyrtl.py

index 37f6936d2c89b983c99bf7b9f2dfc2b284ddb264..8530020cc26b97e3b63300f39cdc67c11b7cd6b9 100644 (file)
@@ -145,7 +145,7 @@ class _RHSValueCompiler(_ValueCompiler):
             if value.operator == "-":
                 return f"(-{sign(arg)})"
             if value.operator == "b":
-                return f"bool({mask(arg)})"
+                return f"!!({mask(arg)})"
             if value.operator == "r|":
                 return f"(0 != {mask(arg)})"
             if value.operator == "r&":