diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2011-03-02 00:41:38 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2011-03-02 00:41:38 -0800 |
commit | 8966312785e30272de6f7453e7662a7bb05bc331 (patch) | |
tree | f61789899fa147b33e99425e3e3b25559fc90848 | |
parent | 579c5f0b65290b46687273fc58bab5f6f2d17e07 (diff) | |
download | gem5-8966312785e30272de6f7453e7662a7bb05bc331.tar.xz |
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
-rw-r--r-- | src/arch/x86/isa/decoder/x87.isa | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |