What is a default precision for a 64-bit platform with AMD CPU?

What is a default precision for a 64-bit platform with AMD CPU?

Bild des Benutzers Sergey Kostrov

I have two questions:

What is a default precision for a 64-bitplatform with AMD CPU? Is it _PC_64?

Here is a piece of codes from 'float.h' header file ( MS Visual Studios 20xx ):

...

/* Initial Control Word value */
#if     defined( _M_IX86 )
#define _CW_DEFAULT ( _RC_NEAR + _PC_53 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + ... )
#elif   defined( _M_IA64 )
#define _CW_DEFAULT ( _RC_NEAR + _PC_64 + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + ... )
#elif   defined( _M_AMD64 )
#define _CW_DEFAULT ( _RC_NEAR + _EM_INVALID + _EM_ZERODIVIDE + _EM_OVERFLOW + _EM_UNDERFLOW + _EM_INEXACT + ... )
#endif

...

5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Tim Prince
Best Reply

AMD64 here refers to the Windows X64 platform; no distinction regarding Intel64 or AMD64 platforms. The CPU hardware default is 64-bit precision mode (80-bit long double); Microsoft expects software to set 53-bit mode before any user mode x87 instructions are reached.
Microsoft made a change in responsibility for initializing precision mode in the X64 OS. The X64 OS sets 53-bit mode prior to starting your .exe, where the 32-bit OS expected the program to make that initialization. Besides, there is little or no support in the compilers or run-time library for X87 user code in 64-bit mode.
I don't know whether there is a consistency requirement for both the OS and a 32-bit program running under WOW64 to set precision mode. As far as I know, gcc programs run OK under either 32- or 64-bit OS; you might wish to be prepared for the "default" precision mode to be different accordingly. Likewise, when running under linux, you might be prepared for Intel compilers to initialize precision mode where gnu compilers do not.

Bild des Benutzers Sergey Kostrov
Quoting TimP (Intel) AMD64 here refers to the Windows X64 platform; no distinction regarding Intel64 or AMD64 platforms...

Thank you! It was really confusing.

Best regards,
Sergey

Bild des Benutzers Sergey Kostrov

I finally found a topic in MSDN:

"How to: Enable a 64-Bit Visual C++ Toolset at the Command Line"

that explains it, but in a little bit different way:

...
Argument: "x86_amd64"
Compiler: x64 Cross
Host: X86, x64, Itanium
Target Architecture: x64
...
or
...
Argument: "amd64"
Compiler: x64 Native
Host: x64
Target Architecture: x64
...

Bild des Benutzers Sergey Kostrov

...and it explains why MS Depends shows 'AMD64' in a CPU columnfora 64-bit application:

Melden Sie sich an, um einen Kommentar zu hinterlassen.