From: Gabe Black Date: Wed, 2 Mar 2011 08:41:38 +0000 (-0800) Subject: X86: Decode the mysterious and elusive ffreep x87 instruction. X-Git-Tag: stable_2012_02_02~500 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8966312785e30272de6f7453e7662a7bb05bc331;p=gem5.git X86: Decode the mysterious and elusive ffreep x87 instruction. The internet says this instruction was created by accident when an Intel CPU failed to decode x87 instructions properly. It's been documented on a few rare occasions and has generally worked to ensure backwards compatability. One source claims that the gcc toolchain is basically the only thing that emits it, and that emulators/binary translators like qemu and bochs implement it. We won't actually implement it here since we're hardly implementing any other x87 instructions either. If we were to implement it, it would behave the same as ffree but then also pop the register stack. http://www.pagetable.com/?p=16 --- diff --git a/src/arch/x86/isa/decoder/x87.isa b/src/arch/x86/isa/decoder/x87.isa index e44a18f65..ace96fbf6 100644 --- a/src/arch/x86/isa/decoder/x87.isa +++ b/src/arch/x86/isa/decoder/x87.isa @@ -291,7 +291,9 @@ format WarnUnimpl { //0x7: esc7(); 0x7: decode MODRM_REG { 0x0: decode MODRM_MOD { - 0x3: Inst::UD2(); + // The ffreep instruction isn't entirely real. It should work + // the same as ffree but then also pop the register stack. + 0x3: ffreep(); default: fild(); } 0x1: decode MODRM_MOD {