comparison gcc/longlong.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. 1 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
2 Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2 Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This file is part of the GNU C Library. 6 This file is part of the GNU C Library.
7 7
8 The GNU C Library is free software; you can redistribute it and/or 8 The GNU C Library is free software; you can redistribute it and/or
716 #define UMUL_TIME 17 716 #define UMUL_TIME 17
717 #define UDIV_TIME 150 717 #define UDIV_TIME 150
718 #endif /* __mc88110__ */ 718 #endif /* __mc88110__ */
719 #endif /* __m88000__ */ 719 #endif /* __m88000__ */
720 720
721 #if defined (__mn10300__)
722 # if defined (__AM33__)
723 # define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
724 # define umul_ppmm(w1, w0, u, v) \
725 asm("mulu %3,%2,%1,%0" : "=r"(w0), "=r"(w1) : "r"(u), "r"(v))
726 # define smul_ppmm(w1, w0, u, v) \
727 asm("mul %3,%2,%1,%0" : "=r"(w0), "=r"(w1) : "r"(u), "r"(v))
728 # else
729 # define umul_ppmm(w1, w0, u, v) \
730 asm("nop; nop; mulu %3,%0" : "=d"(w0), "=z"(w1) : "%0"(u), "d"(v))
731 # define smul_ppmm(w1, w0, u, v) \
732 asm("nop; nop; mul %3,%0" : "=d"(w0), "=z"(w1) : "%0"(u), "d"(v))
733 # endif
734 # define add_ssaaaa(sh, sl, ah, al, bh, bl) \
735 do { \
736 DWunion __s, __a, __b; \
737 __a.s.low = (al); __a.s.high = (ah); \
738 __b.s.low = (bl); __b.s.high = (bh); \
739 __s.ll = __a.ll + __b.ll; \
740 (sl) = __s.s.low; (sh) = __s.s.high; \
741 } while (0)
742 # define sub_ddmmss(sh, sl, ah, al, bh, bl) \
743 do { \
744 DWunion __s, __a, __b; \
745 __a.s.low = (al); __a.s.high = (ah); \
746 __b.s.low = (bl); __b.s.high = (bh); \
747 __s.ll = __a.ll - __b.ll; \
748 (sl) = __s.s.low; (sh) = __s.s.high; \
749 } while (0)
750 # define udiv_qrnnd(q, r, nh, nl, d) \
751 asm("divu %2,%0" : "=D"(q), "=z"(r) : "D"(d), "0"(nl), "1"(nh))
752 # define sdiv_qrnnd(q, r, nh, nl, d) \
753 asm("div %2,%0" : "=D"(q), "=z"(r) : "D"(d), "0"(nl), "1"(nh))
754 # define UMUL_TIME 3
755 # define UDIV_TIME 38
756 #endif
757
721 #if defined (__mips__) && W_TYPE_SIZE == 32 758 #if defined (__mips__) && W_TYPE_SIZE == 32
722 #define umul_ppmm(w1, w0, u, v) \ 759 #define umul_ppmm(w1, w0, u, v) \
723 do { \ 760 do { \
724 UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \ 761 UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \
725 (w1) = (USItype) (__x >> 32); \ 762 (w1) = (USItype) (__x >> 32); \