From: Nilay Vaish Date: Tue, 28 Jan 2014 00:50:52 +0000 (-0600) Subject: x86: implements fxch instruction. X-Git-Tag: stable_2014_08_26~188 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5be0b846b1ca0131fc6c67c1ff7dcf64791ebc73;p=gem5.git x86: implements fxch instruction. --- diff --git a/src/arch/x86/isa/decoder/x87.isa b/src/arch/x86/isa/decoder/x87.isa index ac1306412..61f125e7c 100644 --- a/src/arch/x86/isa/decoder/x87.isa +++ b/src/arch/x86/isa/decoder/x87.isa @@ -59,7 +59,7 @@ format WarnUnimpl { default: Inst::FLD(Md); } 0x1: decode MODRM_MOD { - 0x3: fxch(); + 0x3: Inst::FXCH(Eq); default: Inst::UD2(); } 0x2: decode MODRM_MOD { @@ -240,8 +240,14 @@ format WarnUnimpl { 0x3: Inst::UD2(); default: fisttp(); } - 0x2: Inst::FST(Eq); - 0x3: Inst::FSTP(Eq); + 0x2: decode MODRM_MOD { + 0x3: Inst::FST(Eq); + default: Inst::FST(Mq); + } + 0x3: decode MODRM_MOD { + 0x3: Inst::FSTP(Eq); + default: Inst::FSTP(Mq); + } 0x4: decode MODRM_MOD { 0x3: fucom(); default: frstor(); diff --git a/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/exchange.py b/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/exchange.py index 982ac8e55..b6fbb01cc 100644 --- a/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/exchange.py +++ b/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/exchange.py @@ -36,5 +36,20 @@ # Authors: Gabe Black microcode = ''' -# FXCH +def macroop FXCH_R +{ + movfp ufp1, sti + movfp sti, st(0) + movfp st(0), ufp1 +}; + +def macroop FXCH_M +{ + fault "new UnimpInstFault" +}; + +def macroop FXCH_P +{ + fault "new UnimpInstFault" +}; '''