* sysdeps/hppa: Directory removed, saved in ports repository.

* sysdeps/mach/hppa: Likewise.
	* sysdeps/mach/hurd/hppa: Likewise.
	* sysdeps/unix/sysv/linux/hppa: Likewise.
	* configure.in (machine): Remove hppa* cases.
	* configure: Regenerated.
	* shlib-versions: Remove hppa cases.

	* sysdeps/m68k: Directory removed, saved in ports repository.
	* sysdeps/unix/bsd/m68k: Likewise.
	* sysdeps/unix/sysv/linux/m68k: Likewise.
	* configure.in (machine): Remove m68* cases.
	* configure: Regenerated.
This commit is contained in:
Roland McGrath 2006-02-28 10:18:39 +00:00
parent a5f2bd861c
commit 14d44b191f
414 changed files with 48 additions and 17409 deletions

View File

@ -1,5 +1,19 @@
2006-02-28 Roland McGrath <roland@redhat.com>
* sysdeps/hppa: Directory removed, saved in ports repository.
* sysdeps/mach/hppa: Likewise.
* sysdeps/mach/hurd/hppa: Likewise.
* sysdeps/unix/sysv/linux/hppa: Likewise.
* configure.in (machine): Remove hppa* cases.
* configure: Regenerated.
* shlib-versions: Remove hppa cases.
* sysdeps/m68k: Directory removed, saved in ports repository.
* sysdeps/unix/bsd/m68k: Likewise.
* sysdeps/unix/sysv/linux/m68k: Likewise.
* configure.in (machine): Remove m68* cases.
* configure: Regenerated.
* elf/rtld-Rules (subdir-args): New variable.
(rtld-subdir-make): Use it.

4
configure vendored
View File

@ -1999,12 +1999,8 @@ a29k | am29000) base_machine=a29k machine=a29k ;;
alpha*) base_machine=alpha machine=alpha/$machine ;;
c3[012]) base_machine=cx0 machine=cx0/c30 ;;
c4[04]) base_machine=cx0 machine=cx0/c40 ;;
hppa*64*) base_machine=hppa machine=hppa/hppa64 ;;
hppa*) base_machine=hppa machine=hppa/hppa1.1 ;;
i[34567]86) base_machine=i386 machine=i386/$machine ;;
ia64) base_machine=ia64 machine=ia64 ;;
m680?0) base_machine=m68k machine=m68k/$machine ;;
m68k) base_machine=m68k machine=m68k/m68020 ;;
m88???) base_machine=m88k machine=m88k/$machine ;;
m88k) base_machine=m88k machine=m88k/m88100 ;;
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;

View File

@ -487,12 +487,8 @@ a29k | am29000) base_machine=a29k machine=a29k ;;
alpha*) base_machine=alpha machine=alpha/$machine ;;
c3[012]) base_machine=cx0 machine=cx0/c30 ;;
c4[04]) base_machine=cx0 machine=cx0/c40 ;;
hppa*64*) base_machine=hppa machine=hppa/hppa64 ;;
hppa*) base_machine=hppa machine=hppa/hppa1.1 ;;
i[34567]86) base_machine=i386 machine=i386/$machine ;;
ia64) base_machine=ia64 machine=ia64 ;;
m680?0) base_machine=m68k machine=m68k/$machine ;;
m68k) base_machine=m68k machine=m68k/m68020 ;;
m88???) base_machine=m88k machine=m88k/$machine ;;
m88k) base_machine=m88k machine=m88k/m88100 ;;
powerpc) base_machine=powerpc machine=powerpc/powerpc32 ;;

View File

@ -1,3 +1,37 @@
2006-02-27 Jakub Jelinek <jakub@redhat.com>
* Makefile (libpthread-routines): Add
pthread_mutexattr_[sg]etprotocol, pthread_mutexattr_[sg]etprioceiling
and pthread_mutex_[sg]etprioceiling.
* Versions (GLIBC_2.4): Export pthread_mutexattr_getprotocol,
pthread_mutexattr_setprotocol, pthread_mutexattr_getprioceiling,
pthread_mutexattr_setprioceiling, pthread_mutex_getprioceiling and
pthread_mutex_setprioceiling.
* sysdeps/pthread/pthread.h (PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT,
PTHREAD_PRIO_PROTECT): New enum values.
(pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol,
pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling,
pthread_mutex_getprioceiling, pthread_mutex_setprioceiling): New
prototypes.
* pthreadP.h (PTHREAD_MUTEX_PRIO_INHERIT_PRIVATE_NP,
PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP): New enum values.
(PTHREAD_MUTEX_PRIO_CEILING_SHIFT, PTHREAD_MUTEX_PRIO_CEILING_MASK):
Define.
(PTHREAD_MUTEXATTR_PROTOCOL_SHIFT, PTHREAD_MUTEXATTR_PROTOCOL_MASK,
PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT,
PTHREAD_MUTEXATTR_PRIO_CEILING_MASK): Define.
(PTHREAD_MUTEXATTR_FLAG_BITS): Or in PTHREAD_MUTEXATTR_PROTOCOL_MASK
and PTHREAD_MUTEXATTR_PRIO_CEILING_MASK.
* pthread_mutex_init.c (__pthread_mutex_init): For the time being
return ENOTSUP for PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT
protocol mutexes.
* pthread_mutex_getprioceiling.c: New file.
* pthread_mutex_setprioceiling.c: New file.
* pthread_mutexattr_getprioceiling.c: New file.
* pthread_mutexattr_setprioceiling.c: New file.
* pthread_mutexattr_getprotocol.c: New file.
* pthread_mutexattr_setprotocol.c: New file.
2006-02-27 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/aio_misc.h: Include <limits.h>.

View File

@ -51,7 +51,6 @@ sparc64-.*-linux.* libm=6 GLIBC_2.2
alpha.*-.*-linux.* libm=6.1
ia64-.*-linux.* libm=6.1 GLIBC_2.2
sh.*-.*-linux.* libm=6 GLIBC_2.2
hppa.*-.*-.* libm=6 GLIBC_2.2
.*-.*-linux.* libm=6
.*-.*-gnu-gnu.* libm=6
@ -60,7 +59,6 @@ alpha.*-.*-linux.* libc=6.1
ia64-.*-linux.* libc=6.1 GLIBC_2.2
sh.*-.*-linux.* libc=6 GLIBC_2.2
sparc64-.*-linux.* libc=6 GLIBC_2.2
hppa.*-.*-.* libc=6 GLIBC_2.2
.*-.*-linux.* libc=6
# libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release.
@ -79,7 +77,6 @@ sparc.*-.*-linux.* ld=ld-linux.so.2
alpha.*-.*-linux.* ld=ld-linux.so.2
sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
ia64-.*-linux.* ld=ld-linux-ia64.so.2 GLIBC_2.2
hppa.*-.*-.* ld=ld.so.1 GLIBC_2.2
s390x-.*-linux.* ld=ld64.so.1 GLIBC_2.2
powerpc64.*-.*-linux.* ld=ld64.so.1 GLIBC_2.3
cris-.*-linux.* ld=ld.so.1 GLIBC_2.2
@ -125,7 +122,6 @@ alpha.*-.*-linux.* libBrokenLocale=1.1
ia64-.*-.* libBrokenLocale=1 GLIBC_2.2
sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2
sparc64-.*-.* libBrokenLocale=1 GLIBC_2.2
hppa-.*-.* libBrokenLocale=1 GLIBC_2.2
.*-.*-.* libBrokenLocale=1
# The real-time library from POSIX.1b.

View File

@ -1,41 +0,0 @@
# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by David Huggins-Daines (dhd@debian.org)
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library 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
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
# We used to need this since the build process uses ld -r. Now we use
# ld -r --unique=.text* which does more or less the same thing, but better.
# CFLAGS-.os += -ffunction-sections
LDFLAGS-c_pic.os += -Wl,--unique=.text*
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -mdisable-fpregs
sysdep-dl-routines += dl-symaddr dl-fptr
sysdep_routines += $(sysdep-dl-routines)
sysdep-rtld-routines += $(sysdep-dl-routines)
endif
ifeq ($(subdir),csu)
ifeq (yes,$(build-shared))
# Compatibility
ifeq (yes,$(have-protected))
CPPFLAGS-libgcc-compat.c = -DHAVE_DOT_HIDDEN
endif
sysdep_routines += libgcc-compat
shared-only-routines += libgcc-compat
endif
endif

View File

@ -1,12 +0,0 @@
ld {
GLIBC_PRIVATE {
# hppa specific functions in the dynamic linker, but used by libc.so.
_dl_symbol_address; _dl_unmap; _dl_lookup_address;
_dl_function_address;
}
}
libc {
GLIBC_2.2 {
__clz_tab;
}
}

View File

@ -1,72 +0,0 @@
/* longjmp for PA-RISC.
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
#define _SETJMP_H
#define _ASM
#include <bits/setjmp.h>
/* __longjmp(jmpbuf, val) */
.text
.align 4
.globl __longjmp
.export __longjmp, code
.proc
.callinfo
__longjmp:
/* set return value */
copy %r25, %r28
ldw 0(%r26), %r3
ldw 8(%r26), %r4
ldw 12(%r26), %r5
ldw 16(%r26), %r6
ldw 20(%r26), %r7
ldw 24(%r26), %r8
ldw 28(%r26), %r9
ldw 32(%r26), %r10
ldw 36(%r26), %r11
ldw 40(%r26), %r12
ldw 44(%r26), %r13
ldw 48(%r26), %r14
ldw 52(%r26), %r15
ldw 56(%r26), %r16
ldw 60(%r26), %r17
ldw 64(%r26), %r18
ldw 68(%r26), %r19
ldw 72(%r26), %r27
ldw 76(%r26), %r30
ldw 80(%r26), %rp
ldo 88(%r26),%r20
fldds,ma 8(%r20), %fr12
fldds,ma 8(%r20), %fr13
fldds,ma 8(%r20), %fr14
fldds,ma 8(%r20), %fr15
fldds,ma 8(%r20), %fr16
fldds,ma 8(%r20), %fr17
fldds,ma 8(%r20), %fr18
fldds,ma 8(%r20), %fr19
fldds,ma 8(%r20), %fr20
fldds 0(%r20), %fr21
bv,n %r0(%r2)
.procend

View File

@ -1,6 +0,0 @@
/* An instruction privileged instruction to crash a userspace program.
We go with iitlbp because it has a history of being used to crash
programs. */
#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%r0)")

View File

@ -1,58 +0,0 @@
;! HP-PA __mpn_add_n -- Add two limb vectors of the same length > 0 and store
;! sum in a third limb vector.
;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr gr26
;! s1_ptr gr25
;! s2_ptr gr24
;! size gr23
;! One might want to unroll this as for other processors, but it turns
;! out that the data cache contention after a store makes such
;! unrolling useless. We can't come under 5 cycles/limb anyway.
.text
.export __mpn_add_n
__mpn_add_n:
.proc
.callinfo frame=0,no_calls
.entry
ldws,ma 4(%r25),%r21
ldws,ma 4(%r24),%r20
addib,= -1,%r23,L$end ;! check for (SIZE == 1)
add %r21,%r20,%r28 ;! add first limbs ignoring cy
L$loop: ldws,ma 4(%r25),%r21
ldws,ma 4(%r24),%r20
stws,ma %r28,4(%r26)
addib,<> -1,%r23,L$loop
addc %r21,%r20,%r28
L$end: stws %r28,0(%r26)
bv 0(%r2)
addc %r0,%r0,%r28
.exit
.procend

View File

@ -1,7 +0,0 @@
/* hppa1.1 big-endian. */
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif
#define __BYTE_ORDER __BIG_ENDIAN

View File

@ -1,6 +0,0 @@
/* Used to store the function descriptor table */
struct link_map_machine
{
size_t fptr_table_len;
ElfW(Addr) *fptr_table;
};

View File

@ -1,36 +0,0 @@
/* Copyright (C) 2000, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* Define the machine-dependent type `jmp_buf'. HPPA version. */
#ifndef _BITS_SETJMP_H
#define _BITS_SETJMP_H 1
#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
We use an array of 'double' instead, to make writing the assembler
easier, and to ensure proper alignment. Naturally, user code should
not depend on either representation. */
#ifndef _ASM
typedef double __jmp_buf[21];
#endif
#endif /* bits/setjmp.h */

View File

@ -1,39 +0,0 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. HPPA version.
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
We cannot do it in C because it must be a tail-call, so frame-unwinding
in setjmp doesn't clobber the state restored by longjmp. */
.text
.align 4
.globl _setjmp
.export _setjmp, code
.level 2.0
.proc
.callinfo
.import __sigsetjmp
_setjmp:
b __sigsetjmp
ldi 0, %r25
.procend
libc_hidden_def (_setjmp)

View File

@ -1,36 +0,0 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. HPPA version.
Copyright (C) 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
We cannot do it in C because it must be a tail-call, so frame-unwinding
in setjmp doesn't clobber the state restored by longjmp. */
.text
.align 4
.globl setjmp
.export setjmp, code
.level 2.0
.proc
.callinfo
.import __sigsetjmp
setjmp:
b __sigsetjmp
ldi 1, %r25
.procend

View File

@ -1,33 +0,0 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
echo "$as_me:$LINENO: checking for assembler line separator" >&5
echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6
if test "${libc_cv_asm_line_sep+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat > conftest.s <<EOF
nop ; is_old_puffin
EOF
if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
libc_cv_asm_line_sep='!'
else
if test -z "$enable_hacker_mode"; then
echo "*** You need a newer assembler to compile glibc"
rm -f conftest*
exit 1
fi
libc_cv_asm_line_sep=';'
fi
rm -f conftest*
fi
echo "$as_me:$LINENO: result: $libc_cv_asm_line_sep" >&5
echo "${ECHO_T}$libc_cv_asm_line_sep" >&6
cat >>confdefs.h <<_ACEOF
#define ASM_LINE_SEP $libc_cv_asm_line_sep
_ACEOF

View File

@ -1,21 +0,0 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
dnl The standard hppa assembler uses `;' to start comments and `!'
dnl as a line separator.
AC_CACHE_CHECK(for assembler line separator,
libc_cv_asm_line_sep, [dnl
cat > conftest.s <<EOF
nop ; is_old_puffin
EOF
if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
libc_cv_asm_line_sep='!'
else
if test -z "$enable_hacker_mode"; then
echo "*** You need a newer assembler to compile glibc"
rm -f conftest*
exit 1
fi
libc_cv_asm_line_sep=';'
fi
rm -f conftest*])
AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)

View File

@ -1,35 +0,0 @@
/* Function descriptors. HPPA version.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef dl_hppa_fptr_h
#define dl_hppa_fptr_h 1
#include <sysdeps/generic/dl-fptr.h>
/* There are currently 20 dynamic symbols in ld.so.
ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */
#define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200
#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
asm (" addil LT%%" #symbol ", %%r19\n" \
" ldw RT%%" #symbol "(%%sr0,%%r1), %0\n" \
: "=&r" (var));
#endif /* !dl_hppa_fptr_h */

View File

@ -1,65 +0,0 @@
/* Configuration of lookup functions.
Copyright (C) 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define ELF_FUNCTION_PTR_IS_SPECIAL
#define DL_UNMAP_IS_SPECIAL
/* Forward declaration. */
struct link_map;
void *_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref);
#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref)
Elf32_Addr _dl_lookup_address (const void *address);
/* Clear the bottom two bits so generic code can find the fdesc entry */
#define DL_LOOKUP_ADDRESS(addr) \
(_dl_lookup_address ((void *)((unsigned long)addr & ~3)))
void _dl_unmap (struct link_map *map);
#define DL_UNMAP(map) _dl_unmap (map)
#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \
({ \
unsigned int fptr[2]; \
fptr[0] = (unsigned int) (addr); \
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \
(ElfW(Addr))((unsigned int)fptr | 2); \
})
#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \
({ \
static unsigned int fptr[2]; \
fptr[0] = (unsigned int) (addr); \
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \
(ElfW(Addr))((unsigned int)fptr | 2); \
})
/* The test for "addr & 2" below is to accomodate old binaries which
violated the ELF ABI by pointing DT_INIT and DT_FINI at a function
descriptor. */
#define DL_DT_INIT_ADDRESS(map, addr) \
((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr))
#define DL_DT_FINI_ADDRESS(map, addr) \
((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr))

View File

