Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.
공지
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

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

SergeyKostrov
소중한 기여자 II
1,886 조회수
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 포인트
1 솔루션
TimP
명예로운 기여자 III
1,886 조회수
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 포인트
4 응답
TimP
명예로운 기여자 III
1,887 조회수
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 포인트
SergeyKostrov
소중한 기여자 II
1,886 조회수
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 포인트
SergeyKostrov
소중한 기여자 II
1,886 조회수
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 포인트
SergeyKostrov
소중한 기여자 II
1,886 조회수
...and it explains why MS Depends shows 'AMD64' in a CPU columnfora 64-bit application:


0 포인트
응답