Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

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

SergeyKostrov
Valued Contributor II
843 Views
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 ):

[cpp]... /* 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 ... [/cpp]
0 Kudos
1 Solution
TimP
Honored Contributor III
843 Views
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.

View solution in original post

0 Kudos
4 Replies
TimP
Honored Contributor III
844 Views
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.
0 Kudos
SergeyKostrov
Valued Contributor II
843 Views
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
0 Kudos
SergeyKostrov
Valued Contributor II
843 Views
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
...
0 Kudos
SergeyKostrov
Valued Contributor II
843 Views
...and it explains why MS Depends shows 'AMD64' in a CPU columnfora 64-bit application:


0 Kudos
Reply