@ -1,762 +0,0 @@
/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version.
Copyright (C) 1995-1997,1999-2003
Free Software Foundation, Inc.
Contributed by David Huggins-Daines <dhd@debian.org>
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef dl_machine_h
#define dl_machine_h 1
#define ELF_MACHINE_NAME "hppa"
#include <sys/param.h>
#include <assert.h>
#include <string.h>
#include <link.h>
#include <errno.h>
#include <dl-fptr.h>
#include <abort-instr.h>
# define VALID_ELF_OSABI(osabi) ((osabi == ELFOSABI_SYSV) || (osabi == ELFOSABI_LINUX))
# define VALID_ELF_ABIVERSION(ver) (ver == 0)
# define VALID_ELF_HEADER(hdr,exp,size) \
memcmp (hdr,exp,size-2) == 0 \
&& VALID_ELF_OSABI (hdr[EI_OSABI]) \
&& VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
/* These two definitions must match the definition of the stub in
bfd/elf32-hppa.c (see plt_stub[]).
a. Define the size of the *entire* stub we place at the end of the PLT
table (right up against the GOT).
b. Define the number of bytes back from the GOT to the entry point of
the PLT stub. You see the PLT stub must be entered in the middle
so it can depwi to find it's own address (long jump stub)
c. Define the size of a single PLT entry so we can jump over the
last entry to get the stub address */
#define SIZEOF_PLT_STUB (7*4)
#define GOT_FROM_PLT_STUB (4*4)
#define PLT_ENTRY_SIZE (2*4)
/* Initialize the function descriptor table before relocations */
static inline void
__hppa_init_bootstrap_fdesc_table (struct link_map *map)
{
ElfW(Addr) *boot_table;
/* Careful: this will be called before got has been relocated... */
ELF_MACHINE_LOAD_ADDRESS(boot_table,_dl_boot_fptr_table);
map->l_mach.fptr_table_len = ELF_MACHINE_BOOT_FPTR_TABLE_LEN;
map->l_mach.fptr_table = boot_table;
}
#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \
__hppa_init_bootstrap_fdesc_table (&bootstrap_map);
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
return ehdr->e_machine == EM_PARISC;
}
/* Return the link-time address of _DYNAMIC. */
static inline Elf32_Addr
elf_machine_dynamic (void) __attribute__ ((const));
static inline Elf32_Addr
elf_machine_dynamic (void)
{
Elf32_Addr dynamic;
asm ("b,l 1f,%0\n"
" depi 0,31,2,%0\n"
"1: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0\n"
" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
: "=r" (dynamic) : : "r1");
return dynamic;
}
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr
elf_machine_load_address (void) __attribute__ ((const));
static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr dynamic;
asm (
" b,l 1f,%0\n"
" depi 0,31,2,%0\n"
"1: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0\n"
" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
: "=r" (dynamic) : : "r1");
return dynamic - elf_machine_dynamic ();
}
/* Fixup a PLT entry to bounce directly to the function at VALUE.
Optimized non-profile version. */
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
/* map is the link_map for the caller, t is the link_map for the object
being called */
reloc_addr[1] = D_PTR (t, l_info[DT_PLTGOT]);
reloc_addr[0] = value;
/* Return the PLT slot rather than the function value so that the
trampoline can load the new LTP. */
return (Elf32_Addr) reloc_addr;
}
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
#define ELF_MACHINE_PROFILE_FIXUP_PLT elf_machine_profile_fixup_plt
static inline Elf32_Addr
elf_machine_profile_fixup_plt (struct link_map *map, lookup_t t,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
if(__builtin_expect (t == NULL, 1))
return (Elf32_Addr) reloc_addr;
/* Return the PLT slot rather than the function value so that the
trampoline can load the new LTP. */
return (Elf32_Addr) elf_machine_fixup_plt(map, t, reloc, reloc_addr, value);
}
/* Return the final value of a plt relocation. */
static inline Elf32_Addr
elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
Elf32_Addr value)
{
/* We are rela only */
return value + reloc->r_addend;
}
/* Set up the loaded object described by L so its unrelocated PLT
entries will jump to the on-demand fixup code in dl-runtime.c. */
static inline int
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
{
Elf32_Addr *got = NULL;
Elf32_Addr l_addr, iplt, jmprel, end_jmprel, r_type, r_sym;
const Elf32_Rela *reloc;
struct fdesc *fptr;
static union {
unsigned char c[8];
Elf32_Addr i[2];
} sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}};
/* If we don't have a PLT we can just skip all this... */
if (__builtin_expect (l->l_info[DT_JMPREL] == NULL,0))
return lazy;
/* All paths use these values */
l_addr = l->l_addr;
jmprel = D_PTR(l, l_info[DT_JMPREL]);
end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val;
extern void _dl_runtime_resolve (void);
extern void _dl_runtime_profile (void);
/* Linking lazily */
if (lazy)
{
/* FIXME: Search for the got, but backwards through the relocs, technically we should
find it on the first try. However, assuming the relocs got out of order the
routine is made a bit more robust by searching them all in case of failure. */
for (iplt = (end_jmprel - sizeof(Elf32_Rela)); iplt >= jmprel; iplt -= sizeof (Elf32_Rela))
{
reloc = (const Elf32_Rela *) iplt;
r_type = ELF32_R_TYPE (reloc->r_info);
r_sym = ELF32_R_SYM (reloc->r_info);
got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB);
/* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */
if (__builtin_expect (r_type != R_PARISC_IPLT, 0))
{
if (__builtin_expect (r_type != R_PARISC_NONE, 0))
_dl_reloc_bad_type (l, r_type, 1);
continue;
}
/* Check for the plt_stub that binutils placed here for us
to use with _dl_runtime_resolve */
if (got[-2] != sig.i[0] || got[-1] != sig.i[1])
{
got = NULL; /* Not the stub... keep looking */
}
else
{
/* Found the GOT! */
register Elf32_Addr ltp __asm__ ("%r19");
/* Identify this shared object. */
got[1] = (Elf32_Addr) l;
/* This function will be called to perform the relocation. */
if (__builtin_expect (!profile, 1))
{
/* If a static application called us, then _dl_runtime_resolve is not
a function descriptor, but the *real* address of the function... */
if((unsigned long) &_dl_runtime_resolve & 3)
{
got[-2] = (Elf32_Addr) ((struct fdesc *)
((unsigned long) &_dl_runtime_resolve & ~3))->ip;
}
else
{
/* Static executable! */
got[-2] = (Elf32_Addr) &_dl_runtime_resolve;
}
}
else
{
if (_dl_name_match_p (GLRO(dl_profile), l))
{
/* This is the object we are looking for. Say that
we really want profiling and the timers are
started. */
GL(dl_profile_map) = l;
}
if((unsigned long) &_dl_runtime_resolve & 3)
{
got[-2] = (Elf32_Addr) ((struct fdesc *)
((unsigned long) &_dl_runtime_profile & ~3))->ip;
}
else
{
/* Static executable */
got[-2] = (Elf32_Addr) &_dl_runtime_profile;
}
}
/* Plunk in the gp of this function descriptor so we
can make the call to _dl_runtime_xxxxxx */
got[-1] = ltp;
break;
/* Done looking for the GOT, and stub is setup */
} /* else we found the GOT */
} /* for, walk the relocs backwards */
if(!got)
return 0; /* No lazy linking for you! */
/* Process all the relocs, now that we know the GOT... */
for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela))
{
reloc = (const Elf32_Rela *) iplt;
r_type = ELF32_R_TYPE (reloc->r_info);
r_sym = ELF32_R_SYM (reloc->r_info);
if (__builtin_expect (r_type == R_PARISC_IPLT, 1))
{
fptr = (struct fdesc *) (reloc->r_offset + l_addr);
if (r_sym != 0)
{
/* Relocate the pointer to the stub. */
fptr->ip = (Elf32_Addr) got - GOT_FROM_PLT_STUB;
/* Instead of the LTP value, we put the reloc offset
here. The trampoline code will load the proper
LTP and pass the reloc offset to the fixup
function. */
fptr->gp = iplt - jmprel;
} /* r_sym != 0 */
else
{
/* Relocate this *ABS* entry. */
fptr->ip = reloc->r_addend + l_addr;
fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
}
} /* r_type == R_PARISC_IPLT */
} /* for all the relocations */
} /* if lazy */
else
{
for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela))
{
reloc = (const Elf32_Rela *) iplt;
r_type = ELF32_R_TYPE (reloc->r_info);
r_sym = ELF32_R_SYM (reloc->r_info);
if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1))
{
fptr = (struct fdesc *) (reloc->r_offset + l_addr);
/* Relocate this *ABS* entry, set only the gp, the rest is set later
when elf_machine_rela_relative is called (WITHOUT the linkmap) */
fptr->gp = D_PTR (l, l_info[DT_PLTGOT]);
} /* r_type == R_PARISC_IPLT */
} /* for all the relocations */
}
return lazy;
}
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START \
/* Set up dp for any non-PIC lib constructors that may be called. */ \
static struct link_map * __attribute__((used)) \
set_dp (struct link_map *map) \
{ \
register Elf32_Addr dp asm ("%r27"); \
dp = D_PTR (map, l_info[DT_PLTGOT]); \
asm volatile ("" : : "r" (dp)); \
return map; \
} \
\
asm ( \
" .text\n" \
" .globl _start\n" \
" .type _start,@function\n" \
"_start:\n" \
/* The kernel does not give us an initial stack frame. */ \
" ldo 64(%sp),%sp\n" \
/* Save the relevant arguments (yes, those are the correct \
registers, the kernel is weird) in their stack slots. */ \
" stw %r25,-40(%sp)\n" /* argc */ \
" stw %r24,-44(%sp)\n" /* argv */ \
\
/* We need the LTP, and we need it now. \
$PIC_pcrel$0 points 8 bytes past the current instruction, \
just like a branch reloc. This sequence gets us the \
runtime address of _DYNAMIC. */ \
" bl 0f,%r19\n" \
" depi 0,31,2,%r19\n" /* clear priviledge bits */ \
"0: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19\n" \
" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26\n" \
\
/* The link time address is stored in the first entry of the \
GOT. */ \
" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19\n" \
" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20\n" \
\
" sub %r26,%r20,%r20\n" /* Calculate load offset */ \
\
/* Rummage through the dynamic entries, looking for \
DT_PLTGOT. */ \
" ldw,ma 8(%r26),%r19\n" \
"1: cmpib,=,n 3,%r19,2f\n" /* tag == DT_PLTGOT? */ \
" cmpib,<>,n 0,%r19,1b\n" \
" ldw,ma 8(%r26),%r19\n" \
\
/* Uh oh! We didn't find one. Abort. */ \
" iitlbp %r0,(%r0)\n" \
\
"2: ldw -4(%r26),%r19\n" /* Found it, load value. */ \
" add %r19,%r20,%r19\n" /* And add the load offset. */ \
\
/* Our initial stack layout is rather different from everyone \
else's due to the unique PA-RISC ABI. As far as I know it \
looks like this: \
\
----------------------------------- (this frame created above) \
| 32 bytes of magic | \
|---------------------------------| \
| 32 bytes argument/sp save area | \
|---------------------------------| ((current->mm->env_end) \
| N bytes of slack | + 63 & ~63) \
|---------------------------------| \
| envvar and arg strings | \
|---------------------------------| \
| ELF auxiliary info | \
| (up to 28 words) | \
|---------------------------------| \
| Environment variable pointers | \
| upwards to NULL | \
|---------------------------------| \
| Argument pointers | \
| upwards to NULL | \
|---------------------------------| \
| argc (1 word) | \
----------------------------------- \
\
So, obviously, we can't just pass %sp to _dl_start. That's \
okay, argv-4 will do just fine. \
\
The pleasant part of this is that if we need to skip \
arguments we can just decrement argc and move argv, because \
the stack pointer is utterly unrelated to the location of \
the environment and argument vectors. */ \
\
/* This is always within range so we'll be okay. */ \
" bl _dl_start,%rp\n" \
" ldo -4(%r24),%r26\n" \
\
" .globl _dl_start_user\n" \
" .type _dl_start_user,@function\n" \
"_dl_start_user:\n" \
/* Save the entry point in %r3. */ \
" copy %ret0,%r3\n" \
\
/* Remember the lowest stack address. */ \
" addil LT'__libc_stack_end,%r19\n" \
" ldw RT'__libc_stack_end(%r1),%r20\n" \
" stw %sp,0(%r20)\n" \
\
/* See if we were called as a command with the executable file \
name as an extra leading argument. */ \
" addil LT'_dl_skip_args,%r19\n" \
" ldw RT'_dl_skip_args(%r1),%r20\n" \
" ldw 0(%r20),%r20\n" \
\
" ldw -40(%sp),%r25\n" /* argc */ \
" comib,= 0,%r20,.Lnofix\n" /* FIXME: Mispredicted branch */\
" ldw -44(%sp),%r24\n" /* argv (delay slot) */ \
\
" sub %r25,%r20,%r25\n" \
" stw %r25,-40(%sp)\n" \
" sh2add %r20,%r24,%r24\n" \
" stw %r24,-44(%sp)\n" \
\
".Lnofix:\n" \
" addil LT'_rtld_local,%r19\n" \
" ldw RT'_rtld_local(%r1),%r26\n" \
" bl set_dp, %r2\n" \
" ldw 0(%r26),%r26\n" \
\
/* Call _dl_init(_dl_loaded, argc, argv, envp). */ \
" copy %r28,%r26\n" \
\
/* envp = argv + argc + 1 */ \
" sh2add %r25,%r24,%r23\n" \
" bl _dl_init_internal,%r2\n" \
" ldo 4(%r23),%r23\n" /* delay slot */ \
\
/* Reload argc, argv to the registers start.S expects. */ \
" ldw -40(%sp),%r25\n" \
" ldw -44(%sp),%r24\n" \
\
/* _dl_fini does have a PLT slot now. I don't know how to get \
to it though, so this hack will remain. */ \
" .section .data\n" \
"__dl_fini_plabel:\n" \
" .word _dl_fini\n" \
" .word 0xdeadbeef\n" \
" .previous\n" \
\
/* %r3 contains a function pointer, we need to mask out the \
lower bits and load the gp and jump address. */ \
" depi 0,31,2,%r3\n" \
" ldw 0(%r3),%r2\n" \
" addil LT'__dl_fini_plabel,%r19\n" \
" ldw RT'__dl_fini_plabel(%r1),%r23\n" \
" stw %r19,4(%r23)\n" \
" ldw 4(%r3),%r19\n" /* load the object's gp */ \
" bv %r0(%r2)\n" \
" depi 2,31,2,%r23\n" /* delay slot */ \
);
/* This code gets called via the .plt stub, and is used in
dl-runtime.c to call the `fixup' function and then redirect to the
address it returns.
WARNING: This template is also used by gcc's __cffc, and expects
that the "bl" for fixup() exist at a particular offset.
Do not change this template without changing gcc, while the prefix
"bl" should fix everything so gcc finds the right spot, it will
slow down __cffc when it attempts to call fixup to resolve function
descriptor references. Please refer to gcc/gcc/config/pa/fptr.c
Enter with r19 = reloc offset, r20 = got-8, r21 = fixup ltp. */
#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
extern void tramp_name (void); \
asm ( \
" .text\n" \
/* FAKE bl to provide gcc's __cffc with fixup's address */ \
" bl " #fixup_name ",%r2\n" /* Runtime address of fixup */ \
" .globl " #tramp_name "\n" \
" .type " #tramp_name ",@function\n" \
#tramp_name ":\n" \
" .proc\n" \
" .callinfo frame=64,calls,save_rp\n" \
" .entry\n" \
/* Save return pointer */ \
" stw %r2,-20(%sp)\n" \
/* Save argument registers in the call stack frame. */ \
" stw %r26,-36(%sp)\n" \
" stw %r25,-40(%sp)\n" \
" stw %r24,-44(%sp)\n" \
" stw %r23,-48(%sp)\n" \
/* Build a call frame, and save structure pointer. */ \
" stwm %r28,64(%sp)\n" \
\
/* Set up args to fixup func. */ \
" ldw 8+4(%r20),%r26\n" /* (1) got[1] == struct link_map */ \
" copy %r19,%r25\n" /* (2) reloc offset */ \
" copy %r2,%r24\n" /* (3) profile_fixup needs rp */ \
\
/* Call the real address resolver. */ \
" bl " #fixup_name ",%r2\n" \
" copy %r21,%r19\n" /* set fixup func ltp (DELAY SLOT)*/ \
\
" ldw 0(%r28),%r22\n" /* load up the returned func ptr */ \
" ldw 4(%r28),%r19\n" \
" ldwm -64(%sp),%r28\n" \
/* Arguments. */ \
" ldw -36(%sp),%r26\n" \
" ldw -40(%sp),%r25\n" \
" ldw -44(%sp),%r24\n" \
" ldw -48(%sp),%r23\n" \
/* Call the real function. */ \
" bv %r0(%r22)\n" \
/* Return pointer. */ \
" ldw -20(%sp),%r2\n" \
" .exit\n" \
" .procend\n");
#ifndef PROF
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \
TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup);
#else
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \
strong_alias (_dl_runtime_resolve, _dl_runtime_profile);
#endif
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
PLT entries should not be allowed to define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
#define elf_machine_type_class(type) \
((((type) == R_PARISC_IPLT || (type) == R_PARISC_EPLT) \
* ELF_RTYPE_CLASS_PLT) \
| (((type) == R_PARISC_COPY) * ELF_RTYPE_CLASS_COPY))
/* Used by the runtime in fixup to figure out if reloc is *really* PLT */
#define ELF_MACHINE_JMP_SLOT R_PARISC_IPLT
#define ELF_MACHINE_SIZEOF_JMP_SLOT PLT_ENTRY_SIZE
/* We only use RELA. */
#define ELF_MACHINE_NO_REL 1
/* Return the address of the entry point. */
#define ELF_MACHINE_START_ADDRESS(map, start) \
DL_STATIC_FUNCTION_ADDRESS (map, start)
/* We define an initialization functions. This is called very early in
* _dl_sysdep_start. */
#define DL_PLATFORM_INIT dl_platform_init ()
static inline void __attribute__ ((unused))
dl_platform_init (void)
{
if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
/* Avoid an empty string which would disturb us. */
GLRO(dl_platform) = NULL;
}
#endif /* !dl_machine_h */
/* These are only actually used where RESOLVE_MAP is defined, anyway. */
#ifdef RESOLVE_MAP
auto void __attribute__((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
void *const reloc_addr_arg)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
unsigned long const r_type = ELF32_R_TYPE (reloc->r_info);
struct link_map *sym_map;
Elf32_Addr value;
# if !defined RTLD_BOOTSTRAP && !defined SHARED
/* This is defined in rtld.c, but nowhere in the static libc.a; make the
reference weak so static programs can still link. This declaration
cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP)
because rtld.c contains the common defn for _dl_rtld_map, which is
incompatible with a weak decl in the same file. */
weak_extern (GL(dl_rtld_map));
# endif
/* RESOLVE_MAP will return a null value for undefined syms, and
non-null for all other syms. In particular, relocs with no
symbol (symbol index of zero), also called *ABS* relocs, will be
resolved to MAP. (The first entry in a symbol table is all
zeros, and an all zero Elf32_Sym has a binding of STB_LOCAL.)
See RESOLVE_MAP definition in elf/dl-reloc.c */
# ifdef RTLD_BOOTSTRAP
/* RESOLVE_MAP in rtld.c doesn't have the local sym test. */
sym_map = (ELF32_ST_BIND (sym->st_info) != STB_LOCAL
? RESOLVE_MAP (&sym, version, r_type) : map);
# else
sym_map = RESOLVE_MAP (&sym, version, r_type);
# endif
if (sym_map)
{
value = sym ? sym_map->l_addr + sym->st_value : 0;
value += reloc->r_addend;
}
else
value = 0;
switch (r_type)
{
case R_PARISC_DIR32:
/* .eh_frame can have unaligned relocs. */
if ((unsigned long) reloc_addr_arg & 3)
{
char *rel_addr = (char *) reloc_addr_arg;
rel_addr[0] = value >> 24;
rel_addr[1] = value >> 16;
rel_addr[2] = value >> 8;
rel_addr[3] = value;
return;
}
break;
case R_PARISC_PLABEL32:
/* Easy rule: If there is a symbol and it is global, then we
need to make a dynamic function descriptor. Otherwise we
have the address of a PLT slot for a local symbol which we
know to be unique. */
if (sym == NULL
|| sym_map == NULL
|| ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
{
break;
}
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL.
We have to do this outside of the generic function descriptor
code, since it doesn't know about our requirement for setting
protection bits */
value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2);
break;
case R_PARISC_IPLT:
if (__builtin_expect (sym_map != NULL, 1))
{
elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, value);
}
else
{
/* If we get here, it's a (weak) undefined sym. */
elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, value);
}
return;
case R_PARISC_COPY:
if (__builtin_expect (sym == NULL, 0))
/* This can happen in trace mode if an object could not be
found. */
break;
if (__builtin_expect (sym->st_size > refsym->st_size, 0)
|| (__builtin_expect (sym->st_size < refsym->st_size, 0)
&& __builtin_expect (GLRO(dl_verbose), 0)))
{
const char *strtab;
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
_dl_error_printf ("%s: Symbol `%s' has different size in shared object, "
"consider re-linking\n",
rtld_progname ?: "<program name unknown>",
strtab + refsym->st_name);
}
memcpy (reloc_addr_arg, (void *) value,
MIN (sym->st_size, refsym->st_size));
return;
case R_PARISC_NONE: /* Alright, Wilbur. */
return;
default:
_dl_reloc_bad_type (map, r_type, 0);
}
*reloc_addr = value;
}
/* hppa doesn't have an R_PARISC_RELATIVE reloc, but uses relocs with
ELF32_R_SYM (info) == 0 for a similar purpose. */
auto void __attribute__((always_inline))
elf_machine_rela_relative (Elf32_Addr l_addr,
const Elf32_Rela *reloc,
void *const reloc_addr_arg)
{
unsigned long const r_type = ELF32_R_TYPE (reloc->r_info);
Elf32_Addr *const reloc_addr = reloc_addr_arg;
static char msgbuf[] = { "Unknown" };
struct link_map map;
Elf32_Addr value;
value = l_addr + reloc->r_addend;
if (ELF32_R_SYM (reloc->r_info) != 0){
_dl_error_printf ("%s: In elf_machine_rela_relative "
"ELF32_R_SYM (reloc->r_info) != 0. Aborting.",
rtld_progname ?: "<program name unknown>");
ABORT_INSTRUCTION; /* Crash. */
}
switch (r_type)
{
case R_PARISC_DIR32:
/* .eh_frame can have unaligned relocs. */
if ((unsigned long) reloc_addr_arg & 3)
{
char *rel_addr = (char *) reloc_addr_arg;
rel_addr[0] = value >> 24;
rel_addr[1] = value >> 16;
rel_addr[2] = value >> 8;
rel_addr[3] = value;
return;
}
break;
case R_PARISC_PLABEL32:
break;
case R_PARISC_IPLT: /* elf_machine_runtime_setup already set gp */
break;
case R_PARISC_NONE:
return;
default: /* Bad reloc, map unknown (really it's the current map) */
map.l_name = msgbuf;
_dl_reloc_bad_type (&map, r_type, 0);
return;
}
*reloc_addr = value;
}
auto void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
Elf32_Addr l_addr, const Elf32_Rela *reloc)
{
/* We don't have anything to do here. elf_machine_runtime_setup has
done all the relocs already. */
}
#endif /* RESOLVE_MAP */

