The -qarch compiler option specifies the processor architecture for which code is generated. The -qtune compiler option tunes instruction selection, scheduling, and other architecture-dependent performance enhancements to run best on a specific hardware architecture.
The new -qarch=pwr8 suboption produces object code containing instructions that will run on the POWER8 hardware platforms. With the new -qtune=pwr8 suboption, optimizations are tuned for the POWER8 hardware platforms.
For more information, see -qarch and -qtune .
The IBM XL C/C++ compiler has partially supported C++11 features. The -qlanglvl=extended0x group option can enable or disable all these features in batch. Besides this group option, each C++11 feature has an individual controlling -qlanglvl suboption. If several -qlanglvl options are specified, the last one takes effect.
For the details of option -qlanglvl, see http://www-01.ibm.com/support/knowledgecenter/api/content/SSXVZZ_13.1.0/com.ibm.xlcpp131.linux.doc/compiler_ref/opt_langlvl.html .
For the C++11 features that XL... [More]
The z/OS V2R1 XL C/C++ compiler introduces support for OpenMP parallelization directives. Parallelization of C/C++ program code can be enabled by specifying the SMP compiler option.
z/OS XL C/C++ compiler supports shared memory program parallelization by explicit parallelization of C and C++ program code using pragma directives that are compliant to the OpenMP Application Program Interface specification. When the SMP compiler option is in effect, program code with OpenMP directives that are compliant to the OpenMP API 3.1... [More]
In XL C/C++ for AIX, V13.1, a new suboption, stackclobber , is added to the -qcheck option to detect stack corruption of nonvolatile registers in the save area in user programs. This type of corruption happens only if any of the nonvolatile registers in the save area of the stack is modified. When such violation is encountered, a runtime error will be raised by sending a SIGTRAP signal to the process.
Here's an example that shows the effect of -qcheck=stackclobber :
void func4(char *p, int off, int... [More]
IBM XL C/C++ for Linux, V13.1 supports an extended feature "Visibility attributes of entities" to assist with performance tuning and application optimization.
The visibility attributes of entity describe whether and how an entity defined in one module can be referenced or used in other modules. Visibility attributes affect entities with external linkage only, and cannot increase the visibility of other entities. By specifying visibility attributes for entities, you can export only the entities that are necessary to shared... [More]
The C++11 standard introduced a new keyword, nullptr as a null pointer constant. The nullptr constant can be distinguished from integer 0 for overloaded functions. The constants of 0 and NULL are treated as of the integer type for overloaded functions, whereas nullptr can be implicitly converted to only the pointer type, pointer-to-member type, and bool type.
Before C++11, initializing null pointers with 0 or NULL makes it impossible to distinguish between a null pointer and integer 0 for overloaded functions. For example, see the... [More]
We have published a paper (two-part series) to introduce symbol visibility.
Part I: you may get to know the fundamental concept about symbol and symbol visibility, and ways for a programmer to make symbol visibility under control on IBM® AIX® that runs on the IBM POWER® platform. Further, the article details about symbol preemption to show the subtle difference between exported symbol and symbol that is exported but also protected.
C++ 14 is here, and its proceeding to publication this year.
On Aug 18, C++ 14 was formally ratified.
We had one C++ Standard meeting since my last blog post for Issaquah Standard meeting , and that was in Rapperswil, Switzerland in June 16-21. We were there several years ago, and it is always nice to be in among the pristine lakes of the Switzerland Alps.
Jens Weller, who runs Meeting C++ has described a few of my recent talks on C++14 at C++Now (as well as previously at ADC++ 2014) as well as ongoing... [More]
The C++11 standard generalizes the concept of constant expressions and introduces a new keyword constexpr as a declaration specifier. A constant expression is an expression that can be evaluated at compile time by the compiler. The major benefits of this feature are as follows:
Improves type safety and portability of code that requires compile-time evaluation
Improves support for systems programming, library building, and generic programming
Improves the usability of Standard Library components.... [More]
The origin of Type Traits can be traced back to the TR1 and boost libraries. However, the T ype Traits feature is formally introduced into the C++ language in the C++11 standard library. As its name suggests, Type Traits exposes different characteristics of types, or simply the “type of type”. In many C++ programming practices, especially these in template metaprogramming, developers may find it difficult to build a template work for all types without knowing the characteristics of a type. That’s the key reason for... [More]
The XL C/C++ for AIX Fix Pack 19 (August 2014 PTFs) for 11.1 are now available at the following links and on Fix Central:
XL C /C+ + fo r AI X Fi x Pa c k 19 (August 2 014 PTF ) fo r 11 . 1
Fix lis t fo r XL C/C + + f o r A I X
XL C fo r AI X Fi x Pa c k 19 (August 2 014 PTF ) fo r 11 . 1
Fix lis t fo r XL C f o r A... [More]
Note: This article was originally written in Chinese by Xiao Feng Guan/China/IBM. I translated this article into English. If you have any comments, please feel free to contact the original author or me.
In C++11, with the introduction of rvalue reference, the performance of the std::string class has been improved greatly. Besides, the std::string class has included many new APIs, including the stoi / stol / sto member functions ,as well as the std::to_string global function. These two kinds of functions are very useful in... [More]
In IBM XL C/C++ for Linux, V13.1, we support a vector built-in function vec_gbb that can perform a gather-bits-by-bytes operation on the input.
NOTE: This built-in function is valid only when -qarch is set to target POWER8™ processors.
The following table describes the types of the function returned value " d" and the argument " a".
The same type as the... [More]
In June 2014, documentation for XL C/C++ for AIX and Linux, V13.1 was published successfully on IBM Knowledge Center, instead of information center.
Prior to IBM Knowledge Center, IBM product documentation was hosted on various information center servers and maintained separately by various product teams. IBM Knowledge Center provides a central repository for all IBM product documentation. With IBM Knowledge Center, you can easily perform the following tasks with product documentation:
1. Read and search documentation... [More]
Authors: Garfee Guan, Sumi Chen
Standard C++14 makes C++11 more complete as C++11 has a lot of imperfections. C++14 not only amends C++11 but also proposes many new features, among which the most eye-catching one is the supplements to lambda-expressions.
Lambda-expression is the most interesting feature in C++11 that challenges the long-used way of defining functions. C++14 proposes two major supplements to this famous feature.
The first supplement is called “generalized lambda-capture” that comes from... [More]