Annotation of researchv10dc/cmd/gcc/gnulib.c, revision 1.1

1.1     ! root        1: /* Subroutines needed by GCC output code on some machines.  */
        !             2: /* Compile this file with the Unix C compiler!  */
        !             3: 
        !             4: #include "config.h"
        !             5: 
        !             6: union double_di { double d; int i[2]; };
        !             7: union flt_or_int { int i; float f; };
        !             8: 
        !             9: #ifdef WORDS_BIG_ENDIAN
        !            10: #define HIGH 0
        !            11: #define LOW 1
        !            12: #else
        !            13: #define HIGH 1
        !            14: #define LOW 0
        !            15: #endif
        !            16: 
        !            17: #ifdef Lva_end
        !            18: /* This is here in case the user says #undef va_end, which ANSI C permits.  */
        !            19: void
        !            20: va_end (ap)
        !            21:      char **ap;
        !            22: {
        !            23: }
        !            24: #endif
        !            25: 
        !            26: #ifdef L_eprintf
        !            27: #include <stdio.h>
        !            28: /* This is used by the `assert' macro.  */
        !            29: void
        !            30: _eprintf (string, line)
        !            31:      char *string;
        !            32:      int line;
        !            33: {
        !            34:   fprintf (stderr, string, line);
        !            35: }
        !            36: #endif
        !            37: 
        !            38: #ifdef L_umulsi3
        !            39: _umulsi3 (a, b)
        !            40:      unsigned a, b;
        !            41: {
        !            42:   return a * b;
        !            43: }
        !            44: #endif
        !            45: 
        !            46: #ifdef L_mulsi3
        !            47: _mulsi3 (a, b)
        !            48:      int a, b;
        !            49: {
        !            50:   return a * b;
        !            51: }
        !            52: #endif
        !            53: 
        !            54: #ifdef L_udivsi3
        !            55: _udivsi3 (a, b)
        !            56:      unsigned a, b;
        !            57: {
        !            58:   return a / b;
        !            59: }
        !            60: #endif
        !            61: 
        !            62: #ifdef L_divsi3
        !            63: _divsi3 (a, b)
        !            64:      int a, b;
        !            65: {
        !            66:   return a / b;
        !            67: }
        !            68: #endif
        !            69: 
        !            70: #ifdef L_umodsi3
        !            71: _umodsi3 (a, b)
        !            72:      unsigned a, b;
        !            73: {
        !            74:   return a % b;
        !            75: }
        !            76: #endif
        !            77: 
        !            78: #ifdef L_modsi3
        !            79: _modsi3 (a, b)
        !            80:      int a, b;
        !            81: {
        !            82:   return a % b;
        !            83: }
        !            84: #endif
        !            85: 
        !            86: #ifdef L_lshrsi3
        !            87: _lshrsi3 (a, b)
        !            88:      unsigned a, b;
        !            89: {
        !            90:   return a >> b;
        !            91: }
        !            92: #endif
        !            93: 
        !            94: #ifdef L_lshlsi3
        !            95: _lshlsi3 (a, b)
        !            96:      unsigned a, b;
        !            97: {
        !            98:   return a << b;
        !            99: }
        !           100: #endif
        !           101: 
        !           102: #ifdef L_ashrsi3
        !           103: _ashrsi3 (a, b)
        !           104:      int a, b;
        !           105: {
        !           106:   return a >> b;
        !           107: }
        !           108: #endif
        !           109: 
        !           110: #ifdef L_ashlsi3
        !           111: _ashlsi3 (a, b)
        !           112:      int a, b;
        !           113: {
        !           114:   return a << b;
        !           115: }
        !           116: #endif
        !           117: 
        !           118: #ifdef L_divdf3
        !           119: double
        !           120: _divdf3 (a, b)
        !           121:      double a, b;
        !           122: {
        !           123:   return a / b;
        !           124: }
        !           125: #endif
        !           126: 
        !           127: #ifdef L_muldf3
        !           128: double
        !           129: _muldf3 (a, b)
        !           130:      double a, b;
        !           131: {
        !           132:   return a * b;
        !           133: }
        !           134: #endif
        !           135: 
        !           136: #ifdef L_negdf2
        !           137: double
        !           138: _negdf2 (a)
        !           139:      double a;
        !           140: {
        !           141:   return -a;
        !           142: }
        !           143: #endif
        !           144: 
        !           145: #ifdef L_adddf3
        !           146: double
        !           147: _adddf3 (a, b)
        !           148:      double a, b;
        !           149: {
        !           150:   return a + b;
        !           151: }
        !           152: #endif
        !           153: 
        !           154: #ifdef L_subdf3
        !           155: double
        !           156: _subdf3 (a, b)
        !           157:      double a, b;
        !           158: {
        !           159:   return a - b;
        !           160: }
        !           161: #endif
        !           162: 
        !           163: #ifdef L_cmpdf2
        !           164: int
        !           165: _cmpdf2 (a, b)
        !           166:      double a, b;
        !           167: {
        !           168:   if (a > b)
        !           169:     return 1;
        !           170:   else if (a < b)
        !           171:     return -1;
        !           172:   return 0;
        !           173: }
        !           174: #endif
        !           175: 
        !           176: #ifdef L_fixunsdfsi
        !           177: _fixunsdfsi (a)
        !           178:      double a;
        !           179: {
        !           180:   return (unsigned int) a;
        !           181: }
        !           182: #endif
        !           183: 
        !           184: #ifdef L_fixunsdfdi
        !           185: double
        !           186: _fixunsdfdi (a)
        !           187:      double a;
        !           188: {
        !           189:   union double_di u;
        !           190:   u.i[LOW] = (unsigned int) a;
        !           191:   u.i[HIGH] = 0;
        !           192:   return u.d;
        !           193: }
        !           194: #endif
        !           195: 
        !           196: #ifdef L_fixdfsi
        !           197: _fixdfsi (a)
        !           198:      double a;
        !           199: {
        !           200:   return (int) a;
        !           201: }
        !           202: #endif
        !           203: 
        !           204: #ifdef L_fixdfdi
        !           205: double
        !           206: _fixdfdi (a)
        !           207:      double a;
        !           208: {
        !           209:   union double_di u;
        !           210:   u.i[LOW] = (int) a;
        !           211:   u.i[HIGH] = (int) a < 0 ? -1 : 0;
        !           212:   return u.d;
        !           213: }
        !           214: #endif
        !           215: 
        !           216: #ifdef L_floatsidf
        !           217: double
        !           218: _floatsidf (a)
        !           219:      int a;
        !           220: {
        !           221:   return (double) a;
        !           222: }
        !           223: #endif
        !           224: 
        !           225: #ifdef L_floatdidf
        !           226: double
        !           227: _floatdidf (u)
        !           228:      union double_di u;
        !           229: {
        !           230:   register double hi
        !           231:     = ((double) u.i[HIGH]) * (double) 0x10000 * (double) 0x10000;
        !           232:   register double low = (unsigned int) u.i[LOW];
        !           233:   return hi + low;
        !           234: }
        !           235: #endif
        !           236: 
        !           237: #define INTIFY(FLOATVAL)  (intify.f = (FLOATVAL), intify.i)
        !           238: 
        !           239: #ifdef L_addsf3
        !           240: int
        !           241: _addsf3 (a, b)
        !           242:      union flt_or_int a, b;
        !           243: {
        !           244:   union flt_or_int intify;
        !           245:   return INTIFY (a.f + b.f);
        !           246: }
        !           247: #endif
        !           248: 
        !           249: #ifdef L_negsf2
        !           250: int
        !           251: _negsf2 (a)
        !           252:      union flt_or_int a;
        !           253: {
        !           254:   union flt_or_int intify;
        !           255:   return INTIFY (-a.f);
        !           256: }
        !           257: #endif
        !           258: 
        !           259: #ifdef L_subsf3
        !           260: int
        !           261: _subsf3 (a, b)
        !           262:      union flt_or_int a, b;
        !           263: {
        !           264:   union flt_or_int intify;
        !           265:   return INTIFY (a.f - b.f);
        !           266: }
        !           267: #endif
        !           268: 
        !           269: #ifdef L_cmpsf2
        !           270: int
        !           271: _cmpsf2 (a, b)
        !           272:      union flt_or_int a, b;
        !           273: {
        !           274:   union flt_or_int intify;
        !           275:   if (a.f > b.f)
        !           276:     return 1;
        !           277:   else if (a.f < b.f)
        !           278:     return -1;
        !           279:   return 0;
        !           280: }
        !           281: #endif
        !           282: 
        !           283: #ifdef L_mulsf3
        !           284: int
        !           285: _mulsf3 (a, b)
        !           286:      union flt_or_int a, b;
        !           287: {
        !           288:   union flt_or_int intify;
        !           289:   return INTIFY (a.f * b.f);
        !           290: }
        !           291: #endif
        !           292: 
        !           293: #ifdef L_divsf3
        !           294: int
        !           295: _divsf3 (a, b)
        !           296:      union flt_or_int a, b;
        !           297: {
        !           298:   union flt_or_int intify;
        !           299:   return INTIFY (a.f / b.f);
        !           300: }
        !           301: #endif
        !           302: 
        !           303: #ifdef L_truncdfsf2
        !           304: int
        !           305: _truncdfsf2 (a)
        !           306:      double a;
        !           307: {
        !           308:   union flt_or_int intify;
        !           309:   return INTIFY (a);
        !           310: }
        !           311: #endif
        !           312: 
        !           313: #ifdef L_extendsfdf2
        !           314: double
        !           315: _extendsfdf2 (a)
        !           316:      union flt_or_int a;
        !           317: {
        !           318:   union flt_or_int intify;
        !           319:   return a.f;
        !           320: }
        !           321: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.