Preventive Service Planning
Abstract
This page contains corrections and additions to the product documentation shipped with IBM XL C/C++ for AIX, V10.1.
Content
Language Reference
The following corrections and additions apply to the IBM XL C/C++ for AIX, V10.1 Language Reference:
Chapter: Special member functions (C++ only)
Section: Constructors
Topic: Initialization of base classes and members
B1::B1(int)
B1::B1()
D1::D1(int, int)
should read:
B1::B1(int)
B2::B2()
D1::D1(int, int)
Chapter: The IBM XL C language extensions
In C99 features as extensions to C89:
One of the possible values for -qlanglvl is specified as "stcd99".
It should read "stdc99".
Compiler Reference
The following corrections and additions apply to the IBM XL C/C++ for AIX, V10.1 Compiler Reference:
Chapter: Configuring compiler defaults
Section: Setting environment variables
Topic: Environment variables for parallel processing
In "XLSMPOPTS", the description of stack=num should read:
stack=num
- Specifies the largest amount of space in bytes (num) that a thread's stack needs. The default value for num is 4194304.
Set num so it is within the acceptable upper limit. num can be up to 256 MB for 32-bit mode, or up to the limit imposed by system resources for 64-bit mode. An application that exceeds the upper limit may cause a segmentation fault.
Chapter: Compiler options reference
Section: Individual option descriptions
Topic: -qdfp
The following new information is added:
Note: To use decimal floating-point types and literals, you must also enable specific code in header files by defining the __STDC_WANT_DEC_FP__ macro at compiler time. See Examples.
Examples
To compile myprogram.c so that the compiler supports decimal floating-point types and literals, enter:
xlc myprogram.c -qarch=pwr7 -qdfp -D__STDC_WANT_DEC_FP__
Topic: -qfloat
-qfloat=fltint | nofltint option
The following new information is added:
If -qarch is set to a processor that has an instruction to convert from floating point to integer, that instruction will be used regardless of the [no]fltint setting. This conversion also applies to all PowerPC processors in 64-bit mode.
- -qfloat=dfpemulate:nofenv:nofltint:fold: nohscmplx:nohsflt:nohssnglmaf:nonans:norelax:rndsngl:rngchk:norrm:norsqrt:single:nospnans
should read:
- -qfloat=dfpemulate:nofenv:nofltint:fold: nohscmplx:nohsflt:nohssngl:maf:nonans:norelax:rndsngl:rngchk:norrm:norsqrt:single:nospnans
__IBM_FAST_SET_MAP_ITERATOR macro
This new macro enables the linked list data structure for STL set<...>::iterator or map<...>::iterator, and its variants, multiset or multimap. This macro provides a faster way to carry out ++ or -- iteration operations for those C++ applications that make extensive use of the set or map iterator to perform many more lookups rather then insertions, erasures, or deletions.
This macro changes how the ++ or -- operation is accessed and the double-linked list is maintained through the insertion and erasure operations. If you intermix applications compiled with this macro with those that are not, there is a potential for incompatibility in terms of incorrect runtime results.
-qinfo=private suboption
In the syntax diagram the suboption -qinfo=private has no effect when specified and should be removed. Instead, use the -qreport option to report compiler-driven automatic parallelization cases; user parallelization cases are not reported.
Topic: -qlanglvl
-qlanglvl=[no]FileScopeConstExternLinkage option
The following -qlanglvl option is added:
[no]FileScopeConstExternLinkage
Controls whether the file scope of constant variables have internal or external linkage when the static or extern keyword is not specified.
When -qlanglvl=fileScopeConstExternLinkage is in effect, all file scope constant variables are marked as externally visible. Otherwise, all file scope constant variables are marked as static.
Default: nofileScopeConstExternLinkage
Chapter: Configuring compiler defaults
Section: Setting environment variables
Under The XLSMPOPTS environment variable, the following option has been added under Parallel execution options:
procs=cpu_id[,cpu_id,...]
Enables thread binding and specifies a list of cpu_id to which the threads are bound. If the number of CPU IDs specified is less than the number of threads used by the program, the remaining threads are not bound.
Chapter: Compiler pragmas reference
Section: Individual pragma descriptions
Topic: #pragma reg_killed_by
fs
- Floating-point and status control register
Should read:
fsr
- Floating-point and status control register
Topic: #pragma stream_unroll
Examples
Should read:
The following example shows how #pragma stream_unroll can increase performance.
int i, m, n;
int a[1000];
int b[1000];
int c[1000];
....
#pragma stream_unroll(4)
for (i=0; i<n; i++) {
a[i] = b[i] * c[i];
}
The unroll factor of 4 reduces the number of iterations from n to n/4, as follows:
m = n/4;
for (i=0; i<n/4; i++){
a[i] = b[i] + c[i];
a[i+m] = b[i+m] + c[i+m];
a[i+2*m] = b[i+2*m] + c[i+2*m];
a[i+3*m] = b[i+3*m] + c[i+3*m];
}
The increased number of read and store operations are distributed among a number of streams determined by the compiler, which reduces computation time and increase performance.
Chapter: Compiler predefined macros
Section: Macros indicating the XL C/C++ compiler product
The Description and Predefined value of __xlC__ should be updated as follows:
Predefined macro name | Description | Predefined value |
__xlC__ | Indicates the VR level of the XL C and XL C++ compilers in hexadecimal format. Using the XL C compiler also automatically defines this macro. | A four-digit hexadecimal integer in the format 0xVVRR, where: V
In XL C/C++ V10.1, the value of the macro is 0x0a01. |
The following predefined macro should be added in the table:
Predefined macro name | Description | Predefined value |
__xlC_ver__ | Indicates the MF level of the XL C and XL C++ compilers in hexadecimal format. Using the XL C compiler also automatically defines this macro. | An eight-digit hexadecimal integer in the format 0x0000MMFF, where: M
In XL C/C++ V10.1, PTF 10.1.0.3, the value of the macro is 0x00000003. |
Optimization and Programming Guide
The following correction applies to the IBM XL C/C++ for AIX, V10.1 Optimization and Programming Guide:
Chapter: Handling floating-point operations
Topic: Compiling a decimal floating-point program
The following text:
If you are using decimal floating-point formats in your programs, use the -qdfp option when you compile them. For example, to compile the following Hello World program dfp_hello.c, the compiler invocation is:
xlc -qdfp dfp_hello.c
Should read:
If you are using decimal floating-point formats in your programs, use the -qdfp option and define the __STDC_WANT_DEC_FP__ macro when you compile them.
For example, to compile dfp_hello.c, use the following compiler invocation:
xlc dfp_hello.c -qdfp -qarch=pwr7 -D__STDC_WANT_DEC_FP__
Chapter: Parallelizing your programs
Topic: Shared and private variables in a parallel environment
The following text:
The compiler can privatize some shared variables if it is possible to do so without changing the semantics of the program. For example, if each loop iteration uses a unique value of a shared variable, that variable can be privatized. Privatized shared variables are reported by the -qinfo=private option. Use critical sections to synchronize access to all shared variables not listed in this report.
Should read:
The compiler can privatize some shared variables if it is possible to do so without changing the semantics of the program. For example, if each loop iteration uses a unique value of a shared variable, that variable can be privatized. Privatized shared variables are reported by the -qreport option. Use critical sections to synchronize access to all shared variables not listed in this report.
For information on how to list which shared variables are privatized by the compiler, see:
How to list privatized shared variables in an automatic parallel loop
Was this topic helpful?
Document Information
Modified date:
06 December 2018
UID
swg21329031