take every opportunity *not* to go onto a separate line with commas
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 3 Dec 2023 10:11:28 +0000 (10:11 +0000)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 4 Dec 2023 06:32:30 +0000 (22:32 -0800)
bad:
-        log("is priv", instr_is_privileged, hex(self.msr.value),
-            self.msr[MSRb.PR])

good:
-        if instr_is_privileged and self.msr[MSRb.PR] == 1:
+        PR = self.msr[MSRb.PR]
+        log("is priv", instr_is_privileged, hex(self.msr.value), PR)
+        if instr_is_privileged and PR == 1:

src/openpower/decoder/isa/caller.py

index 2385ecf06cba6a7bcfe5f8d768a6dedcbe51dc52..46876cf94eaa3345745aecec8e07b77d1e9feca8 100644 (file)
@@ -2133,10 +2133,10 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop):
                       MicrOp.OP_MTSPR.value] and spr_msb:
             instr_is_privileged = True
 
-        log("is priv", instr_is_privileged, hex(self.msr.value),
-            self.msr[MSRb.PR])
         # check MSR priv bit and whether op is privileged: if so, throw trap
-        if instr_is_privileged and self.msr[MSRb.PR] == 1:
+        PR = self.msr[MSRb.PR]
+        log("is priv", instr_is_privileged, hex(self.msr.value), PR)
+        if instr_is_privileged and PR == 1:
             self.call_trap(0x700, PIb.PRIV)
             return