Commit 6da9c622 by Richard Kenner

configure.in (alpha*-*-*): Aad config/alpha/t-alpha.

	* configure.in (alpha*-*-*): Aad config/alpha/t-alpha.
	* configure: Rebuilt.
	* libgcc2.c (__fixunstfDI): Renamed from __fixunstfdi.
	(__fixunsxfDI): Renamed from __fixunsxfdi.
	(__fixunsdfDI): Renamed from __fixunsdfdi.
	(__fixunssfDI): Renamed from __fixunssfdi.
	(__floatdisf): Use proper type in REP_BIT macro.
	(__fixunsxfSI): Renamed from __fixunsxfsi.
	(__fixunsdfSI): Renamed from __fixunsdfsi.
	(__fixunssfSI): Renamed from __fixunssfsi.
	* libgcc2.h: Add cases for MIN_UNITS_PER_WORD > 4.
	Change location of macros and upper-case some names as above.
	* longlong.h ([alpha]): Use PARAMS, not __P in decl of __udiv__qrnnd.
	* config/alpha/t-alpha, config/alpha/qrnnd.asm: New files.

From-SVN: r33166
parent 4cf7705a
# Alpha 21064 __udiv_qrnnd
# Copyright (C) 1992, 1994, 1995, 2000 Free Software Foundation, Inc.
# This file is part of GCC.
# The GNU MP Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# In addition to the permissions in the GNU General Public License, the
# Free Software Foundation gives you unlimited permission to link the
# compiled version of this file with other programs, and to distribute
# those programs without any restriction coming from the use of this
# file. (The General Public License restrictions do apply in other
# respects; for example, they cover modification of the file, and
# distribution when not linked into another program.)
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.
.set noreorder
.set noat
.text
.globl __udiv_qrnnd
.ent __udiv_qrnnd
__udiv_qrnnd:
.frame $30,0,$26,0
.prologue 0
#define cnt $2
#define tmp $3
#define rem_ptr $16
#define n1 $17
#define n0 $18
#define d $19
#define qb $20
#define AT $at
ldiq cnt,16
blt d,$largedivisor
$loop1: cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule d,n1,qb
subq n1,d,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule d,n1,qb
subq n1,d,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule d,n1,qb
subq n1,d,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule d,n1,qb
subq n1,d,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
subq cnt,1,cnt
bgt cnt,$loop1
stq n1,0(rem_ptr)
bis $31,n0,$0
ret $31,($26),1
$largedivisor:
and n0,1,$4
srl n0,1,n0
sll n1,63,tmp
or tmp,n0,n0
srl n1,1,n1
and d,1,$6
srl d,1,$5
addq $5,$6,$5
$loop2: cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule $5,n1,qb
subq n1,$5,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule $5,n1,qb
subq n1,$5,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule $5,n1,qb
subq n1,$5,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
cmplt n0,0,tmp
addq n1,n1,n1
bis n1,tmp,n1
addq n0,n0,n0
cmpule $5,n1,qb
subq n1,$5,tmp
cmovne qb,tmp,n1
bis n0,qb,n0
subq cnt,1,cnt
bgt cnt,$loop2
addq n1,n1,n1
addq $4,n1,n1
bne $6,$Odd
stq n1,0(rem_ptr)
bis $31,n0,$0
ret $31,($26),1
$Odd:
/* q' in n0. r' in n1 */
addq n1,n0,n1
cmpult n1,n0,tmp # tmp := carry from addq
subq n1,d,AT
addq n0,tmp,n0
cmovne tmp,AT,n1
cmpult n1,d,tmp
addq n0,1,AT
cmoveq tmp,AT,n0
subq n1,d,AT
cmoveq tmp,AT,n1
stq n1,0(rem_ptr)
bis $31,n0,$0
ret $31,($26),1
.end __udiv_qrnnd
# This is really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = qrnnd.S
qrnnd.S: $(srcdir)/config/alpha/qrnnd.asm
cat $(srcdir)/config/alpha/qrnnd.asm > qrnnd.S
......@@ -599,7 +599,7 @@ changequote([,])dnl
xm_file="alpha/xm-alpha-interix.h xm-interix.h"
xmake_file="x-interix alpha/t-pe"
tmake_file="alpha/t-interix alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-interix alpha/t-ieee"
if test x$enable_threads = xyes ; then
thread_file='posix'
fi
......@@ -612,7 +612,7 @@ changequote([,])dnl
alpha*-*-linux-gnuecoff*)
tm_file="${tm_file} alpha/linux-ecoff.h alpha/linux.h"
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-ieee"
gas=no
xmake_file=none
gas=yes gnu_ld=yes
......@@ -620,7 +620,7 @@ changequote([,])dnl
alpha*-*-linux-gnulibc1*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux alpha/t-crtbe alpha/t-ieee"
tmake_file="t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-linux alpha/t-crtbe alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
gas=yes gnu_ld=yes
......@@ -631,7 +631,7 @@ changequote([,])dnl
alpha*-*-linux-gnu*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="t-linux alpha/t-linux alpha/t-crtbe alpha/t-ieee"
tmake_file="t-linux alpha/t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
gas=yes gnu_ld=yes
......@@ -642,7 +642,7 @@ changequote([,])dnl
alpha*-*-netbsd*)
tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-crtbe alpha/t-ieee"
tmake_file="alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
gas=yes gnu_ld=yes
......@@ -651,7 +651,7 @@ changequote([,])dnl
alpha*-*-openbsd*)
# default x-alpha is only appropriate for dec-osf.
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-ieee"
;;
alpha*-dec-osf*)
......@@ -664,7 +664,7 @@ changequote([,])dnl
extra_passes="mips-tfile mips-tdump"
fi
use_collect2=yes
tmake_file="alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-ieee"
case $machine in
*-*-osf1*)
tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
......@@ -694,7 +694,7 @@ changequote([,])dnl
;;
alpha*-*-vxworks*)
tm_file="${tm_file} dbx.h alpha/vxworks.h"
tmake_file="alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-ieee"
if [ x$gas != xyes ]
then
extra_passes="mips-tfile mips-tdump"
......@@ -705,7 +705,7 @@ changequote([,])dnl
alpha*-*-winnt*)
tm_file="${tm_file} alpha/alpha32.h alpha/win-nt.h winnt/win-nt.h"
xm_file="${xm_file} config/winnt/xm-winnt.h alpha/xm-winnt.h"
tmake_file="t-libc-ok alpha/t-ieee"
tmake_file="t-libc-ok alpha/t-alpha alpha/t-ieee"
xmake_file=winnt/x-winnt
extra_host_objs=oldnames.o
extra_gcc_objs="spawnv.o oldnames.o"
......@@ -720,7 +720,7 @@ changequote([,])dnl
alpha*-dec-vms*)
tm_file=alpha/vms.h
xm_file="${xm_file} alpha/xm-vms.h"
tmake_file="alpha/t-vms alpha/t-ieee"
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-ieee"
;;
arc-*-elf*)
extra_parts="crtinit.o crtfini.o"
......
......@@ -89,13 +89,14 @@ __lshrdi3 (DWtype u, word_type b)
if (bm <= 0)
{
w.s.high = 0;
w.s.low = (UWtype)uu.s.high >> -bm;
w.s.low = (UWtype) uu.s.high >> -bm;
}
else
{
UWtype carries = (UWtype)uu.s.high << bm;
w.s.high = (UWtype)uu.s.high >> b;
w.s.low = ((UWtype)uu.s.low >> b) | carries;
UWtype carries = (UWtype) uu.s.high << bm;
w.s.high = (UWtype) uu.s.high >> b;
w.s.low = ((UWtype) uu.s.low >> b) | carries;
}
return w.ll;
......@@ -119,13 +120,14 @@ __ashldi3 (DWtype u, word_type b)
if (bm <= 0)
{
w.s.low = 0;
w.s.high = (UWtype)uu.s.low << -bm;
w.s.high = (UWtype) uu.s.low << -bm;
}
else
{
UWtype carries = (UWtype)uu.s.low >> bm;
w.s.low = (UWtype)uu.s.low << b;
w.s.high = ((UWtype)uu.s.high << b) | carries;
UWtype carries = (UWtype) uu.s.low >> bm;
w.s.low = (UWtype) uu.s.low << b;
w.s.high = ((UWtype) uu.s.high << b) | carries;
}
return w.ll;
......@@ -154,9 +156,10 @@ __ashrdi3 (DWtype u, word_type b)
}
else
{
UWtype carries = (UWtype)uu.s.high << bm;
UWtype carries = (UWtype) uu.s.high << bm;
w.s.high = uu.s.high >> b;
w.s.low = ((UWtype)uu.s.low >> b) | carries;
w.s.low = ((UWtype) uu.s.low >> b) | carries;
}
return w.ll;
......@@ -668,7 +671,7 @@ __ucmpdi2 (DWtype a, DWtype b)
#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
DWtype
__fixunstfdi (TFtype a)
__fixunstfDI (TFtype a)
{
TFtype b;
UDWtype v;
......@@ -700,8 +703,8 @@ DWtype
__fixtfdi (TFtype a)
{
if (a < 0)
return - __fixunstfdi (-a);
return __fixunstfdi (a);
return - __fixunstfDI (-a);
return __fixunstfDI (a);
}
#endif
......@@ -710,7 +713,7 @@ __fixtfdi (TFtype a)
#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
DWtype
__fixunsxfdi (XFtype a)
__fixunsxfDI (XFtype a)
{
XFtype b;
UDWtype v;
......@@ -742,8 +745,8 @@ DWtype
__fixxfdi (XFtype a)
{
if (a < 0)
return - __fixunsxfdi (-a);
return __fixunsxfdi (a);
return - __fixunsxfDI (-a);
return __fixunsxfDI (a);
}
#endif
......@@ -752,7 +755,7 @@ __fixxfdi (XFtype a)
#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
DWtype
__fixunsdfdi (DFtype a)
__fixunsdfDI (DFtype a)
{
DFtype b;
UDWtype v;
......@@ -784,8 +787,8 @@ DWtype
__fixdfdi (DFtype a)
{
if (a < 0)
return - __fixunsdfdi (-a);
return __fixunsdfdi (a);
return - __fixunsdfDI (-a);
return __fixunsdfDI (a);
}
#endif
......@@ -794,7 +797,7 @@ __fixdfdi (DFtype a)
#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
DWtype
__fixunssfdi (SFtype original_a)
__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
......@@ -813,7 +816,7 @@ __fixunssfdi (SFtype original_a)
v = (UWtype) b;
v <<= WORD_SIZE;
/* Remove high part from the DFtype, leaving the low part as flonum. */
a -= (DFtype)v;
a -= (DFtype) v;
/* Convert that to fixed (but not to DWtype!) and add it in.
Sometimes A comes out negative. This is significant, since
A has more bits than a long int does. */
......@@ -830,8 +833,8 @@ DWtype
__fixsfdi (SFtype a)
{
if (a < 0)
return - __fixunssfdi (-a);
return __fixunssfdi (a);
return - __fixunssfDI (-a);
return __fixunssfDI (a);
}
#endif
......@@ -943,11 +946,11 @@ __floatdisf (DWtype u)
if (DF_SIZE < DI_SIZE
&& DF_SIZE > (DI_SIZE - DF_SIZE + SF_SIZE))
{
#define REP_BIT ((UWtype) 1 << (DI_SIZE - DF_SIZE))
#define REP_BIT ((UDWtype) 1 << (DI_SIZE - DF_SIZE))
if (! (- ((DWtype) 1 << DF_SIZE) < u
&& u < ((DWtype) 1 << DF_SIZE)))
{
if ((UWtype) u & (REP_BIT - 1))
if ((UDWtype) u & (REP_BIT - 1))
u |= REP_BIT;
}
}
......@@ -974,7 +977,7 @@ __floatdisf (DWtype u)
#include <limits.h>
UWtype
__fixunsxfsi (XFtype a)
__fixunsxfSI (XFtype a)
{
if (a >= - (DFtype) LONG_MIN)
return (Wtype) (a + LONG_MIN) - LONG_MIN;
......@@ -996,7 +999,7 @@ __fixunsxfsi (XFtype a)
#include <limits.h>
UWtype
__fixunsdfsi (DFtype a)
__fixunsdfSI (DFtype a)
{
if (a >= - (DFtype) LONG_MIN)
return (Wtype) (a + LONG_MIN) - LONG_MIN;
......@@ -1018,7 +1021,7 @@ __fixunsdfsi (DFtype a)
#include <limits.h>
UWtype
__fixunssfsi (SFtype a)
__fixunssfSI (SFtype a)
{
if (a >= - (SFtype) LONG_MIN)
return (Wtype) (a + LONG_MIN) - LONG_MIN;
......
......@@ -99,6 +99,11 @@ typedef unsigned int USItype __attribute__ ((mode (SI)));
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));
#if MIN_UNITS_PER_WORD > 4
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));
#endif
#endif
#endif
......@@ -153,7 +158,17 @@ typedef int word_type __attribute__ ((mode (__word__)));
#define float bogus_type
#define double bogus_type
#if MIN_UNITS_PER_WORD > 2
#if MIN_UNITS_PER_WORD > 4
#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
#define Wtype DItype
#define UWtype UDItype
#define HWtype DItype
#define UHWtype UDItype
#define DWtype TItype
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
#elif MIN_UNITS_PER_WORD > 2
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype
......@@ -185,11 +200,42 @@ typedef int word_type __attribute__ ((mode (__word__)));
#define __NDW(a,b) __ ## a ## hi ## b
#endif
#define __muldi3 __NDW(mul,3)
#define __divdi3 __NDW(div,3)
#define __udivdi3 __NDW(udiv,3)
#define __moddi3 __NDW(mod,3)
#define __umoddi3 __NDW(umod,3)
#define __negdi2 __NDW(neg,2)
#define __lshrdi3 __NDW(lshr,3)
#define __ashldi3 __NDW(ashl,3)
#define __ashrdi3 __NDW(ashr,3)
#define __ffsdi2 __NDW(ffs,2)
#define __cmpdi2 __NDW(cmp,2)
#define __ucmpdi2 __NDW(ucmp,2)
#define __udivmoddi4 __NDW(udivmod,4)
#define __fixunstfDI __NDW(fixunstf,)
#define __fixtfdi __NDW(fixtf,)
#define __fixunsxfDI __NDW(fixunsxf,)
#define __fixxfdi __NDW(fixxf,)
#define __fixunsdfDI __NDW(fixunsdf,)
#define __fixdfdi __NDW(fixdf,)
#define __fixunssfDI __NDW(fixunssf,)
#define __fixsfdi __NDW(fixsf,)
#define __floatdixf __NDW(float,xf)
#define __floatditf __NDW(float,tf)
#define __floatdidf __NDW(float,df)
#define __floatdisf __NDW(float,sf)
#define __fixunsxfSI __NW(fixunsxf,)
#define __fixunstfSI __NW(fixunstf,)
#define __fixunsdfSI __NW(fixunsdf,)
#define __fixunssfSI __NW(fixunssf,)
extern DWtype __muldi3 (DWtype, DWtype);
extern DWtype __divdi3 (DWtype, DWtype);
extern UDWtype __udivdi3 (UDWtype, UDWtype);
extern UDWtype __umoddi3 (UDWtype, UDWtype);
extern DWtype __moddi3 (DWtype, DWtype);
/* __udivmoddi4 is static inline when building other libgcc2 portions. */
#if (!defined (L_udivdi3) && !defined (L_divdi3) && \
!defined (L_umoddi3) && !defined (L_moddi3))
......@@ -220,55 +266,25 @@ extern DWtype __fixdfdi (DFtype);
extern DWtype __fixsfdi (SFtype);
extern DFtype __floatdidf (DWtype);
extern SFtype __floatdisf (DWtype);
extern UWtype __fixunsdfsi (DFtype);
extern UWtype __fixunssfsi (SFtype);
extern DWtype __fixunsdfdi (DFtype);
extern DWtype __fixunssfdi (SFtype);
extern UWtype __fixunsdfSI (DFtype);
extern UWtype __fixunssfSI (SFtype);
extern DWtype __fixunsdfDI (DFtype);
extern DWtype __fixunssfDI (SFtype);
#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 96
extern DWtype __fixxfdi (XFtype);
extern DWtype __fixunsxfdi (XFtype);
extern DWtype __fixunsxfDI (XFtype);
extern XFtype __floatdixf (DWtype);
extern UWtype __fixunsxfsi (XFtype);
extern UWtype __fixunsxfSI (XFtype);
#endif
#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128
extern DWtype __fixunstfdi (TFtype);
extern DWtype __fixunstfDI (TFtype);
extern DWtype __fixtfdi (TFtype);
extern TFtype __floatditf (DWtype);
#endif
#endif /* BITS_PER_UNIT == 8 */
#define __muldi3 __NDW(mul,3)
#define __divdi3 __NDW(div,3)
#define __udivdi3 __NDW(udiv,3)
#define __moddi3 __NDW(mod,3)
#define __umoddi3 __NDW(umod,3)
#define __negdi2 __NDW(neg,2)
#define __lshrdi3 __NDW(lshr,3)
#define __ashldi3 __NDW(ashl,3)
#define __ashrdi3 __NDW(ashr,3)
#define __ffsdi2 __NDW(ffs,2)
#define __cmpdi2 __NDW(cmp,2)
#define __ucmpdi2 __NDW(ucmp,2)
#define __udivmoddi4 __NDW(udivmod,4)
#define __fixunstfdi __NDW(fixunstf,)
#define __fixtfdi __NDW(fixtf,)
#define __fixunsxfdi __NDW(fixunsxf,)
#define __fixxfdi __NDW(fixxf,)
#define __fixunsdfdi __NDW(fixunsdf,)
#define __fixdfdi __NDW(fixdf,)
#define __fixunssfdi __NDW(fixunssf,)
#define __fixsfdi __NDW(fixsf,)
#define __floatdixf __NDW(float,xf)
#define __floatditf __NDW(float,tf)
#define __floatdidf __NDW(float,df)
#define __floatdisf __NDW(float,sf)
#define __fixunsxfsi __NW(fixunsxf,)
#define __fixunstfsi __NW(fixunstf,)
#define __fixunsdfsi __NW(fixunsdf,)
#define __fixunssfsi __NW(fixunssf,)
/* DWstructs are pairs of Wtype values in the order determined by
LIBGCC2_WORDS_BIG_ENDIAN. */
......
......@@ -168,7 +168,7 @@
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
(r) = __r; \
} while (0)
extern UDItype __udiv_qrnnd __P ((UDItype *, UDItype, UDItype, UDItype));
extern UDItype __udiv_qrnnd PARAMS ((UDItype *, UDItype, UDItype, UDItype));
#define UDIV_TIME 220
#endif /* LONGLONG_STANDALONE */
#endif /* __alpha */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment