Add ca32 to caller.py
authorMichael Nolan <mtnolan2640@gmail.com>
Tue, 19 May 2020 15:20:04 +0000 (11:20 -0400)
committerMichael Nolan <mtnolan2640@gmail.com>
Tue, 19 May 2020 15:21:04 +0000 (11:21 -0400)
src/soc/decoder/isa/caller.py

index 85bd96bc8504e7b39b31e1184f4845ec29d00b8a..57e7825254b611650705487d7592f8428156f0f8 100644 (file)
@@ -253,6 +253,14 @@ class ISACaller:
             cy = False
         self.spr['XER'][XER_bits['CA']] = cy
 
+
+        # 32 bit carry
+        gts = [(x[32:64] > output[32:64]) == SelectableInt(1, 1)
+               for x in inputs]
+        cy32 = 1 if any(gts) else 0
+        self.spr['XER'][XER_bits['CA32']] = cy32
+
+
     def handle_comparison(self, outputs):
         out = outputs[0]
         out = exts(out.value, out.bits)