Fixes are available
XL C/C++ for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C for AIX Fix Pack 5 (November 2015 Update) for 13.1
XL C/C++ for AIX Fix Pack 5 (November 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 6 (February 2016 PTF) for 13.1
XL C for AIX Fix Pack 6 (February 2016 Update) for 13.1
XL C for AIX Fix Pack 7 (May 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C for AIX Fix Pack 8 (August 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C for AIX Fix Pack 9 (June 2017 Update) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C for AIX Fix Pack 10 (February 2018 Update) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
XL C for AIX Fix Pack 11 (November 2018) for 13.1
APAR status
Closed as program error.
Error description
xlC does not take the opportunity to use vector splat immediate for memset. For input values -16..+15 for second parameter a single vspltisb instruction can be used to construct a vector. ===== COMPILE COMMAND: xlC -q64 -O2 -qlist test.cpp -qarch=pwr7 -qaltivec ===== TESTCASE: $ cat test.cpp #include <builtins.h> #include <string.h> void memset16(void *out) { __alignx(4,out); memset(out, 0, 16); } $ ===== ACTUAL OUTPUT: VR's set/used: ---- ---- ---- ---- ---- ---- ---- ---- | 000000 PDEF memset16(void *) | 000000 AKA memset16__FPv 4| PROC out,gr3 398| 000000 addi 38000000 1 LI gr0=0 398| 000004 std F8030000 1 ST8 (char)(gr3,0)=gr0 398| 000008 std F8030008 1 ST8 (char)(gr3,8)=gr0 8| 00000C bclr 4E800020 1 BA lr | Tag Table | 000010 00000000 00092000 00000000 00000010 | Instruction count 4 ===== EXPECTED OUTPUT: The output could also look like: xxlxor 0,0,0 stvd2x 0,0,<out>
Local fix
N/A
Problem summary
USERS AFFECTED: Users who use memset are affected by this issue. PROBLEM DESCRIPTION: The compiler was generating inefficient code for memset code when -qarch=pwr7 was specified.
Problem conclusion
The compiler has been fixed so that when changing memset into vector instructions, the compiler uses two other instructions for edge cases to generate 0x00 and 0xff to have one cycle saved on power 7.
Temporary fix
Comments
APAR Information
APAR number
IV65273
Reported component name
XL C FOR AIX
Reported component ID
5725C7100
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-09-26
Closed date
2014-09-26
Last modified date
2014-09-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C FOR AIX
Fixed component ID
5725C7100
Applicable component levels
RD10 PSY
UP
Document Information
Modified date:
01 October 2021