Implement cdqe and cqo, which are also called cbw and cwde, and cwd and cdq respectively, depending on the operand size.

--HG--
extra : convert_revision : 67ac035c68608d7260c21ce32009b344f3834e46
This commit is contained in:
Gabe Black
2007-07-24 15:07:03 -07:00
parent f8f7f994b8
commit 28614addff

View File

@@ -53,7 +53,18 @@
#
# Authors: Gabe Black
microcode = ""
microcode = '''
def macroop CDQE_R {
sext reg, reg, "env.dataSize << 2"
};
def macroop CQO_R_R {
# A shift might be slower than, for example, an explicit sign extension,
# so it might be worthwhile to try to find an alternative.
mov regm, regm, reg
sra regm, regm, "env.dataSize * 8 - 1"
};
'''
#let {{
# class CBW(Inst):
# "GenFault ${new UnimpInstFault}"