x86: implements emms instruction

This commit is contained in:
Nilay Vaish
2013-01-15 07:43:20 -06:00
parent 91b00d98a5
commit 7f5463539b
5 changed files with 13 additions and 2 deletions

View File

@@ -604,7 +604,7 @@
0x4: Inst::PCMPEQB(Pq,Qq);
0x5: Inst::PCMPEQW(Pq,Qq);
0x6: Inst::PCMPEQD(Pq,Qq);
0x7: WarnUnimpl::emms();
0x7: Inst::EMMS();
}
// repe (0xF3)
0x4: decode OPCODE_OP_BOTTOM3 {

View File

@@ -36,6 +36,9 @@
# Authors: Gabe Black
microcode = '''
# EMMS
def macroop EMMS {
emms
};
# FEMMS
'''

View File

@@ -212,6 +212,7 @@ let {{
assembler.symbols["fsw"] = readFpReg("FSW")
assembler.symbols["fcw"] = readFpReg("FCW")
assembler.symbols["ftw"] = readFpReg("FTW")
macroopDict = assembler.assemble(microcode)

View File

@@ -1502,4 +1502,10 @@ let {{
else if(arg1 == arg2)
ccFlagBits = ccFlagBits | ZFBit;
'''
class Emms(MediaOp):
def __init__(self):
super(Emms, self).__init__('InstRegIndex(MISCREG_FTW)',
'InstRegIndex(0)', 'InstRegIndex(0)', 0)
code = 'FTW = 0xFFFF;'
}};

View File

@@ -162,6 +162,7 @@ def operands {{
# Registers related to the state of x87 floating point unit.
'TOP': controlReg('MISCREG_X87_TOP', 66, ctype='ub'),
'FSW': controlReg('MISCREG_FSW', 67, ctype='uw'),
'FTW': controlReg('MISCREG_FTW', 68, ctype='uw'),
# The segment base as used by memory instructions.
'SegBase': controlReg('MISCREG_SEG_EFF_BASE(segment)', 70),