IBM Support

LI76663: REDUNDANT STORES AND LOADS FOR STOREBCD_URG

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The compiler generates redundant stores and loads for the
    storeBCD_urg() built-in which leads to a performance degradation
    at runtime.
    
    The following test case demonstrates the issue:
    
    ===== COMPILE COMMAND:
    xlC -q64 -O -qarch=pwr7 -qdfp -c load_store_bcd31.C
    
    ===== TESTCASE:
    $cat load_store_bcd31.C
    #include <builtins.h>
    
    
    extern "C" void storeBCD(_Decimal128 dfp, unsigned char *cp,
    unsigned
    long long* op)
    {
       __d128_to_signed_BCD (dfp, 1, (unsigned long long *)cp,
    (unsigned
    long long *)(cp+8));
    }
    
    extern "C" void storeBCD_urg(_Decimal128 dfp, unsigned char *cp,
    unsigned long long* op)
    {
       unsigned long long upper;
       unsigned long long lower;
       __d128_to_signed_BCD (dfp, 1, &upper, &lower);
       *((unsigned long long *)cp) = upper;
       *((unsigned long long *)(cp+8)) = lower;
    }
    
    extern "C" _Decimal128 loadBCD(unsigned char *cp)
    {
       return __signed_BCD_to_d128(*(unsigned long long *)cp,
    *(unsigned
    long long *)(cp+8));
    }
    $
    
    
    ======= ACTUAL LISTING OUTPUT:
     GPR's set/used:   su-s -u-- ---- ----  ---- ---- ---- ----
     FPR's set/used:   ssuu ---- ---- ----  ---- ---- ---- ----
     CCR's set/used:   ---- ----
      VR's set/used:   ---- ---- ---- ----  ---- ---- ---- ----
         | 000000                           PDEF     storeBCD_urg
        0|                                  PROC
    dfp,cp,op,vs2,vs3,gr5,gr6
       16| 000020 ddedpdq  FC181284   1     CVDFESB
    vs0,vs1=vs2,vs3,1
       16| 000024 stfd     D801FFD0   1     STFL
    #MX_WORK2_0(gr1,-48)=vs0
       16| 000028 stfd     D821FFE0   1     STFL
    #MX_WORK2_1(gr1,-32)=vs1
       16| 00002C ld       E801FFD0   1     L8
    gr0=#MX_WORK2_0(gr1,-48)
       16| 000030 ld       E861FFE0   1     L8
    gr3=#MX_WORK2_1(gr1,-32)
       16| 000034 std      F861FFC0   1     ST8
    lower(gr1,-64)=gr3
       16| 000038 std      F801FFC8   1     ST8
    upper(gr1,-56)=gr0
       17| 00003C std      F8050000   1     ST8       (unsigned long
    long;unsigned char)(gr5,0)=gr0
       18| 000040 std      F8650008   1     ST8       (unsigned long
    long;unsigned char)(gr5,8)=gr3
       19| 000044 bclr     4E800020   1     BA        lr
         |               Tag Table
    
    
    ======= EXPECTED LISTING OUTPUT:
     GPR's set/used:   su-s -u-- ---- ----  ---- ---- ---- ----
     FPR's set/used:   ssuu ---- ---- ----  ---- ---- ---- ----
     CCR's set/used:   ---- ----
      VR's set/used:   ---- ---- ---- ----  ---- ---- ---- ----
         | 000000                           PDEF     storeBCD_urg
        0|                                  PROC
    dfp,cp,op,vs2,vs3,gr5,gr6
       16| 000020 ddedpdq  FC181284   1     CVDFESB
    vs0,vs1=vs2,vs3,1
       16| 000024 stfd     D821FFE0   1     STFL
    lower(gr1,-32)=vs1
       16| 000028 stfd     D801FFE8   1     STFL
    upper(gr1,-24)=vs0
       17| 00002C ld       E801FFE8   1     L8
    gr0=upper(gr1,-24)
       18| 000030 ld       E861FFE0   1     L8
    gr3=lower(gr1,-32)
       17| 000034 std      F8050000   1     ST8       (unsigned long
    long;unsigned char)(gr5,0)=gr0
       18| 000038 std      F8650008   1     ST8       (unsigned long
    long;unsigned char)(gr5,8)=gr3
       19| 00003C bclr     4E800020   1     BA        lr
         |               Tag Table
    

Local fix

  • n/a
    

Problem summary

  • USERS AFFECTED:
    Users using -qdfp with the storeBCD_urg function and
    optimization maybe affected by this issue.
    
    PROBLEM DESCRIPTION:
    The compiler is generating redundant stores and loads for the
    storeBCD_urg function.
    

Problem conclusion

  • The compiler has now been fixed to avoid generating redundant
    stores and loads for storeBCD_urg.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76663

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5724X1400

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2012-02-06

  • Closed date

    2012-02-06

  • Last modified date

    2012-02-06

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

    IV10080

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5724X1400

Applicable component levels



Document information

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

Software version: B10

Reference #: LI76663

Modified date: 06 February 2012