Skip to main content

IV37038: 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

    IV37038

  • 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-02-20

  • Closed date

    2013-03-12

  • Last modified date

    2013-03-13

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

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

    LI77366

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

  • RC10 PSY U858497

       UP C

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

XL C for AIX

Compiler


Software version:
12.1


Reference #:
IV37038


Modified date:
2013-03-13

Translate my page

Content navigation