IBM Support

IV37629: SUBOPTIMAL CODE SEQUENCES FOR MULTIPLICATION

Fixes are available

XL C/C++ for AIX Fix Pack 4 (June 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 4 (June 2013 PTF) for 12.1
XL C for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Compiler generates suboptimal code sequences for multiplication
    with characteristic immediate.
    
    Consider the following test case:
    
    $cat test.C
    /*********************************************************/
    extern "C" unsigned long long mulimm(unsigned long long in)
    {
      return in * 0xEFE000ULL;
    }
    /*********************************************************/
    
    Compile source test.C as:
    
    xlC -q64 -O2 -qlist test.C -qarch=pwr7 -c
    
    Review the content of test.lst file. Instead of sequence:
    
    ...
    ...
    | 000000                           PDEF     mulimm
        1|                                  PROC      in,gr3
        3| 000000 addis    3C0000EF   1     LIU       gr0=239
        3| 000004 ori      6000E000   1     OIL       gr0=gr0,0xE000
        3| 000008 mulld    7C6301D2   1     M         gr3=gr3,gr0
        4| 00000C bclr     4E800020   1     BA        lr
    
    The compiler now generates more effective sequence of
    instructions:
    
    ...
    ...
    | 000000                           PDEF     mulimm
        1|                                  PROC      in,gr3
        3| 000000 mulli    1C03077F   0     M8        gr0=gr3,1919
        3| 000004 rldicr   78036CA4   2     SLL8      gr3=gr0,13
        4| 000008 bclr     4E800020   1     BA        lr
    

Local fix

  • Don't use this kind of immediate as one of the multiplier or
    shift it appropriately
    

Problem summary

  • Compiler generates suboptimal code sequences for multiplication
    with characteristic immediate on Power7
    

Problem conclusion

  • We now shift the imediate and issue MULLI instruction for
    multiplicat      and then shift back
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV37629

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-03-05

  • Closed date

    2013-06-17

  • Last modified date

    2013-06-17

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    LI77655

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels



Document information

More support for: XL C for AIX
Compiler

Software version: 12.1

Reference #: IV37629

Modified date: 17 June 2013