arch-power: Add fixed-point doubleword arithmetic modulo instructions
authorSandipan Das <sandipan@linux.vnet.ibm.com>
Thu, 7 Jun 2018 06:53:49 +0000 (12:23 +0530)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 24 Jan 2021 03:21:27 +0000 (03:21 +0000)
This adds the following arithmetic instructions:
  * Modulo Signed Doubleword (modsd)
  * Modulo Unsigned Doubleword (modud)

Change-Id: Ic7bcb85869ccedf5c95aadfe925c85b3b1155031
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
src/arch/power/isa/decoder.isa

index 8a3da348f281a81b838828dd8a0b809a46279dd8..4857616b68829ae3761bdfb089936760a3be4e43 100644 (file)
@@ -429,6 +429,26 @@ decode PO default Unknown::unknown() {
                     Rt = 0;
                 }
             }});
+
+            777: modsd({{
+                int64_t src1 = Ra_sd;
+                int64_t src2 = Rb_sd;
+                if ((src1 != INT64_MIN || src2 != -1) && src2 != 0) {
+                    Rt = src1 % src2;
+                } else {
+                    Rt = 0;
+                }
+            }});
+
+            265: modud({{
+                uint64_t src1 = Ra;
+                uint64_t src2 = Rb;
+                if (src2 != 0) {
+                    Rt = src1 % src2;
+                } else {
+                    Rt = 0;
+                }
+            }});
         }
 
         format IntOp {