home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / builtin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  6.7 KB  |  175 lines

  1. #if (defined(__IBMC__) || defined(__IBMCPP__))
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __builtin_h
  10.    #define __builtin_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.       #ifdef _M_I386
  18.          #define _LNK_CONV   _Optlink
  19.       #else
  20.          #define _LNK_CONV
  21.       #endif
  22.    #endif
  23.  
  24.    /********************************************************************/
  25.    /*  <builtin.h> header file                                         */
  26.    /*                                                                  */
  27.    /*  VisualAge for C++ for Windows, Version 3.5                      */
  28.    /*    Licensed Material - Property of IBM                           */
  29.    /*                                                                  */
  30.    /*  5801-ARR and Other Materials                                    */
  31.    /*                                                                  */
  32.    /*  (c) Copyright IBM Corp 1991, 1996. All rights reserved.         */
  33.    /*                                                                  */
  34.    /********************************************************************/
  35.  
  36.    #if defined(__EXTENDED__)
  37.  
  38.       #ifndef __size_t
  39.          #define __size_t
  40.          typedef unsigned int size_t;
  41.       #endif
  42.  
  43.     #ifdef __THW_PPC__
  44.       unsigned long  _getTIBvalue( const unsigned int );
  45.       int   __lxchg(volatile int *__locklocation, int __value);
  46.  
  47.       #if !defined(_alloca) && (defined(__IBMC__) || defined(__IBMCPP__))
  48.          void * _Builtin __alloca( size_t );
  49.          #define _alloca( x ) __alloca( (x) )
  50.          #define alloca( x ) __alloca( (x) )
  51.       #endif
  52.       #ifdef __IBMCPP__
  53.           extern "builtin" void __iospace_eieio();
  54.           extern "builtin" void __iospace_sync();
  55.           extern "builtin" unsigned short __load2r(unsigned short*);
  56.           extern "builtin" int __load4r(unsigned int*);
  57.           extern "builtin" unsigned short __store2r(unsigned short*);
  58.           extern "builtin" int __store4r(unsigned int*);
  59.           extern "builtin" double __readflm();
  60.           extern "builtin" double __setflm(double);
  61.           extern "builtin" double __setrnd(int);
  62.       #endif
  63.     #else
  64.       void           _Builtin __interrupt( const unsigned int );
  65.       unsigned long  _Builtin __getTIBvalue( const unsigned int );
  66.  
  67.       #define _interrupt( x )   __interrupt( x )
  68.       #define _getTIBvalue( x ) __getTIBvalue( x )
  69.  
  70.       double _Builtin __fsin ( double );
  71.       double _Builtin __fcos ( double );
  72.       double _Builtin __fptan ( double );
  73.       double _Builtin __fpatan ( double );
  74.       double _Builtin __facos ( double );
  75.       double _Builtin __fasin ( double );
  76.       double _Builtin __fsincos ( double, double * );
  77.       double _Builtin __fsqrt ( double );
  78.       double _Builtin __fcossin ( double, double * );
  79.       double _Builtin __f2xm1 ( double );
  80.       double _Builtin __fyl2x ( double, double );
  81.       double _Builtin __fyl2xp1 ( double, double );
  82.  
  83.       #define _fsin( x )         __fsin( (x) )
  84.       #define _fcos( x )         __fcos( (x) )
  85.       #define _fptan( x )        __fptan( (x) )
  86.       #define _fpatan( x )       __fpatan( (x) )
  87.       #define _facos( x )        __facos( (x) )
  88.       #define _fasin( x )        __fasin( (x) )
  89.       #define _fsincos( x, y )   __fsincos( (x), (y) )
  90.       #define _fsqrt( x )        __fsqrt( (x) )
  91.       #define _fcossin( x, y )   __fcossin( (x), (y) )
  92.       #define _f2xm1( x )        __f2xm1( (x) )
  93.       #define _fyl2x( x, y )     __fyl2x( (x), (y) )
  94.       #define _fyl2xp1( x, y )   __fyl2xp1( (x), (y) )
  95.  
  96.       void           _Builtin __enable( void );
  97.       void           _Builtin __disable( void );
  98.       int            _Builtin __inpb( const unsigned int );
  99.       unsigned short _Builtin __inpw( const unsigned int );
  100.       unsigned long  _Builtin __inpd( const unsigned int );
  101.       int            _Builtin __outpb( const unsigned int, const int );
  102.       unsigned short _Builtin __outpw( const unsigned int, const unsigned short );
  103.       unsigned long  _Builtin __outpd( const unsigned int, const unsigned long );
  104.       unsigned int   _Builtin __clear87( void );
  105.       unsigned int   _Builtin __control87( unsigned int, unsigned int );
  106.       unsigned int   _Builtin __status87( void );
  107.  
  108.       #ifndef _alloca
  109.          void * _Builtin __alloca( size_t );
  110.          #pragma info( none )
  111.          #define _alloca( x ) __alloca( (x) )
  112.          #define alloca( x ) __alloca( (x) )
  113.          #pragma info( restore )
  114.       #endif
  115.  
  116.       #if __OS2__
  117.          unsigned char _Builtin __parmdwords( void );
  118.       #endif
  119.  
  120.       #define _enable( )              __enable( )
  121.       #define _disable( )             __disable( )
  122.       #define _inp( x )               __inpb( x )
  123.       #define _inpw( x )              __inpw( x )
  124.       #define _inpd( x )              __inpd( x )
  125.       #define _outp( x, y )           __outpb( (x), (y) )
  126.       #define _outpw( x, y )          __outpw( (x), (y) )
  127.       #define _outpd( x, y )          __outpd( (x), (y) )
  128.       #define _clear87( )             __clear87( )
  129.       #define _control87( x, y )      __control87( (x), (y) )
  130.       #define _status87( )            __status87( )
  131.  
  132.    #if _LONG_LONG
  133.       unsigned long long _Builtin  __llrotl(unsigned long long, int);
  134.       unsigned long long _Builtin  __llrotr(unsigned long long, int);
  135.    #endif
  136.       unsigned long  _Builtin  __lrotl(unsigned long, int);
  137.       unsigned long  _Builtin  __lrotr(unsigned long, int);
  138.       unsigned short _Builtin  __srotl(unsigned short, int);
  139.       unsigned short _Builtin  __srotr(unsigned short, int);
  140.       unsigned char  _Builtin  __crotl(unsigned char, int);
  141.       unsigned char  _Builtin  __crotr(unsigned char, int);
  142.  
  143.       #define  _rotl( x, y )   __lrotl( (x), (y) )
  144.       #define  _rotr( x, y )   __lrotr( (x), (y) )
  145.       #define  _llrotl( x, y ) __llrotl( (x), (y) )
  146.       #define  _llrotr( x, y ) __llrotr( (x), (y) )
  147.       #define  _lrotl( x, y )  __lrotl( (x), (y) )
  148.       #define  _lrotr( x, y )  __lrotr( (x), (y) )
  149.       #define  _srotl( x, y )  __srotl( (x), (y) )
  150.       #define  _srotr( x, y )  __srotr( (x), (y) )
  151.       #define  _crotl( x, y )  __crotl( (x), (y) )
  152.       #define  _crotr( x, y )  __crotr( (x), (y) )
  153.  
  154.       int   _Builtin __lxchg(volatile int *__locklocation, int __value);
  155.       short _Builtin __sxchg(volatile short *__locklocation, short __value);
  156.       char  _Builtin __cxchg(volatile char *__locklocation, char __value);
  157.     #endif
  158.  
  159.    #endif
  160.  
  161.    #ifdef __cplusplus
  162.       }
  163.    #endif
  164.  
  165. #endif
  166.  
  167. #if (defined(__IBMC__) || defined(__IBMCPP__))
  168. #pragma info( none )
  169. #ifndef __CHKHDR__
  170.    #pragma info( restore )
  171. #endif
  172. #pragma info( restore )
  173. #endif
  174.  
  175.