⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libgcc2.c

📁 GCC编译器源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
		 This special case is necessary, not an optimization.  */	      /* The condition on the next line takes advantage of that		 n1 >= d1 (true due to program flow).  */	      if (n1 > d1 || n0 >= d0)		{		  q0 = 1;		  sub_ddmmss (n1, n0, n1, n0, d1, d0);		}	      else		q0 = 0;	      q1 = 0;	      if (rp != 0)		{		  rr.s.low = n0;		  rr.s.high = n1;		  *rp = rr.ll;		}	    }	  else	    {	      USItype m1, m0;	      /* Normalize.  */	      b = SI_TYPE_SIZE - bm;	      d1 = (d1 << bm) | (d0 >> b);	      d0 = d0 << bm;	      n2 = n1 >> b;	      n1 = (n1 << bm) | (n0 >> b);	      n0 = n0 << bm;	      udiv_qrnnd (q0, n1, n2, n1, d1);	      umul_ppmm (m1, m0, q0, d0);	      if (m1 > n1 || (m1 == n1 && m0 > n0))		{		  q0--;		  sub_ddmmss (m1, m0, m1, m0, d1, d0);		}	      q1 = 0;	      /* Remainder in (n1n0 - m1m0) >> bm.  */	      if (rp != 0)		{		  sub_ddmmss (n1, n0, n1, n0, m1, m0);		  rr.s.low = (n1 << b) | (n0 >> bm);		  rr.s.high = n1 >> bm;		  *rp = rr.ll;		}	    }	}    }  ww.s.low = q0;  ww.s.high = q1;  return ww.ll;}#endif#ifdef L_divdi3UDItype __udivmoddi4 ();DItype__divdi3 (DItype u, DItype v){  word_type c = 0;  DIunion uu, vv;  DItype w;  uu.ll = u;  vv.ll = v;  if (uu.s.high < 0)    c = ~c,    uu.ll = __negdi2 (uu.ll);  if (vv.s.high < 0)    c = ~c,    vv.ll = __negdi2 (vv.ll);  w = __udivmoddi4 (uu.ll, vv.ll, (UDItype *) 0);  if (c)    w = __negdi2 (w);  return w;}#endif#ifdef L_moddi3UDItype __udivmoddi4 ();DItype__moddi3 (DItype u, DItype v){  word_type c = 0;  DIunion uu, vv;  DItype w;  uu.ll = u;  vv.ll = v;  if (uu.s.high < 0)    c = ~c,    uu.ll = __negdi2 (uu.ll);  if (vv.s.high < 0)    vv.ll = __negdi2 (vv.ll);  (void) __udivmoddi4 (uu.ll, vv.ll, &w);  if (c)    w = __negdi2 (w);  return w;}#endif#ifdef L_umoddi3UDItype __udivmoddi4 ();UDItype__umoddi3 (UDItype u, UDItype v){  UDItype w;  (void) __udivmoddi4 (u, v, &w);  return w;}#endif#ifdef L_udivdi3UDItype __udivmoddi4 ();UDItype__udivdi3 (UDItype n, UDItype d){  return __udivmoddi4 (n, d, (UDItype *) 0);}#endif#ifdef L_cmpdi2word_type__cmpdi2 (DItype a, DItype b){  DIunion au, bu;  au.ll = a, bu.ll = b;  if (au.s.high < bu.s.high)    return 0;  else if (au.s.high > bu.s.high)    return 2;  if ((USItype) au.s.low < (USItype) bu.s.low)    return 0;  else if ((USItype) au.s.low > (USItype) bu.s.low)    return 2;  return 1;}#endif#ifdef L_ucmpdi2word_type__ucmpdi2 (DItype a, DItype b){  DIunion au, bu;  au.ll = a, bu.ll = b;  if ((USItype) au.s.high < (USItype) bu.s.high)    return 0;  else if ((USItype) au.s.high > (USItype) bu.s.high)    return 2;  if ((USItype) au.s.low < (USItype) bu.s.low)    return 0;  else if ((USItype) au.s.low > (USItype) bu.s.low)    return 2;  return 1;}#endif#if defined(L_fixunstfdi) && (LONG_DOUBLE_TYPE_SIZE == 128)#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)DItype__fixunstfdi (TFtype a){  TFtype b;  UDItype v;  if (a < 0)    return 0;  /* Compute high word of result, as a flonum.  */  b = (a / HIGH_WORD_COEFF);  /* Convert that to fixed (but not to DItype!),     and shift it into the high word.  */  v = (USItype) b;  v <<= WORD_SIZE;  /* Remove high part from the TFtype, leaving the low part as flonum.  */  a -= (TFtype)v;  /* Convert that to fixed (but not to DItype!) and add it in.     Sometimes A comes out negative.  This is significant, since     A has more bits than a long int does.  */  if (a < 0)    v -= (USItype) (- a);  else    v += (USItype) a;  return v;}#endif#if defined(L_fixtfdi) && (LONG_DOUBLE_TYPE_SIZE == 128)DItype__fixtfdi (TFtype a){  if (a < 0)    return - __fixunstfdi (-a);  return __fixunstfdi (a);}#endif#if defined(L_fixunsxfdi) && (LONG_DOUBLE_TYPE_SIZE == 96)#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)DItype__fixunsxfdi (XFtype a){  XFtype b;  UDItype v;  if (a < 0)    return 0;  /* Compute high word of result, as a flonum.  */  b = (a / HIGH_WORD_COEFF);  /* Convert that to fixed (but not to DItype!),     and shift it into the high word.  */  v = (USItype) b;  v <<= WORD_SIZE;  /* Remove high part from the XFtype, leaving the low part as flonum.  */  a -= (XFtype)v;  /* Convert that to fixed (but not to DItype!) and add it in.     Sometimes A comes out negative.  This is significant, since     A has more bits than a long int does.  */  if (a < 0)    v -= (USItype) (- a);  else    v += (USItype) a;  return v;}#endif#if defined(L_fixxfdi) && (LONG_DOUBLE_TYPE_SIZE == 96)DItype__fixxfdi (XFtype a){  if (a < 0)    return - __fixunsxfdi (-a);  return __fixunsxfdi (a);}#endif#ifdef L_fixunsdfdi#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)DItype__fixunsdfdi (DFtype a){  DFtype b;  UDItype v;  if (a < 0)    return 0;  /* Compute high word of result, as a flonum.  */  b = (a / HIGH_WORD_COEFF);  /* Convert that to fixed (but not to DItype!),     and shift it into the high word.  */  v = (USItype) b;  v <<= WORD_SIZE;  /* Remove high part from the DFtype, leaving the low part as flonum.  */  a -= (DFtype)v;  /* Convert that to fixed (but not to DItype!) and add it in.     Sometimes A comes out negative.  This is significant, since     A has more bits than a long int does.  */  if (a < 0)    v -= (USItype) (- a);  else    v += (USItype) a;  return v;}#endif#ifdef L_fixdfdiDItype__fixdfdi (DFtype a){  if (a < 0)    return - __fixunsdfdi (-a);  return __fixunsdfdi (a);}#endif#ifdef L_fixunssfdi#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)DItype__fixunssfdi (SFtype original_a){  /* Convert the SFtype to a DFtype, because that is surely not going     to lose any bits.  Some day someone else can write a faster version     that avoids converting to DFtype, and verify it really works right.  */  DFtype a = original_a;  DFtype b;  UDItype v;  if (a < 0)    return 0;  /* Compute high word of result, as a flonum.  */  b = (a / HIGH_WORD_COEFF);  /* Convert that to fixed (but not to DItype!),     and shift it into the high word.  */  v = (USItype) b;  v <<= WORD_SIZE;  /* Remove high part from the DFtype, leaving the low part as flonum.  */  a -= (DFtype)v;  /* Convert that to fixed (but not to DItype!) and add it in.     Sometimes A comes out negative.  This is significant, since     A has more bits than a long int does.  */  if (a < 0)    v -= (USItype) (- a);  else    v += (USItype) a;  return v;}#endif#ifdef L_fixsfdiDItype__fixsfdi (SFtype a){  if (a < 0)    return - __fixunssfdi (-a);  return __fixunssfdi (a);}#endif#if defined(L_floatdixf) && (LONG_DOUBLE_TYPE_SIZE == 96)#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_HALFWORD_COEFF (((UDItype) 1) << (WORD_SIZE / 2))#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)XFtype__floatdixf (DItype u){  XFtype d;  SItype negate = 0;  if (u < 0)    u = -u, negate = 1;  d = (USItype) (u >> WORD_SIZE);  d *= HIGH_HALFWORD_COEFF;  d *= HIGH_HALFWORD_COEFF;  d += (USItype) (u & (HIGH_WORD_COEFF - 1));  return (negate ? -d : d);}#endif#if defined(L_floatditf) && (LONG_DOUBLE_TYPE_SIZE == 128)#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_HALFWORD_COEFF (((UDItype) 1) << (WORD_SIZE / 2))#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)TFtype__floatditf (DItype u){  TFtype d;  SItype negate = 0;  if (u < 0)    u = -u, negate = 1;  d = (USItype) (u >> WORD_SIZE);  d *= HIGH_HALFWORD_COEFF;  d *= HIGH_HALFWORD_COEFF;  d += (USItype) (u & (HIGH_WORD_COEFF - 1));  return (negate ? -d : d);}#endif#ifdef L_floatdidf#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_HALFWORD_COEFF (((UDItype) 1) << (WORD_SIZE / 2))#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)DFtype__floatdidf (DItype u){  DFtype d;  SItype negate = 0;  if (u < 0)    u = -u, negate = 1;  d = (USItype) (u >> WORD_SIZE);  d *= HIGH_HALFWORD_COEFF;  d *= HIGH_HALFWORD_COEFF;  d += (USItype) (u & (HIGH_WORD_COEFF - 1));  return (negate ? -d : d);}#endif#ifdef L_floatdisf#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)#define HIGH_HALFWORD_COEFF (((UDItype) 1) << (WORD_SIZE / 2))#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)#define DI_SIZE (sizeof (DItype) * BITS_PER_UNIT)/* Define codes for all the float formats that we know of.  Note   that this is copied from real.h.  */   #define UNKNOWN_FLOAT_FORMAT 0#define IEEE_FLOAT_FORMAT 1#define VAX_FLOAT_FORMAT 2#define IBM_FLOAT_FORMAT 3/* Default to IEEE float if not specified.  Nearly all machines use it.  */#ifndef HOST_FLOAT_FORMAT#define	HOST_FLOAT_FORMAT	IEEE_FLOAT_FORMAT#endif#if HOST_FLOAT_FORMAT == IEEE_FLOAT_FORMAT#define DF_SIZE 53#define SF_SIZE 24#endif#if HOST_FLOAT_FORMAT == IBM_FLOAT_FORMAT#define DF_SIZE 56#define SF_SIZE 24#endif#if HOST_FLOAT_FORMAT == VAX_FLOAT_FORMAT#define DF_SIZE 56#define SF_SIZE 24#endifSFtype__floatdisf (DItype u){  /* Do the calculation in DFmode     so that we don't lose any of the precision of the high word     while multiplying it.  */  DFtype f;  SItype negate = 0;  if (u < 0)    u = -u, negate = 1;  /* Protect against double-rounding error.     Represent any low-order bits, that might be truncated in DFmode,     by a bit that won't be lost.  The bit can go in anywhere below the     rounding position of the SFmode.  A fixed mask and bit position     handles all usual configurations.  It doesn't handle the case     of 128-bit DImode, however.  */  if (DF_SIZE < DI_SIZE      && DF_SIZE > (DI_SIZE - DF_SIZE + SF_SIZE))    {#define REP_BIT ((USItype) 1 << (DI_SIZE - DF_SIZE))      if (u >= ((UDItype) 1 << DF_SIZE))	{	  if ((USItype) u & (REP_BIT - 1))	    u |= REP_BIT;	}    }  f = (USItype) (u >> WORD_SIZE);  f *= HIGH_HALFWORD_COEFF;  f *= HIGH_HALFWORD_COEFF;  f += (USItype) (u & (HIGH_WORD_COEFF - 1));  return (SFtype) (negate ? -f : f);}#endif#if defined(L_fixunsxfsi) && LONG_DOUBLE_TYPE_SIZE == 96/* Reenable the normal types, in case limits.h needs them.  */#undef char#undef short#undef int#undef long#undef unsigned#undef float#undef double#undef MIN#undef MAX#include <limits.h>USItype__fixunsxfsi (XFtype a){  if (a >= - (DFtype) LONG_MIN)    return (SItype) (a + LONG_MIN) - LONG_MIN;  return (SItype) a;}#endif#ifdef L_fixunsdfsi/* Reenable the normal types, in case limits.h needs them.  */#undef char#undef short#undef int#undef long#undef unsigned#undef float#undef double#undef MIN#undef MAX#include <limits.h>USItype__fixunsdfsi (DFtype a){  if (a >= - (DFtype) LONG_MIN)    return (SItype) (a + LONG_MIN) - LONG_MIN;  return (SItype) a;}#endif#ifdef L_fixunssfsi/* Reenable the normal types, in case limits.h needs them.  */#undef char#undef short#undef int#undef long#undef unsigned#undef float#undef double#undef MIN#undef MAX#include <limits.h>USItype__fixunssfsi (SFtype a){  if (a >= - (SFtype) LONG_MIN)    return (SItype) (a + LONG_MIN) - LONG_MIN;  return (SItype) a;}#endif/* From here on down, the routines use normal data types.  */#define SItype bogus_type#define USItype bogus_type#define DItype bogus_type#define UDItype bogus_type#define SFtype bogus_type#define DFtype bogus_type#undef char#undef short#undef int#undef long#undef unsigned#undef float#undef double#ifdef L__gcc_bcmp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -