32-bit and 64-bit application development

You can use XL C/C++ to develop both 32-bit and 64-bit applications. This section contains reference information and other portability considerations for moving C and C++ programs from 32-bit to 64-bit mode.

A porting exercise is a true port if the hardware and operating systems are the only things that are changed. Moving a 32-bit application to a 64-bit programming model as part of the process of migrating to Linux means that the exercise is no longer a true port but a development activity. A 32-bit application with any of the following characteristics is very likely to require changes when ported to a 64-bit environment:

Developing in 64-bit mode allows the application to take advantage of the newer, faster 64-bit hardware and operating systems to improve performance on large, complex, memory-intensive programs, such as database and scientific applications. Applications that are limited by a 32-bit address space, such as database applications, Web search engines, and scientific computing applications, are likely to benefit from a transition to the 64-bit mode. I/O bound applications in 64-bit mode can also realize improved performance by keeping data in memory rather than writing to disk, since disk I/O is usually slower than memory access.

The ability to handle larger problems directly in physical memory is perhaps the most significant performance benefit of 64-bit machines. However, some applications compiled in 32-bit mode perform better than when they are recompiled in 64-bit mode. Some reasons for this include:

Other disadvantages of 64-bit applications are that they require more stack space to hold the larger registers. Applications have a bigger cache footprint due to the larger pointer size. 64-bit applications do not run on 32-bit platforms.

Some ways to compensate for the performance liabilities of 64-bit programs are listed below.

Well-written code is likely to compile and run correctly with a minimum of rework and debugging if moved to the 64-bit programming model. The term well-written implies conformance to the language standard and adherence to good programming practices. In the context of moving to a 64-bit programming model, the term also includes the notions that the code does not depend on a specific byte order nor on external data formats, and that it uses function prototypes, appropriate system header files, and system-derived data types IBM Copyright 2003