View File

@ -1,36 +0,0 @@
/* Get the symbol address. HPPA version.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <ldsodefs.h>
#include <dl-machine.h>
void *
_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
{
/* Find the "ip" from the "map" and symbol "ref" */
Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value;
/* On hppa, we have to return the pointer to function descriptor.
This involves an "| 2" to inform $$dyncall that this is a plabel32 */
if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC){
return (void *)((unsigned long)_dl_make_fptr (map, ref, value) | 2);
}
else
return (void *) value;
}

View File

@ -1,10 +0,0 @@
#ifndef __ASSEMBLY__
extern void _start (void);
#endif
/* The function's entry point is stored in the first word of the
function descriptor (plabel) of _start(). */
#define ENTRY_POINT __canonicalize_funcptr_for_compare(_start)
/* We have to provide a special declaration. */
#define ENTRY_POINT_DECL(class) class void _start (void);

View File

@ -1,139 +0,0 @@
/* Special .init and .fini section support for HPPA
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
In addition to the permissions in the GNU Lesser 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 GNU Lesser 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.)
Note that people who make modified versions of this file are not
obligated to grant this special exception for their modified
versions; it is their choice whether to do so. The GNU Lesser
General Public License gives permission to release a modified
version without this exception; this exception also makes it
possible to release a modified version which carries forward this
exception.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* This file is compiled into assembly code which is then munged by a sed
script into two files: crti.s and crtn.s.
* crti.s puts a function prologue at the beginning of the
.init and .fini sections and defines global symbols for
those addresses, so they can be called as functions.
* crtn.s puts the corresponding function epilogues
in the .init and .fini sections. */
/* If we use the standard C version, the linkage table pointer won't
be properly preserved due to the splitting up of function prologues
and epilogues. Therefore we write these in assembly to make sure
they do the right thing.
Note that we cannot have a weak undefined __gmon_start__, because
that would require this to be PIC, and the linker is currently not
able to generate a proper procedure descriptor for _init. Sad but
true. Anyway, HPPA is one of those horrible architectures where
making the comparison and indirect call is quite expensive (see the
comment in sysdeps/generic/initfini.c). */
__asm__ ("\
\n\
#include \"defs.h\"\n\
\n\
/*@HEADER_ENDS*/\n\
\n\
/*@_init_PROLOG_BEGINS*/\n\
.section .init\n\
.align 4\n\
.globl _init\n\
.type _init,@function\n\
_init:\n\
stw %rp,-20(%sp)\n\
stwm %r4,64(%sp)\n\
stw %r19,-32(%sp)\n\
bl __gmon_start__,%rp\n\
copy %r19,%r4 /* delay slot */\n\
copy %r4,%r19\n\
/*@_init_PROLOG_ENDS*/\n\
\n\
/*@_init_EPILOG_BEGINS*/\n\
.text\n\
.align 4\n\
.weak __gmon_start__\n\
.type __gmon_start__,@function\n\
__gmon_start__:\n\
.proc\n\
.callinfo\n\
.entry\n\
bv,n %r0(%r2)\n\
.exit\n\
.procend\n\
\n\
/* Here is the tail end of _init. We put __gmon_start before this so\n\
that the assembler creates the .PARISC.unwind section for us, ie.\n\
with the right attributes. */\n\
.section .init\n\
ldw -84(%sp),%rp\n\
copy %r4,%r19\n\
bv %r0(%rp)\n\
_end_init:\n\
ldwm -64(%sp),%r4\n\
\n\
/* Our very own unwind info, because the assembler can't handle\n\
functions split into two or more pieces. */\n\
.section .PARISC.unwind\n\
.extern _init\n\
.word _init, _end_init\n\
.byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\
\n\
/*@_init_EPILOG_ENDS*/\n\
\n\
/*@_fini_PROLOG_BEGINS*/\n\
.section .fini\n\
.align 4\n\
.globl _fini\n\
.type _fini,@function\n\
_fini:\n\
stw %rp,-20(%sp)\n\
stwm %r4,64(%sp)\n\
stw %r19,-32(%sp)\n\
copy %r19,%r4\n\
/*@_fini_PROLOG_ENDS*/\n\
\n\
/*@_fini_EPILOG_BEGINS*/\n\
.section .fini\n\
ldw -84(%sp),%rp\n\
copy %r4,%r19\n\
bv %r0(%rp)\n\
_end_fini:\n\
ldwm -64(%sp),%r4\n\
\n\
.section .PARISC.unwind\n\
.extern _fini\n\
.word _fini, _end_fini\n\
.byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\
\n\
/*@_fini_EPILOG_ENDS*/\n\
\n\
/*@TRAILER_BEGINS*/\
");

View File

@ -1,121 +0,0 @@
/* ELF startup code for HPPA.
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
In addition to the permissions in the GNU Lesser 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 GNU Lesser 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.)
Note that people who make modified versions of this file are not
obligated to grant this special exception for their modified
versions; it is their choice whether to do so. The GNU Lesser
General Public License gives permission to release a modified
version without this exception; this exception also makes it
possible to release a modified version which carries forward this
exception.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
.import main, code
.import $global$, data
.import __libc_start_main, code
.import __libc_csu_fini, code
.import __libc_csu_init, code
/* Have the linker create plabel words
so we get PLABEL32 relocs and not 21/14 */
.section .rodata
.align 4
.Lpmain:
.word P%main
.Lp__libc_start_main:
.word P%__libc_start_main
.Lp__libc_csu_fini:
.word P%__libc_csu_fini
.Lp__libc_csu_init:
.word P%__libc_csu_init
.text
.align 4
.globl _start
.export _start, ENTRY
.type _start,@function
_start:
.proc
.callinfo
/* Expand the stack to store the 5th through 7th args */
ldo 64(%sp), %sp
/* TODO: Follow ABI? Place more things on the stack here... */
#if SHARED
/* load main (1st argument) */
addil LR'.Lpmain, %r19
ldw RR'.Lpmain(%r1), %r26
ldw 0(%r26),%r26
/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
/* void (*init) (void) (4th argument) */
addil LR'.Lp__libc_csu_init, %r19
ldw RR'.Lp__libc_csu_init(%r1), %r23
ldw 0(%r23), %r23
/* void (*fini) (void) (5th argument) */
addil LR'.Lp__libc_csu_fini, %r19
ldw RR'.Lp__libc_csu_fini(%r1), %r22
ldw 0(%r22), %r22
#else
/* load main (1st argument) */
ldil LR'.Lpmain, %r26
ldw RR'.Lpmain(%r26), %r26
/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
/* void (*init) (void) (4th argument) */
ldil LR'.Lp__libc_csu_init, %r23
ldw RR'.Lp__libc_csu_init(%r23), %r23
/* void (*fini) (void) (5th argument) */
ldil LR'.Lp__libc_csu_fini, %r22
ldw RR'.Lp__libc_csu_fini(%r22), %r22
#endif
/* Store 5th argument */
stw %r22, -52(%sp)
/* void (*rtld_fini) (void) (6th argument) */
stw %r23, -56(%sp)
/* void *stack_end (7th argument) */
stw %sp, -60(%sp)
/* load global */
ldil L%$global$, %dp
ldo R%$global$(%dp), %dp
bl __libc_start_main,%r2
nop
/* die horribly if it returned (it shouldn't) */
iitlbp %r0,(%sr0,%r0)
nop
.procend
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
__data_start:
.long 0
.weak data_start
data_start = __data_start

View File

@ -1,78 +0,0 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _FENV_H
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
/* Define bits representing the exception. We use the values of the
appropriate enable bits in the FPU status word (which,
coincidentally, are the same as the flag bits, but shifted right by
27 bits). */
enum
{
FE_INVALID = 1<<4, /* V */
#define FE_INVALID FE_INVALID
FE_DIVBYZERO = 1<<3, /* Z */
#define FE_DIVBYZERO FE_DIVBYZERO
FE_OVERFLOW = 1<<2, /* O */
#define FE_OVERFLOW FE_OVERFLOW
FE_UNDERFLOW = 1<<1, /* U */
#define FE_UNDERFLOW FE_UNDERFLOW
FE_INEXACT = 1<<0, /* I */
#define FE_INEXACT FE_INEXACT
};
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
/* The PA-RISC FPU supports all of the four defined rounding modes.
We use the values of the RM field in the floating point status
register for the appropriate macros. */
enum
{
FE_TONEAREST = 0 << 9,
#define FE_TONEAREST FE_TONEAREST
FE_TOWARDZERO = 1 << 9,
#define FE_TOWARDZERO FE_TOWARDZERO
FE_UPWARD = 2 << 9,
#define FE_UPWARD FE_UPWARD
FE_DOWNWARD = 3 << 9,
#define FE_DOWNWARD FE_DOWNWARD
};
/* Type representing exception flags. */
typedef unsigned int fexcept_t;
/* Type representing floating-point environment. This structure
corresponds to the layout of the status and exception words in the
register file. */
typedef struct
{
unsigned int __status_word;
unsigned int __exception[7];
} fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((fenv_t *) -1)
#ifdef __USE_GNU
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((fenv_t *) -2)
#endif

View File

@ -1,37 +0,0 @@
/* Clear given exceptions in current floating-point environment.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
feclearexcept (int excepts)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
/* Clear all the relevant bits. */
sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
/* Success. */
return 0;
}

View File

@ -1,37 +0,0 @@
/* Disable floating-point exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fedisableexcept (int excepts)
{
unsigned int sw[2], old_exc;
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
old_exc = sw[0] & FE_ALL_EXCEPT;
sw[0] &= ~(excepts & FE_ALL_EXCEPT);
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
return old_exc;
}

View File

@ -1,37 +0,0 @@
/* Enable floating-point exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
feenableexcept (int excepts)
{
unsigned int sw[2], old_exc;
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
old_exc = sw[0] & FE_ALL_EXCEPT;
sw[0] |= (excepts & FE_ALL_EXCEPT);
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
return old_exc;
}

View File

@ -1,33 +0,0 @@
/* Store current floating-point environment.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fegetenv (fenv_t *envp)
{
__asm__ (
"fstd,ma %%fr0,8(%1)\n"
"fstd,ma %%fr1,8(%1)\n"
"fstd,ma %%fr2,8(%1)\n"
"fstd %%fr3,0(%1)\n"
: "=m" (*envp), "+r" (envp));
return 0;
}

View File

@ -1,32 +0,0 @@
/* Get enabled floating-point exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fegetexcept (void)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
return sw[0] & FE_ALL_EXCEPT;
}

View File

@ -1,32 +0,0 @@
/* Return current rounding direction.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fegetround (void)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
return sw[0] & FE_DOWNWARD;
}

View File

@ -1,56 +0,0 @@
/* Store current floating-point environment and clear exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
#include <string.h>
int
feholdexcept (fenv_t *envp)
{
fenv_t clear;
fenv_t * _regs = envp;
/* Store the environment. */
__asm__ (
"fstd,ma %%fr0,8(%1)\n"
"fstd,ma %%fr1,8(%1)\n"
"fstd,ma %%fr2,8(%1)\n"
"fstd %%fr3,0(%1)\n"
: "=m" (*_regs), "+r" (_regs));
memcpy (&clear, envp, sizeof (clear));
/* Now clear all exceptions. */
clear.__status_word &= ~(FE_ALL_EXCEPT << 27);
memset (clear.__exception, 0, sizeof (clear.__exception));
/* And set all exceptions to non-stop. */
clear.__status_word &= ~FE_ALL_EXCEPT;
/* Load the new environment. */
_regs = &clear;
__asm__ (
"fldd,ma 8(%0),%%fr0\n"
"fldd,ma 8(%0),%%fr1\n"
"fldd,ma 8(%0),%%fr2\n"
"fldd 0(%0),%%fr3\n"
: : "r" (_regs));
return 0;
}

