Re: Either 64bit mode or floating-point ?
- From: Grumble <devnull@xxxxxxxxxx>
- Date: Thu, 09 Mar 2006 10:43:59 +0100
Peter Michael Hager wrote:
I am a slightly confused about a statement found at Tom's Hardware Guide:
"The activation of the 64 bit mode does, in practice, have one noteworthy
disadvantage: the floating-point unit is thereby rendered inoperable (even
for AMD)."
This is, quite simply, not true.
64-Bit Media and x87 Floating-Point Instructions
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26569.pdf
<quote AMD>
This chapter describes the function, mnemonic syntax, opcodes, affected
flags, and possible exceptions generated by the 64-bit media
instructions. These instructions operate on data located in the 64-bit
MMX registers. [...]
The 64-bit media instructions can be used in legacy mode or long mode.
[...] Compilation of 64-bit media programs for execution in 64-bit mode
offers four primary advantages: access to the eight extended, 64-bit
general-purpose registers (for a register set consisting of GPR0–GPR15),
access to the eight extended XMM registers (for a register set
consisting of XMM0–XMM15), access to the 64-bit virtual address space,
and access to the RIP-relative addressing mode.
</quote>
MMX in 64-bit mode... OK
<quote AMD>
This chapter describes the function, mnemonic syntax, opcodes, condition
codes, affected flags, and possible exceptions generated by the x87
floating-point instructions. The x87 floating-point instructions are
used in legacy floating-point applications. Most of these instructions
load, store, or operate on data located in the x87 ST(0)-ST(7) stack
registers (the FPR0-FPR7 physical registers). The remaining instructions
within this category are used to manage the x87 floating-point
environment. [...]
The x87 instructions can be used in legacy mode or long mode. [...]
Compilation of x87 media programs for execution in 64-bit mode offers
two primary advantages: access to the 64-bit virtual address space and
access to the RIP-relative addressing mode.
</quote>
x87 in 64-bit mode... OK
In other words, as far as the hardware is concerned, MMX and x87 are
completely supported in 64-bit mode.
However, a looong time ago, Microsoft claimed they would deprecate MMX
and x87 by not saving the state on a context switch.
*But* they changed their mind along the way:
http://blogs.technet.com/josebda/archive/2005/04/30/404353.aspx
levicki wrote:
I have read somewhere in MSDN (perhaps it was in DDK part) that
Windows x64 will not preserve state of FPU and MMX registers across
context switch and that the code written to take advantage of FPU
and MMX will not work. Does that still apply and if it does what is
the scope? 64-bit apps, drivers, 32-bit apps or all of them?
Program Manager in Visual C++ Group wrote:
It does preserve the state. It's the DDK page that has stale
information, which I've requested it to be changed. Let them know that
the OS does preserve state of x87 and MMX registers on context switches.
Software Engineer in Windows Kernel Group added:
For user threads the state of legacy floating point is preserved at
context switch. But it is not true for kernel threads. Kernel mode
drivers can not use legacy floating point instructions.
Does that mean, I will have to emulate the f-instructions when using the
AMD64 or EM64T mode (win-x64) on these processors, like I did in former
times with the 486sx and its predecessors ?
If you are writing Windows application code, MMX and x87 are supported
in 64-bit mode.
--
Regards, Grumble
.
- References:
- Either 64bit mode or floating-point ?
- From: PeterMichaelHager
- Either 64bit mode or floating-point ?
- Prev by Date: Re: SSE/MMX peculiarity on AMD AthlonXP
- Next by Date: Re: 64 bit asm
- Previous by thread: Re: Either 64bit mode or floating-point ?
- Next by thread: Re: Compiler inserts redundant comparison against zero
- Index(es):
Relevant Pages
|