summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-30 15:40:39 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-30 15:40:39 -0700
commit44c3419e1a0dbf6f222955f627b45192da2ad12e (patch)
tree8aecc296df2a20df48d32b2c6fa40fe32d68c12b /src/arch
parent74fcf117ddcfe58c3b99f5f2a1209a1f7d306b07 (diff)
downloadgem5-44c3419e1a0dbf6f222955f627b45192da2ad12e.tar.xz
X86: Implement unsigned divide. The non-byte version ignores rdx which it shouldn't.
--HG-- extra : convert_revision : 07e5509fb8ed9d73c144d6f52951ebc02e7c0032
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/isa/insts/arithmetic/multiply_and_divide.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/arch/x86/isa/insts/arithmetic/multiply_and_divide.py b/src/arch/x86/isa/insts/arithmetic/multiply_and_divide.py
index 936fa6973..5355775eb 100644
--- a/src/arch/x86/isa/insts/arithmetic/multiply_and_divide.py
+++ b/src/arch/x86/isa/insts/arithmetic/multiply_and_divide.py
@@ -196,6 +196,53 @@ def macroop IMUL_R_P_I
ld t2, ds, [0, t0, t7]
mulel reg, t2, t1
};
+
+#
+# One byte version of unsigned division
+#
+
+def macroop DIV_B_R
+{
+ div1 rax, rax, reg
+};
+
+def macroop DIV_B_M
+{
+ ld t1, ds, [scale, index, base], disp
+ div1 rax, rax, t1
+};
+
+def macroop DIV_B_P
+{
+ rdip t7
+ ld t1, ds, [0, t0, t7], disp
+ div1 rax, rax, t1
+};
+
+#
+# Unsigned division
+#
+
+def macroop DIV_R
+{
+ divr rdx, rax, reg
+ divq rax, rax, reg
+};
+
+def macroop DIV_M
+{
+ ld t1, ds, [scale, index, base], disp
+ divr rdx, rax, t1
+ divq rax, rax, t1
+};
+
+def macroop DIV_P
+{
+ rdip t7
+ ld t1, ds, [0, t0, t7], disp
+ divr rdx, rax, t1
+ divq rax, rax, t1
+};
'''
#let {{
# class MUL(Inst):