View File

@ -1,66 +0,0 @@
/* Install given floating-point environment.
Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
Based on the m68k version by
Andreas Schwab <schwab@suse.de>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fesetenv (const fenv_t *envp)
{
fenv_t temp;
fenv_t * _regs = &temp;
/* Install the environment specified by ENVP. But there are a few
values which we do not want to come from the saved environment.
Therefore, we get the current environment and replace the values
we want to use from the environment specified by the parameter. */
__asm__ (
"fstd,ma %%fr0,8(%1)\n"
"fstd,ma %%fr1,8(%1)\n"
"fstd,ma %%fr2,8(%1)\n"
"fstd %%fr3,0(%1)\n"
: "=m" (*_regs), "+r" (_regs));
temp.__status_word &= ~(FE_ALL_EXCEPT
| (FE_ALL_EXCEPT << 27)
| FE_DOWNWARD);
if (envp == FE_DFL_ENV)
;
else if (envp == FE_NOMASK_ENV)
temp.__status_word |= FE_ALL_EXCEPT;
else
temp.__status_word |= (envp->__status_word
& (FE_ALL_EXCEPT
| FE_DOWNWARD
| (FE_ALL_EXCEPT << 27)));
/* Load the new environment. */
__asm__ (
"fldd,ma -8(%1),%%fr3\n"
"fldd,ma -8(%1),%%fr2\n"
"fldd,ma -8(%1),%%fr1\n"
"fldd 0(%1),%%fr0\n"
: "=m" (*_regs), "+r" (_regs));
/* Success. */
return 0;
}
libm_hidden_def (fesetenv)

View File

@ -1,39 +0,0 @@
/* Set current rounding direction.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fesetround (int round)
{
unsigned int sw[2];
if (round & ~FE_DOWNWARD)
/* ROUND is not a valid rounding mode. */
return 1;
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
sw[0] &= ~FE_DOWNWARD;
sw[0] |= round;
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
return 0;
}

View File

@ -1,37 +0,0 @@
/* Install given floating-point environment and raise exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
feupdateenv (const fenv_t *envp)
{
unsigned int sw[2];
/* Get the current exception status. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
/* Install new environment. */
fesetenv (envp);
/* Raise the saved exceptions */
feraiseexcept(sw[0] & FE_ALL_EXCEPT);
/* Success. */
return 0;
}

View File

@ -1,36 +0,0 @@
/* Store current representation for exceptions.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fegetexceptflag (fexcept_t *flagp, int excepts)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
*flagp = (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
/* Success. */
return 0;
}

View File

@ -1,102 +0,0 @@
/* Raise given exceptions.
Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
#include <float.h>
#include <math.h>
/* Please see section 10,
page 10-5 "Delayed Trapping" in the PA-RISC 2.0 Architecture manual */
int
feraiseexcept (int excepts)
{
/* Raise exceptions represented by EXCEPTS. But we must raise only one
signal at a time. It is important that if the overflow/underflow
exception and the divide by zero exception are given at the same
time, the overflow/underflow exception follows the divide by zero
exception. */
/* We do these bits in assembly to be certain GCC doesn't optimize
away something important, and so we can force delayed traps to
occur. */
/* We use "fldd 0(%%sr0,%%sp),%0" to flush the delayed exception */
/* First: Invalid exception. */
if (excepts & FE_INVALID)
{
/* One example of a invalid operation is 0 * Infinity. */
double d = HUGE_VAL;
__asm__ __volatile__ (
" fcpy,dbl %%fr0,%%fr22\n"
" fmpy,dbl %0,%%fr22,%0\n"
" fldd 0(%%sr0,%%sp),%0"
: "+f" (d) : : "%fr22" );
}
/* Second: Division by zero. */
if (excepts & FE_DIVBYZERO)
{
double d = 1.0;
__asm__ __volatile__ (
" fcpy,dbl %%fr0,%%fr22\n"
" fdiv,dbl %0,%%fr22,%0\n"
" fldd 0(%%sr0,%%sp),%0"
: "+f" (d) : : "%fr22" );
}
/* Third: Overflow. */
if (excepts & FE_OVERFLOW)
{
double d = DBL_MAX;
__asm__ __volatile__ (
" fadd,dbl %0,%0,%0\n"
" fldd 0(%%sr0,%%sp),%0"
: "+f" (d) );
}
/* Fourth: Underflow. */
if (excepts & FE_UNDERFLOW)
{
double d = DBL_MIN;
double e = 3.0;
__asm__ __volatile__ (
" fdiv,dbl %0,%1,%0\n"
" fldd 0(%%sr0,%%sp),%0"
: "+f" (d) : "f" (e) );
}
/* Fifth: Inexact */
if (excepts & FE_INEXACT)
{
double d = M_PI;
double e = 69.69;
__asm__ __volatile__ (
" fdiv,dbl %0,%1,%%fr22\n"
" fcnvfxt,dbl,sgl %%fr22,%%fr22L\n"
" fldd 0(%%sr0,%%sp),%%fr22"
: : "f" (d), "f" (e) : "%fr22" );
}
/* Success. */
return 0;
}
libm_hidden_def (feraiseexcept)

View File

@ -1,40 +0,0 @@
/* Set floating-point environment exception handling.
Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
#include <math.h>
int
fesetexceptflag (const fexcept_t *flagp, int excepts)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
/* Install new enable trap bits */
sw[0] |= (*flagp & excepts & FE_ALL_EXCEPT) << 27;
/* Store the new status word. */
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));
/* Success. */
return 0;
}

View File

@ -1,32 +0,0 @@
/* Test exception in current environment.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org>, 2000
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <fenv.h>
int
fetestexcept (int excepts)
{
unsigned int sw[2];
/* Get the current status word. */
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
}

View File

