26.11.2012 Views

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

Compiler Usage Guidelines for 64-Bit Operating Systems on AMD64 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>Compiler</str<strong>on</strong>g> <str<strong>on</strong>g>Usage</str<strong>on</strong>g> <str<strong>on</strong>g>Guidelines</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> AMD<str<strong>on</strong>g>64</str<strong>on</strong>g> Plat<str<strong>on</strong>g>for</str<strong>on</strong>g>ms<br />

Does your program rely <strong>on</strong> x87 features?<br />

32035 Rev. 3.22 November 2007<br />

Some Intel compiler switches instruct the compiler to use SSE2 registers and instructi<strong>on</strong>s. If the<br />

results do not match your expectati<strong>on</strong>s when using SSE2, the program may rely <strong>on</strong> some x87 features.<br />

As a diagnostic step, try building the program using x87 operati<strong>on</strong>s <str<strong>on</strong>g>for</str<strong>on</strong>g> floating-point computati<strong>on</strong>s<br />

and see if the results are as expected. Omitting the -QxK, -QxW, and -arch:SSE2 switches<br />

recommended in the general per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance guidelines causes the compiler to build the program using<br />

x87 operati<strong>on</strong>s <str<strong>on</strong>g>for</str<strong>on</strong>g> floating-point computati<strong>on</strong>s.<br />

Because omitting the -QxK, -QxW, and -arch:SSE2 switches could lower per<str<strong>on</strong>g>for</str<strong>on</strong>g>mance, the user<br />

could investigate the precisi<strong>on</strong> requirements of the program. If the user has access to the source code,<br />

it may be possible to adapt the algorithm to SSE2.<br />

4.11.3 Program Terminates Unexpectedly<br />

Are you using an architecture switch that is unsafe <str<strong>on</strong>g>for</str<strong>on</strong>g> AMD Opter<strong>on</strong> processors?<br />

Some architecture switches can cause programs compiled with the Intel compiler versi<strong>on</strong>s 7.1 and 8.0<br />

to terminate unexpectedly when run <strong>on</strong> AMD Opter<strong>on</strong> processors. Table 9 shows 32-bit Intel<br />

compiler architecture switches that are not safe <str<strong>on</strong>g>for</str<strong>on</strong>g> the AMD Opter<strong>on</strong> processor. If a program built<br />

with any of the switches shown in Table 9 produces errors, try building the program without those<br />

switches.<br />

Table 9. Unsafe Architecture Switches in 32-<str<strong>on</strong>g>Bit</str<strong>on</strong>g> Intel <str<strong>on</strong>g>Compiler</str<strong>on</strong>g>s <str<strong>on</strong>g>for</str<strong>on</strong>g> Microsoft ®<br />

Windows ®<br />

<str<strong>on</strong>g>Compiler</str<strong>on</strong>g> Versi<strong>on</strong> Unsafe Architecture Switches<br />

Intel 7.1 -QxK and -QxW<br />

Intel 8.0 -QxK -QxW -QxP -QxB and -QxN<br />

Intel 8.1 -QxN and -QxP<br />

4.11.4 Program Gives Unexpected Results or Excepti<strong>on</strong> Behavior<br />

Does your program need C++ excepti<strong>on</strong> handling?<br />

By default, the Intel C++ compiler <str<strong>on</strong>g>for</str<strong>on</strong>g> Microsoft Windows does not turn <strong>on</strong> C++ excepti<strong>on</strong> handling.<br />

To enable C++ excepti<strong>on</strong>s, use the -GX and -GR switches with the C++ compiler.<br />

4.12 Microsoft ® <str<strong>on</strong>g>Compiler</str<strong>on</strong>g>s (32-<str<strong>on</strong>g>Bit</str<strong>on</strong>g>) <str<strong>on</strong>g>for</str<strong>on</strong>g> Microsoft ®<br />

Windows ®<br />

This secti<strong>on</strong> addresses errors and unexpected results that may be encountered when using 32-bit<br />

Microsoft compilers <str<strong>on</strong>g>for</str<strong>on</strong>g> Microsoft Windows.<br />

52 Troubleshooting and Portability Issues Chapter 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!