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

📄 libgcc2.c

📁 C++ 编写的EROS RTOS
💻 C
📖 第 1 页 / 共 4 页
字号:
		  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 (u, v)     DItype u, 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 (u, v)     DItype u, 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 (u, v)     UDItype u, v;{  UDItype w;  (void) __udivmoddi4 (u, v, &w);  return w;}#endif#ifdef L_udivdi3UDItype __udivmoddi4 ();UDItype__udivdi3 (n, d)     UDItype n, d;{  return __udivmoddi4 (n, d, (UDItype *) 0);}#endif#ifdef L_cmpdi2word_type__cmpdi2 (a, b)     DItype a, 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 (a, b)     DItype a, 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 (a)     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 (a)     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 (a)     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 (a)     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 (a)     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 (a)     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 (u)     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 (u)     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 (u)     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 (u)     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 (a)     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 (a)     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/* Like bcmp except the sign is meaningful.   Result is negative if S1 is less than S2,   positive if S1 is greater, 0 if S1 and S2 are equal.  */int__gcc_bcmp (s1, s2, size)     unsigned char *s1, *s2;     size_t size;{  while (size > 0)    {      unsigned char c1 = *s1++, c2 = *s2++;      if (c1 != c2)	return c1 - c2;      size--;    }  return 0;}#endif#ifdef L_varargs#ifdef __i860__#if defined(__svr4__) || defined(__alliant__)	asm ("	.text");	asm ("	.align	4");/* The Alliant needs the added underscore.  */	asm (".globl	__builtin_saveregs");asm ("__builtin_saveregs:");	asm (".globl	___builtin_saveregs");asm ("___builtin_saveregs:");        asm ("	andnot	0x0f,%sp,%sp");	/* round down to 16-byte boundary */	asm ("	adds	-96,%sp,%sp");  /* allocate stack space for reg save					   area and also for a new va_list					   structure */	/* Save all argument registers in the arg reg save area.  The	   arg reg save area must have the following layout (according	   to the svr4 ABI):		struct {		  union  {		    float freg[8];		    double dreg[4];		  } float_regs;		  long	ireg[12];		};	*/	asm ("	fst.q	%f8,  0(%sp)"); /* save floating regs (f8-f15)  */	asm ("	fst.q	%f12,16(%sp)"); 	asm ("	st.l	%r16,32(%sp)"); /* save integer regs (r16-r27) */	asm ("	st.l	%r17,36(%sp)"); 	asm ("	st.l	%r18,40(%sp)");	asm ("	st.l	%r19,44(%sp)");	asm ("	st.l	%r20,48(%sp)");	asm ("	st.l	%r21,52(%sp)");	asm ("	st.l	%r22,56(%sp)");	asm ("	st.l	%r23,60(%sp)");	asm ("	st.l	%r24,64(%sp)");	asm ("	st.l	%r25,68(%sp)");	asm ("	st.l	%r26,72(%sp)");	asm ("	st.l	%r27,76(%sp)");

⌨️ 快捷键说明

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