IBM Support

LI77655: SUBOPTIMAL CODE SEQUENCES FOR MULTIPLICATION

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

    LI77655

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    IV37629

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels



Document information

More support for: XL C/C++ for Linux
Compiler

Software version: 12.1

Reference #: LI77655

Modified date: 28 October 2013