@ -1,890 +0,0 @@
# Begin of automatic generation
# atan2
Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025":
float: 3
ifloat: 3
Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025":
float: 3
ifloat: 3
Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772":
float: 1
ifloat: 1
# atanh
Test "atanh (0.75) == 0.972955074527656652552676371721589865":
float: 1
ifloat: 1
# cacosh
Test "Real part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
double: 1
float: 7
idouble: 1
ifloat: 7
Test "Imaginary part of: cacosh (-2 - 3 i) == 1.9833870299165354323470769028940395 - 2.1414491111159960199416055713254211 i":
double: 1
float: 3
idouble: 1
ifloat: 3
# casin
Test "Real part of: casin (0.75 + 1.25 i) == 0.453276177638793913448921196101971749 + 1.13239363160530819522266333696834467 i":
double: 1
float: 1
idouble: 1
ifloat: 1
# casinh
Test "Real part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 5
float: 1
idouble: 5
ifloat: 1
Test "Imaginary part of: casinh (-2 - 3 i) == -1.9686379257930962917886650952454982 - 0.96465850440760279204541105949953237 i":
double: 3
float: 6
idouble: 3
ifloat: 6
Test "Real part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
float: 1
ifloat: 1
Test "Imaginary part of: casinh (0.75 + 1.25 i) == 1.03171853444778027336364058631006594 + 0.911738290968487636358489564316731207 i":
double: 1
float: 1
idouble: 1
ifloat: 1
# catan
Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
float: 3
ifloat: 3
Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
float: 4
ifloat: 4
# catanh
Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
double: 4
idouble: 4
Test "Imaginary part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
float: 4
ifloat: 4
Test "Real part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
double: 1
idouble: 1
Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
float: 6
ifloat: 6
# cbrt
Test "cbrt (-27.0) == -3.0":
double: 1
idouble: 1
Test "cbrt (0.75) == 0.908560296416069829445605878163630251":
double: 1
idouble: 1
Test "cbrt (0.9921875) == 0.997389022060725270579075195353955217":
double: 1
idouble: 1
# ccos
Test "Imaginary part of: ccos (-2 - 3 i) == -4.18962569096880723013255501961597373 - 9.10922789375533659797919726277886212 i":
float: 1
ifloat: 1
Test "Real part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "Imaginary part of: ccos (0.75 + 1.25 i) == 1.38173873063425888530729933139078645 - 1.09193013555397466170919531722024128 i":
float: 1
ifloat: 1
# ccosh
Test "Real part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
Test "Imaginary part of: ccosh (-2 - 3 i) == -3.72454550491532256547397070325597253 + 0.511822569987384608834463849801875634 i":
float: 1
ifloat: 1
Test "Real part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "Imaginary part of: ccosh (0.75 + 1.25 i) == 0.408242591877968807788852146397499084 + 0.780365930845853240391326216300863152 i":
float: 1
ifloat: 1
# cexp
Test "Imaginary part of: cexp (-2.0 - 3.0 i) == -0.13398091492954261346140525546115575 - 0.019098516261135196432576240858800925 i":
float: 1
ifloat: 1
Test "Real part of: cexp (0.75 + 1.25 i) == 0.667537446429131586942201977015932112 + 2.00900045494094876258347228145863909 i":
float: 1
ifloat: 1
# clog
Test "Imaginary part of: clog (-2 - 3 i) == 1.2824746787307683680267437207826593 - 2.1587989303424641704769327722648368 i":
float: 3
ifloat: 3
Test "Real part of: clog (0.75 + 1.25 i) == 0.376885901188190075998919126749298416 + 1.03037682652431246378774332703115153 i":
float: 1
ifloat: 1
# clog10
Test "Imaginary part of: clog10 (-0 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-2 - 3 i) == 0.556971676153418384603252578971164214 - 0.937554462986374708541507952140189646 i":
double: 1
float: 5
idouble: 1
ifloat: 5
Test "Imaginary part of: clog10 (-3 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-3 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf + 0 i) == inf + pi*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf + 1 i) == inf + pi*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf - 0 i) == inf - pi*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (-inf - 1 i) == inf - pi*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (0 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (0 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Real part of: clog10 (0.75 + 1.25 i) == 0.163679467193165171449476605077428975 + 0.447486970040493067069984724340855636 i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (3 + inf i) == inf + pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (3 - inf i) == inf - pi/2*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (inf + inf i) == inf + pi/4*log10(e) i":
float: 1
ifloat: 1
Test "Imaginary part of: clog10 (inf - inf i) == inf - pi/4*log10(e) i":
float: 1
ifloat: 1
# cos
Test "cos (M_PI_6l * 2.0) == 0.5":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "cos (M_PI_6l * 4.0) == -0.5":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "cos (pi/2) == 0":
double: 1
float: 1
idouble: 1
ifloat: 1
# cpow
Test "Real part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 1
Test "Imaginary part of: cpow (0.75 + 1.25 i, 0.0 + 1.0 i) == 0.331825439177608832276067945276730566 + 0.131338600281188544930936345230903032 i":
float: 1
ifloat: 1
Test "Real part of: cpow (0.75 + 1.25 i, 0.75 + 1.25 i) == 0.117506293914473555420279832210420483 + 0.346552747708338676483025352060418001 i":
double: 1
float: 4
idouble: 1
ifloat: 4
Test "Real part of: cpow (0.75 + 1.25 i, 1.0 + 1.0 i) == 0.0846958290317209430433805274189191353 + 0.513285749182902449043287190519090481 i":
double: 2
float: 3
idouble: 2
ifloat: 3
Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
double: 1
float: 4
idouble: 1
ifloat: 4
Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
float: 2
ifloat: 2
Test "Imaginary part of: cpow (e + 0 i, 0 + 2 * M_PIl i) == 1.0 + 0.0 i":
double: 2
float: 2
idouble: 2
ifloat: 2
# csinh
Test "Imaginary part of: csinh (-2 - 3 i) == 3.59056458998577995201256544779481679 - 0.530921086248519805267040090660676560 i":
double: 1
idouble: 1
Test "Real part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
Test "Imaginary part of: csinh (0.75 + 1.25 i) == 0.259294854551162779153349830618433028 + 1.22863452409509552219214606515777594 i":
float: 1
ifloat: 1
# csqrt
Test "Real part of: csqrt (-2 + 3 i) == 0.89597747612983812471573375529004348 + 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
Test "Real part of: csqrt (-2 - 3 i) == 0.89597747612983812471573375529004348 - 1.6741492280355400404480393008490519 i":
float: 1
ifloat: 1
# ctan
Test "Real part of: ctan (-2 - 3 i) == 0.376402564150424829275122113032269084e-2 - 1.00323862735360980144635859782192726 i":
double: 1
idouble: 1
Test "Imaginary part of: ctan (0.75 + 1.25 i) == 0.160807785916206426725166058173438663 + 0.975363285031235646193581759755216379 i":
double: 1
idouble: 1
# ctanh
Test "Real part of: ctanh (-2 - 3 i) == -0.965385879022133124278480269394560686 + 0.988437503832249372031403430350121098e-2 i":
double: 1
float: 2
idouble: 1
ifloat: 2
Test "Imaginary part of: ctanh (0 + pi/4 i) == 0.0 + 1.0 i":
float: 1
ifloat: 1
Test "Real part of: ctanh (0.75 + 1.25 i) == 1.37260757053378320258048606571226857 + 0.385795952609750664177596760720790220 i":
double: 1
idouble: 1
# erf
Test "erf (1.25) == 0.922900128256458230136523481197281140":
double: 1
idouble: 1
# erfc
Test "erfc (2.0) == 0.00467773498104726583793074363274707139":
double: 1
idouble: 1
Test "erfc (4.125) == 0.542340079956506600531223408575531062e-8":
double: 1
idouble: 1
# exp10
Test "exp10 (-1) == 0.1":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "exp10 (0.75) == 5.62341325190349080394951039776481231":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "exp10 (3) == 1000":
double: 6
float: 2
idouble: 6
ifloat: 2
# expm1
Test "expm1 (0.75) == 1.11700001661267466854536981983709561":
double: 1
idouble: 1
Test "expm1 (1) == M_El - 1.0":
float: 1
ifloat: 1
# hypot
Test "hypot (-0.7, -12.4) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (-0.7, 12.4) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (-12.4, -0.7) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (-12.4, 0.7) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (0.7, -12.4) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (0.7, 12.4) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (12.4, -0.7) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
Test "hypot (12.4, 0.7) == 12.419742348374220601176836866763271":
float: 1
ifloat: 1
# j0
Test "j0 (-4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "j0 (0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
Test "j0 (10.0) == -0.245935764451348335197760862485328754":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "j0 (2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "j0 (4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "j0 (8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
# j1
Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
Test "j1 (2.0) == 0.576724807756873387202448242269137087":
double: 1
idouble: 1
Test "j1 (8.0) == 0.234636346853914624381276651590454612":
double: 1
idouble: 1
# jn
Test "jn (0, -4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (0, 0.75) == 0.864242275166648623555731103820923211":
float: 1
ifloat: 1
Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
float: 2
ifloat: 2
Test "jn (0, 4.0) == -3.9714980986384737228659076845169804197562E-1":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (0, 8.0) == 0.171650807137553906090869407851972001":
float: 1
ifloat: 1
Test "jn (1, 10.0) == 0.0434727461688614366697487680258592883":
float: 2
ifloat: 2
Test "jn (1, 2.0) == 0.576724807756873387202448242269137087":
double: 1
idouble: 1
Test "jn (1, 8.0) == 0.234636346853914624381276651590454612":
double: 1
idouble: 1
Test "jn (10, 0.125) == 0.250543369809369890173993791865771547e-18":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (10, 0.75) == 0.149621713117596814698712483621682835e-10":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
double: 4
float: 3
idouble: 4
ifloat: 3
Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
float: 4
ifloat: 4
Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (3, 0.75) == 0.848438342327410884392755236884386804e-2":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "jn (3, 10.0) == 0.0583793793051868123429354784103409563":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
double: 1
float: 2
idouble: 1
ifloat: 2
# lgamma
Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "lgamma (1.2) == -0.853740900033158497197028392998854470e-1":
double: 1
float: 2
idouble: 1
ifloat: 2
# log10
Test "log10 (0.75) == -0.124938736608299953132449886193870744":
double: 1
float: 2
idouble: 1
ifloat: 2
Test "log10 (e) == log10(e)":
float: 1
ifloat: 1
# log1p
Test "log1p (-0.25) == -0.287682072451780927439219005993827432":
float: 1
ifloat: 1
# sincos
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in sin_res":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "sincos (pi/2, &sin_res, &cos_res) puts 0 in cos_res":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "sincos (pi/6, &sin_res, &cos_res) puts 0.86602540378443864676372317075293616 in cos_res":
float: 1
ifloat: 1
# tan
Test "tan (pi/4) == 1":
double: 1
idouble: 1
# tgamma
Test "tgamma (-0.5) == -2 sqrt (pi)":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "tgamma (0.5) == sqrt (pi)":
float: 1
ifloat: 1
Test "tgamma (0.7) == 1.29805533264755778568117117915281162":
double: 1
float: 1
idouble: 1
ifloat: 1
# y0
Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "y0 (1.5) == 0.382448923797758843955068554978089862":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "y0 (10.0) == 0.0556711672835993914244598774101900481":
float: 1
ifloat: 1
Test "y0 (8.0) == 0.223521489387566220527323400498620359":
double: 1
float: 1
idouble: 1
ifloat: 1
# y1
Test "y1 (0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
Test "y1 (1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
Test "y1 (10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "y1 (2.0) == -0.107032431540937546888370772277476637":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "y1 (8.0) == -0.158060461731247494255555266187483550":
double: 1
float: 2
idouble: 1
ifloat: 2
# yn
Test "yn (0, 1.0) == 0.0882569642156769579829267660235151628":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "yn (0, 1.5) == 0.382448923797758843955068554978089862":
double: 2
float: 1
idouble: 2
ifloat: 1
Test "yn (0, 10.0) == 0.0556711672835993914244598774101900481":
float: 1
ifloat: 1
Test "yn (0, 8.0) == 0.223521489387566220527323400498620359":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (1, 0.125) == -5.19993611253477499595928744876579921":
double: 1
idouble: 1
Test "yn (1, 1.5) == -0.412308626973911295952829820633445323":
float: 1
ifloat: 1
Test "yn (1, 10.0) == 0.249015424206953883923283474663222803":
double: 3
float: 1
idouble: 3
ifloat: 1
Test "yn (1, 2.0) == -0.107032431540937546888370772277476637":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (1, 8.0) == -0.158060461731247494255555266187483550":
double: 1
float: 2
idouble: 1
ifloat: 2
Test "yn (10, 0.125) == -127057845771019398.252538486899753195":
double: 1
idouble: 1
Test "yn (10, 0.75) == -2133501638.90573424452445412893839236":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (10, 1.0) == -121618014.278689189288130426667971145":
double: 1
idouble: 1
Test "yn (10, 10.0) == -0.359814152183402722051986577343560609":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (10, 2.0) == -129184.542208039282635913145923304214":
double: 2
idouble: 2
Test "yn (3, 0.125) == -2612.69757350066712600220955744091741":
double: 1
idouble: 1
Test "yn (3, 0.75) == -12.9877176234475433186319774484809207":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (3, 10.0) == -0.251362657183837329779204747654240998":
double: 1
float: 1
idouble: 1
ifloat: 1
Test "yn (3, 2.0) == -1.12778377684042778608158395773179238":
double: 1
idouble: 1
# Maximal error of functions:
Function: "atan2":
float: 3
ifloat: 3
Function: "atanh":
float: 1
ifloat: 1
Function: Real part of "cacosh":
double: 1
float: 7
idouble: 1
ifloat: 7
Function: Imaginary part of "cacosh":
double: 1
float: 3
idouble: 1
ifloat: 3
Function: Real part of "casin":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: Real part of "casinh":
double: 5
float: 1
idouble: 5
ifloat: 1
Function: Imaginary part of "casinh":
double: 3
float: 6
idouble: 3
ifloat: 6
Function: Real part of "catan":
float: 4
ifloat: 4
Function: Imaginary part of "catan":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: Real part of "catanh":
double: 4
idouble: 4
Function: Imaginary part of "catanh":
float: 6
ifloat: 6
Function: "cbrt":
double: 1
idouble: 1
Function: Real part of "ccos":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: Imaginary part of "ccos":
float: 1
ifloat: 1
Function: Real part of "ccosh":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: Imaginary part of "ccosh":
float: 1
ifloat: 1
Function: Real part of "cexp":
float: 1
ifloat: 1
Function: Imaginary part of "cexp":
float: 1
ifloat: 1
Function: Real part of "clog":
float: 1
ifloat: 1
Function: Imaginary part of "clog":
float: 3
ifloat: 3
Function: Real part of "clog10":
float: 1
ifloat: 1
Function: Imaginary part of "clog10":
double: 1
float: 5
idouble: 1
ifloat: 5
Function: "cos":
double: 2
float: 1
idouble: 2
ifloat: 1
Function: Real part of "cpow":
double: 2
float: 4
idouble: 2
ifloat: 4
Function: Imaginary part of "cpow":
double: 2
float: 2
idouble: 2
ifloat: 2
Function: Real part of "csinh":
float: 1
ifloat: 1
Function: Imaginary part of "csinh":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: Real part of "csqrt":
float: 1
ifloat: 1
Function: Real part of "ctan":
double: 1
idouble: 1
Function: Imaginary part of "ctan":
double: 1
idouble: 1
Function: Real part of "ctanh":
double: 1
float: 2
idouble: 1
ifloat: 2
Function: Imaginary part of "ctanh":
float: 1
ifloat: 1
Function: "erf":
double: 1
idouble: 1
Function: "erfc":
double: 1
idouble: 1
Function: "exp10":
double: 6
float: 2
idouble: 6
ifloat: 2
Function: "expm1":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: "hypot":
float: 1
ifloat: 1
Function: "j0":
double: 2
float: 2
idouble: 2
ifloat: 2
Function: "j1":
double: 1
float: 2
idouble: 1
ifloat: 2
Function: "jn":
double: 4
float: 4
idouble: 4
ifloat: 4
Function: "lgamma":
double: 1
float: 2
idouble: 1
ifloat: 2
Function: "log10":
double: 1
float: 2
idouble: 1
ifloat: 2
Function: "log1p":
float: 1
ifloat: 1
Function: "sincos":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: "tan":
double: 1
idouble: 1
Function: "tgamma":
double: 1
float: 1
idouble: 1
ifloat: 1
Function: "y0":
double: 2
float: 1
idouble: 2
ifloat: 1
Function: "y1":
double: 3
float: 2
idouble: 3
ifloat: 2
Function: "yn":
double: 3
float: 2
idouble: 3
ifloat: 2
# end of automatic generation

View File

@ -1,28 +0,0 @@
/* Definition of stack frame structure. HPPA version.
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* PA stacks grow upwards. */
#define INNER_THAN >
/* FIXME: will verify this later */
struct layout
{
void *next;
void *return_address;
};

View File

@ -1,23 +0,0 @@
/* Definition of object in frame unwind info. hppa version.
Copyright (C) 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* Note: For hppa64 this is 61 */
#define DWARF_FRAME_REGISTERS 89
#include <sysdeps/generic/gccframe.h>

View File

@ -1,4 +0,0 @@
wordsize-32
ieee754/flt-32
ieee754/dbl-64
ieee754/ldbl-128

View File

@ -1,104 +0,0 @@
;! HP-PA-1.1 __mpn_addmul_1 -- Multiply a limb vector with a limb and
;! add the result to a second limb vector.
;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr r26
;! s1_ptr r25
;! size r24
;! s2_limb r23
;! This runs at 11 cycles/limb on a PA7000. With the used instructions, it
;! can not become faster due to data cache contention after a store. On the
;! PA7100 it runs at 10 cycles/limb, and that can not be improved either,
;! since only the xmpyu does not need the integer pipeline, so the only
;! dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb
;! on the PA7100.
;! There are some ideas described in mul_1.s that applies to this code too.
.text
.export __mpn_addmul_1
__mpn_addmul_1:
.proc
.callinfo frame=64,no_calls
.entry
ldo 64(%r30),%r30
fldws,ma 4(%r25),%fr5
stw %r23,-16(%r30) ;! move s2_limb ...
addib,= -1,%r24,L$just_one_limb
fldws -16(%r30),%fr4 ;! ... into fr4
add %r0,%r0,%r0 ;! clear carry
xmpyu %fr4,%fr5,%fr6
fldws,ma 4(%r25),%fr7
fstds %fr6,-16(%r30)
xmpyu %fr4,%fr7,%fr8
ldw -12(%r30),%r20 ;! least significant limb in product
ldw -16(%r30),%r28
fstds %fr8,-16(%r30)
addib,= -1,%r24,L$end
ldw -12(%r30),%r1
;! Main loop
L$loop:
ldws 0(%r26),%r29
fldws,ma 4(%r25),%fr5
add %r29,%r20,%r20
stws,ma %r20,4(%r26)
addc %r28,%r1,%r20
xmpyu %fr4,%fr5,%fr6
ldw -16(%r30),%r28
fstds %fr6,-16(%r30)
addc %r0,%r28,%r28
addib,<> -1,%r24,L$loop
ldw -12(%r30),%r1
L$end:
ldw 0(%r26),%r29
add %r29,%r20,%r20
stws,ma %r20,4(%r26)
addc %r28,%r1,%r20
ldw -16(%r30),%r28
ldws 0(%r26),%r29
addc %r0,%r28,%r28
add %r29,%r20,%r20
stws,ma %r20,4(%r26)
addc %r0,%r28,%r28
bv 0(%r2)
ldo -64(%r30),%r30
L$just_one_limb:
xmpyu %fr4,%fr5,%fr6
ldw 0(%r26),%r29
fstds %fr6,-16(%r30)
ldw -12(%r30),%r1
ldw -16(%r30),%r28
add %r29,%r1,%r20
stw %r20,0(%r26)
addc %r0,%r28,%r28
bv 0(%r2)
ldo -64(%r30),%r30
.exit
.procend

View File

@ -1,100 +0,0 @@
;! HP-PA-1.1 __mpn_mul_1 -- Multiply a limb vector with a limb and store
;! the result in a second limb vector.
;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr r26
;! s1_ptr r25
;! size r24
;! s2_limb r23
;! This runs at 9 cycles/limb on a PA7000. With the used instructions, it can
;! not become faster due to data cache contention after a store. On the
;! PA7100 it runs at 7 cycles/limb, and that can not be improved either, since
;! only the xmpyu does not need the integer pipeline, so the only dual-issue
;! we will get are addc+xmpyu. Unrolling would not help either CPU.
;! We could use fldds to read two limbs at a time from the S1 array, and that
;! could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
;! PA7100, respectively. We don't do that since it does not seem worth the
;! (alignment) troubles...
;! At least the PA7100 is rumored to be able to deal with cache-misses
;! without stalling instruction issue. If this is true, and the cache is
;! actually also lockup-free, we should use a deeper software pipeline, and
;! load from S1 very early; (The loads and stores to -12(sp) will surely be
;! in the cache.)
.text
.export __mpn_mul_1
__mpn_mul_1:
.proc
.callinfo frame=64,no_calls
.entry
ldo 64(%r30),%r30
fldws,ma 4(%r25),%fr5
stw %r23,-16(%r30) ;! move s2_limb ...
addib,= -1,%r24,L$just_one_limb
fldws -16(%r30),%fr4 ;! ... into fr4
add %r0,%r0,%r0 ;! clear carry
xmpyu %fr4,%fr5,%fr6
fldws,ma 4(%r25),%fr7
fstds %fr6,-16(%r30)
xmpyu %fr4,%fr7,%fr8
ldw -12(%r30),%r20 ;! least significant limb in product
ldw -16(%r30),%r28
fstds %fr8,-16(%r30)
addib,= -1,%r24,L$end
ldw -12(%r30),%r1
;! Main loop
L$loop:
fldws,ma 4(%r25),%fr5
stws,ma %r20,4(%r26)
addc %r28,%r1,%r20
xmpyu %fr4,%fr5,%fr6
ldw -16(%r30),%r28
fstds %fr6,-16(%r30)
addib,<> -1,%r24,L$loop
ldw -12(%r30),%r1
L$end:
stws,ma %r20,4(%r26)
addc %r28,%r1,%r20
ldw -16(%r30),%r28
stws,ma %r20,4(%r26)
addc %r0,%r28,%r28
bv 0(%r2)
ldo -64(%r30),%r30
L$just_one_limb:
xmpyu %fr4,%fr5,%fr6
fstds %fr6,-16(%r30)
ldw -16(%r30),%r28
ldo -64(%r30),%r30
bv 0(%r2)
fstws %fr6R,0(%r26)
.exit
.procend

View File

@ -1,113 +0,0 @@
;! HP-PA-1.1 __mpn_submul_1 -- Multiply a limb vector with a limb and
;! subtract the result from a second limb vector.
;! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr r26
;! s1_ptr r25
;! size r24
;! s2_limb r23
;! This runs at 12 cycles/limb on a PA7000. With the used instructions, it
;! can not become faster due to data cache contention after a store. On the
;! PA7100 it runs at 11 cycles/limb, and that can not be improved either,
;! since only the xmpyu does not need the integer pipeline, so the only
;! dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb
;! on the PA7100.
;! There are some ideas described in mul_1.s that applies to this code too.
;! It seems possible to make this run as fast as __mpn_addmul_1, if we use
;! sub,>>= %r29,%r20,%r22
;! addi 1,%r28,%r28
;! but that requires reworking the hairy software pipeline...
.text
.export __mpn_submul_1
__mpn_submul_1:
.proc
.callinfo frame=64,no_calls
.entry
ldo 64(%r30),%r30
fldws,ma 4(%r25),%fr5
stw %r23,-16(%r30) ;! move s2_limb ...
addib,= -1,%r24,L$just_one_limb
fldws -16(%r30),%fr4 ;! ... into fr4
add %r0,%r0,%r0 ;! clear carry
xmpyu %fr4,%fr5,%fr6
fldws,ma 4(%r25),%fr7
fstds %fr6,-16(%r30)
xmpyu %fr4,%fr7,%fr8
ldw -12(%r30),%r20 ;! least significant limb in product
ldw -16(%r30),%r28
fstds %fr8,-16(%r30)
addib,= -1,%r24,L$end
ldw -12(%r30),%r1
;! Main loop
L$loop:
ldws 0(%r26),%r29
fldws,ma 4(%r25),%fr5
sub %r29,%r20,%r22
add %r22,%r20,%r0
stws,ma %r22,4(%r26)
addc %r28,%r1,%r20
xmpyu %fr4,%fr5,%fr6
ldw -16(%r30),%r28
fstds %fr6,-16(%r30)
addc %r0,%r28,%r28
addib,<> -1,%r24,L$loop
ldw -12(%r30),%r1
L$end:
ldw 0(%r26),%r29
sub %r29,%r20,%r22
add %r22,%r20,%r0
stws,ma %r22,4(%r26)
addc %r28,%r1,%r20
ldw -16(%r30),%r28
ldws 0(%r26),%r29
addc %r0,%r28,%r28
sub %r29,%r20,%r22
add %r22,%r20,%r0
stws,ma %r22,4(%r26)
addc %r0,%r28,%r28
bv 0(%r2)
ldo -64(%r30),%r30
L$just_one_limb:
xmpyu %fr4,%fr5,%fr6
ldw 0(%r26),%r29
fstds %fr6,-16(%r30)
ldw -12(%r30),%r1
ldw -16(%r30),%r28
sub %r29,%r1,%r22
add %r22,%r1,%r0
stw %r22,0(%r26)
addc %r0,%r28,%r28
bv 0(%r2)
ldo -64(%r30),%r30
.exit
.procend

View File

@ -1,78 +0,0 @@
;! HP-PA __udiv_qrnnd division support, used from longlong.h.
;! This version runs fast on PA 7000 and later.
;! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! rem_ptr gr26
;! n1 gr25
;! n0 gr24
;! d gr23
.text
L$0000:
.word 0x43f00000
.word 0x0
.export __udiv_qrnnd
__udiv_qrnnd:
.proc
.callinfo frame=64,no_calls
.entry
ldo 64(%r30),%r30
stws %r25,-16(%r30) ;! n_hi
stws %r24,-12(%r30) ;! n_lo
b,l L$0,%r1
ldo L$0000-L$0(%r1),%r1
L$0:
fldds -16(%r30),%fr5
stws %r23,-12(%r30)
comib,<= 0,%r25,L$1
fcnvxf,dbl,dbl %fr5,%fr5
fldds 0(%r1),%fr4
fadd,dbl %fr4,%fr5,%fr5
L$1:
fcpy,sgl %fr0,%fr6L
fldws -12(%r30),%fr6R
fcnvxf,dbl,dbl %fr6,%fr4
fdiv,dbl %fr5,%fr4,%fr5
fcnvfx,dbl,dbl %fr5,%fr4
fstws %fr4R,-16(%r30)
xmpyu %fr4R,%fr6R,%fr6
ldws -16(%r30),%r28
fstds %fr6,-16(%r30)
ldws -12(%r30),%r21
ldws -16(%r30),%r20
sub %r24,%r21,%r22
subb %r25,%r20,%r1
comib,= 0,%r1,L$2
ldo -64(%r30),%r30
add %r22,%r23,%r22
ldo -1(%r28),%r28
L$2:
bv 0(%r2)
stws %r22,0(%r26)
.exit
.procend

View File

@ -1,20 +0,0 @@
/* Private macros for accessing __jmp_buf contents. HPPA version.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define JB_SP (76/4)

View File

@ -1,27 +0,0 @@
/* Examine __jmp_buf for unwinding frames. HPPA version.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <setjmp.h>
#include <jmpbuf-offsets.h>
/* Test if longjmp to JMPBUF would unwind the frame containing a local
variable at ADDRESS. */
#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
((void *) (_address) > \
(void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP])))

