The compiler options that are described in this section enable you to do
the following:
- Develop applications for the 64-bit environment
- Help migrate source code from the 32-bit environment to a 64-bit
environment
Some of these options already exist in the 32-bit environment but have
new settings particular to the 64-bit architecture. This section only
covers the new settings for these cases. The options that are grouped
here are primarily for developers who are targetting 64-bit platforms.
Syntax
-q32
Enables 32-bit compilation bit mode (or, more briefly, 32-bit mode) support
in a 64-bit environment. The -q32 option indicates the
compilation bit mode and, together with the -qarch option, determines
the target machines that the 32-bit executable will run on.
Rules
- The default integer and default real size are 4 bytes in 32-bit
mode.
- The default integer pointer size is 4 bytes in 32-bit mode.
- 32-bit object modules are created when targeting 32-bit mode.
- -q32 is the default.
- -q64 may override -q32.
- All settings for -qarch are compatible with -q32.
If you specify -q32, the default suboption is ppc64grsq, and the default -qtune suboption for -q32 is
pwr4.
- The LOC intrinsic returns an INTEGER(4) value.
Examples
- Using 32-bit compilation mode and targetting a generic PowerPC architecture:
-qarch=ppc -q32
- Now keep the same compilation mode, but change the target to RS64II:
-qarch=ppc -q32 -qarch=rs64b
Notice that the last setting for -qarch wins.
- Now keep the same target, but change the compilation mode to 64-bit:
-qarch=ppc -q32 -qarch=rs64b -q64
Notice that specifying -q64 overrides the earlier instance of
-q32.
Syntax
-q64
Indicates the 64-bit compilation bit mode and, together with the
-qarch option, determines the target machines on which the 64-bit
executable will run. The -q64 option indicates that the object
module will be created in 64-bit object format and that the 64-bit instruction
set will be generated. Note that you may compile in a 32-bit
environment to create 64-bit objects, but you must link them in a 64-bit
environment with the -q64 option.
Rules
- Settings for -qarch that are compatible with -q64 are as
follows:
- -qarch=auto (if compiling on a 64-bit system)
- -qarch=com (With -q64 and -qarch=com, the
compiler will silently upgrade the arch setting to
ppc64.)
- -qarch=ppc (With -q64 and -qarch=ppc, the
compiler will silently upgrade the arch to ppc64.)
- -qarch=ppcgr (With -q64 and -qarch=ppcgr,
the compiler will silently upgrade the arch to ppc64gr.)
- -qarch=ppc64
- -qarch=ppc64gr
- -qarch=ppc64grsq
- -qarch=rs64b
- -qarch=rs64c
- -qarch=pwr3
- -qarch=pwr4
- -qarch=pwr5
- -qarch=ppc970
- The default -qarch setting for -q64 is ppc64.
- 64-bit object modules are created when targeting 64-bit mode.
- -q32 may override -q64.
- -q64 will override a conflicting setting for -qarch and will result in the setting -q64 -qarch=ppc64 along with a warning message.
- The default tune setting for -q64 is -qtune=pwr4.
- The default integer and default real size is 4 bytes in 64-bit
mode.
- The default integer pointer size is 8 bytes in 64-bit mode.
- The maximum array size increases to approximately 2**40 bytes (in static
storage) or 2**60 bytes (in dynamic allocation on the heap). The
maximum dimension bound range is extended to -2**63, 2**63-1 bytes. The
maximum array size for array constants has not been extended and will remain
the same as the maximum in 32-bit mode. The maximum array size that you
can initialize is 2**28 bytes.
- The maximum iteration count for array constructor implied DO loops
increases to 2**63-1 bytes.
- The maximum character variable length extends to approximately 2**40
bytes. The maximum length of character constants and subobjects of
constants remains the same as in 32-bit mode, which is 32 767 bytes
(32 KB).
- The LOC intrinsic returns an INTEGER(8) value.
- When you use -qautodbl=dblpad in 64-bit mode, you should use
-qintsize=8 to promote INTEGER(4) to INTEGER(8) for
8 byte integer arithmetic.
Examples
This example targets the RS64II (also known as
RS64b) in 64-bit mode:
-q32 -qarch=rs64b -q64
In this example 64-bit compilation that targets the common group of 64-bit
architectures (which currently consists only of the
RS64II, RS64III,
POWER3, POWER4, POWER5, and PowerPC 970):
-q64 -qarch=com
arch setting is silently upgraded to ppc64, the most
"common" 64-bit mode compilation target.
Syntax
-qwarn64 | -qnowarn64
Aids in porting code from a 32-bit environment to a 64-bit environment by
detecting the truncation of an 8-byte integer pointer to 4 bytes. The
-qwarn64 option uses informational messages to identify statements
that may cause problems with the 32-bit to 64-bit migration.
Rules
- The default setting is -qnowarn64.
- You can use the -qwarn64 option in both 32-bit and 64-bit
modes.
- The compiler flags the following situations with informational
messages:
- The assignment of a reference to the LOC intrinsic to an
INTEGER(4) variable.
- The assignment between an INTEGER(4) variable or
INTEGER(4) constant and an integer pointer.
- The specification of an integer pointer within a common block.
- The specification of an integer pointer within an equivalence
statement.
