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)
committerSandipan Das <sandipan@linux.vnet.ibm.com>
Thu, 7 Jun 2018 11:07:17 +0000 (16:37 +0530)
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 b851c70239ea0672973af0b9608f35dfa9dc840e..43c62afce9d9e6058b24c8c8659512a2d1085597 100644 (file)
@@ -431,6 +431,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 {