View File

@ -1,43 +0,0 @@
/* pre-.hidden libgcc compatibility
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Randolph Chung
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <stdint.h>
#include <shlib-compat.h>
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
symbol_version (__clz_tab_internal, __clz_tab, GLIBC_2.2);
typedef unsigned int UQItype __attribute__ ((mode (QI)));
const UQItype __clz_tab_internal[] =
{
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
};
#endif

View File

@ -1,66 +0,0 @@
;! HP-PA __mpn_lshift --
;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr gr26
;! s_ptr gr25
;! size gr24
;! cnt gr23
.text
.export __mpn_lshift
__mpn_lshift:
.proc
.callinfo frame=64,no_calls
.entry
sh2add %r24,%r25,%r25
sh2add %r24,%r26,%r26
ldws,mb -4(%r25),%r22
subi 32,%r23,%r1
mtsar %r1
addib,= -1,%r24,L$0004
vshd %r0,%r22,%r28 ;! compute carry out limb
ldws,mb -4(%r25),%r29
addib,= -1,%r24,L$0002
vshd %r22,%r29,%r20
L$loop: ldws,mb -4(%r25),%r22
stws,mb %r20,-4(%r26)
addib,= -1,%r24,L$0003
vshd %r29,%r22,%r20
ldws,mb -4(%r25),%r29
stws,mb %r20,-4(%r26)
addib,<> -1,%r24,L$loop
vshd %r22,%r29,%r20
L$0002: stws,mb %r20,-4(%r26)
vshd %r29,%r0,%r20
bv 0(%r2)
stw %r20,-4(%r26)
L$0003: stws,mb %r20,-4(%r26)
L$0004: vshd %r22,%r0,%r20
bv 0(%r2)
stw %r20,-4(%r26)
.exit
.procend

View File

@ -1,25 +0,0 @@
/* Machine-specific calling sequence for `mcount' profiling function. PA-RISC
Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* We can call _mcount directly since gcc supplies the correct
* arguments */
#define _MCOUNT_DECL(from, self) \
void _mcount (u_long from, u_long self)
#define MCOUNT

View File

@ -1,22 +0,0 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define GETSP() ({ register uintptr_t stack_ptr asm ("%r30"); stack_ptr; })
#define STACK_GROWS_UPWARD 1
#include <sysdeps/generic/memusage.h>

View File

@ -1 +0,0 @@
/* __clz_tab not needed on hppa. */

View File

@ -1,63 +0,0 @@
;! HP-PA __mpn_rshift --
;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr gr26
;! s_ptr gr25
;! size gr24
;! cnt gr23
.text
.export __mpn_rshift
__mpn_rshift:
.proc
.callinfo frame=64,no_calls
.entry
ldws,ma 4(%r25),%r22
mtsar %r23
addib,= -1,%r24,L$0004
vshd %r22,%r0,%r28 ;! compute carry out limb
ldws,ma 4(%r25),%r29
addib,= -1,%r24,L$0002
vshd %r29,%r22,%r20
L$loop: ldws,ma 4(%r25),%r22
stws,ma %r20,4(%r26)
addib,= -1,%r24,L$0003
vshd %r22,%r29,%r20
ldws,ma 4(%r25),%r29
stws,ma %r20,4(%r26)
addib,<> -1,%r24,L$loop
vshd %r29,%r22,%r20
L$0002: stws,ma %r20,4(%r26)
vshd %r0,%r29,%r20
bv 0(%r2)
stw %r20,0(%r26)
L$0003: stws,ma %r20,4(%r26)
L$0004: vshd %r0,%r22,%r20
bv 0(%r2)
stw %r20,0(%r26)
.exit
.procend

View File

@ -1,69 +0,0 @@
/* setjmp for HPPA.
Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
.text
.align 4
.import __sigjmp_save, code
.globl __sigsetjmp
.export __sigsetjmp, code
.proc
.callinfo
__sigsetjmp:
stw %r3, 0(%r26)
stw %r4, 8(%r26)
stw %r5, 12(%r26)
stw %r6, 16(%r26)
stw %r7, 20(%r26)
stw %r8, 24(%r26)
stw %r9, 28(%r26)
stw %r10, 32(%r26)
stw %r11, 36(%r26)
stw %r12, 40(%r26)
stw %r13, 44(%r26)
stw %r14, 48(%r26)
stw %r15, 52(%r26)
stw %r16, 56(%r26)
stw %r17, 60(%r26)
stw %r18, 64(%r26)
stw %r19, 68(%r26)
stw %r27, 72(%r26)
stw %r30, 76(%r26)
stw %rp, 80(%r26)
ldo 88(%r26),%r1
fstds,ma %fr12, 8(%r1) /* 88 */
fstds,ma %fr13, 8(%r1) /* 96 */
fstds,ma %fr14, 8(%r1) /* 104 */
fstds,ma %fr15, 8(%r1) /* 112 */
fstds,ma %fr16, 8(%r1) /* 120 */
fstds,ma %fr17, 8(%r1) /* 128 */
fstds,ma %fr18, 8(%r1) /* 136 */
fstds,ma %fr19, 8(%r1) /* 144 */
fstds,ma %fr20, 8(%r1) /* 152 */
fstds %fr21, 0(%r1) /* 160 */
b __sigjmp_save
nop
.procend

View File

@ -1,28 +0,0 @@
/* Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* This file contains a bit of information about the stack allocation
of the processor. */
#ifndef _STACKINFO_H
#define _STACKINFO_H 1
/* On PA the stack grows up. */
#define _STACK_GROWS_UP 1
#endif /* stackinfo.h */

View File

@ -1,59 +0,0 @@
;! HP-PA __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
;! store difference in a third limb vector.
;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! res_ptr gr26
;! s1_ptr gr25
;! s2_ptr gr24
;! size gr23
;! One might want to unroll this as for other processors, but it turns
;! out that the data cache contention after a store makes such
;! unrolling useless. We can't come under 5 cycles/limb anyway.
.text
.export __mpn_sub_n
__mpn_sub_n:
.proc
.callinfo frame=0,no_calls
.entry
ldws,ma 4(%r25),%r21
ldws,ma 4(%r24),%r20
addib,= -1,%r23,L$end ;! check for (SIZE == 1)
sub %r21,%r20,%r28 ;! subtract first limbs ignoring cy
L$loop: ldws,ma 4(%r25),%r21
ldws,ma 4(%r24),%r20
stws,ma %r28,4(%r26)
addib,<> -1,%r23,L$loop
subb %r21,%r20,%r28
L$end: stws %r28,0(%r26)
addc %r0,%r0,%r28
bv 0(%r2)
subi 1,%r28,%r28
.exit
.procend

View File

@ -1,82 +0,0 @@
/* Assembler macros for HP/PA.
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@cygnus.com>, August 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdeps/generic/sysdep.h>
#include <sys/syscall.h>
#include "config.h"
#ifndef ASM_LINE_SEP
#define ASM_LINE_SEP ;
#endif
#ifdef __ASSEMBLER__
/* Syntactic details of assembler. */
#define ALIGNARG(log2) log2
/* Define an entry point visible from C.
There is currently a bug in gdb which prevents us from specifying
incomplete stabs information. Fake some entries here which specify
the current source file. */
#define ENTRY(name) \
.SPACE $TEXT$ ASM_LINE_SEP \
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY ASM_LINE_SEP \
.align ALIGNARG(4) ASM_LINE_SEP \
.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY ASM_LINE_SEP \
.EXPORT C_SYMBOL_NAME(name),ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR ASM_LINE_SEP\
C_LABEL(name) \
CALL_MCOUNT
#undef END
#define END(name) \
.PROCEND
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* The mcount code relies on a normal frame pointer being on the stack
to locate our caller, so push one just for its benefit. */
#define CALL_MCOUNT \
XXX ASM_LINE_SEP
#else
#define CALL_MCOUNT /* Do nothing. */
#endif
#define PSEUDO(name, syscall_name, args) \
ENTRY (name) \
DO_CALL (syscall_name, args)
#undef PSEUDO_END
#define PSEUDO_END(name) \
END (name)
#undef JUMPTARGET
#define JUMPTARGET(name) name
#define SYSCALL_PIC_SETUP /* Nothing. */
/* Local label name for asm code. */
#ifndef L
#define L(name) name
#endif
#endif /* __ASSEMBLER__ */

View File

@ -1,286 +0,0 @@
;! HP-PA __udiv_qrnnd division support, used from longlong.h.
;! This version runs fast on pre-PA7000 CPUs.
;! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
;! This file is part of the GNU MP Library.
;! The GNU MP Library is free software; you can redistribute it and/or modify
;! it under the terms of the GNU Lesser General Public License as published by
;! the Free Software Foundation; either version 2.1 of the License, or (at your
;! option) any later version.
;! The GNU MP Library 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 Lesser General Public
;! License for more details.
;! You should have received a copy of the GNU Lesser General Public License
;! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;! MA 02111-1307, USA.
;! INPUT PARAMETERS
;! rem_ptr gr26
;! n1 gr25
;! n0 gr24
;! d gr23
;! The code size is a bit excessive. We could merge the last two ds;addc
;! sequences by simply moving the "bb,< Odd" instruction down. The only
;! trouble is the FFFFFFFF code that would need some hacking.
.text
.export __udiv_qrnnd
__udiv_qrnnd:
.proc
.callinfo frame=0,no_calls
.entry
comb,< %r23,%r0,L$largedivisor
sub %r0,%r23,%r1 ;! clear cy as side-effect
ds %r0,%r1,%r0
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r24
ds %r25,%r23,%r25
addc %r24,%r24,%r28
ds %r25,%r23,%r25
comclr,>= %r25,%r0,%r0
addl %r25,%r23,%r25
stws %r25,0(%r26)
bv 0(%r2)
addc %r28,%r28,%r28
L$largedivisor:
extru %r24,31,1,%r20 ;! r20 = n0 & 1
bb,< %r23,31,L$odd
extru %r23,30,31,%r22 ;! r22 = d >> 1
shd %r25,%r24,1,%r24 ;! r24 = new n0
extru %r25,30,31,%r25 ;! r25 = new n1
sub %r0,%r22,%r21
ds %r0,%r21,%r0
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
comclr,>= %r25,%r0,%r0
addl %r25,%r22,%r25
sh1addl %r25,%r20,%r25
stws %r25,0(%r26)
bv 0(%r2)
addc %r24,%r24,%r28
L$odd: addib,sv,n 1,%r22,L$FF.. ;! r22 = (d / 2 + 1)
shd %r25,%r24,1,%r24 ;! r24 = new n0
extru %r25,30,31,%r25 ;! r25 = new n1
sub %r0,%r22,%r21
ds %r0,%r21,%r0
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r24
ds %r25,%r22,%r25
addc %r24,%r24,%r28
comclr,>= %r25,%r0,%r0
addl %r25,%r22,%r25
sh1addl %r25,%r20,%r25
;! We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
add,nuv %r28,%r25,%r25
addl %r25,%r1,%r25
addc %r0,%r28,%r28
sub,<< %r25,%r23,%r0
addl %r25,%r1,%r25
stws %r25,0(%r26)
bv 0(%r2)
addc %r0,%r28,%r28
;! This is just a special case of the code above.
;! We come here when d == 0xFFFFFFFF
L$FF..: add,uv %r25,%r24,%r24
sub,<< %r24,%r23,%r0
ldo 1(%r24),%r24
stws %r24,0(%r26)
bv 0(%r2)
addc %r0,%r25,%r28
.exit
.procend

View File

@ -1,5 +0,0 @@
wordsize-32
# 68k uses IEEE 754 floating point.
ieee754/ldbl-96
ieee754/dbl-64
ieee754/flt-32

View File

@ -1,38 +0,0 @@
# Copyright (C) 1993, 1994, 1996, 1997, 2003 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The GNU C Library 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
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
# The mpn functions need this. All existing 68k ports use MIT syntax. If
# a new port wants to use Motorola or Sony syntax, it can redefine this
# variable.
ifndef m68k-syntax-flag
m68k-syntax-flag = -DMIT_SYNTAX
endif
asm-CPPFLAGS += $(m68k-syntax-flag)
pic-ccflag = -fpic
# Make sure setjmp.c is compiled with a frame pointer
CFLAGS-setjmp.c := -fno-omit-frame-pointer
# The 68k `long double' is a distinct type we support.
long-double-fcts = yes
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
endif

View File

@ -1,13 +0,0 @@
libc {
GLIBC_2.0 {
# Functions from libgcc.
__divdi3; __moddi3; __udivdi3; __umoddi3;
}
}
libm {
GLIBC_2.1 {
# A generic bug got this omitted from other configurations' version
# sets, but we always had it.
exp2l;
}
}

View File

@ -1,55 +0,0 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <setjmp.h>
#include <stdlib.h>
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0. */
void
__longjmp (__jmp_buf env, int val)
{
/* This restores the FP and SP that setjmp's caller had,
and puts the return address into A0 and VAL into D0. */
#if defined(__HAVE_68881__) || defined(__HAVE_FPU__)
/* Restore the floating-point registers. */
asm volatile("fmovem%.x %0, %/fp0-%/fp7" :
/* No outputs. */ : "g" (env[0].__fpregs[0]));
#endif
/* Put VAL in D0. */
asm volatile("move%.l %0, %/d0" : /* No outputs. */ :
"g" (val == 0 ? 1 : val) : "d0");
asm volatile(/* Restore the data and address registers. */
"movem%.l %0, %/d1-%/d7/%/a0-%/a7\n"
/* Return to setjmp's caller. */
#ifdef __motorola__
"jmp (%/a0)"
#else
"jmp %/a0@"
#endif
: /* No outputs. */ : "g" (env[0].__dregs[0])
/* We don't bother with the clobbers,
because this code always jumps out anyway. */
);
/* Avoid `volatile function does return' warnings. */
for (;;);
}

View File

@ -1,2 +0,0 @@
/* An instruction which should crash any program is `illegal'. */
#define ABORT_INSTRUCTION asm ("illegal")

View File

@ -1,76 +0,0 @@
/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
sum in a third limb vector.
Copyright (C) 1992, 1994, 1996, 1998 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
The GNU MP Library 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
/*
INPUT PARAMETERS
res_ptr (sp + 4)
s1_ptr (sp + 8)
s2_ptr (sp + 16)
size (sp + 12)
*/
#include "sysdep.h"
#include "asm-syntax.h"
TEXT
ENTRY(__mpn_add_n)
/* Save used registers on the stack. */
movel R(d2),MEM_PREDEC(sp)
movel R(a2),MEM_PREDEC(sp)
/* Copy the arguments to registers. Better use movem? */
movel MEM_DISP(sp,12),R(a2)
movel MEM_DISP(sp,16),R(a0)
movel MEM_DISP(sp,20),R(a1)
movel MEM_DISP(sp,24),R(d2)
eorw #1,R(d2)
lsrl #1,R(d2)
bcc L(L1)
subql #1,R(d2) /* clears cy as side effect */
L(Loop:)
movel MEM_POSTINC(a0),R(d0)
movel MEM_POSTINC(a1),R(d1)
addxl R(d1),R(d0)
movel R(d0),MEM_POSTINC(a2)
L(L1:) movel MEM_POSTINC(a0),R(d0)
movel MEM_POSTINC(a1),R(d1)
addxl R(d1),R(d0)
movel R(d0),MEM_POSTINC(a2)
dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */
subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */
subl #0x10000,R(d2)
bcs L(L2)
addl R(d0),R(d0) /* restore cy */
bra L(Loop)
L(L2:)
negl R(d0)
/* Restore used registers from stack frame. */
movel MEM_POSTINC(sp),R(a2)
movel MEM_POSTINC(sp),R(d2)
rts
END(__mpn_add_n)

View File

@ -1,109 +0,0 @@
/* Definitions for 68k syntax variations.
Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in the GNU MP Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifdef HAVE_ELF
/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
#define ALIGNARG(log2) 1<<log2
/* For ELF we need the `.type' directive to make shared libs work right. */
#define PROLOG(name) .type name,@function
#define EPILOG(name) .size name,.-name
/* For ELF we need to prefix register names and local labels. */
#ifdef __STDC__
#define R_(r) %##r
#define R(r) R_(r)
#define L(label) .##label
#else
#define R(r) %/**/r
#define L(label) ./**/label
#endif
#else
#define ALIGNARG(log2) log2
#define PROLOG(name) /* Nothing. */
#define EPILOG(name) /* Nothing. */
#define R(r) r
#define L(label) label
#endif
#ifdef MIT_SYNTAX
#define MEM(base)R(base)@
#define MEM_DISP(base,displacement)R(base)@(displacement)
#define MEM_INDX(base,idx,size_suffix)R(base)@(R(idx):size_suffix)
#define MEM_INDX1(base,idx,size_suffix,scale)R(base)@(R(idx):size_suffix:scale)
#define MEM_PREDEC(memory_base)R(memory_base)@-
#define MEM_POSTINC(memory_base)R(memory_base)@+
#define TEXT .text
#define ALIGN .even
#define GLOBL .globl
/* Use variable sized opcodes. */
#define bcc jcc
#define bcs jcs
#define bls jls
#define beq jeq
#define bne jne
#define bra jra
#endif
#ifdef MOTOROLA_SYNTAX
#define MEM(base)(R(base))
#define MEM_DISP(base,displacement)(displacement,R(base))
#define MEM_PREDEC(memory_base)-(R(memory_base))
#define MEM_POSTINC(memory_base)(R(memory_base))+
#ifdef __STDC__
#define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix))
#define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix)
#define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale))
#define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale)
#else
#define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix)
#define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale)
#endif
#define TEXT .text
#define ALIGN .align ALIGNARG(2)
#define GLOBL .globl
#define bcc jbcc
#define bcs jbcs
#define bls jbls
#define beq jbeq
#define bne jbne
#define bra jbra
#define movel move.l
#define moveml movem.l
#define moveql moveq.l
#define cmpl cmp.l
#define orl or.l
#define clrl clr.l
#define eorw eor.w
#define lsrl lsr.l
#define lsll lsl.l
#define roxrl roxr.l
#define roxll roxl.l
#define addl add.l
#define addxl addx.l
#define addql addq.l
#define subl sub.l
#define subxl subx.l
#define subql subq.l
#define negl neg.l
#define mulul mulu.l
#endif

