IBM Support

LI77366: INEFFICIENT CODE FOR VEC_ANY_NAN

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following test case shows how the compiler produces
    non-optimal code:
    
    ====Compile Line:
    xlC -q64 -O2 -qarch=pwr7 -c -qlist -qaltivec test.C
    
    ====Testcase:
    $ cat test.C
    #include <builtins.h>
    
    extern "C" bool vec_nan(vector double x)
    {
      return vec_any_nan(x);
    }
    $
    
    Generates:
         | 000000                           PDEF     vec_nan
        4|                                  PROC      x,vs34
        6| 000000 xvcmpeqd F002171E   1     VCDCEQ_R
    vs0,cr6=vs34,vs34
        6| 000004 mfcr     7C102026   1     LFCR1     gr0=cr6,6
        6| 000008 rlwinm   5400CFFE   1     RN4       gr0=gr0,25,0x1
        6| 00000C subfic   20000001   1     SUBC      gr0,ca=1,gr0
        6| 000010 cntlzw   7C030034   1     CNTLZ4    gr3=gr0
        6| 000014 addi     3803FFE0   1     AI        gr0=gr3,-32
        6| 000018 rlwinm   54030FFE   1     SRL4      gr3=gr0,31
        7| 00001C bclr     4E800020   1     BA        lr
    
    Optimal code:
         | 000000                           PDEF     vec_nan_opt
        9|                                  PROC      x,vs34
       11| 000030 xvcmpeqd F002171E   1     VCDCEQ_R
    vs0,cr6=vs34,vs34
       11| 000034 addi     38600001   1     LI        gr3=1
       11| 000038 bclr     4C980020   1     BF
    CL.3,cr6,0x1/lt,taken=50%(0,0)
       11| 00003C addi     38600000   1     LI        gr3=0
       12|                              CL.3:
       12| 000040 bclr     4E800020   1     BA        lr
    

Local fix

  • The optimal code can be created using:
    extern "C" bool vec_nan_opt(vector double x)
    {
      return vec_any_ne(x,x);
    }
    

Problem summary

  • USERS AFFECTED:
    Users that want peak performance using the vec_any_nan builtin
    may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    There have been minor performance issues for the vec_any_nan
    builtin function that may not be noticable, but can potentially
    add up if numerous calls are made.
    

Problem conclusion

  • The minor performance issues for vec_any_nan builtin have been
    improved.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77366

  • 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-04-27

  • Closed date

    2013-04-27

  • Last modified date

    2013-04-27

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

    IV37038

  • 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

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
14 October 2021