X86: Implement unsigned divide. The non-byte version ignores rdx which it shouldn't.

--HG--
extra : convert_revision : 07e5509fb8ed9d73c144d6f52951ebc02e7c0032
This commit is contained in:
Gabe Black 2007-07-30 15:40:39 -07:00
parent 74fcf117dd
commit 44c3419e1a

View file

@ -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):