View File

@ -1,67 +0,0 @@
/* Macros to swap the order of bytes in integer values. m68k version.
Copyright (C) 1997, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
#endif
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
/* Swap bytes in 16 bit value. We don't provide an assembler version
because GCC is smart enough to generate optimal assembler output, and
this allows for better cse. */
#define __bswap_16(x) \
((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_32(x) \
__extension__ \
({ unsigned int __bswap_32_v; \
if (__builtin_constant_p (x)) \
__bswap_32_v = __bswap_constant_32 (x); \
else \
__asm__ __volatile__ ("ror%.w %#8, %0;" \
"swap %0;" \
"ror%.w %#8, %0" \
: "=d" (__bswap_32_v) \
: "0" ((unsigned int) (x))); \
__bswap_32_v; })
#else
# define __bswap_32(x) __bswap_constant_32 (x)
#endif
#if defined __GNUC__ && __GNUC__ >= 2
/* Swap bytes in 64 bit value. */
# define __bswap_64(x) \
__extension__ \
({ union { unsigned long long int __ll; \
unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r; \
__bswap_64_v.__ll = (x); \
__bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]); \
__bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]); \
__bswap_64_r.__ll; })
#endif
#endif /* _BITS_BYTESWAP_H */

View File

@ -1,7 +0,0 @@
/* m68k is big-endian. */
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif
#define __BYTE_ORDER __BIG_ENDIAN

View File

@ -1,43 +0,0 @@
/* `HUGE_VALL' constant for m68k (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _MATH_H
# error "Never use <bits/huge_val.h> directly; include <math.h> instead."
#endif
#if __GNUC_PREREQ(3,3)
# define HUGE_VALL (__builtin_huge_vall ())
#elif __GNUC_PREREQ(2,96)
# define HUGE_VALL (__extension__ 0x1.0p32767L)
#elif defined__GNUC__
# define HUGE_VALL \
(__extension__ \
((union { unsigned long __l[3]; long double __ld; }) \
{ __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
#else /* not GCC */
static union { unsigned char __c[12]; long double __ld; } __huge_vall =
{ { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
# define HUGE_VALL (__huge_vall.__ld)
#endif /* GCC 2.95. */

View File

@ -1,58 +0,0 @@
/* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _LINK_H
# error "Never include <bits/link.h> directly; use <link.h> instead."
#endif
/* Registers for entry into PLT on M68K. */
typedef struct La_m68k_regs
{
uint32_t lr_a0;
uint32_t lr_a1;
uint32_t lr_sp;
} La_m68k_regs;
/* Return values for calls from PLT on M68K. */
typedef struct La_m68k_retval
{
uint32_t lrv_d0;
uint32_t lrv_d1;
uint32_t lrv_a0;
long double lrv_fp0;
} La_m68k_retval;
__BEGIN_DECLS
extern Elf32_Addr la_m68k_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_m68k_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_m68k_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_m68k_regs *__inregs,
La_m68k_retval *__outregs,
const char *symname);
__END_DECLS

View File

@ -1,38 +0,0 @@
/* Copyright (C) 1997, 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#if !defined _MATH_H && !defined _COMPLEX_H
# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
#endif
#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
# define _MATH_H_MATHDEF 1
/* The m68k FPUs evaluate all values in the 96 bit floating-point format
which is also available for the user as `long double'. Therefore we
define: */
typedef long double float_t; /* `float' expressions are evaluated as
`long double'. */
typedef long double double_t; /* `double' expressions are evaluated as
`long double'. */
/* The values returned by `ilogb' for 0 and NaN respectively. */
# define FP_ILOGB0 (-2147483647 - 1)
# define FP_ILOGBNAN (2147483647)
#endif /* ISO C99 */

View File

@ -1,45 +0,0 @@
/* Copyright (C) 1997,1998,2005,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* Define the machine-dependent type `jmp_buf'. m68k version. */
#ifndef _BITS_SETJMP_H
#define _BITS_SETJMP_H 1
#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
typedef struct
{
/* There are eight 4-byte data registers, but D0 is not saved. */
long int __dregs[7];
/* There are six 4-byte address registers, plus the FP and SP. */
int *__aregs[6];
int *__fp;
int *__sp;
#if defined __HAVE_68881__ || defined __HAVE_FPU__
/* There are eight floating point registers which
are saved in IEEE 96-bit extended format. */
char __fpregs[8 * (96 / 8)];
#endif
} __jmp_buf[1];
#endif /* bits/setjmp.h */

View File

@ -1,22 +0,0 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. m68k version.
Copyright (C) 1994, 1997, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define BSD__SETJMP
#include <sysdeps/m68k/setjmp.c>
libc_hidden_def (_setjmp)

View File

@ -1,21 +0,0 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. m68k version.
Copyright (C) 1994, 1997, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define BSD_SETJMP
#include <sysdeps/m68k/setjmp.c>

View File

@ -1,290 +0,0 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version.
Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef dl_machine_h
#define dl_machine_h
#define ELF_MACHINE_NAME "m68k"
#include <sys/param.h>
/* Return nonzero iff ELF header is compatible with the running host. */
static inline int
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
return ehdr->e_machine == EM_68K;
}
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
first element of the GOT. This must be inlined in a function which
uses global data. */
static inline Elf32_Addr
elf_machine_dynamic (void)
{
register Elf32_Addr *got asm ("%a5");
return *got;
}
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr
elf_machine_load_address (void)
{
Elf32_Addr addr;
asm ("lea _dl_start(%%pc), %0\n\t"
"sub.l _dl_start@GOT.w(%%a5), %0"
: "=a" (addr));
return addr;
}
/* Set up the loaded object described by L so its unrelocated PLT
entries will jump to the on-demand fixup code in dl-runtime.c. */
static inline int __attribute__ ((always_inline))
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
{
Elf32_Addr *got;
extern void _dl_runtime_resolve (Elf32_Word);
extern void _dl_runtime_profile (Elf32_Word);
if (l->l_info[DT_JMPREL] && lazy)
{
/* The GOT entries for functions in the PLT have not yet been
filled in. Their initial contents will arrange when called
to push an offset into the .rela.plt section, push
_GLOBAL_OFFSET_TABLE_[1], and then jump to
_GLOBAL_OFFSET_TABLE_[2]. */
got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
/* The got[2] entry contains the address of a function which gets
called to get the address of a so far unresolved function and
jump to it. The profiling extension of the dynamic linker allows
to intercept the calls to collect information. In this case we
don't store the address in the GOT so that all future calls also
end in this function. */
if (profile)
{
got[2] = (Elf32_Addr) &_dl_runtime_profile;
if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
{
/* This is the object we are looking for. Say that we really
want profiling and the timers are started. */
GL(dl_profile_map) = l;
}
}
else
/* This function will get called to fix up the GOT entry indicated by
the offset on the stack, and then jump to the resolved address. */
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
}
return lazy;
}
#define ELF_MACHINE_RUNTIME_FIXUP_ARGS long int save_a0, long int save_a1
/* Mask identifying addresses reserved for the user program,
where the dynamic linker should not map anything. */
#define ELF_MACHINE_USER_ADDRESS_MASK 0x80000000UL
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START asm ("\
.text\n\
.globl _start\n\
.type _start,@function\n\
_start:\n\
move.l %sp, -(%sp)\n\
jbsr _dl_start\n\
addq.l #4, %sp\n\
/* FALLTHRU */\n\
\n\
.globl _dl_start_user\n\
.type _dl_start_user,@function\n\
_dl_start_user:\n\
| Save the user entry point address in %a4.\n\
move.l %d0, %a4\n\
| See if we were run as a command with the executable file\n\
| name as an extra leading argument.\n\
move.l _dl_skip_args(%pc), %d0\n\
| Pop the original argument count\n\
move.l (%sp)+, %d1\n\
| Subtract _dl_skip_args from it.\n\
sub.l %d0, %d1\n\
| Adjust the stack pointer to skip _dl_skip_args words.\n\
lea (%sp, %d0*4), %sp\n\
| Push back the modified argument count.\n\
move.l %d1, -(%sp)\n\
# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\
pea 8(%sp, %d1*4)\n\
pea 8(%sp)\n\
move.l %d1, -(%sp)\n\
move.l _rtld_local(%pc), -(%sp)\n\
jbsr _dl_init_internal@PLTPC\n\
addq.l #8, %sp\n\
addq.l #8, %sp\n\
| Pass our finalizer function to the user in %a1.\n\
lea _dl_fini(%pc), %a1\n\
| Initialize %fp with the stack pointer.\n\
move.l %sp, %fp\n\
| Jump to the user's entry point.\n\
jmp (%a4)\n\
.size _dl_start_user, . - _dl_start_user\n\
.previous");
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
PLT entries should not be allowed to define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
#define elf_machine_type_class(type) \
((((type) == R_68K_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
| (((type) == R_68K_COPY) * ELF_RTYPE_CLASS_COPY))
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_68K_JMP_SLOT
/* The m68k never uses Elf32_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
static inline Elf32_Addr
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
const Elf32_Rela *reloc,
Elf32_Addr *reloc_addr, Elf32_Addr value)
{
return *reloc_addr = value;
}
/* Return the final value of a plt relocation. On the m68k the JMP_SLOT
relocation ignores the addend. */
static inline Elf32_Addr
elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
Elf32_Addr value)
{
return value;
}
/* Names of the architecture-specific auditing callback functions. */
#define ARCH_LA_PLTENTER m68k_gnu_pltenter
#define ARCH_LA_PLTEXIT m68k_gnu_pltexit
#endif /* !dl_machine_h */
#ifdef RESOLVE_MAP
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
MAP is the object containing the reloc. */
auto inline void __attribute__ ((unused, always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
void *const reloc_addr_arg)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
if (__builtin_expect (r_type == R_68K_RELATIVE, 0))
*reloc_addr = map->l_addr + reloc->r_addend;
else
{
const Elf32_Sym *const refsym = sym;
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
switch (r_type)
{
case R_68K_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be
found. */
break;
if (sym->st_size > refsym->st_size
|| (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
{
const char *strtab;
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
_dl_error_printf ("\
%s: Symbol `%s' has different size in shared object, consider re-linking\n",
rtld_progname ?: "<program name unknown>",
strtab + refsym->st_name);
}
memcpy (reloc_addr_arg, (void *) value,
MIN (sym->st_size, refsym->st_size));
break;
case R_68K_GLOB_DAT:
case R_68K_JMP_SLOT:
*reloc_addr = value;
break;
case R_68K_8:
*(char *) reloc_addr = value + reloc->r_addend;
break;
case R_68K_16:
*(short *) reloc_addr = value + reloc->r_addend;
break;
case R_68K_32:
*reloc_addr = value + reloc->r_addend;
break;
case R_68K_PC8:
*(char *) reloc_addr
= value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
case R_68K_PC16:
*(short *) reloc_addr
= value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
case R_68K_PC32:
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
case R_68K_NONE: /* Alright, Wilbur. */
break;
default:
_dl_reloc_bad_type (map, r_type, 0);
break;
}
}
}
auto inline void __attribute__ ((unused, always_inline))
elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
void *const reloc_addr_arg)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
*reloc_addr = l_addr + reloc->r_addend;
}
auto inline void __attribute__ ((unused, always_inline))
elf_machine_lazy_rel (struct link_map *map,
Elf32_Addr l_addr, const Elf32_Rela *reloc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
if (ELF32_R_TYPE (reloc->r_info) == R_68K_JMP_SLOT)
*reloc_addr += l_addr;
else
_dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 1);
}
#endif /* RESOLVE_MAP */

View File

@ -1,129 +0,0 @@
/* PLT trampolines. m68k version.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
.text
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function
_dl_runtime_resolve:
| Save %a0 (struct return address) and %a1.
move.l %a0, -(%sp)
move.l %a1, -(%sp)
| Call the real address resolver.
jbsr _dl_fixup
| Restore register %a0 and %a1.
move.l (%sp)+, %a1
move.l (%sp)+, %a0
| Pop parameters
addq.l #8, %sp
| Call real function.
jmp (%d0)
.size _dl_runtime_resolve, . - _dl_runtime_resolve
.text
.globl _dl_runtime_profile
.type _dl_runtime_profile, @function
_dl_runtime_profile:
pea 8(%sp)
move.l %a1, -(%sp)
move.l %a0, -(%sp)
pea -1.w
| Push parameters for _dl_profile_fixup
pea (%sp)
pea 8(%sp)
move.l 32(%sp), -(%sp)
move.l 32(%sp), -(%sp)
move.l 32(%sp), -(%sp)
subq.l #8, %sp
| Call the real address resolver.
jbsr _dl_profile_fixup
| Pop parameters
lea 28(%sp), %sp
move.l (%sp), %d1
jpl 1f
addq.l #4, %sp
| Restore register %a0 and %a1.
move.l (%sp)+, %a0
move.l (%sp)+, %a1
lea 12(%sp), %sp
| Call real function.
jmp (%d0)
/*
+24 return address
+20 PLT1
+16 PLT2
+12 %sp
+8 %a1
+4 %a0
%sp free
*/
1: move.l %a2, (%sp)
move.l %sp, %a2
move.l %sp, %a0
lea 28(%sp), %a1
| Round framesize up to even
addq.l #1, %d1
lsr #1, %d1
sub.l %d1, %a0
sub.l %d1, %a0
move.l %a0, %sp
jra 2f
1: move.w (%a1)+, (%a0)+
2: dbra %d1,1b
/*
%a2+24 return address
%a2+20 PLT1
%a2+16 PLT2
%a2+12 %sp
%a2+8 %a1
%a2+4 %a0
%a2 %a2
%sp copied stack frame
*/
move.l 4(%a2), %a0
move.l 8(%a2), %a1
jsr (%d0)
move.l %a2, %sp
move.l (%sp)+, %a2
/*
+20 return address
+16 PLT1
+12 PLT2
+8 %sp
+4 %a1
%sp %a0
*/
fmove.x %fp0, -(%sp)
move.l %d1, -(%sp)
move.l %d0, -(%sp)
pea (%sp)
pea 20(%sp)
move.l 40(%sp), -(%sp)
move.l 40(%sp), -(%sp)
jbsr _dl_call_pltexit
lea 16(%sp), %sp
move.l (%sp)+, %d0
move.l (%sp)+, %d1
fmove.x (%sp)+, %fp0
lea 20(%sp), %sp
rts
.size _dl_runtime_profile, . - _dl_runtime_profile

View File

@ -1,100 +0,0 @@
/* Startup code compliant to the ELF m68k ABI.
Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
In addition to the permissions in the GNU Lesser 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 GNU Lesser 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.)
Note that people who make modified versions of this file are not
obligated to grant this special exception for their modified
versions; it is their choice whether to do so. The GNU Lesser
General Public License gives permission to release a modified
version without this exception; this exception also makes it
possible to release a modified version which carries forward this
exception.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* This is the canonical entry point, usually the first thing in the text
segment. The SVR4/m68k ABI says that when the entry point runs,
most registers' values are unspecified, except for:
%a1 Contains a function pointer to be registered with `atexit'.
This is how the dynamic linker arranges to have DT_FINI
functions called for shared libraries that have been loaded
before this code runs.
%sp The stack contains the arguments and environment:
0(%sp) argc
4(%sp) argv[0]
...
(4*argc)(%sp) NULL
(4*(argc+1))(%sp) envp[0]
...
NULL
*/
.text
.globl _start
.type _start,@function
_start:
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
sub.l %fp, %fp
/* Extract the arguments as encoded on the stack and set up the
arguments for `main': argc, argv. envp will be determined
later in __libc_start_main. */
move.l (%sp)+, %d0 /* Pop the argument count. */
move.l %sp, %a0 /* The argument vector starts just at the
current stack top. */
/* Provide the highest stack address to the user code (for stacks
which grow downward). */
pea (%sp)
pea (%a1) /* Push address of the shared library
termination function. */
/* Push the address of our own entry points to `.fini' and
`.init'. */
pea __libc_csu_fini
pea __libc_csu_init
pea (%a0) /* Push second argument: argv. */
move.l %d0, -(%sp) /* Push first argument: argc. */
pea main
/* Call the user's main function, and exit with its value. But
let the libc call main. */
jbsr __libc_start_main
illegal /* Crash if somehow `exit' does return. */
/* Define a symbol for the first piece of initialized data. */
.data
.globl __data_start
__data_start:
.long 0
.weak data_start
data_start = __data_start

