InvestorsHub Logo
Followers 4
Posts 4127
Boards Moderated 0
Alias Born 03/06/2003

Re: jhalada post# 27447

Thursday, 02/26/2004 2:47:16 PM

Thursday, February 26, 2004 2:47:16 PM

Post# of 97595
fastpathguru, jhalada, x87 Floating Point -

I'm trying to resolve that question. The manual is a little confusing, but here goes. From p. 283-284 (Volume 1):

6.1.2 Compatibility
x87 floating-point instructions can be executed in any of the architecture’s operating modes. Existing x87 binary programs run in legacy and compatibility modes without modification. The support provided by the AMD64 architecture for such binaries is identical to that provided by legacy x86 architectures.

To run in 64-bit mode, x87 floating-point programs must be recompiled. The recompilation has no side effects on such programs, other then to make available the extended general purpose registers and 64-bit virtual address space.


OK - we see that x87 floating-point is run in Compatibility Mode just like Protected Mode, as one would expect to insure binary compatibility. This reason alone suggests that these instructions will be with us for some time because Compatibility Mode is part of Long Mode. Thus dropping Legacy Mode does not remove the requirement for x87.

The implication here is that recompiling for 64-bit mode results in different opcodes, but what I can't understand from this explanation is whether the compiler implements a translation to a more efficient method. I suspect it continues to be the stack-oriented x87. Looking at page 350, Performance Considerations, we find:

6.11.1 Replace x87 Code with 128-Bit Media Code
Code written with 128-bit media floating-point instructions can operate in parallel on four times as many single-precision floating-point operands as can x87 floating-point code. This achieves potentially four times the computational work of x87 instructions that use single-precision operands. Also, the higher density of 128-bit media floating-point operands may make it possible to remove local temporary variables that would otherwise be needed in x87 floating-point code. 128-bit media code is easier to write than x87 floating-point code, because the XMM register file is flat rather than stack-oriented, and, in 64-bit mode there are twice the number of XMM registers as x87 registers.


This leads me to believe that traditional x87 is supported in 64-bit mode, but it is an isolated set of logic which does not interfere with the preferred 128-Bit Media Code. AMD seems to be saying 'we have to support this stuff, but if you use the new 64-bit replacement then your code will be executed on a totally different & better part of the core'. There seems to be little, if any, overlap in the underlying implementations.

Of course, recompiling high level applications will result in automatic use of the preferred 128-Bit Media Code, except for stuff in old code which may have hard coded certain x87 instructions. If Microsoft drops support for x87 in their 64-bit compilers then that will force those sections of old code to be updated, they will show up as compile time errors.

Volume:
Day Range:
Bid:
Ask:
Last Trade Time:
Total Trades:
  • 1D
  • 1M
  • 3M
  • 6M
  • 1Y
  • 5Y
Recent AMD News