View File

@ -1,48 +0,0 @@
/* ffs -- find first set bit in a word, counted from least significant end.
For mc68020, mc68030, mc68040.
This file is part of the GNU C Library.
Copyright (C) 1991, 1992, 1997, 1998, 2004, 2005 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define ffsl __something_else
#include <string.h>
#undef ffs
#if defined (__GNUC__) && defined (__mc68020__)
int
__ffs (x)
int x;
{
int cnt;
asm ("bfffo %1{#0:#0},%0" : "=d" (cnt) : "dm" (x & -x));
return 32 - cnt;
}
weak_alias (__ffs, ffs)
libc_hidden_builtin_def (ffs)
#undef ffsl
weak_alias (__ffs, ffsl)
#else
#include <string/ffs.c>
#endif

View File

@ -1,11 +0,0 @@
ifeq ($(subdir),math)
ifndef math-twiddled
# Avoid twiddling in generic/Makefile.
math-twiddled := t
endif
bsdmath_dirs := $(bsdmath_dirs) mc68881
endif

View File

@ -1,79 +0,0 @@
/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _FENV_H
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
/* Define bits representing the exception. We use the bit positions of
the appropriate bits in the FPSR Accrued Exception Byte. */
enum
{
FE_INEXACT = 1 << 3,
#define FE_INEXACT FE_INEXACT
FE_DIVBYZERO = 1 << 4,
#define FE_DIVBYZERO FE_DIVBYZERO
FE_UNDERFLOW = 1 << 5,
#define FE_UNDERFLOW FE_UNDERFLOW
FE_OVERFLOW = 1 << 6,
#define FE_OVERFLOW FE_OVERFLOW
FE_INVALID = 1 << 7
#define FE_INVALID FE_INVALID
};
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
/* The m68k FPU supports all of the four defined rounding modes. We use
the bit positions in the FPCR Mode Control Byte as the values for the
appropriate macros. */
enum
{
FE_TONEAREST = 0,
#define FE_TONEAREST FE_TONEAREST
FE_TOWARDZERO = 1 << 4,
#define FE_TOWARDZERO FE_TOWARDZERO
FE_DOWNWARD = 2 << 4,
#define FE_DOWNWARD FE_DOWNWARD
FE_UPWARD = 3 << 4
#define FE_UPWARD FE_UPWARD
};
/* Type representing exception flags. */
typedef unsigned int fexcept_t;
/* Type representing floating-point environment. This structure
corresponds to the layout of the block written by `fmovem'. */
typedef struct
{
unsigned int __control_register;
unsigned int __status_register;
unsigned int __instruction_address;
}
fenv_t;
/* If the default argument is used we use this value. */
#define FE_DFL_ENV ((__const fenv_t *) -1)
#ifdef __USE_GNU
/* Floating-point environment where none of the exceptions are masked. */
# define FE_NOMASK_ENV ((__const fenv_t *) -2)
#endif

View File

@ -1,445 +0,0 @@
/* Definitions of inline math functions implemented by the m68881/2.
Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifdef __GNUC__
#ifdef __USE_ISOC99
/* GCC 3.1 and up have builtins that actually can be used. */
# if !__GNUC_PREREQ (3,1)
/* ISO C99 defines some macros to perform unordered comparisons. The
m68k FPU supports this with special opcodes and we should use them.
These must not be inline functions since we have to be able to handle
all floating-point types. */
# undef isgreater
# undef isgreaterequal
# undef isless
# undef islessequal
# undef islessgreater
# undef isunordered
# define isgreater(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsogt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# define isgreaterequal(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsoge %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# define isless(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsolt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# define islessequal(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsole %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# define islessgreater(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsogl %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# define isunordered(x, y) \
__extension__ \
({ char __result; \
__asm__ ("fcmp%.x %2,%1; fsun %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
__result != 0; })
# endif /* GCC 3.1 */
#endif
#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
|| defined __LIBC_INTERNAL_MATH_INLINES
#ifdef __LIBC_INTERNAL_MATH_INLINES
/* This is used when defining the functions themselves. Define them with
__ names, and with `static inline' instead of `extern inline' so the
bodies will always be used, never an external function call. */
# define __m81_u(x) __CONCAT(__,x)
# define __m81_inline static __inline
#else
# define __m81_u(x) x
# ifdef __cplusplus
# define __m81_inline __inline
# else
# define __m81_inline extern __inline
# endif
# define __M81_MATH_INLINES 1
#endif
/* Define a const math function. */
#define __m81_defun(rettype, func, args) \
__m81_inline rettype __attribute__((__const__)) \
__m81_u(func) args
/* Define the three variants of a math function that has a direct
implementation in the m68k fpu. FUNC is the name for C (which will be
suffixed with f and l for the float and long double version, resp). OP
is the name of the fpu operation (without leading f). */
#if defined __USE_MISC || defined __USE_ISOC99
# define __inline_mathop(func, op) \
__inline_mathop1(double, func, op) \
__inline_mathop1(float, __CONCAT(func,f), op) \
__inline_mathop1(long double, __CONCAT(func,l), op)
#else
# define __inline_mathop(func, op) \
__inline_mathop1(double, func, op)
#endif
#define __inline_mathop1(float_type,func, op) \
__m81_defun (float_type, func, (float_type __mathop_x)) \
{ \
float_type __result; \
__asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
return __result; \
}
__inline_mathop(__atan, atan)
__inline_mathop(__cos, cos)
__inline_mathop(__sin, sin)
__inline_mathop(__tan, tan)
__inline_mathop(__tanh, tanh)
__inline_mathop(__fabs, abs)
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__inline_mathop(__rint, int)
__inline_mathop(__expm1, etoxm1)
__inline_mathop(__log1p, lognp1)
#endif
#ifdef __USE_MISC
__inline_mathop(__significand, getman)
#endif
#ifdef __USE_ISOC99
__inline_mathop(__trunc, intrz)
#endif
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
__inline_mathop(atan, atan)
__inline_mathop(cos, cos)
__inline_mathop(sin, sin)
__inline_mathop(tan, tan)
__inline_mathop(tanh, tanh)
# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
__inline_mathop(rint, int)
__inline_mathop(expm1, etoxm1)
__inline_mathop(log1p, lognp1)
# endif
# ifdef __USE_MISC
__inline_mathop(significand, getman)
# endif
# ifdef __USE_ISOC99
__inline_mathop(trunc, intrz)
# endif
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
/* This macro contains the definition for the rest of the inline
functions, using FLOAT_TYPE as the domain type and S as the suffix
for the function names. */
#define __inline_functions(float_type, s) \
__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x)) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
__asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \
/* Set rounding towards negative infinity. */ \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" ((__ctrl_reg & ~0x10) | 0x20)); \
/* Convert X to an integer, using -Inf rounding. */ \
__asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \
/* Restore the previous rounding mode. */ \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" (__ctrl_reg)); \
return __result; \
} \
\
__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
__asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \
/* Set rounding towards positive infinity. */ \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" (__ctrl_reg | 0x30)); \
/* Convert X to an integer, using +Inf rounding. */ \
__asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \
/* Restore the previous rounding mode. */ \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" (__ctrl_reg)); \
return __result; \
}
__inline_functions(double,)
#if defined __USE_MISC || defined __USE_ISOC99
__inline_functions(float,f)
__inline_functions(long double,l)
#endif
#undef __inline_functions
#ifdef __USE_MISC
# define __inline_functions(float_type, s) \
__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
{ \
/* There is no branch-condition for infinity, \
so we must extract and examine the condition codes manually. */ \
unsigned long int __fpsr; \
__asm("ftst%.x %1\n" \
"fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
} \
\
__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
{ \
/* There is no branch-condition for infinity, so we must extract and \
examine the condition codes manually. */ \
unsigned long int __fpsr; \
__asm ("ftst%.x %1\n" \
"fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
return (__fpsr & (3 << 24)) == 0; \
} \
\
__m81_defun (float_type, __CONCAT(__scalbn,s), \
(float_type __x, int __n)) \
{ \
float_type __result; \
__asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \
return __result; \
}
__inline_functions(double,)
__inline_functions(float,f)
__inline_functions(long double,l)
# undef __inline_functions
#endif /* Use misc. */
#if defined __USE_MISC || defined __USE_XOPEN
# define __inline_functions(float_type, s) \
__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
{ \
char __result; \
__asm("ftst%.x %1\n" \
"fsun %0" : "=dm" (__result) : "f" (__value)); \
return __result; \
}
__inline_functions(double,)
# ifdef __USE_MISC
__inline_functions(float,f)
__inline_functions(long double,l)
# endif
# undef __inline_functions
#endif
#ifdef __USE_ISOC99
# define __inline_functions(float_type, s) \
__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
{ \
/* There is no branch-condition for the sign bit, so we must extract \
and examine the condition codes manually. */ \
unsigned long int __fpsr; \
__asm ("ftst%.x %1\n" \
"fmove%.l %/fpsr, %0" : "=dm" (__fpsr) : "f" (__value)); \
return (__fpsr >> 27) & 1; \
} \
\
__m81_defun (float_type, __CONCAT(__scalbln,s), \
(float_type __x, long int __n)) \
{ \
return __CONCAT(__scalbn,s) (__x, __n); \
} \
\
__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) \
{ \
float_type __result; \
unsigned long int __ctrl_reg; \
__asm __volatile__ ("fmove%.l %!, %0" : "=dm" (__ctrl_reg)); \
/* Temporarily disable the inexact exception. */ \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" (__ctrl_reg & ~0x200)); \
__asm __volatile__ ("fint%.x %1, %0" : "=f" (__result) : "f" (__x)); \
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
: "dmi" (__ctrl_reg)); \
return __result; \
} \
\
__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
{ \
long int __result; \
__asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x)); \
return __result; \
} \
\
__m81_inline float_type \
__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
float_type __z) \
{ \
return (__x * __y) + __z; \
}
__inline_functions (double,)
__inline_functions (float,f)
__inline_functions (long double,l)
# undef __inline_functions
#endif /* Use ISO C9x */
#ifdef __USE_GNU
# define __inline_functions(float_type, s) \
__m81_inline void \
__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
float_type *__cosx) \
{ \
__asm ("fsincos%.x %2,%1:%0" \
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
}
__inline_functions (double,)
__inline_functions (float,f)
__inline_functions (long double,l)
# undef __inline_functions
#endif
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Define inline versions of the user visible functions. */
/* Note that there must be no whitespace before the argument passed for
NAME, to make token pasting work correctly with -traditional. */
# define __inline_forward_c(rettype, name, args1, args2) \
extern __inline rettype __attribute__((__const__)) \
name args1 \
{ \
return __CONCAT(__,name) args2; \
}
# define __inline_forward(rettype, name, args1, args2) \
extern __inline rettype name args1 \
{ \
return __CONCAT(__,name) args2; \
}
__inline_forward_c(double,floor, (double __x), (__x))
__inline_forward_c(double,ceil, (double __x), (__x))
# ifdef __USE_MISC
# ifndef __USE_ISOC99 /* Conflict with macro of same name. */
__inline_forward_c(int,isinf, (double __value), (__value))
# endif
__inline_forward_c(int,finite, (double __value), (__value))
__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
# endif
# if defined __USE_MISC || defined __USE_XOPEN
# ifndef __USE_ISOC99 /* Conflict with macro of same name. */
__inline_forward_c(int,isnan, (double __value), (__value))
# endif
# endif
# ifdef __USE_ISOC99
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
__inline_forward_c(double,nearbyint, (double __value), (__value))
__inline_forward_c(long int,lrint, (double __value), (__value))
__inline_forward_c(double,fma, (double __x, double __y, double __z),
(__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
(__x, __sinx, __cosx))
# endif
# if defined __USE_MISC || defined __USE_ISOC99
__inline_forward_c(float,floorf, (float __x), (__x))
__inline_forward_c(float,ceilf, (float __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
# endif
# ifdef __USE_ISOC99
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(float,nearbyintf, (float __value), (__value))
__inline_forward_c(long int,lrintf, (float __value), (__value))
__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
(__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
(__x, __sinx, __cosx))
# endif
__inline_forward_c(long double,floorl, (long double __x), (__x))
__inline_forward_c(long double,ceill, (long double __x), (__x))
# ifdef __USE_MISC
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
# endif
# ifdef __USE_ISOC99
__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
__inline_forward_c(long int,lrintl, (long double __value), (__value))
__inline_forward_c(long double,fmal,
(long double __x, long double __y, long double __z),
(__x, __y, __z))
# endif
# ifdef __USE_GNU
__inline_forward(void,sincosl,
(long double __x, long double *__sinx, long double *__cosx),
(__x, __sinx, __cosx))
# endif
#endif /* Use misc or ISO C99 */
#undef __inline_forward
#undef __inline_forward_c
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
#endif
#endif /* GCC. */

View File

@ -1 +0,0 @@
/* Not needed. */

View File

@ -1 +0,0 @@
/* Not needed. */

View File

@ -1 +0,0 @@
/* Not needed. */

View File

@ -1,35 +0,0 @@
/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <math.h>
#include "math_private.h"
#include "mathimpl.h"
#ifndef FUNC
#define FUNC __ieee754_acos
#endif
#ifndef float_type
#define float_type double
#endif
float_type
FUNC (x)
float_type x;
{
return __m81_u(FUNC)(x);
}

View File

@ -1,5 +0,0 @@
#ifndef FUNC
#define FUNC __ieee754_acosf
#endif
#define float_type float
#include <e_acos.c>

View File

@ -1,5 +0,0 @@
#ifndef FUNC
#define FUNC __ieee754_acosl
#endif
#define float_type long double
#include <e_acos.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_asin
#include <e_acos.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_asinf
#include <e_acosf.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_asinl
#include <e_acosl.c>

View File

@ -1,104 +0,0 @@
/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <math.h>
#include "math_private.h"
#include "mathimpl.h"
#ifndef SUFF
#define SUFF
#endif
#ifndef float_type
#define float_type double
#endif
#define CONCATX(a,b) __CONCAT(a,b)
#define s(name) CONCATX(name,SUFF)
#define m81(func) __m81_u(s(func))
float_type
s(__ieee754_atan2) (float_type y, float_type x)
{
float_type pi, pi_2, z;
unsigned long y_cond, x_cond;
__asm ("fmovecr%.x %#0, %0" : "=f" (pi));
__asm ("fscale%.w %#-1, %0" : "=f" (pi_2) : "0" (pi));
y_cond = __m81_test (y);
x_cond = __m81_test (x);
if ((x_cond | y_cond) & __M81_COND_NAN)
z = x + y;
else if (y_cond & __M81_COND_ZERO)
{
if (x_cond & __M81_COND_NEG)
z = y_cond & __M81_COND_NEG ? -pi : pi;
else
z = y;
}
else if (x_cond & __M81_COND_INF)
{
if (y_cond & __M81_COND_INF)
{
float_type pi_4;
__asm ("fscale%.w %#-2, %0" : "=f" (pi_4) : "0" (pi));
z = x_cond & __M81_COND_NEG ? 3 * pi_4 : pi_4;
}
else
z = x_cond & __M81_COND_NEG ? pi : 0;
if (y_cond & __M81_COND_NEG)
z = -z;
}
else if (y_cond & __M81_COND_INF)
z = y_cond & __M81_COND_NEG ? -pi_2 : pi_2;
else if (x_cond & __M81_COND_NEG)
{
if (y_cond & __M81_COND_NEG)
{
if (-x > -y)
z = -pi + m81(__atan) (y / x);
else
z = -pi_2 - m81(__atan) (x / y);
}
else
{
if (-x > y)
z = pi + m81(__atan) (y / x);
else
z = pi_2 - m81(__atan) (x / y);
}
}
else
{
if (y_cond & __M81_COND_NEG)
{
if (x > -y)
z = m81(__atan) (y / x);
else
z = -pi_2 - m81(__atan) (x / y);
}
else
{
if (x > y)
z = m81(__atan) (y / x);
else
z = pi_2 - m81(__atan) (x / y);
}
}
return z;
}

View File

@ -1,3 +0,0 @@
#define SUFF f
#define float_type float
#include <e_atan2.c>

View File

@ -1,3 +0,0 @@
#define SUFF l
#define float_type long double
#include <e_atan2.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_atanh
#include <e_acos.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_atanhf
#include <e_acosf.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_atanhl
#include <e_acosl.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_cosh
#include <e_acos.c>

View File

@ -1,2 +0,0 @@
#define FUNC __ieee754_coshf
#include <e_acosf.c>

Some files were not shown because too many files have changed in this diff Show More