diff options
author | cvs2svn <> | 2004-05-04 00:18:00 +0400 |
---|---|---|
committer | cvs2svn <> | 2004-05-04 00:18:00 +0400 |
commit | 7198e96ef84366ba3bf74d3b2fa9e57ad922c7e9 (patch) | |
tree | 779d1965f54f1b4124e2f9f8ed442c062a09b2cd /winsup/mingw/mingwex | |
parent | 1af84bb7f58c0aecfc1b5c6b6685e14afe36785e (diff) |
This commit was manufactured by cvs2svn to create tag 'csl-arm-2004-q1a'.csl-arm-2004-q1a
Sprout from master 2004-05-03 20:17:59 UTC Jeff Johnston <jjohnstn@redhat.com> ''
Cherrypick from cygnus 1999-05-03 07:29:06 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import':
COPYING
COPYING.LIB
README
config/mh-armpic
config/mh-elfalphapic
config/mh-m68kpic
config/mh-papic
config/mh-ppcpic
config/mh-x86pic
config/mt-d30v
config/mt-netware
config/mt-ospace
etc/add-log.el
etc/add-log.vi
etc/configbuild.ein
etc/configbuild.fig
etc/configbuild.jin
etc/configbuild.tin
etc/configdev.ein
etc/configdev.fig
etc/configdev.jin
etc/configdev.tin
etc/configure
etc/configure.in
include/aout/hp.h
include/aout/hppa.h
include/coff/sym.h
include/coff/symconst.h
include/fopen-bin.h
include/fopen-same.h
include/fopen-vms.h
include/gdbm.h
include/nlm/ppc-ext.h
include/opcode/mn10200.h
include/opcode/tahoe.h
include/opcode/tic30.h
makefile.vms
move-if-change
setup.com
ylwrap
Delete:
djunpack.bat
winsup/CYGWIN_LICENSE
winsup/ChangeLog
winsup/Makefile.common
winsup/Makefile.in
winsup/bz2lib/CHANGES
winsup/bz2lib/ChangeLog
winsup/bz2lib/LICENSE
winsup/bz2lib/Makefile
winsup/bz2lib/Makefile-libbz2_so
winsup/bz2lib/Makefile.in
winsup/bz2lib/README
winsup/bz2lib/README.COMPILATION.PROBLEMS
winsup/bz2lib/Y2K_INFO
winsup/bz2lib/aclocal.m4
winsup/bz2lib/blocksort.c
winsup/bz2lib/bzip2.1
winsup/bz2lib/bzip2.1.preformatted
winsup/bz2lib/bzip2.c
winsup/bz2lib/bzip2.txt
winsup/bz2lib/bzip2recover.c
winsup/bz2lib/bzlib.c
winsup/bz2lib/bzlib.h
winsup/bz2lib/bzlib_private.h
winsup/bz2lib/compress.c
winsup/bz2lib/configure
winsup/bz2lib/configure.in
winsup/bz2lib/crctable.c
winsup/bz2lib/decompress.c
winsup/bz2lib/dlltest.c
winsup/bz2lib/dlltest.dsp
winsup/bz2lib/huffman.c
winsup/bz2lib/libbz2.def
winsup/bz2lib/libbz2.dsp
winsup/bz2lib/makefile.msc
winsup/bz2lib/manual.ps
winsup/bz2lib/manual.texi
winsup/bz2lib/manual_1.html
winsup/bz2lib/manual_2.html
winsup/bz2lib/manual_3.html
winsup/bz2lib/manual_4.html
winsup/bz2lib/manual_toc.html
winsup/bz2lib/randtable.c
winsup/bz2lib/sample1.bz2
winsup/bz2lib/sample1.ref
winsup/bz2lib/sample2.bz2
winsup/bz2lib/sample2.ref
winsup/bz2lib/sample3.bz2
winsup/bz2lib/sample3.ref
winsup/bz2lib/spewG.c
winsup/bz2lib/unzcrash.c
winsup/bz2lib/words0
winsup/bz2lib/words1
winsup/bz2lib/words2
winsup/bz2lib/words3
winsup/configure
winsup/configure.in
winsup/cygserver/ChangeLog
winsup/cygserver/Makefile.in
winsup/cygserver/README
winsup/cygserver/bsd_helper.cc
winsup/cygserver/bsd_helper.h
winsup/cygserver/bsd_log.cc
winsup/cygserver/bsd_log.h
winsup/cygserver/bsd_mutex.cc
winsup/cygserver/bsd_mutex.h
winsup/cygserver/client.cc
winsup/cygserver/configure
winsup/cygserver/configure.in
winsup/cygserver/cygserver-config
winsup/cygserver/cygserver.cc
winsup/cygserver/cygserver.conf
winsup/cygserver/msg.cc
winsup/cygserver/process.cc
winsup/cygserver/process.h
winsup/cygserver/sem.cc
winsup/cygserver/shm.cc
winsup/cygserver/sysv_msg.cc
winsup/cygserver/sysv_sem.cc
winsup/cygserver/sysv_shm.cc
winsup/cygserver/threaded_queue.cc
winsup/cygserver/threaded_queue.h
winsup/cygserver/transport.cc
winsup/cygserver/transport.h
winsup/cygserver/transport_pipes.cc
winsup/cygserver/transport_pipes.h
winsup/cygserver/transport_sockets.cc
winsup/cygserver/transport_sockets.h
winsup/cygserver/woutsup.h
winsup/cygwin/CYGWIN_LICENSE
winsup/cygwin/ChangeLog
winsup/cygwin/ChangeLog-1995
winsup/cygwin/ChangeLog-1996
winsup/cygwin/ChangeLog-1997
winsup/cygwin/ChangeLog-1998
winsup/cygwin/ChangeLog-1999
winsup/cygwin/ChangeLog-2000
winsup/cygwin/ChangeLog-2001
winsup/cygwin/ChangeLog-2002
winsup/cygwin/ChangeLog-2003
winsup/cygwin/Makefile.in
winsup/cygwin/ROADMAP
winsup/cygwin/acconfig.h
winsup/cygwin/ansi.sgml
winsup/cygwin/assert.cc
winsup/cygwin/autoload.cc
winsup/cygwin/automode.c
winsup/cygwin/binmode.c
winsup/cygwin/child_info.h
winsup/cygwin/config.h.in
winsup/cygwin/config/i386/profile.h
winsup/cygwin/configure
winsup/cygwin/configure.in
winsup/cygwin/cpuid.h
winsup/cygwin/crt0.c
winsup/cygwin/cxx.cc
winsup/cygwin/cygerrno.h
winsup/cygwin/cygheap.cc
winsup/cygwin/cygheap.h
winsup/cygwin/cygmagic
winsup/cygwin/cygmalloc.h
winsup/cygwin/cygserver.h
winsup/cygwin/cygserver_ipc.h
winsup/cygwin/cygserver_msg.h
winsup/cygwin/cygserver_sem.h
winsup/cygwin/cygserver_shm.h
winsup/cygwin/cygthread.cc
winsup/cygwin/cygthread.h
winsup/cygwin/cygtls.cc
winsup/cygwin/cygtls.h
winsup/cygwin/cygwin-shilka
winsup/cygwin/cygwin.din
winsup/cygwin/cygwin.sc
winsup/cygwin/cygwin_version.h
winsup/cygwin/dcrt0.cc
winsup/cygwin/debug.cc
winsup/cygwin/debug.h
winsup/cygwin/delqueue.cc
winsup/cygwin/devices.cc
winsup/cygwin/devices.h
winsup/cygwin/devices.in
winsup/cygwin/dir.cc
winsup/cygwin/dlfcn.cc
winsup/cygwin/dll_init.cc
winsup/cygwin/dll_init.h
winsup/cygwin/dll_init.sgml
winsup/cygwin/dlmalloc.c
winsup/cygwin/dlmalloc.h
winsup/cygwin/dtable.cc
winsup/cygwin/dtable.h
winsup/cygwin/dtable.sgml
winsup/cygwin/environ.cc
winsup/cygwin/environ.h
winsup/cygwin/errno.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/exec.cc
winsup/cygwin/external.cc
winsup/cygwin/external.sgml
winsup/cygwin/fcntl.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/fhandler_dsp.cc
winsup/cygwin/fhandler_fifo.cc
winsup/cygwin/fhandler_floppy.cc
winsup/cygwin/fhandler_mem.cc
winsup/cygwin/fhandler_nodevice.cc
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_random.cc
winsup/cygwin/fhandler_raw.cc
winsup/cygwin/fhandler_registry.cc
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/fhandler_socket.cc
winsup/cygwin/fhandler_tape.cc
winsup/cygwin/fhandler_termios.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fhandler_virtual.cc
winsup/cygwin/fhandler_windows.cc
winsup/cygwin/fhandler_zero.cc
winsup/cygwin/flock.cc
winsup/cygwin/fork.cc
winsup/cygwin/gcrt0.c
winsup/cygwin/gendef
winsup/cygwin/gendevices
winsup/cygwin/gentls_offsets
winsup/cygwin/glob.c
winsup/cygwin/gmon.c
winsup/cygwin/gmon.h
winsup/cygwin/grp.cc
winsup/cygwin/heap.cc
winsup/cygwin/heap.h
winsup/cygwin/hires.h
winsup/cygwin/how-autoload-works.txt
winsup/cygwin/how-cygheap-works.txt
winsup/cygwin/how-fhandlers-work.txt
winsup/cygwin/how-signals-work.txt
winsup/cygwin/how-spawn-works.txt
winsup/cygwin/how-to-debug-cygwin.txt
winsup/cygwin/how-vfork-works.txt
winsup/cygwin/include/a.out.h
winsup/cygwin/include/arpa/ftp.h
winsup/cygwin/include/arpa/inet.h
winsup/cygwin/include/arpa/telnet.h
winsup/cygwin/include/asm/byteorder.h
winsup/cygwin/include/asm/socket.h
winsup/cygwin/include/asm/types.h
winsup/cygwin/include/cygwin/_types.h
winsup/cygwin/include/cygwin/acl.h
winsup/cygwin/include/cygwin/config.h
winsup/cygwin/include/cygwin/core_dump.h
winsup/cygwin/include/cygwin/cygwin_dll.h
winsup/cygwin/include/cygwin/fs.h
winsup/cygwin/include/cygwin/grp.h
winsup/cygwin/include/cygwin/hdreg.h
winsup/cygwin/include/cygwin/icmp.h
winsup/cygwin/include/cygwin/if.h
winsup/cygwin/include/cygwin/in.h
winsup/cygwin/include/cygwin/in_systm.h
winsup/cygwin/include/cygwin/ipc.h
winsup/cygwin/include/cygwin/msg.h
winsup/cygwin/include/cygwin/mtio.h
winsup/cygwin/include/cygwin/rdevio.h
winsup/cygwin/include/cygwin/sem.h
winsup/cygwin/include/cygwin/shm.h
winsup/cygwin/include/cygwin/signal.h
winsup/cygwin/include/cygwin/socket.h
winsup/cygwin/include/cygwin/sockios.h
winsup/cygwin/include/cygwin/stat.h
winsup/cygwin/include/cygwin/sysproto.h
winsup/cygwin/include/cygwin/types.h
winsup/cygwin/include/cygwin/uio.h
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/include/dlfcn.h
winsup/cygwin/include/err.h
winsup/cygwin/include/exceptions.h
winsup/cygwin/include/fcntl.h
winsup/cygwin/include/features.h
winsup/cygwin/include/fnmatch.h
winsup/cygwin/include/getopt.h
winsup/cygwin/include/glob.h
winsup/cygwin/include/icmp.h
winsup/cygwin/include/inttypes.h
winsup/cygwin/include/io.h
winsup/cygwin/include/lastlog.h
winsup/cygwin/include/limits.h
winsup/cygwin/include/mapi.h
winsup/cygwin/include/memory.h
winsup/cygwin/include/mntent.h
winsup/cygwin/include/net/if.h
winsup/cygwin/include/netdb.h
winsup/cygwin/include/netinet/in.h
winsup/cygwin/include/netinet/in_systm.h
winsup/cygwin/include/netinet/ip.h
winsup/cygwin/include/netinet/ip_icmp.h
winsup/cygwin/include/netinet/tcp.h
winsup/cygwin/include/netinet/udp.h
winsup/cygwin/include/paths.h
winsup/cygwin/include/poll.h
winsup/cygwin/include/pthread.h
winsup/cygwin/include/pty.h
winsup/cygwin/include/sched.h
winsup/cygwin/include/semaphore.h
winsup/cygwin/include/stdint.h
winsup/cygwin/include/strings.h
winsup/cygwin/include/sys/acl.h
winsup/cygwin/include/sys/cdefs.h
winsup/cygwin/include/sys/copying.dj
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/include/sys/dirent.h
winsup/cygwin/include/sys/file.h
winsup/cygwin/include/sys/ioctl.h
winsup/cygwin/include/sys/ipc.h
winsup/cygwin/include/sys/lock.h
winsup/cygwin/include/sys/mman.h
winsup/cygwin/include/sys/mount.h
winsup/cygwin/include/sys/msg.h
winsup/cygwin/include/sys/mtio.h
winsup/cygwin/include/sys/param.h
winsup/cygwin/include/sys/poll.h
winsup/cygwin/include/sys/procfs.h
winsup/cygwin/include/sys/queue.h
winsup/cygwin/include/sys/resource.h
winsup/cygwin/include/sys/select.h
winsup/cygwin/include/sys/sem.h
winsup/cygwin/include/sys/shm.h
winsup/cygwin/include/sys/smallprint.h
winsup/cygwin/include/sys/socket.h
winsup/cygwin/include/sys/soundcard.h
winsup/cygwin/include/sys/statfs.h
winsup/cygwin/include/sys/stdio.h
winsup/cygwin/include/sys/strace.h
winsup/cygwin/include/sys/syslog.h
winsup/cygwin/include/sys/sysmacros.h
winsup/cygwin/include/sys/sysproto.h
winsup/cygwin/include/sys/termio.h
winsup/cygwin/include/sys/termios.h
winsup/cygwin/include/sys/ttychars.h
winsup/cygwin/include/sys/uio.h
winsup/cygwin/include/sys/un.h
winsup/cygwin/include/sys/utime.h
winsup/cygwin/include/sys/utmp.h
winsup/cygwin/include/sys/utsname.h
winsup/cygwin/include/sys/vfs.h
winsup/cygwin/include/sys/wait.h
winsup/cygwin/include/sysexits.h
winsup/cygwin/include/syslog.h
winsup/cygwin/include/termio.h
winsup/cygwin/include/tzfile.h
winsup/cygwin/init.cc
winsup/cygwin/ioctl.cc
winsup/cygwin/ipc.cc
winsup/cygwin/lib/_cygwin_crt0_common.cc
winsup/cygwin/lib/crt0.h
winsup/cygwin/lib/cygwin_attach_dll.c
winsup/cygwin/lib/cygwin_crt0.c
winsup/cygwin/lib/dll_entry.c
winsup/cygwin/lib/dll_main.cc
winsup/cygwin/lib/libcmain.c
winsup/cygwin/lib/premain0.c
winsup/cygwin/lib/premain1.c
winsup/cygwin/lib/premain2.c
winsup/cygwin/lib/premain3.c
winsup/cygwin/lib/pseudo-reloc.c
winsup/cygwin/libc/bsdlib.cc
winsup/cygwin/libc/fnmatch.c
winsup/cygwin/libc/getopt.c
winsup/cygwin/libc/iruserok.c
winsup/cygwin/localtime.cc
winsup/cygwin/malloc.cc
winsup/cygwin/malloc_wrapper.cc
winsup/cygwin/mcount.c
winsup/cygwin/misc-std.sgml
winsup/cygwin/miscfuncs.cc
winsup/cygwin/mkvers.sh
winsup/cygwin/mmap.cc
winsup/cygwin/msg.cc
winsup/cygwin/mtinfo.h
winsup/cygwin/net.cc
winsup/cygwin/netdb.cc
winsup/cygwin/newsym
winsup/cygwin/ntdll.h
winsup/cygwin/ntea.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/path.h
winsup/cygwin/path.sgml
winsup/cygwin/perprocess.h
winsup/cygwin/perthread.h
winsup/cygwin/pinfo.cc
winsup/cygwin/pinfo.h
winsup/cygwin/pipe.cc
winsup/cygwin/poll.cc
winsup/cygwin/posix.sgml
winsup/cygwin/profil.c
winsup/cygwin/profil.h
winsup/cygwin/pseudo-reloc.cc
winsup/cygwin/pthread.cc
winsup/cygwin/pwdgrp.h
winsup/cygwin/regex/COPYRIGHT
winsup/cygwin/regex/cclass.h
winsup/cygwin/regex/cname.h
winsup/cygwin/regex/engine.c
winsup/cygwin/regex/engine.ih
winsup/cygwin/regex/mkh
winsup/cygwin/regex/regcomp.c
winsup/cygwin/regex/regcomp.ih
winsup/cygwin/regex/regerror.c
winsup/cygwin/regex/regerror.ih
winsup/cygwin/regex/regex.3
winsup/cygwin/regex/regex.7
winsup/cygwin/regex/regex.h
winsup/cygwin/regex/regex2.h
winsup/cygwin/regex/regexec.c
winsup/cygwin/regex/regfree.c
winsup/cygwin/regex/tests
winsup/cygwin/regex/utils.h
winsup/cygwin/regexp/COPYRIGHT
winsup/cygwin/regexp/README
winsup/cygwin/regexp/regexp.h
winsup/cygwin/regexp/regmagic.h
winsup/cygwin/regexp/v8_regerror.c
winsup/cygwin/regexp/v8_regexp.c
winsup/cygwin/regexp/v8_regsub.c
winsup/cygwin/registry.cc
winsup/cygwin/registry.h
winsup/cygwin/resource.cc
winsup/cygwin/rmsym
winsup/cygwin/scandir.cc
winsup/cygwin/sched.cc
winsup/cygwin/sec_acl.cc
winsup/cygwin/sec_helper.cc
winsup/cygwin/security.cc
winsup/cygwin/security.h
winsup/cygwin/select.cc
winsup/cygwin/select.h
winsup/cygwin/sem.cc
winsup/cygwin/shared.cc
winsup/cygwin/shared.sgml
winsup/cygwin/shared_info.h
winsup/cygwin/shm.cc
winsup/cygwin/signal.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h
winsup/cygwin/smallprint.c
winsup/cygwin/spawn.cc
winsup/cygwin/speclib
winsup/cygwin/stackdump.sgml
winsup/cygwin/strace.cc
winsup/cygwin/string.h
winsup/cygwin/strsep.cc
winsup/cygwin/strsig.cc
winsup/cygwin/sync.cc
winsup/cygwin/sync.h
winsup/cygwin/syscalls.cc
winsup/cygwin/sysconf.cc
winsup/cygwin/syslog.cc
winsup/cygwin/termios.cc
winsup/cygwin/textmode.c
winsup/cygwin/textreadmode.c
winsup/cygwin/thread.cc
winsup/cygwin/thread.h
winsup/cygwin/timer.cc
winsup/cygwin/times.cc
winsup/cygwin/tlsoffsets.h
winsup/cygwin/tty.cc
winsup/cygwin/tty.h
winsup/cygwin/tz_posixrules.h
winsup/cygwin/uinfo.cc
winsup/cygwin/uname.cc
winsup/cygwin/wait.cc
winsup/cygwin/winbase.h
winsup/cygwin/wincap.cc
winsup/cygwin/wincap.h
winsup/cygwin/window.cc
winsup/cygwin/winsup.h
winsup/cygwin/winver.rc
winsup/cygwin/wsock_event.h
winsup/doc/ChangeLog
winsup/doc/Makefile.in
winsup/doc/calls.texinfo
winsup/doc/changes.texinfo
winsup/doc/configure
winsup/doc/configure.in
winsup/doc/copy.texinfo
winsup/doc/cygserver.sgml
winsup/doc/cygwin-api.in.sgml
winsup/doc/cygwin-ug-net.in.sgml
winsup/doc/cygwin-ug.in.sgml
winsup/doc/cygwin.dsl
winsup/doc/cygwinenv.sgml
winsup/doc/dll.sgml
winsup/doc/doctool.c
winsup/doc/doctool.txt
winsup/doc/effectively.sgml
winsup/doc/faq.texinfo
winsup/doc/fhandler-tut.txt
winsup/doc/filemodes.sgml
winsup/doc/gcc.sgml
winsup/doc/gdb.sgml
winsup/doc/history.texinfo
winsup/doc/how-api.texinfo
winsup/doc/how-programming.texinfo
winsup/doc/how-resources.texinfo
winsup/doc/how-using.texinfo
winsup/doc/how.texinfo
winsup/doc/install.texinfo
winsup/doc/legal.sgml
winsup/doc/ntsec.sgml
winsup/doc/overview.sgml
winsup/doc/overview2.sgml
winsup/doc/pathnames.sgml
winsup/doc/programming.sgml
winsup/doc/readme.texinfo
winsup/doc/relnotes.texinfo
winsup/doc/setup-net.sgml
winsup/doc/setup.sgml
winsup/doc/setup2.sgml
winsup/doc/textbinary.sgml
winsup/doc/using.sgml
winsup/doc/what.texinfo
winsup/doc/who.texinfo
winsup/doc/windres.sgml
winsup/mingw/CONTRIBUTORS
winsup/mingw/CRT_fp10.c
winsup/mingw/CRT_fp8.c
winsup/mingw/CRT_noglob.c
winsup/mingw/CRTfmode.c
winsup/mingw/CRTglob.c
winsup/mingw/CRTinit.c
winsup/mingw/ChangeLog
winsup/mingw/DISCLAIMER
winsup/mingw/Makefile.in
winsup/mingw/README
winsup/mingw/TODO
winsup/mingw/binmode.c
winsup/mingw/config.guess
winsup/mingw/config.sub
winsup/mingw/configure
winsup/mingw/configure.in
winsup/mingw/crt1.c
winsup/mingw/crtdll.def
winsup/mingw/crtmt.c
winsup/mingw/crtst.c
winsup/mingw/dllcrt1.c
winsup/mingw/dllmain.c
winsup/mingw/gccmain.c
winsup/mingw/include/_mingw.h
winsup/mingw/include/assert.h
winsup/mingw/include/complex.h
winsup/mingw/include/conio.h
winsup/mingw/include/ctype.h
winsup/mingw/include/dir.h
winsup/mingw/include/direct.h
winsup/mingw/include/dirent.h
winsup/mingw/include/dos.h
winsup/mingw/include/errno.h
winsup/mingw/include/excpt.h
winsup/mingw/include/fcntl.h
winsup/mingw/include/fenv.h
winsup/mingw/include/float.h
winsup/mingw/include/getopt.h
winsup/mingw/include/inttypes.h
winsup/mingw/include/io.h
winsup/mingw/include/limits.h
winsup/mingw/include/locale.h
winsup/mingw/include/malloc.h
winsup/mingw/include/math.h
winsup/mingw/include/mbctype.h
winsup/mingw/include/mbstring.h
winsup/mingw/include/mem.h
winsup/mingw/include/memory.h
winsup/mingw/include/process.h
winsup/mingw/include/search.h
winsup/mingw/include/setjmp.h
winsup/mingw/include/share.h
winsup/mingw/include/signal.h
winsup/mingw/include/stdarg.h
winsup/mingw/include/stddef.h
winsup/mingw/include/stdint.h
winsup/mingw/include/stdio.h
winsup/mingw/include/stdlib.h
winsup/mingw/include/string.h
winsup/mingw/include/strings.h
winsup/mingw/include/sys/fcntl.h
winsup/mingw/include/sys/file.h
winsup/mingw/include/sys/locking.h
winsup/mingw/include/sys/param.h
winsup/mingw/include/sys/stat.h
winsup/mingw/include/sys/time.h
winsup/mingw/include/sys/timeb.h
winsup/mingw/include/sys/types.h
winsup/mingw/include/sys/unistd.h
winsup/mingw/include/sys/utime.h
winsup/mingw/include/tchar.h
winsup/mingw/include/time.h
winsup/mingw/include/unistd.h
winsup/mingw/include/utime.h
winsup/mingw/include/values.h
winsup/mingw/include/varargs.h
winsup/mingw/include/wchar.h
winsup/mingw/include/wctype.h
winsup/mingw/init.c
winsup/mingw/install-sh
winsup/mingw/isascii.c
winsup/mingw/iscsym.c
winsup/mingw/iscsymf.c
winsup/mingw/jamfile
winsup/mingw/main.c
winsup/mingw/mingwex/Makefile.in
winsup/mingw/mingwex/_Exit.c
winsup/mingw/mingwex/atoll.c
winsup/mingw/mingwex/complex/cabs.c
winsup/mingw/mingwex/complex/cacos.c
winsup/mingw/mingwex/complex/cacosh.c
winsup/mingw/mingwex/complex/casin.c
winsup/mingw/mingwex/complex/casinh.c
winsup/mingw/mingwex/complex/catan.c
winsup/mingw/mingwex/complex/catanh.c
winsup/mingw/mingwex/complex/ccos.c
winsup/mingw/mingwex/complex/ccosh.c
winsup/mingw/mingwex/complex/cexp.c
winsup/mingw/mingwex/complex/cimag.c
winsup/mingw/mingwex/complex/clog.c
winsup/mingw/mingwex/complex/cpow.c
winsup/mingw/mingwex/complex/cproj.c
winsup/mingw/mingwex/complex/creal.c
winsup/mingw/mingwex/complex/csin.c
winsup/mingw/mingwex/complex/csinh.c
winsup/mingw/mingwex/complex/csqrt.c
winsup/mingw/mingwex/complex/ctan.c
winsup/mingw/mingwex/complex/ctanh.c
winsup/mingw/mingwex/configure
winsup/mingw/mingwex/configure.in
winsup/mingw/mingwex/dirent.c
winsup/mingw/mingwex/feclearexcept.c
winsup/mingw/mingwex/fegetenv.c
winsup/mingw/mingwex/fegetexceptflag.c
winsup/mingw/mingwex/fegetround.c
winsup/mingw/mingwex/feholdexcept.c
winsup/mingw/mingwex/feraiseexcept.c
winsup/mingw/mingwex/fesetenv.c
winsup/mingw/mingwex/fesetexceptflag.c
winsup/mingw/mingwex/fesetround.c
winsup/mingw/mingwex/fetestexcept.c
winsup/mingw/mingwex/feupdateenv.c
winsup/mingw/mingwex/fwide.c
winsup/mingw/mingwex/getopt.c
winsup/mingw/mingwex/imaxabs.c
winsup/mingw/mingwex/imaxdiv.c
winsup/mingw/mingwex/ldtoa.c
winsup/mingw/mingwex/lltoa.c
winsup/mingw/mingwex/lltow.c
winsup/mingw/mingwex/math/acosf.c
winsup/mingw/mingwex/math/acosl.c
winsup/mingw/mingwex/math/asinf.c
winsup/mingw/mingwex/math/asinl.c
winsup/mingw/mingwex/math/atan2f.c
winsup/mingw/mingwex/math/atan2l.c
winsup/mingw/mingwex/math/atanf.c
winsup/mingw/mingwex/math/atanl.c
winsup/mingw/mingwex/math/cbrt.c
winsup/mingw/mingwex/math/cbrtf.c
winsup/mingw/mingwex/math/cbrtl.c
winsup/mingw/mingwex/math/ceilf.S
winsup/mingw/mingwex/math/ceill.S
winsup/mingw/mingwex/math/cephes_emath.c
winsup/mingw/mingwex/math/cephes_emath.h
winsup/mingw/mingwex/math/cephes_mconf.h
winsup/mingw/mingwex/math/copysign.S
winsup/mingw/mingwex/math/copysignf.S
winsup/mingw/mingwex/math/copysignl.S
winsup/mingw/mingwex/math/cosf.S
winsup/mingw/mingwex/math/coshf.c
winsup/mingw/mingwex/math/coshl.c
winsup/mingw/mingwex/math/cosl.S
winsup/mingw/mingwex/math/exp2.S
winsup/mingw/mingwex/math/exp2f.S
winsup/mingw/mingwex/math/exp2l.S
winsup/mingw/mingwex/math/expf.c
winsup/mingw/mingwex/math/expl.c
winsup/mingw/mingwex/math/fabs.c
winsup/mingw/mingwex/math/fabsf.c
winsup/mingw/mingwex/math/fabsl.c
winsup/mingw/mingwex/math/fdim.c
winsup/mingw/mingwex/math/fdimf.c
winsup/mingw/mingwex/math/fdiml.c
winsup/mingw/mingwex/math/floorf.S
winsup/mingw/mingwex/math/floorl.S
winsup/mingw/mingwex/math/fma.S
winsup/mingw/mingwex/math/fmaf.S
winsup/mingw/mingwex/math/fmal.c
winsup/mingw/mingwex/math/fmax.c
winsup/mingw/mingwex/math/fmaxf.c
winsup/mingw/mingwex/math/fmaxl.c
winsup/mingw/mingwex/math/fmin.c
winsup/mingw/mingwex/math/fminf.c
winsup/mingw/mingwex/math/fminl.c
winsup/mingw/mingwex/math/fmodf.c
winsup/mingw/mingwex/math/fmodl.c
winsup/mingw/mingwex/math/fp_consts.c
winsup/mingw/mingwex/math/fp_consts.h
winsup/mingw/mingwex/math/fp_constsf.c
winsup/mingw/mingwex/math/fp_constsl.c
winsup/mingw/mingwex/math/fpclassify.c
winsup/mingw/mingwex/math/fpclassifyf.c
winsup/mingw/mingwex/math/fpclassifyl.c
winsup/mingw/mingwex/math/frexpf.c
winsup/mingw/mingwex/math/frexpl.S
winsup/mingw/mingwex/math/fucom.c
winsup/mingw/mingwex/math/hypotf.c
winsup/mingw/mingwex/math/hypotl.c
winsup/mingw/mingwex/math/ilogb.S
winsup/mingw/mingwex/math/ilogbf.S
winsup/mingw/mingwex/math/ilogbl.S
winsup/mingw/mingwex/math/isnan.c
winsup/mingw/mingwex/math/isnanf.c
winsup/mingw/mingwex/math/isnanl.c
winsup/mingw/mingwex/math/ldexpf.c
winsup/mingw/mingwex/math/ldexpl.c
winsup/mingw/mingwex/math/lgamma.c
winsup/mingw/mingwex/math/lgammaf.c
winsup/mingw/mingwex/math/lgammal.c
winsup/mingw/mingwex/math/llrint.c
winsup/mingw/mingwex/math/llrintf.c
winsup/mingw/mingwex/math/llrintl.c
winsup/mingw/mingwex/math/llround.c
winsup/mingw/mingwex/math/llroundf.c
winsup/mingw/mingwex/math/llroundl.c
winsup/mingw/mingwex/math/log10f.S
winsup/mingw/mingwex/math/log10l.S
winsup/mingw/mingwex/math/log1p.S
winsup/mingw/mingwex/math/log1pf.S
winsup/mingw/mingwex/math/log1pl.S
winsup/mingw/mingwex/math/log2.S
winsup/mingw/mingwex/math/log2f.S
winsup/mingw/mingwex/math/log2l.S
winsup/mingw/mingwex/math/logb.c
winsup/mingw/mingwex/math/logbf.c
winsup/mingw/mingwex/math/logbl.c
winsup/mingw/mingwex/math/logf.S
winsup/mingw/mingwex/math/logl.S
winsup/mingw/mingwex/math/lrint.c
winsup/mingw/mingwex/math/lrintf.c
winsup/mingw/mingwex/math/lrintl.c
winsup/mingw/mingwex/math/lround.c
winsup/mingw/mingwex/math/lroundf.c
winsup/mingw/mingwex/math/lroundl.c
winsup/mingw/mingwex/math/modff.c
winsup/mingw/mingwex/math/modfl.c
winsup/mingw/mingwex/math/nearbyint.S
winsup/mingw/mingwex/math/nearbyintf.S
winsup/mingw/mingwex/math/nearbyintl.S
winsup/mingw/mingwex/math/nextafterf.c
winsup/mingw/mingwex/math/pow.c
winsup/mingw/mingwex/math/powf.c
winsup/mingw/mingwex/math/powi.c
winsup/mingw/mingwex/math/powif.c
winsup/mingw/mingwex/math/powil.c
winsup/mingw/mingwex/math/powl.c
winsup/mingw/mingwex/math/remainder.S
winsup/mingw/mingwex/math/remainderf.S
winsup/mingw/mingwex/math/remainderl.S
winsup/mingw/mingwex/math/remquo.S
winsup/mingw/mingwex/math/remquof.S
winsup/mingw/mingwex/math/remquol.S
winsup/mingw/mingwex/math/rint.c
winsup/mingw/mingwex/math/rintf.c
winsup/mingw/mingwex/math/rintl.c
winsup/mingw/mingwex/math/round.c
winsup/mingw/mingwex/math/roundf.c
winsup/mingw/mingwex/math/roundl.c
winsup/mingw/mingwex/math/s_erf.c
winsup/mingw/mingwex/math/scalbn.S
winsup/mingw/mingwex/math/scalbnf.S
winsup/mingw/mingwex/math/scalbnl.S
winsup/mingw/mingwex/math/sf_erf.c
winsup/mingw/mingwex/math/signbit.c
winsup/mingw/mingwex/math/signbitf.c
winsup/mingw/mingwex/math/signbitl.c
winsup/mingw/mingwex/math/sinf.S
winsup/mingw/mingwex/math/sinhf.c
winsup/mingw/mingwex/math/sinhl.c
winsup/mingw/mingwex/math/sinl.S
winsup/mingw/mingwex/math/sqrtf.c
winsup/mingw/mingwex/math/sqrtl.c
winsup/mingw/mingwex/math/tanf.S
winsup/mingw/mingwex/math/tanhf.c
winsup/mingw/mingwex/math/tanhl.c
winsup/mingw/mingwex/math/tanl.S
winsup/mingw/mingwex/math/tgamma.c
winsup/mingw/mingwex/math/tgammaf.c
winsup/mingw/mingwex/math/tgammal.c
winsup/mingw/mingwex/math/trunc.c
winsup/mingw/mingwex/math/truncf.c
winsup/mingw/mingwex/math/truncl.c
winsup/mingw/mingwex/mbsinit.c
winsup/mingw/mingwex/mingw-fseek.c
winsup/mingw/mingwex/sitest.c
winsup/mingw/mingwex/stdio/snprintf.c
winsup/mingw/mingwex/stdio/snwprintf.c
winsup/mingw/mingwex/stdio/vfscanf.c
winsup/mingw/mingwex/stdio/vfwscanf.c
winsup/mingw/mingwex/stdio/vscanf.c
winsup/mingw/mingwex/stdio/vsnprintf.c
winsup/mingw/mingwex/stdio/vsnwprintf.c
winsup/mingw/mingwex/stdio/vsscanf.c
winsup/mingw/mingwex/stdio/vswscanf.c
winsup/mingw/mingwex/stdio/vwscanf.c
winsup/mingw/mingwex/strtof.c
winsup/mingw/mingwex/strtoimax.c
winsup/mingw/mingwex/strtold.c
winsup/mingw/mingwex/strtoumax.c
winsup/mingw/mingwex/testwmem.c
winsup/mingw/mingwex/ulltoa.c
winsup/mingw/mingwex/ulltow.c
winsup/mingw/mingwex/wcstof.c
winsup/mingw/mingwex/wcstoimax.c
winsup/mingw/mingwex/wcstold.c
winsup/mingw/mingwex/wcstoumax.c
winsup/mingw/mingwex/wdirent.c
winsup/mingw/mingwex/wmemchr.c
winsup/mingw/mingwex/wmemcmp.c
winsup/mingw/mingwex/wmemcpy.c
winsup/mingw/mingwex/wmemmove.c
winsup/mingw/mingwex/wmemset.c
winsup/mingw/mingwex/wtoll.c
winsup/mingw/mkinstalldirs
winsup/mingw/moldname.def.in
winsup/mingw/msvcrt.def.in
winsup/mingw/mthr.c
winsup/mingw/mthr_init.c
winsup/mingw/mthr_stub.c
winsup/mingw/profile/Makefile.in
winsup/mingw/profile/configure
winsup/mingw/profile/configure.in
winsup/mingw/profile/gcrt0.c
winsup/mingw/profile/gmon.c
winsup/mingw/profile/gmon.h
winsup/mingw/profile/mcount.c
winsup/mingw/profile/profil.c
winsup/mingw/profile/profil.h
winsup/mingw/profile/profile.h
winsup/mingw/pseudo-reloc-list.c
winsup/mingw/pseudo-reloc.c
winsup/mingw/readme.txt
winsup/mingw/samples/dirent/jamfile
winsup/mingw/samples/dirent/test.c
winsup/mingw/samples/dirent/wtest.c
winsup/mingw/samples/dlltest/dll.c
winsup/mingw/samples/dlltest/dll.def
winsup/mingw/samples/dlltest/dll.h
winsup/mingw/samples/dlltest/exe.c
winsup/mingw/samples/dlltest/exe.exp
winsup/mingw/samples/dlltest/expexe.c
winsup/mingw/samples/dlltest/expexe.def
winsup/mingw/samples/dlltest/jamfile
winsup/mingw/samples/dlltest/loaddll.c
winsup/mingw/samples/dlltest/loadexe.c
winsup/mingw/samples/dlltest/readme.txt
winsup/mingw/samples/dlltest/silly.cpp
winsup/mingw/samples/dlltest/silly.def
winsup/mingw/samples/dlltest/silly.exp
winsup/mingw/samples/dlltest/silly.h
winsup/mingw/samples/dlltest/sillydll.cpp
winsup/mingw/samples/filehand/filehand.c
winsup/mingw/samples/filehand/jamfile
winsup/mingw/samples/filehand/junk.txt
winsup/mingw/samples/fixargv/fixargv.c
winsup/mingw/samples/fixargv/fixargv.h
winsup/mingw/samples/fixargv/readme.txt
winsup/mingw/samples/fmode/all.c
winsup/mingw/samples/fmode/jamfile
winsup/mingw/samples/fmode/readme.txt
winsup/mingw/samples/fmode/test.c
winsup/mingw/samples/fmode/test2.c
winsup/mingw/samples/globbing/glob.c
winsup/mingw/samples/globbing/jamfile
winsup/mingw/samples/globbing/noglob.c
winsup/mingw/samples/globbing/readme.txt
winsup/mingw/samples/print/jamfile
winsup/mingw/samples/print/prntest.c
winsup/mingw/samples/seh/eh3.c
winsup/mingw/samples/seh/exutil.c
winsup/mingw/samples/seh/exutil.def
winsup/mingw/samples/seh/exutil.h
winsup/mingw/samples/seh/jamfile
winsup/mingw/samples/seh/sehfix.c
winsup/mingw/samples/seh/sehsub.c
winsup/mingw/samples/seh/sehtest.c
winsup/mingw/samples/simpledll/dll.c
winsup/mingw/samples/simpledll/dll.cpp
winsup/mingw/samples/simpledll/dll.def
winsup/mingw/samples/simpledll/exe.c
winsup/mingw/samples/simpledll/jamfile
winsup/mingw/samples/simpledll/makedll.bat
winsup/mingw/samples/test/jamfile
winsup/mingw/samples/test/test.c
winsup/mingw/samples/wintest/jamfile
winsup/mingw/samples/wintest/test.c
winsup/mingw/strcasecmp.c
winsup/mingw/strncasecmp.c
winsup/mingw/test_headers.c
winsup/mingw/toascii.c
winsup/mingw/txtmode.c
winsup/mingw/wcscmpi.c
winsup/subauth/ChangeLog
winsup/subauth/Makefile.in
winsup/subauth/configure
winsup/subauth/configure.in
winsup/subauth/cygsuba.c
winsup/subauth/cygsuba.din
winsup/testsuite/ChangeLog
winsup/testsuite/Makefile.in
winsup/testsuite/README
winsup/testsuite/config/default.exp
winsup/testsuite/configure
winsup/testsuite/configure.in
winsup/testsuite/cygrun.c
winsup/testsuite/libltp/include/dataascii.h
winsup/testsuite/libltp/include/databin.h
winsup/testsuite/libltp/include/file_lock.h
winsup/testsuite/libltp/include/forker.h
winsup/testsuite/libltp/include/open_flags.h
winsup/testsuite/libltp/include/pattern.h
winsup/testsuite/libltp/include/random_range.h
winsup/testsuite/libltp/include/rmobj.h
winsup/testsuite/libltp/include/search_path.h
winsup/testsuite/libltp/include/str_to_bytes.h
winsup/testsuite/libltp/include/string_to_tokens.h
winsup/testsuite/libltp/include/test.h
winsup/testsuite/libltp/include/tlibio.h
winsup/testsuite/libltp/include/usctest.h
winsup/testsuite/libltp/include/write_log.h
winsup/testsuite/libltp/lib/dataascii.c
winsup/testsuite/libltp/lib/databin.c
winsup/testsuite/libltp/lib/datapid.c
winsup/testsuite/libltp/lib/forker.c
winsup/testsuite/libltp/lib/get_high_address.c
winsup/testsuite/libltp/lib/libtestsuite.c
winsup/testsuite/libltp/lib/open_flags.c
winsup/testsuite/libltp/lib/parse_opts.c
winsup/testsuite/libltp/lib/pattern.c
winsup/testsuite/libltp/lib/rmobj.c
winsup/testsuite/libltp/lib/search_path.c
winsup/testsuite/libltp/lib/str_to_bytes.c
winsup/testsuite/libltp/lib/string_to_tokens.c
winsup/testsuite/libltp/lib/tst_res.c
winsup/testsuite/libltp/lib/tst_sig.c
winsup/testsuite/libltp/lib/tst_tmpdir.c
winsup/testsuite/libltp/lib/write_log.c
winsup/testsuite/winsup.api/checksignal.c
winsup/testsuite/winsup.api/crlf.c
winsup/testsuite/winsup.api/devdsp.c
winsup/testsuite/winsup.api/devdsp_okay.h
winsup/testsuite/winsup.api/devzero.c
winsup/testsuite/winsup.api/iospeed.c
winsup/testsuite/winsup.api/known_bugs.tcl
winsup/testsuite/winsup.api/ltp/access01.c
winsup/testsuite/winsup.api/ltp/access03.c
winsup/testsuite/winsup.api/ltp/access04.c
winsup/testsuite/winsup.api/ltp/access05.c
winsup/testsuite/winsup.api/ltp/alarm01.c
winsup/testsuite/winsup.api/ltp/alarm02.c
winsup/testsuite/winsup.api/ltp/alarm03.c
winsup/testsuite/winsup.api/ltp/alarm07.c
winsup/testsuite/winsup.api/ltp/asyncio02.c
winsup/testsuite/winsup.api/ltp/chdir02.c
winsup/testsuite/winsup.api/ltp/chdir04.c
winsup/testsuite/winsup.api/ltp/chmod01.c
winsup/testsuite/winsup.api/ltp/chmod02.c
winsup/testsuite/winsup.api/ltp/chown01.c
winsup/testsuite/winsup.api/ltp/close01.c
winsup/testsuite/winsup.api/ltp/close02.c
winsup/testsuite/winsup.api/ltp/close08.c
winsup/testsuite/winsup.api/ltp/creat01.c
winsup/testsuite/winsup.api/ltp/creat03.c
winsup/testsuite/winsup.api/ltp/creat09.c
winsup/testsuite/winsup.api/ltp/dup01.c
winsup/testsuite/winsup.api/ltp/dup02.c
winsup/testsuite/winsup.api/ltp/dup03.c
winsup/testsuite/winsup.api/ltp/dup04.c
winsup/testsuite/winsup.api/ltp/dup05.c
winsup/testsuite/winsup.api/ltp/execl01.c
winsup/testsuite/winsup.api/ltp/execle01.c
winsup/testsuite/winsup.api/ltp/execlp01.c
winsup/testsuite/winsup.api/ltp/execv01.c
winsup/testsuite/winsup.api/ltp/execve01.c
winsup/testsuite/winsup.api/ltp/execvp01.c
winsup/testsuite/winsup.api/ltp/exit01.c
winsup/testsuite/winsup.api/ltp/exit02.c
winsup/testsuite/winsup.api/ltp/fchdir01.c
winsup/testsuite/winsup.api/ltp/fchdir02.c
winsup/testsuite/winsup.api/ltp/fchmod01.c
winsup/testsuite/winsup.api/ltp/fchown01.c
winsup/testsuite/winsup.api/ltp/fcntl02.c
winsup/testsuite/winsup.api/ltp/fcntl03.c
winsup/testsuite/winsup.api/ltp/fcntl04.c
winsup/testsuite/winsup.api/ltp/fcntl05.c
winsup/testsuite/winsup.api/ltp/fcntl07.c
winsup/testsuite/winsup.api/ltp/fcntl07B.c
winsup/testsuite/winsup.api/ltp/fcntl08.c
winsup/testsuite/winsup.api/ltp/fcntl09.c
winsup/testsuite/winsup.api/ltp/fcntl10.c
winsup/testsuite/winsup.api/ltp/fork01.c
winsup/testsuite/winsup.api/ltp/fork02.c
winsup/testsuite/winsup.api/ltp/fork03.c
winsup/testsuite/winsup.api/ltp/fork04.c
winsup/testsuite/winsup.api/ltp/fork06.c
winsup/testsuite/winsup.api/ltp/fork07.c
winsup/testsuite/winsup.api/ltp/fork09.c
winsup/testsuite/winsup.api/ltp/fork10.c
winsup/testsuite/winsup.api/ltp/fork11.c
winsup/testsuite/winsup.api/ltp/fpathconf01.c
winsup/testsuite/winsup.api/ltp/fstat01.c
winsup/testsuite/winsup.api/ltp/fstat02.c
winsup/testsuite/winsup.api/ltp/fstat03.c
winsup/testsuite/winsup.api/ltp/fstat04.c
winsup/testsuite/winsup.api/ltp/fsync01.c
winsup/testsuite/winsup.api/ltp/ftruncate01.c
winsup/testsuite/winsup.api/ltp/ftruncate02.c
winsup/testsuite/winsup.api/ltp/ftruncate03.c
winsup/testsuite/winsup.api/ltp/getegid01.c
winsup/testsuite/winsup.api/ltp/geteuid01.c
winsup/testsuite/winsup.api/ltp/getgid01.c
winsup/testsuite/winsup.api/ltp/getgid02.c
winsup/testsuite/winsup.api/ltp/getgid03.c
winsup/testsuite/winsup.api/ltp/getgroups01.c
winsup/testsuite/winsup.api/ltp/getgroups02.c
winsup/testsuite/winsup.api/ltp/gethostid01.c
winsup/testsuite/winsup.api/ltp/gethostname01.c
winsup/testsuite/winsup.api/ltp/getpgid01.c
winsup/testsuite/winsup.api/ltp/getpgid02.c
winsup/testsuite/winsup.api/ltp/getpgrp01.c
winsup/testsuite/winsup.api/ltp/getpid01.c
winsup/testsuite/winsup.api/ltp/getpid02.c
winsup/testsuite/winsup.api/ltp/getppid01.c
winsup/testsuite/winsup.api/ltp/getppid02.c
winsup/testsuite/winsup.api/ltp/getuid01.c
winsup/testsuite/winsup.api/ltp/getuid02.c
winsup/testsuite/winsup.api/ltp/getuid03.c
winsup/testsuite/winsup.api/ltp/kill01.c
winsup/testsuite/winsup.api/ltp/kill02.c
winsup/testsuite/winsup.api/ltp/kill03.c
winsup/testsuite/winsup.api/ltp/kill04.c
winsup/testsuite/winsup.api/ltp/kill09.c
winsup/testsuite/winsup.api/ltp/link02.c
winsup/testsuite/winsup.api/ltp/link03.c
winsup/testsuite/winsup.api/ltp/link04.c
winsup/testsuite/winsup.api/ltp/link05.c
winsup/testsuite/winsup.api/ltp/lseek01.c
winsup/testsuite/winsup.api/ltp/lseek02.c
winsup/testsuite/winsup.api/ltp/lseek03.c
winsup/testsuite/winsup.api/ltp/lseek04.c
winsup/testsuite/winsup.api/ltp/lseek05.c
winsup/testsuite/winsup.api/ltp/lseek06.c
winsup/testsuite/winsup.api/ltp/lseek07.c
winsup/testsuite/winsup.api/ltp/lseek08.c
winsup/testsuite/winsup.api/ltp/lseek09.c
winsup/testsuite/winsup.api/ltp/lseek10.c
winsup/testsuite/winsup.api/ltp/lstat02.c
winsup/testsuite/winsup.api/ltp/mkdir01.c
winsup/testsuite/winsup.api/ltp/mkdir08.c
winsup/testsuite/winsup.api/ltp/mknod01.c
winsup/testsuite/winsup.api/ltp/mmap001.c
winsup/testsuite/winsup.api/ltp/mmap02.c
winsup/testsuite/winsup.api/ltp/mmap03.c
winsup/testsuite/winsup.api/ltp/mmap04.c
winsup/testsuite/winsup.api/ltp/mmap05.c
winsup/testsuite/winsup.api/ltp/mmap06.c
winsup/testsuite/winsup.api/ltp/mmap07.c
winsup/testsuite/winsup.api/ltp/mmap08.c
winsup/testsuite/winsup.api/ltp/munmap01.c
winsup/testsuite/winsup.api/ltp/munmap02.c
winsup/testsuite/winsup.api/ltp/nice05.c
winsup/testsuite/winsup.api/ltp/open02.c
winsup/testsuite/winsup.api/ltp/open03.c
winsup/testsuite/winsup.api/ltp/pathconf01.c
winsup/testsuite/winsup.api/ltp/pause01.c
winsup/testsuite/winsup.api/ltp/pipe01.c
winsup/testsuite/winsup.api/ltp/pipe08.c
winsup/testsuite/winsup.api/ltp/pipe09.c
winsup/testsuite/winsup.api/ltp/pipe10.c
winsup/testsuite/winsup.api/ltp/pipe11.c
winsup/testsuite/winsup.api/ltp/poll01.c
winsup/testsuite/winsup.api/ltp/read01.c
winsup/testsuite/winsup.api/ltp/read04.c
winsup/testsuite/winsup.api/ltp/readdir01.c
winsup/testsuite/winsup.api/ltp/readlink01.c
winsup/testsuite/winsup.api/ltp/readlink02.c
winsup/testsuite/winsup.api/ltp/readlink03.c
winsup/testsuite/winsup.api/ltp/rename01.c
winsup/testsuite/winsup.api/ltp/rename02.c
winsup/testsuite/winsup.api/ltp/rename08.c
winsup/testsuite/winsup.api/ltp/rename10.c
winsup/testsuite/winsup.api/ltp/rmdir01.c
winsup/testsuite/winsup.api/ltp/rmdir04.c
winsup/testsuite/winsup.api/ltp/rmdir05.c
winsup/testsuite/winsup.api/ltp/sbrk01.c
winsup/testsuite/winsup.api/ltp/select01.c
winsup/testsuite/winsup.api/ltp/select02.c
winsup/testsuite/winsup.api/ltp/select03.c
winsup/testsuite/winsup.api/ltp/setgid01.c
winsup/testsuite/winsup.api/ltp/setgroups01.c
winsup/testsuite/winsup.api/ltp/setpgid01.c
winsup/testsuite/winsup.api/ltp/setregid01.c
winsup/testsuite/winsup.api/ltp/setreuid01.c
winsup/testsuite/winsup.api/ltp/setuid01.c
winsup/testsuite/winsup.api/ltp/setuid02.c
winsup/testsuite/winsup.api/ltp/signal03.c
winsup/testsuite/winsup.api/ltp/stat01.c
winsup/testsuite/winsup.api/ltp/stat02.c
winsup/testsuite/winsup.api/ltp/stat03.c
winsup/testsuite/winsup.api/ltp/stat05.c
winsup/testsuite/winsup.api/ltp/stat06.c
winsup/testsuite/winsup.api/ltp/symlink01.c
winsup/testsuite/winsup.api/ltp/symlink02.c
winsup/testsuite/winsup.api/ltp/symlink03.c
winsup/testsuite/winsup.api/ltp/symlink04.c
winsup/testsuite/winsup.api/ltp/symlink05.c
winsup/testsuite/winsup.api/ltp/sync01.c
winsup/testsuite/winsup.api/ltp/sync02.c
winsup/testsuite/winsup.api/ltp/time01.c
winsup/testsuite/winsup.api/ltp/time02.c
winsup/testsuite/winsup.api/ltp/times01.c
winsup/testsuite/winsup.api/ltp/times02.c
winsup/testsuite/winsup.api/ltp/times03.c
winsup/testsuite/winsup.api/ltp/truncate01.c
winsup/testsuite/winsup.api/ltp/truncate02.c
winsup/testsuite/winsup.api/ltp/ulimit01.c
winsup/testsuite/winsup.api/ltp/umask01.c
winsup/testsuite/winsup.api/ltp/umask02.c
winsup/testsuite/winsup.api/ltp/umask03.c
winsup/testsuite/winsup.api/ltp/uname01.c
winsup/testsuite/winsup.api/ltp/unlink05.c
winsup/testsuite/winsup.api/ltp/unlink06.c
winsup/testsuite/winsup.api/ltp/unlink07.c
winsup/testsuite/winsup.api/ltp/unlink08.c
winsup/testsuite/winsup.api/ltp/vfork01.c
winsup/testsuite/winsup.api/ltp/wait02.c
winsup/testsuite/winsup.api/ltp/wait401.c
winsup/testsuite/winsup.api/ltp/wait402.c
winsup/testsuite/winsup.api/ltp/write01.c
winsup/testsuite/winsup.api/ltp/write02.c
winsup/testsuite/winsup.api/ltp/write03.c
winsup/testsuite/winsup.api/mmaptest01.c
winsup/testsuite/winsup.api/mmaptest02.c
winsup/testsuite/winsup.api/mmaptest03.c
winsup/testsuite/winsup.api/mmaptest04.c
winsup/testsuite/winsup.api/msgtest.c
winsup/testsuite/winsup.api/nullgetcwd.c
winsup/testsuite/winsup.api/pthread/cancel1.c
winsup/testsuite/winsup.api/pthread/cancel10.c
winsup/testsuite/winsup.api/pthread/cancel11.c
winsup/testsuite/winsup.api/pthread/cancel12.c
winsup/testsuite/winsup.api/pthread/cancel2.c
winsup/testsuite/winsup.api/pthread/cancel3.c
winsup/testsuite/winsup.api/pthread/cancel4.c
winsup/testsuite/winsup.api/pthread/cancel5.c
winsup/testsuite/winsup.api/pthread/cancel6.c
winsup/testsuite/winsup.api/pthread/cancel7.c
winsup/testsuite/winsup.api/pthread/cancel8.c
winsup/testsuite/winsup.api/pthread/cancel9.c
winsup/testsuite/winsup.api/pthread/cleanup2.c
winsup/testsuite/winsup.api/pthread/cleanup3.c
winsup/testsuite/winsup.api/pthread/condvar1.c
winsup/testsuite/winsup.api/pthread/condvar2.c
winsup/testsuite/winsup.api/pthread/condvar2_1.c
winsup/testsuite/winsup.api/pthread/condvar3.c
winsup/testsuite/winsup.api/pthread/condvar3_1.c
winsup/testsuite/winsup.api/pthread/condvar3_2.c
winsup/testsuite/winsup.api/pthread/condvar3_3.c
winsup/testsuite/winsup.api/pthread/condvar4.c
winsup/testsuite/winsup.api/pthread/condvar5.c
winsup/testsuite/winsup.api/pthread/condvar6.c
winsup/testsuite/winsup.api/pthread/condvar7.c
winsup/testsuite/winsup.api/pthread/condvar8.c
winsup/testsuite/winsup.api/pthread/condvar9.c
winsup/testsuite/winsup.api/pthread/count1.c
winsup/testsuite/winsup.api/pthread/create1.c
winsup/testsuite/winsup.api/pthread/create2.c
winsup/testsuite/winsup.api/pthread/equal1.c
winsup/testsuite/winsup.api/pthread/exit1.c
winsup/testsuite/winsup.api/pthread/exit2.c
winsup/testsuite/winsup.api/pthread/exit3.c
winsup/testsuite/winsup.api/pthread/inherit1.c
winsup/testsuite/winsup.api/pthread/join0.c
winsup/testsuite/winsup.api/pthread/join1.c
winsup/testsuite/winsup.api/pthread/join2.c
winsup/testsuite/winsup.api/pthread/mainthreadexits.c
winsup/testsuite/winsup.api/pthread/mutex1.c
winsup/testsuite/winsup.api/pthread/mutex1d.c
winsup/testsuite/winsup.api/pthread/mutex1e.c
winsup/testsuite/winsup.api/pthread/mutex1n.c
winsup/testsuite/winsup.api/pthread/mutex1r.c
winsup/testsuite/winsup.api/pthread/mutex2.c
winsup/testsuite/winsup.api/pthread/mutex3.c
winsup/testsuite/winsup.api/pthread/mutex4.c
winsup/testsuite/winsup.api/pthread/mutex5.c
winsup/testsuite/winsup.api/pthread/mutex6d.c
winsup/testsuite/winsup.api/pthread/mutex6e.c
winsup/testsuite/winsup.api/pthread/mutex6n.c
winsup/testsuite/winsup.api/pthread/mutex6r.c
winsup/testsuite/winsup.api/pthread/mutex7.c
winsup/testsuite/winsup.api/pthread/mutex7d.c
winsup/testsuite/winsup.api/pthread/mutex7e.c
winsup/testsuite/winsup.api/pthread/mutex7n.c
winsup/testsuite/winsup.api/pthread/mutex7r.c
winsup/testsuite/winsup.api/pthread/mutex8e.c
winsup/testsuite/winsup.api/pthread/mutex8n.c
winsup/testsuite/winsup.api/pthread/mutex8r.c
winsup/testsuite/winsup.api/pthread/once1.c
winsup/testsuite/winsup.api/pthread/priority1.c
winsup/testsuite/winsup.api/pthread/priority2.c
winsup/testsuite/winsup.api/pthread/rwlock1.c
winsup/testsuite/winsup.api/pthread/rwlock2.c
winsup/testsuite/winsup.api/pthread/rwlock3.c
winsup/testsuite/winsup.api/pthread/rwlock4.c
winsup/testsuite/winsup.api/pthread/rwlock5.c
winsup/testsuite/winsup.api/pthread/rwlock6.c
winsup/testsuite/winsup.api/pthread/rwlock7.c
winsup/testsuite/winsup.api/pthread/self1.c
winsup/testsuite/winsup.api/pthread/self2.c
winsup/testsuite/winsup.api/pthread/test.h
winsup/testsuite/winsup.api/pthread/threadidafterfork.c
winsup/testsuite/winsup.api/pthread/tsd1.c
winsup/testsuite/winsup.api/samples/sample-fail.c
winsup/testsuite/winsup.api/samples/sample-miscompile.c
winsup/testsuite/winsup.api/samples/sample-pass.c
winsup/testsuite/winsup.api/semtest.c
winsup/testsuite/winsup.api/shmtest.c
winsup/testsuite/winsup.api/sigchld.c
winsup/testsuite/winsup.api/signal-into-win32-api.c
winsup/testsuite/winsup.api/systemcall.c
winsup/testsuite/winsup.api/waitpid.c
winsup/testsuite/winsup.api/winsup.exp
winsup/utils/ChangeLog
winsup/utils/ChangeLog-2000
winsup/utils/Makefile.in
winsup/utils/aclocal.m4
winsup/utils/configure
winsup/utils/configure.in
winsup/utils/cygcheck.cc
winsup/utils/cygpath.cc
winsup/utils/dump_setup.cc
winsup/utils/dumper.cc
winsup/utils/dumper.h
winsup/utils/getfacl.c
winsup/utils/ipcrm.c
winsup/utils/ipcs.c
winsup/utils/kill.cc
winsup/utils/mkgroup.c
winsup/utils/mkpasswd.c
winsup/utils/module_info.cc
winsup/utils/mount.cc
winsup/utils/parse_pe.cc
winsup/utils/passwd.c
winsup/utils/path.cc
winsup/utils/path.h
winsup/utils/ps.cc
winsup/utils/regtool.cc
winsup/utils/setfacl.c
winsup/utils/ssp.c
winsup/utils/ssp.txt
winsup/utils/strace.cc
winsup/utils/umount.cc
winsup/utils/utils.sgml
winsup/w32api/CONTRIBUTIONS
winsup/w32api/ChangeLog
winsup/w32api/Makefile.in
winsup/w32api/README.w32api
winsup/w32api/TODO
winsup/w32api/config.guess
winsup/w32api/config.sub
winsup/w32api/configure
winsup/w32api/configure.in
winsup/w32api/include/GL/gl.h
winsup/w32api/include/GL/glext.h
winsup/w32api/include/GL/glu.h
winsup/w32api/include/accctrl.h
winsup/w32api/include/aclapi.h
winsup/w32api/include/aclui.h
winsup/w32api/include/afxres.h
winsup/w32api/include/basetsd.h
winsup/w32api/include/basetyps.h
winsup/w32api/include/cderr.h
winsup/w32api/include/cguid.h
winsup/w32api/include/comcat.h
winsup/w32api/include/commctrl.h
winsup/w32api/include/commdlg.h
winsup/w32api/include/cpl.h
winsup/w32api/include/cplext.h
winsup/w32api/include/custcntl.h
winsup/w32api/include/dbt.h
winsup/w32api/include/dde.h
winsup/w32api/include/ddeml.h
winsup/w32api/include/ddk/atm.h
winsup/w32api/include/ddk/batclass.h
winsup/w32api/include/ddk/cfg.h
winsup/w32api/include/ddk/cfgmgr32.h
winsup/w32api/include/ddk/d4drvif.h
winsup/w32api/include/ddk/d4iface.h
winsup/w32api/include/ddk/ddkmapi.h
winsup/w32api/include/ddk/hidclass.h
winsup/w32api/include/ddk/hidpi.h
winsup/w32api/include/ddk/hidusage.h
winsup/w32api/include/ddk/mcd.h
winsup/w32api/include/ddk/miniport.h
winsup/w32api/include/ddk/minitape.h
winsup/w32api/include/ddk/mountdev.h
winsup/w32api/include/ddk/mountmgr.h
winsup/w32api/include/ddk/ndis.h
winsup/w32api/include/ddk/ndisguid.h
winsup/w32api/include/ddk/ndistapi.h
winsup/w32api/include/ddk/ndiswan.h
winsup/w32api/include/ddk/netevent.h
winsup/w32api/include/ddk/netpnp.h
winsup/w32api/include/ddk/newdev.h
winsup/w32api/include/ddk/ntapi.h
winsup/w32api/include/ddk/ntdd8042.h
winsup/w32api/include/ddk/ntddbeep.h
winsup/w32api/include/ddk/ntddcdrm.h
winsup/w32api/include/ddk/ntddcdvd.h
winsup/w32api/include/ddk/ntddchgr.h
winsup/w32api/include/ddk/ntdddisk.h
winsup/w32api/include/ddk/ntddk.h
winsup/w32api/include/ddk/ntddkbd.h
winsup/w32api/include/ddk/ntddmou.h
winsup/w32api/include/ddk/ntddndis.h
winsup/w32api/include/ddk/ntddpar.h
winsup/w32api/include/ddk/ntddpcm.h
winsup/w32api/include/ddk/ntddscsi.h
winsup/w32api/include/ddk/ntddser.h
winsup/w32api/include/ddk/ntddstor.h
winsup/w32api/include/ddk/ntddtape.h
winsup/w32api/include/ddk/ntddtdi.h
winsup/w32api/include/ddk/ntddvdeo.h
winsup/w32api/include/ddk/ntddvol.h
winsup/w32api/include/ddk/ntifs.h
winsup/w32api/include/ddk/ntpoapi.h
winsup/w32api/include/ddk/ntstatus.h
winsup/w32api/include/ddk/parallel.h
winsup/w32api/include/ddk/pfhook.h
winsup/w32api/include/ddk/poclass.h
winsup/w32api/include/ddk/scsi.h
winsup/w32api/include/ddk/scsiscan.h
winsup/w32api/include/ddk/scsiwmi.h
winsup/w32api/include/ddk/smbus.h
winsup/w32api/include/ddk/srb.h
winsup/w32api/include/ddk/storport.h
winsup/w32api/include/ddk/tdi.h
winsup/w32api/include/ddk/tdiinfo.h
winsup/w32api/include/ddk/tdikrnl.h
winsup/w32api/include/ddk/tdistat.h
winsup/w32api/include/ddk/tvout.h
winsup/w32api/include/ddk/upssvc.h
winsup/w32api/include/ddk/usb.h
winsup/w32api/include/ddk/usb100.h
winsup/w32api/include/ddk/usbcamdi.h
winsup/w32api/include/ddk/usbdi.h
winsup/w32api/include/ddk/usbioctl.h
winsup/w32api/include/ddk/usbiodef.h
winsup/w32api/include/ddk/usbscan.h
winsup/w32api/include/ddk/usbuser.h
winsup/w32api/include/ddk/video.h
winsup/w32api/include/ddk/videoagp.h
winsup/w32api/include/ddk/win2k.h
winsup/w32api/include/ddk/winddi.h
winsup/w32api/include/ddk/winddk.h
winsup/w32api/include/ddk/winnt4.h
winsup/w32api/include/ddk/winxp.h
winsup/w32api/include/ddk/ws2san.h
winsup/w32api/include/ddk/xfilter.h
winsup/w32api/include/dhcpcsdk.h
winsup/w32api/include/directx/d3d9.h
winsup/w32api/include/directx/d3d9caps.h
winsup/w32api/include/directx/d3d9types.h
winsup/w32api/include/directx/dxerr8.h
winsup/w32api/include/directx/dxerr9.h
winsup/w32api/include/dlgs.h
winsup/w32api/include/docobj.h
winsup/w32api/include/errorrep.h
winsup/w32api/include/exdisp.h
winsup/w32api/include/exdispid.h
winsup/w32api/include/httpext.h
winsup/w32api/include/idispids.h
winsup/w32api/include/imagehlp.h
winsup/w32api/include/imm.h
winsup/w32api/include/initguid.h
winsup/w32api/include/intshcut.h
winsup/w32api/include/ipexport.h
winsup/w32api/include/iphlpapi.h
winsup/w32api/include/ipifcons.h
winsup/w32api/include/iprtrmib.h
winsup/w32api/include/iptypes.h
winsup/w32api/include/isguids.h
winsup/w32api/include/largeint.h
winsup/w32api/include/lm.h
winsup/w32api/include/lmaccess.h
winsup/w32api/include/lmalert.h
winsup/w32api/include/lmapibuf.h
winsup/w32api/include/lmat.h
winsup/w32api/include/lmaudit.h
winsup/w32api/include/lmbrowsr.h
winsup/w32api/include/lmchdev.h
winsup/w32api/include/lmconfig.h
winsup/w32api/include/lmcons.h
winsup/w32api/include/lmerr.h
winsup/w32api/include/lmerrlog.h
winsup/w32api/include/lmmsg.h
winsup/w32api/include/lmremutl.h
winsup/w32api/include/lmrepl.h
winsup/w32api/include/lmserver.h
winsup/w32api/include/lmshare.h
winsup/w32api/include/lmsname.h
winsup/w32api/include/lmstats.h
winsup/w32api/include/lmsvc.h
winsup/w32api/include/lmuse.h
winsup/w32api/include/lmuseflg.h
winsup/w32api/include/lmwksta.h
winsup/w32api/include/lzexpand.h
winsup/w32api/include/mapi.h
winsup/w32api/include/mciavi.h
winsup/w32api/include/mcx.h
winsup/w32api/include/mgmtapi.h
winsup/w32api/include/mmsystem.h
winsup/w32api/include/msacm.h
winsup/w32api/include/mshtml.h
winsup/w32api/include/mswsock.h
winsup/w32api/include/nb30.h
winsup/w32api/include/nddeapi.h
winsup/w32api/include/nspapi.h
winsup/w32api/include/ntdef.h
winsup/w32api/include/ntdll.h
winsup/w32api/include/ntldap.h
winsup/w32api/include/ntsecapi.h
winsup/w32api/include/ntsecpkg.h
winsup/w32api/include/oaidl.h
winsup/w32api/include/objbase.h
winsup/w32api/include/objfwd.h
winsup/w32api/include/objidl.h
winsup/w32api/include/ocidl.h
winsup/w32api/include/odbcinst.h
winsup/w32api/include/ole.h
winsup/w32api/include/ole2.h
winsup/w32api/include/ole2ver.h
winsup/w32api/include/oleacc.h
winsup/w32api/include/oleauto.h
winsup/w32api/include/olectl.h
winsup/w32api/include/olectlid.h
winsup/w32api/include/oledlg.h
winsup/w32api/include/oleidl.h
winsup/w32api/include/pbt.h
winsup/w32api/include/poppack.h
winsup/w32api/include/powrprof.h
winsup/w32api/include/prsht.h
winsup/w32api/include/psapi.h
winsup/w32api/include/pshpack1.h
winsup/w32api/include/pshpack2.h
winsup/w32api/include/pshpack4.h
winsup/w32api/include/pshpack8.h
winsup/w32api/include/rapi.h
winsup/w32api/include/ras.h
winsup/w32api/include/rasdlg.h
winsup/w32api/include/raserror.h
winsup/w32api/include/rassapi.h
winsup/w32api/include/regstr.h
winsup/w32api/include/richedit.h
winsup/w32api/include/richole.h
winsup/w32api/include/rpc.h
winsup/w32api/include/rpcdce.h
winsup/w32api/include/rpcdce2.h
winsup/w32api/include/rpcdcep.h
winsup/w32api/include/rpcndr.h
winsup/w32api/include/rpcnsi.h
winsup/w32api/include/rpcnsip.h
winsup/w32api/include/rpcnterr.h
winsup/w32api/include/rpcproxy.h
winsup/w32api/include/schannel.h
winsup/w32api/include/schnlsp.h
winsup/w32api/include/scrnsave.h
winsup/w32api/include/secext.h
winsup/w32api/include/security.h
winsup/w32api/include/servprov.h
winsup/w32api/include/setupapi.h
winsup/w32api/include/shellapi.h
winsup/w32api/include/shlguid.h
winsup/w32api/include/shlobj.h
winsup/w32api/include/shlwapi.h
winsup/w32api/include/snmp.h
winsup/w32api/include/sql.h
winsup/w32api/include/sqlext.h
winsup/w32api/include/sqltypes.h
winsup/w32api/include/sqlucode.h
winsup/w32api/include/sspi.h
winsup/w32api/include/subauth.h
winsup/w32api/include/svcguid.h
winsup/w32api/include/tlhelp32.h
winsup/w32api/include/tmschema.h
winsup/w32api/include/unknwn.h
winsup/w32api/include/userenv.h
winsup/w32api/include/uxtheme.h
winsup/w32api/include/vfw.h
winsup/w32api/include/w32api.h
winsup/w32api/include/winable.h
winsup/w32api/include/winbase.h
winsup/w32api/include/winber.h
winsup/w32api/include/wincon.h
winsup/w32api/include/wincrypt.h
winsup/w32api/include/windef.h
winsup/w32api/include/windns.h
winsup/w32api/include/windows.h
winsup/w32api/include/windowsx.h
winsup/w32api/include/winerror.h
winsup/w32api/include/wingdi.h
winsup/w32api/include/wininet.h
winsup/w32api/include/winioctl.h
winsup/w32api/include/winldap.h
winsup/w32api/include/winnetwk.h
winsup/w32api/include/winnls.h
winsup/w32api/include/winnt.h
winsup/w32api/include/winperf.h
winsup/w32api/include/winreg.h
winsup/w32api/include/winresrc.h
winsup/w32api/include/winsnmp.h
winsup/w32api/include/winsock.h
winsup/w32api/include/winsock2.h
winsup/w32api/include/winspool.h
winsup/w32api/include/winsvc.h
winsup/w32api/include/winuser.h
winsup/w32api/include/winver.h
winsup/w32api/include/ws2spi.h
winsup/w32api/include/ws2tcpip.h
winsup/w32api/include/wsahelp.h
winsup/w32api/include/wsipx.h
winsup/w32api/include/wsnetbs.h
winsup/w32api/include/wtypes.h
winsup/w32api/include/zmouse.h
winsup/w32api/install-sh
winsup/w32api/lib/Makefile.in
winsup/w32api/lib/aclui.def
winsup/w32api/lib/advapi32.def
winsup/w32api/lib/avicap32.def
winsup/w32api/lib/avifil32.def
winsup/w32api/lib/cap.def
winsup/w32api/lib/comctl32.def
winsup/w32api/lib/comdlg32.def
winsup/w32api/lib/crypt32.def
winsup/w32api/lib/ctl3d32.def
winsup/w32api/lib/ddk/Makefile.in
winsup/w32api/lib/ddk/apcups.def
winsup/w32api/lib/ddk/cfgmgr32.def
winsup/w32api/lib/ddk/dxapi.def
winsup/w32api/lib/ddk/hal.def
winsup/w32api/lib/ddk/hid.def
winsup/w32api/lib/ddk/hidparse.def
winsup/w32api/lib/ddk/mcd.def
winsup/w32api/lib/ddk/ndis.def
winsup/w32api/lib/ddk/ntoskrnl.def
winsup/w32api/lib/ddk/scsiport.def
winsup/w32api/lib/ddk/tdi.def
winsup/w32api/lib/ddk/usbcamd.def
winsup/w32api/lib/ddk/usbcamd2.def
winsup/w32api/lib/ddk/videoprt.def
winsup/w32api/lib/ddk/win32k.def
winsup/w32api/lib/dhcpcsvc.def
winsup/w32api/lib/directx/Makefile.in
winsup/w32api/lib/directx/d3d8.def
winsup/w32api/lib/directx/d3d9.def
winsup/w32api/lib/directx/d3dim.def
winsup/w32api/lib/directx/d3drm.def
winsup/w32api/lib/directx/d3dx8d.def
winsup/w32api/lib/directx/d3dx9d.def
winsup/w32api/lib/directx/d3dxof.def
winsup/w32api/lib/directx/ddraw.def
winsup/w32api/lib/directx/dinput.def
winsup/w32api/lib/directx/dinput8.def
winsup/w32api/lib/directx/dinput_joy.c
winsup/w32api/lib/directx/dinput_joy2.c
winsup/w32api/lib/directx/dinput_kbd.c
winsup/w32api/lib/directx/dinput_mouse.c
winsup/w32api/lib/directx/dinput_mouse2.c
winsup/w32api/lib/directx/dinput_private.h
winsup/w32api/lib/directx/dmoguids.c
winsup/w32api/lib/directx/dplayx.def
winsup/w32api/lib/directx/dpnaddr.def
winsup/w32api/lib/directx/dpnet.def
winsup/w32api/lib/directx/dpnlobby.def
winsup/w32api/lib/directx/dpvoice.def
winsup/w32api/lib/directx/dsetup.def
winsup/w32api/lib/directx/dsound.def
winsup/w32api/lib/directx/dxerr.c
winsup/w32api/lib/directx/dxerr8.c
winsup/w32api/lib/directx/dxerr8w.c
winsup/w32api/lib/directx/dxerr9.c
winsup/w32api/lib/directx/dxerr9w.c
winsup/w32api/lib/directx/dxguid.c
winsup/w32api/lib/directx/ksproxy.def
winsup/w32api/lib/directx/ksuser.c
winsup/w32api/lib/directx/ksuser.def
winsup/w32api/lib/directx/msdmo.def
winsup/w32api/lib/directx/quartz.def
winsup/w32api/lib/directx/strmiids.c
winsup/w32api/lib/directx/test.c
winsup/w32api/lib/dlcapi.def
winsup/w32api/lib/dnsapi.def
winsup/w32api/lib/faultrep.def
winsup/w32api/lib/gdi32.def
winsup/w32api/lib/glaux.def
winsup/w32api/lib/glu32.def
winsup/w32api/lib/glut.def
winsup/w32api/lib/glut32.def
winsup/w32api/lib/igmpagnt.def
winsup/w32api/lib/imagehlp.def
winsup/w32api/lib/imm32.def
winsup/w32api/lib/iphlpapi.def
winsup/w32api/lib/kernel32.c
winsup/w32api/lib/kernel32.def
winsup/w32api/lib/largeint.c
winsup/w32api/lib/lz32.def
winsup/w32api/lib/mapi32.def
winsup/w32api/lib/mfcuia32.def
winsup/w32api/lib/mgmtapi.def
winsup/w32api/lib/mpr.def
winsup/w32api/lib/msacm32.def
winsup/w32api/lib/mshtml-uuid.c
winsup/w32api/lib/msimg32.def
winsup/w32api/lib/msvcp60.def
winsup/w32api/lib/msvfw32.def
winsup/w32api/lib/mswsock.def
winsup/w32api/lib/nddeapi.def
winsup/w32api/lib/netapi32.def
winsup/w32api/lib/ntdll.def
winsup/w32api/lib/odbc32.def
winsup/w32api/lib/odbccp32.def
winsup/w32api/lib/ole32.def
winsup/w32api/lib/oleacc.def
winsup/w32api/lib/oleaut32.def
winsup/w32api/lib/olecli32.def
winsup/w32api/lib/oledlg.def
winsup/w32api/lib/olepro32.def
winsup/w32api/lib/olesvr32.def
winsup/w32api/lib/opengl32.def
winsup/w32api/lib/penwin32.def
winsup/w32api/lib/pkpd32.def
winsup/w32api/lib/powrprof.def
winsup/w32api/lib/psapi.def
winsup/w32api/lib/rapi.def
winsup/w32api/lib/rasapi32.def
winsup/w32api/lib/rasdlg.def
winsup/w32api/lib/res.rc
winsup/w32api/lib/rpcdce4.def
winsup/w32api/lib/rpcns4.def
winsup/w32api/lib/rpcrt4.def
winsup/w32api/lib/scrnsave.c
winsup/w32api/lib/secur32.def
winsup/w32api/lib/setupapi.def
winsup/w32api/lib/shell32.c
winsup/w32api/lib/shell32.def
winsup/w32api/lib/shfolder.def
winsup/w32api/lib/shlwapi.def
winsup/w32api/lib/snmpapi.def
winsup/w32api/lib/svrapi.def
winsup/w32api/lib/tapi32.def
winsup/w32api/lib/test.c
winsup/w32api/lib/th32.def
winsup/w32api/lib/thunk32.def
winsup/w32api/lib/url.def
winsup/w32api/lib/user32.def
winsup/w32api/lib/userenv.def
winsup/w32api/lib/uuid.c
winsup/w32api/lib/uxtheme.def
winsup/w32api/lib/vdmdbg.def
winsup/w32api/lib/version.def
winsup/w32api/lib/vfw32.mri
winsup/w32api/lib/win32spl.def
winsup/w32api/lib/wininet.def
winsup/w32api/lib/winmm.def
winsup/w32api/lib/winspool.def
winsup/w32api/lib/winstrm.def
winsup/w32api/lib/wldap32.def
winsup/w32api/lib/wow32.def
winsup/w32api/lib/ws2_32.def
winsup/w32api/lib/wsnmp32.def
winsup/w32api/lib/wsock32.def
winsup/w32api/lib/wst.def
Diffstat (limited to 'winsup/mingw/mingwex')
218 files changed, 0 insertions, 17608 deletions
diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in deleted file mode 100644 index cc9e44040..000000000 --- a/winsup/mingw/mingwex/Makefile.in +++ /dev/null @@ -1,233 +0,0 @@ -# -# mingw/mingwex/Makefile.in: This file is part of Mingw runtime. -# -# This makefile requires GNU make. - -srcdir = @srcdir@ -VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex -objdir = . - -target_alias = @target_alias@ -prefix = @prefix@ - -program_transform_name = @program_transform_name@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(exec_prefix)/$(target_alias) -datadir = @datadir@ -infodir = @infodir@ -includedir = @includedir@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs -DISTFILES = Makefile.in configure configure.in \ - _Exit.c atoll.c dirent.c feclearexcept.c fegetenv.c \ - fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \ - fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \ - feupdateenv.c fwide.c getopt.c imaxabs.c imaxdiv.c ldtoa.c \ - lltoa.c lltow.c mbsinit.c mingw-fseek.c sitest.c strtof.c \ - strtoimax.c strtold.c strtoumax.c testwmem.c ulltoa.c ulltow.c \ - wcstof.c wcstoimax.c wcstold.c wcstoumax.c wdirent.c wmemchr.c \ - wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c - -MATH_DISTFILES = \ - acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \ - atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \ - cephes_emath.h cephes_emath.c cephes_mconf.h \ - copysign.S copysignf.S copysignl.S cosf.S coshf.c coshl.c cosl.S \ - exp2.S exp2f.S exp2l.S expf.c expl.c fabs.c fabsf.c fabsl.c \ - fdim.c fdimf.c fdiml.c floorf.S floorl.S fma.S fmaf.S fmal.c \ - fmax.c fmaxf.c fmaxl.c fmin.c fminf.c fminl.c fmodf.c \ - fmodl.c fp_consts.c fp_consts.h fp_constsf.c fp_constsl.c \ - fpclassify.c fpclassifyf.c fpclassifyl.c \ - frexpf.c frexpl.S fucom.c hypotf.c hypotl.c ilogb.S ilogbf.S \ - ilogbl.S isnan.c isnanf.c isnanl.c ldexpf.c ldexpl.c \ - lgamma.c lgammaf.c lgammal.c llrint.c \ - llrintf.c llrintl.c llround.c llroundf.c llroundl.c \ - log10f.S log10l.S log1p.S log1pf.S log1pl.S log2.S log2f.S \ - log2l.S logb.c logbf.c logbl.c logf.S logl.S lrint.c lrintf.c \ - lrintl.c lround.c lroundf.c lroundl.c modff.c modfl.c \ - nearbyint.S nearbyintf.S nearbyintl.S nextafterf.c \ - pow.c powf.c powi.c powif.c powil.c powl.c \ - remainder.S remainderf.S remainderl.S remquo.S \ - remquof.S remquol.S rint.c rintf.c rintl.c round.c roundf.c \ - roundl.c scalbn.S scalbnf.S scalbnl.S s_erf.c sf_erf.c \ - signbit.c signbitf.c signbitl.c sinf.S sinhf.c sinhl.c sinl.S \ - sqrtf.c sqrtl.c tanf.S tanhf.c tanhl.c tanl.S tgamma.c \ - tgammaf.c tgammal.c trunc.c truncf.c truncl.c - -STDIO_DISTFILES = \ - snprintf.c snwprintf.c vsnprintf.c vsnwprintf.c \ - vfscanf.c vfwscanf.c vscanf.c vsscanf.c vswscanf.c vwscanf.c - -COMPLEX_DISTFILES = \ - cabs.c cacos.c cacosh.c casin.c casinh.c catan.c catanh.c \ - ccos.c ccosh.c cexp.c cimag.c clog.c cpow.c cproj.c creal.c \ - csin.c csinh.c csqrt.c ctan.c ctanh.c - -CC = @CC@ -# FIXME: Which is it, CC or CC_FOR_TARGET? -CC_FOR_TARGET = $(CC) -AS_FOR_TARGET = $(AS) -CFLAGS = @CFLAGS@ -Wall -CXXFLAGS = @CXXFLAGS@ -OPTFLAGS= -fomit-frame-pointer - -# compiling with Cygwin? -MNO_CYGWIN = @MNO_CYGWIN@ - -W32API_INCLUDE = @W32API_INCLUDE@ -INCLUDES = -I$(srcdir) -I$(srcdir)/../include \ - -nostdinc -nostdinc++ \ - -iwithprefixbefore include -ALL_CFLAGS = $(CFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN) -ALL_CXXFLAGS = $(CXXFLAGS) $(OPTFLAGS) $(W32API_INCLUDE) $(INCLUDES) $(MNO_CYGWIN) - -AS = @AS@ -AR = @AR@ -LD = @LD@ -AR_FLAGS = rcv -RANLIB = @RANLIB@ -DLLTOOL = @DLLTOOL@ -DLLTOOLFLAGS = -DLLTOOL_FOR_TARGET = $(DLLTOOL) -DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) - -LIBMINGWEX_A = libmingwex.a - -Q8_OBJS = \ - fwide.o imaxabs.o imaxdiv.o mbsinit.o \ - strtoimax.o strtoumax.o wcstoimax.o wcstoumax.o \ - wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o -STDLIB_OBJS = \ - strtold.o wcstold.o -STDLIB_STUB_OBJS = \ - lltoa.o ulltoa.o \ - lltow.o ulltow.o \ - atoll.o wtoll.o \ - strtof.o wcstof.o \ - _Exit.o -STDIO_OBJS = \ - snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o \ - vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o -MATH_OBJS = \ - acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \ - atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \ - cephes_emath.o \ - copysign.o copysignf.o copysignl.o cosf.o coshf.o coshl.o cosl.o \ - exp2.o exp2f.o exp2l.o expf.o expl.o fabs.o fabsf.o fabsl.o \ - fdim.o fdimf.o fdiml.o floorf.o floorl.o fma.o fmaf.o fmal.o \ - fmax.o fmaxf.o fmaxl.o fmin.o fminf.o fminl.o fmodf.o \ - fmodl.o fp_consts.o fp_constsf.o fp_constsl.o \ - fpclassify.o fpclassifyf.o fpclassifyl.o \ - frexpf.o frexpl.o fucom.o hypotf.o hypotl.o ilogb.o ilogbf.o \ - ilogbl.o isnan.o isnanf.o isnanl.o ldexpf.o ldexpl.o \ - lgamma.o lgammaf.o lgammal.o llrint.o \ - llrintf.o llrintl.o llround.o llroundf.o llroundl.o \ - log10f.o log10l.o log1p.o log1pf.o log1pl.o log2.o log2f.o \ - log2l.o logb.o logbf.o logbl.o logf.o logl.o lrint.o lrintf.o \ - lrintl.o lround.o lroundf.o lroundl.o modff.o modfl.o \ - nearbyint.o nearbyintf.o nearbyintl.o nextafterf.o \ - pow.o powf.o powi.o powif.o powil.o powl.o \ - remainder.o remainderf.o remainderl.o remquo.o \ - remquof.o remquol.o rint.o rintf.o rintl.o round.o roundf.o \ - roundl.o scalbn.o scalbnf.o scalbnl.o s_erf.o sf_erf.o \ - signbit.o signbitf.o signbitl.o sinf.o sinhf.o sinhl.o sinl.o \ - sqrtf.o sqrtl.o tanf.o tanhf.o tanhl.o tanl.o tgamma.o \ - tgammaf.o tgammal.o trunc.o truncf.o truncl.o -FENV_OBJS = fesetround.o fegetround.o \ - fegetenv.o fesetenv.o feupdateenv.o \ - feclearexcept.o feholdexcept.o fegetexceptflag.o \ - feraiseexcept.o fetestexcept.o fesetexceptflag.o -POSIX_OBJS = \ - dirent.o wdirent.o getopt.o -REPLACE_OBJS = \ - mingw-fseek.o -COMPLEX_OBJS = \ - cabs.o cacos.o cacosh.o casin.o casinh.o catan.o catanh.o \ - ccos.o ccosh.o cexp.o cimag.o clog.o cpow.o cproj.o creal.o \ - csin.o csinh.o csqrt.o ctan.o ctanh.o - -LIB_OBJS = $(Q8_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \ - $(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \ - $(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS) - -LIBS = $(LIBMINGWEX_A) -DLLS = - -all: $(LIBMINGWEX_A) - -$(LIBMINGWEX_A): $(LIB_OBJS) - rm -f $(LIBMINGWEX_A) - $(AR) $(ARFLAGS) $@ $(LIB_OBJS) - $(RANLIB) $@ - - -Makefile: Makefile.in config.status configure - $(SHELL) config.status - -config.status: configure - $(SHELL) config.status --recheck - -info: - -info-html: - -install-info: info - -install: all - $(mkinstalldirs) $(inst_libdir) - for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - -clean: - -rm -f $(LIB_OBJS) $(LIBMINGWEX_A) - -distclean: - -rm -f *.o *.a *~ core a.out - -rm -f config.cache config.status config.log - -rm -f Makefile -.c.o: - $(CC) -c $(ALL_CFLAGS) $< -o $@ -.S.o: - $(CC) -c $< -o $@ -.s.o: - $(CC) -c $< -o $@ - - -# -# Dependancies -# -wdirent.o: $(srcdir)/dirent.c $(srcdir)/wdirent.c -strtold.o: $(srcdir)/strtold.c $(srcdir)/math/cephes_emath.h -wcstold.o: $(srcdir)/wcstold.c $(srcdir)/math/cephes_emath.h - - -dist: - mkdir $(distdir)/mingwex - chmod 755 $(distdir)/mingwex - @for i in $(DISTFILES); do\ - cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \ - done - mkdir $(distdir)/mingwex/math - chmod 755 $(distdir)/mingwex/math - @for i in $(MATH_DISTFILES); do\ - cp -p $(srcdir)/math/$$i $(distdir)/mingwex/math/$$i ; \ - done - mkdir $(distdir)/mingwex/stdio - chmod 755 $(distdir)/mingwex/stdio - @for i in $(STDIO_DISTFILES); do\ - cp -p $(srcdir)/stdio/$$i $(distdir)/mingwex/stdio/$$i ; \ - done - mkdir $(distdir)/mingwex/complex - chmod 755 $(distdir)/mingwex/complex - @for i in $(COMPLEX_DISTFILES); do\ - cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/complex/$$i ; \ - done - diff --git a/winsup/mingw/mingwex/_Exit.c b/winsup/mingw/mingwex/_Exit.c deleted file mode 100644 index 38f7e182e..000000000 --- a/winsup/mingw/mingwex/_Exit.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -void _Exit(int status) - { _exit(status); } diff --git a/winsup/mingw/mingwex/atoll.c b/winsup/mingw/mingwex/atoll.c deleted file mode 100644 index 97920b4ee..000000000 --- a/winsup/mingw/mingwex/atoll.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -long long atoll (const char * _c) - { return _atoi64 (_c); } diff --git a/winsup/mingw/mingwex/complex/cabs.c b/winsup/mingw/mingwex/complex/cabs.c deleted file mode 100644 index ff547dd6e..000000000 --- a/winsup/mingw/mingwex/complex/cabs.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> -#include <complex.h> - -double cabs (double complex Z) -{ - return _hypot ( __real__ Z, __imag__ Z); -} diff --git a/winsup/mingw/mingwex/complex/cacos.c b/winsup/mingw/mingwex/complex/cacos.c deleted file mode 100644 index 265cba0d7..000000000 --- a/winsup/mingw/mingwex/complex/cacos.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - cacos.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacos (Z) = -I * clog(Z + I * csqrt(1 - Z * Z)) */ - -double complex cacos (double complex Z) -{ - double complex Res; - double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0) - { - __real__ Res = acos (x); - __imag__ Res = 0.0; - } - - else - { - double complex ZZ; - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* caculate 1 - Z * Z */ - __real__ ZZ = 1.0 - (x - y) * (x + y); - __imag__ ZZ = -2.0 * x * y; - - - Res = csqrt(ZZ); - - /* calculate ZZ + I * sqrt (ZZ) */ - - __real__ ZZ = x - __imag__ Res; - __imag__ ZZ = y + __real__ Res; - - ZZ = clog(ZZ); - - /* mult by -I */ - - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return Res; -} - -#else - -/* cacos ( Z ) = pi/2 - casin ( Z ) */ - -double complex cacos (double complex Z) -{ - double complex Res = casin (Z); - __real__ Res = M_PI_2 - __real__ Res; - __imag__ Res = - __imag__ Res; - return Res; -} -#endif - -#if 0 -#include <stdio.h> -int main() -{ - double z; - double complex bar = 0.7 + 1.2 * I; - double complex foo = cacos (bar); - - printf ("%.16e\t%.16e\n", __real__ foo, __imag__ foo); - - foo = cacos (bar); - printf ("%.16e\t%.16e\n", __real__ foo, __imag__ foo); - - return 1; -} -#endif - diff --git a/winsup/mingw/mingwex/complex/cacosh.c b/winsup/mingw/mingwex/complex/cacosh.c deleted file mode 100644 index 34469cb56..000000000 --- a/winsup/mingw/mingwex/complex/cacosh.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - cacosh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacosh (z) = I * cacos (z) */ -double complex cacosh (double complex Z) -{ - double complex Tmp; - double complex Res; - - Tmp = cacos (Z); - __real__ Res = -__imag__ Tmp; - __imag__ Res = __real__ Tmp; - return Res; -} - -#else - -/* cacosh (z) = I * cacos (z) = I * (pi/2 - casin (z)) */ - -double complex cacosh (double complex Z) -{ - double complex Tmp; - double complex Res; - - Tmp = casin (Z); - __real__ Res = __imag__ Tmp; - __imag__ Res = M_PI_2 - __real__ Tmp; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/casin.c b/winsup/mingw/mingwex/complex/casin.c deleted file mode 100644 index cd79767b5..000000000 --- a/winsup/mingw/mingwex/complex/casin.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - casin.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */ - -double complex casin (double complex Z) -{ - double complex Res; - double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0) - { - __real__ Res = asin (x); - __imag__ Res = 0.0; - } - else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */ - { - double complex ZZ; - - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* calculate 1 - Z * Z */ - __real__ ZZ = 1.0 - (x - y) * (x + y); - __imag__ ZZ = -2.0 * x * y; - ZZ = csqrt (ZZ); - - - /* add I * Z to ZZ */ - - __real__ ZZ -= y; - __imag__ ZZ += x; - - ZZ = clog (ZZ); - - /* mult by -I */ - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return (Res); -} diff --git a/winsup/mingw/mingwex/complex/casinh.c b/winsup/mingw/mingwex/complex/casinh.c deleted file mode 100644 index a86c1d625..000000000 --- a/winsup/mingw/mingwex/complex/casinh.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - casinh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* casinh (z) = -I casin (I * z) */ - -double complex casinh (double complex Z) -{ - double complex Tmp; - double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = casin (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catan.c b/winsup/mingw/mingwex/complex/catan.c deleted file mode 100644 index eee1e8fa7..000000000 --- a/winsup/mingw/mingwex/complex/catan.c +++ /dev/null @@ -1,49 +0,0 @@ -/* catan.c */ - -/* - Contributed by Danny Smith - 2003-10-17 - - FIXME: This needs some serious numerical analysis. -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */ - -double complex -catan (double complex Z) -{ - double complex Res; - double complex Tmp; - double x = __real__ Z; - double y = __imag__ Z; - - if ( x == 0.0 && (1.0 - fabs (y)) == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if (isinf (_hypot (x, y))) - { - __real__ Res = (x > 0 ? M_PI_2 : -M_PI_2); - __imag__ Res = 0.0; - } - else - { - __real__ Tmp = - x; - __imag__ Tmp = 1.0 - y; - - __real__ Res = x; - __imag__ Res = y + 1.0; - - Tmp = clog (Res/Tmp); - __real__ Res = - 0.5 * __imag__ Tmp; - __imag__ Res = 0.5 * __real__ Tmp; - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanh.c b/winsup/mingw/mingwex/complex/catanh.c deleted file mode 100644 index 78f028014..000000000 --- a/winsup/mingw/mingwex/complex/catanh.c +++ /dev/null @@ -1,23 +0,0 @@ -/* catanh.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* catanh (z) = -I * catan (I * z) */ - -double complex catanh (double complex Z) -{ - double complex Tmp; - double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = catan (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccos.c b/winsup/mingw/mingwex/complex/ccos.c deleted file mode 100644 index ef5b5a70e..000000000 --- a/winsup/mingw/mingwex/complex/ccos.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - ccos.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* ccos (x + I * y) = cos (x) * cosh (y) - + I * (sin (x) * sinh (y)) */ - - -double complex ccos (double complex Z) -{ - double complex Res; - __real__ Res = cos (__real__ Z) * cosh ( __imag__ Z); - __imag__ Res = -sin (__real__ Z) * sinh ( __imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccosh.c b/winsup/mingw/mingwex/complex/ccosh.c deleted file mode 100644 index 8d304fd0e..000000000 --- a/winsup/mingw/mingwex/complex/ccosh.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - ccosh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* ccosh (x + I * y) = cosh (x) * cos (y) - + I * (sinh (x) * sin (y)) */ - -double complex ccosh (double complex Z) -{ - double complex Res; - __real__ Res = cosh (__real__ Z) * cos (__imag__ Z); - __imag__ Res = sinh (__real__ Z) * sin (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cexp.c b/winsup/mingw/mingwex/complex/cexp.c deleted file mode 100644 index 43ac9ab9e..000000000 --- a/winsup/mingw/mingwex/complex/cexp.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - cexp.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* cexp (x + I * y) = exp (x) * cos (y) + I * exp (x) * sin (y) */ - -double complex cexp (double complex Z) -{ - double complex Res; - long double rho = exp (__real__ Z); - __real__ Res = rho * cos(__imag__ Z); - __imag__ Res = rho * sin(__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cimag.c b/winsup/mingw/mingwex/complex/cimag.c deleted file mode 100644 index b6b32561c..000000000 --- a/winsup/mingw/mingwex/complex/cimag.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -double __attribute__ ((const)) cimag (double complex _Z) -{ - return __imag__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/clog.c b/winsup/mingw/mingwex/complex/clog.c deleted file mode 100644 index 57c51ebb0..000000000 --- a/winsup/mingw/mingwex/complex/clog.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - clog.c - Contributed by Danny Smith - 2003-10-20 -*/ - -/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */ - -#include <math.h> -#include <complex.h> - -double complex clog (double complex Z) -{ - double complex Res; - __real__ Res = log (_hypot (__real__ Z, __imag__ Z)); - __imag__ Res = carg (Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cpow.c b/winsup/mingw/mingwex/complex/cpow.c deleted file mode 100644 index c12b12fc0..000000000 --- a/winsup/mingw/mingwex/complex/cpow.c +++ /dev/null @@ -1,48 +0,0 @@ -/* cpow.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -/* cpow(X, Y) = cexp(X * clog(Y)) */ - -#include <math.h> -#include <complex.h> - -/* Use dll version of pow */ -extern double (*_imp__pow) (double, double); -#define pow (*_imp__pow) - -double complex cpow (double complex X, double complex Y) -{ - double complex Res; - double i; - double r = hypot (__real__ X, __imag__ X); - if (r == 0.0) - { - __real__ Res = __imag__ Res = 0.0; - } - else - { - double rho; - double theta; - i = carg (X); - theta = i * __real__ Y; - - if (__imag__ Y == 0.0) - /* This gives slightly more accurate results in these cases. */ - rho = pow (r, __real__ Y); - else - { - r = log (r); - /* rearrangement of cexp(X * clog(Y)) */ - theta += r * __imag__ Y; - rho = exp (r * __real__ Y - i * __imag__ Y); - } - - __real__ Res = rho * cos (theta); - __imag__ Res = rho * sin (theta); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cproj.c b/winsup/mingw/mingwex/complex/cproj.c deleted file mode 100644 index cc7c48d0f..000000000 --- a/winsup/mingw/mingwex/complex/cproj.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - cproj.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* Return the value of the projection onto the Riemann sphere.*/ - -double complex cproj (double complex Z) -{ - complex double Res = Z; - if (isinf (__real__ Z) || isinf (__imag__ Z)) - { - __real__ Res = HUGE_VAL; - __imag__ Res = copysign (0.0, __imag__ Z); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/creal.c b/winsup/mingw/mingwex/complex/creal.c deleted file mode 100644 index 6905b7e2a..000000000 --- a/winsup/mingw/mingwex/complex/creal.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -double __attribute__ ((const)) creal (double complex _Z) -{ - return __real__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/csin.c b/winsup/mingw/mingwex/complex/csin.c deleted file mode 100644 index 37df8057e..000000000 --- a/winsup/mingw/mingwex/complex/csin.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csin.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* csin (x + I * y) = sin (x) * cosh (y) - + I * (cos (x) * sinh (y)) */ - -double complex csin (double complex Z) -{ - double complex Res; - __real__ Res = sin (__real__ Z) * cosh ( __imag__ Z); - __imag__ Res = cos (__real__ Z) * sinh ( __imag__ Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/csinh.c b/winsup/mingw/mingwex/complex/csinh.c deleted file mode 100644 index 4ee6cbe86..000000000 --- a/winsup/mingw/mingwex/complex/csinh.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csinh.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - - -#include <math.h> -#include <complex.h> - -/* csinh (x + I * y) = sinh (x) * cos (y) - + I * (cosh (x) * sin (y)) */ - - -double complex csinh (double complex Z) -{ - double complex Res; - __real__ Res = sinh (__real__ Z) * cos (__imag__ Z); - __imag__ Res = cosh (__real__ Z) * sin (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/csqrt.c b/winsup/mingw/mingwex/complex/csqrt.c deleted file mode 100644 index 3717939f4..000000000 --- a/winsup/mingw/mingwex/complex/csqrt.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - csqrt.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -double complex csqrt (double complex Z) -{ - double complex Res; - double t; - double x = __real__ Z; - double y = __imag__ Z; - - if (y == 0.0) - { - if (x < 0.0) - { - __real__ Res = 0.0; - __imag__ Res = sqrt (-x); - } - else - { - __real__ Res = sqrt (x); - __imag__ Res = 0.0; - } - } - - else if (x == 0.0) - { - t = sqrt(0.5 * fabs (y)); - __real__ Res = y > 0 ? t : -t; - __imag__ Res = t; - } - - else - { - t = sqrt (2.0 * (_hypot (x, y) + fabs (x))); - if ( x > 0.0) - { - __real__ Res = 0.5 * t; - __imag__ Res = y / t; - } - else - { - __real__ Res = fabs ( y / t); - __imag__ Res = (y < 0.0 ? -0.5 : 0.5) * t; - } - } - - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/ctan.c b/winsup/mingw/mingwex/complex/ctan.c deleted file mode 100644 index a479772a9..000000000 --- a/winsup/mingw/mingwex/complex/ctan.c +++ /dev/null @@ -1,41 +0,0 @@ -/* ctan.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - - -/* ctan (x + I * y) = (sin (2 * x) + I * sinh(2 * y)) - / (cos (2 * x) + cosh (2 * y)) */ - -double complex ctan (double complex Z) -{ - double complex Res; - double two_I = 2.0 * __imag__ Z; - double two_R = 2.0 * __real__ Z; - double denom = cos (two_R) + cosh (two_I); - if (denom == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = 0.0; - __imag__ Res = two_I > 0 ? 1.0 : -1.0; - } - else - { - __real__ Res = sin (two_R) / denom; - __imag__ Res = sinh (two_I) / denom; - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/ctanh.c b/winsup/mingw/mingwex/complex/ctanh.c deleted file mode 100644 index 6d3e615da..000000000 --- a/winsup/mingw/mingwex/complex/ctanh.c +++ /dev/null @@ -1,44 +0,0 @@ -/* ctanh.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* - ctanh (x + I * y) = (sinh (2 * x) + sin (2 * y) * I ) - / (cosh (2 * x) + cos (2 * y)) . -*/ - -double complex -ctanh (double complex Z) -{ - double complex Res; - double two_R = 2.0 * __real__ Z; - double two_I = 2.0 * __imag__ Z; - double denom = cosh (two_R) + cos (two_I); - - if (denom == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if ( isinf (denom)) - { - errno = ERANGE; - __real__ Res = two_R > 0 ? 1.0 : -1.0; - __imag__ Res = 0.0; - } - else - { - __real__ Res = sinh (two_R) / denom; - __imag__ Res = sin (two_I) / denom; - } - return Res; -} diff --git a/winsup/mingw/mingwex/configure b/winsup/mingw/mingwex/configure deleted file mode 100755 index b369222b7..000000000 --- a/winsup/mingw/mingwex/configure +++ /dev/null @@ -1,1011 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=imaxabs.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -CC=${CC-cc} - -AS=${AS-as} - -AR=${AR-ar} - -LD=${LD-ld} - -RANLIB=${RANLIB-ranlib} - -DLLTOOL=${DLLTOOL-dlltool} - -DLLWRAP=${DLLWRAP-dllwrap} - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:587: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:608: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:626: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -case "$target_os" in -*cygwin*) - MNO_CYGWIN=-mno-cygwin - ;; -*) - # Build it for MSVCRT by default. - MNO_CYGWIN= - ;; -esac - - - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:676: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@CC@%$CC%g -s%@AS@%$AS%g -s%@AR@%$AR%g -s%@LD@%$LD%g -s%@RANLIB@%$RANLIB%g -s%@DLLTOOL@%$DLLTOOL%g -s%@DLLWRAP@%$DLLWRAP%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@MNO_CYGWIN@%$MNO_CYGWIN%g -s%@W32API_INCLUDE@%$W32API_INCLUDE%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <<EOF - -EOF -cat >> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - diff --git a/winsup/mingw/mingwex/configure.in b/winsup/mingw/mingwex/configure.in deleted file mode 100644 index f9b340e29..000000000 --- a/winsup/mingw/mingwex/configure.in +++ /dev/null @@ -1,55 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl This file is part of Mingw runtime. -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_PREREQ(2.13) -AC_INIT(imaxabs.c) - -CC=${CC-cc} -AC_SUBST(CC) -AS=${AS-as} -AC_SUBST(AS) -AR=${AR-ar} -AC_SUBST(AR) -LD=${LD-ld} -AC_SUBST(LD) -RANLIB=${RANLIB-ranlib} -AC_SUBST(RANLIB) -DLLTOOL=${DLLTOOL-dlltool} -AC_SUBST(DLLTOOL) -DLLWRAP=${DLLWRAP-dllwrap} -AC_SUBST(DLLWRAP) -AC_CANONICAL_SYSTEM - -case "$target_os" in -*cygwin*) - MNO_CYGWIN=-mno-cygwin - ;; -*) - # Build it for MSVCRT by default. - MNO_CYGWIN= - ;; -esac - -AC_SUBST(MNO_CYGWIN) - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' -AC_SUBST(W32API_INCLUDE) - -AC_PROG_INSTALL -AC_OUTPUT(Makefile) - diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c deleted file mode 100644 index 4cfa9c726..000000000 --- a/winsup/mingw/mingwex/dirent.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - * dirent.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Derived from DIRLIB.C by Matt J. Weinstein - * This note appears in the DIRLIB.H - * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 - * - * Updated by Jeremy Bettis <jeremy@hksys.com> - * Significantly revised and rewinddir, seekdir and telldir added by Colin - * Peters <colin@fu.is.saga-u.ac.jp> - * - */ - -#include <stdlib.h> -#include <errno.h> -#include <string.h> -#include <io.h> -#include <direct.h> -#include <dirent.h> - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> /* for GetFileAttributes */ - -#include <tchar.h> -#define SUFFIX _T("*") -#define SLASH _T("\\") - -/* - * opendir - * - * Returns a pointer to a DIR structure appropriately filled in to begin - * searching a directory. - */ -_TDIR * -_topendir (const _TCHAR *szPath) -{ - _TDIR *nd; - unsigned int rc; - _TCHAR szFullPath[MAX_PATH]; - - errno = 0; - - if (!szPath) - { - errno = EFAULT; - return (_TDIR *) 0; - } - - if (szPath[0] == _T('\0')) - { - errno = ENOTDIR; - return (_TDIR *) 0; - } - - /* Attempt to determine if the given path really is a directory. */ - rc = GetFileAttributes (szPath); - if (rc == (unsigned int)-1) - { - /* call GetLastError for more error info */ - errno = ENOENT; - return (_TDIR *) 0; - } - if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) - { - /* Error, entry exists but not a directory. */ - errno = ENOTDIR; - return (_TDIR *) 0; - } - - /* Make an absolute pathname. */ - _tfullpath (szFullPath, szPath, MAX_PATH); - - /* Allocate enough space to store DIR structure and the complete - * directory path given. */ - nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen(szFullPath) + _tcslen (SLASH) + - _tcslen(SUFFIX) + 1) * sizeof(_TCHAR)); - - if (!nd) - { - /* Error, out of memory. */ - errno = ENOMEM; - return (_TDIR *) 0; - } - - /* Create the search expression. */ - _tcscpy (nd->dd_name, szFullPath); - - /* Add on a slash if the path does not end with one. */ - if (nd->dd_name[0] != _T('\0') && - nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('/') && - nd->dd_name[_tcslen (nd->dd_name) - 1] != _T('\\')) - { - _tcscat (nd->dd_name, SLASH); - } - - /* Add on the search pattern */ - _tcscat (nd->dd_name, SUFFIX); - - /* Initialize handle to -1 so that a premature closedir doesn't try - * to call _findclose on it. */ - nd->dd_handle = -1; - - /* Initialize the status. */ - nd->dd_stat = 0; - - /* Initialize the dirent structure. ino and reclen are invalid under - * Win32, and name simply points at the appropriate part of the - * findfirst_t structure. */ - nd->dd_dir.d_ino = 0; - nd->dd_dir.d_reclen = 0; - nd->dd_dir.d_namlen = 0; - memset (nd->dd_dir.d_name, 0, FILENAME_MAX); - - return nd; -} - - -/* - * readdir - * - * Return a pointer to a dirent structure filled with the information on the - * next entry in the directory. - */ -struct _tdirent * -_treaddir (_TDIR * dirp) -{ - errno = 0; - - /* Check for valid DIR struct. */ - if (!dirp) - { - errno = EFAULT; - return (struct _tdirent *) 0; - } - - if (dirp->dd_stat < 0) - { - /* We have already returned all files in the directory - * (or the structure has an invalid dd_stat). */ - return (struct _tdirent *) 0; - } - else if (dirp->dd_stat == 0) - { - /* We haven't started the search yet. */ - /* Start the search */ - dirp->dd_handle = _tfindfirst (dirp->dd_name, &(dirp->dd_dta)); - - if (dirp->dd_handle == -1) - { - /* Whoops! Seems there are no files in that - * directory. */ - dirp->dd_stat = -1; - } - else - { - dirp->dd_stat = 1; - } - } - else - { - /* Get the next search entry. */ - if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) - { - /* We are off the end or otherwise error. - _findnext sets errno to ENOENT if no more file - Undo this. */ - DWORD winerr = GetLastError(); - if (winerr == ERROR_NO_MORE_FILES) - errno = 0; - _findclose (dirp->dd_handle); - dirp->dd_handle = -1; - dirp->dd_stat = -1; - } - else - { - /* Update the status to indicate the correct - * number. */ - dirp->dd_stat++; - } - } - - if (dirp->dd_stat > 0) - { - /* Successfully got an entry. Everything about the file is - * already appropriately filled in except the length of the - * file name. */ - dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name); - _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name); - return &dirp->dd_dir; - } - - return (struct _tdirent *) 0; -} - - -/* - * closedir - * - * Frees up resources allocated by opendir. - */ -int -_tclosedir (_TDIR * dirp) -{ - int rc; - - errno = 0; - rc = 0; - - if (!dirp) - { - errno = EFAULT; - return -1; - } - - if (dirp->dd_handle != -1) - { - rc = _findclose (dirp->dd_handle); - } - - /* Delete the dir structure. */ - free (dirp); - - return rc; -} - -/* - * rewinddir - * - * Return to the beginning of the directory "stream". We simply call findclose - * and then reset things like an opendir. - */ -void -_trewinddir (_TDIR * dirp) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return; - } - - if (dirp->dd_handle != -1) - { - _findclose (dirp->dd_handle); - } - - dirp->dd_handle = -1; - dirp->dd_stat = 0; -} - -/* - * telldir - * - * Returns the "position" in the "directory stream" which can be used with - * seekdir to go back to an old entry. We simply return the value in stat. - */ -long -_ttelldir (_TDIR * dirp) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return -1; - } - return dirp->dd_stat; -} - -/* - * seekdir - * - * Seek to an entry previously returned by telldir. We rewind the directory - * and call readdir repeatedly until either dd_stat is the position number - * or -1 (off the end). This is not perfect, in that the directory may - * have changed while we weren't looking. But that is probably the case with - * any such system. - */ -void -_tseekdir (_TDIR * dirp, long lPos) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return; - } - - if (lPos < -1) - { - /* Seeking to an invalid position. */ - errno = EINVAL; - return; - } - else if (lPos == -1) - { - /* Seek past end. */ - if (dirp->dd_handle != -1) - { - _findclose (dirp->dd_handle); - } - dirp->dd_handle = -1; - dirp->dd_stat = -1; - } - else - { - /* Rewind and read forward to the appropriate index. */ - _trewinddir (dirp); - - while ((dirp->dd_stat < lPos) && _treaddir (dirp)) - ; - } -} diff --git a/winsup/mingw/mingwex/feclearexcept.c b/winsup/mingw/mingwex/feclearexcept.c deleted file mode 100644 index e6017fc9d..000000000 --- a/winsup/mingw/mingwex/feclearexcept.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <fenv.h> - -/* 7.6.2.1 - The feclearexcept function clears the supported exceptions - represented by its argument. */ - -int feclearexcept (int excepts) -{ - fenv_t _env; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); /* get the env */ - _env.__status_word &= ~(excepts & FE_ALL_EXCEPT); /* clear the except */ - __asm__ volatile ("fldenv %0;" :: "m" (_env)); /*set the env */ - return 0; -} diff --git a/winsup/mingw/mingwex/fegetenv.c b/winsup/mingw/mingwex/fegetenv.c deleted file mode 100644 index 5ea5bd011..000000000 --- a/winsup/mingw/mingwex/fegetenv.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <fenv.h> - -/* 7.6.4.1 - The fegetenv function stores the current floating-point environment - in the object pointed to by envp. */ - -int fegetenv (fenv_t * envp) -{ - __asm__ ("fnstenv %0;": "=m" (*envp)); - return 0; -} - diff --git a/winsup/mingw/mingwex/fegetexceptflag.c b/winsup/mingw/mingwex/fegetexceptflag.c deleted file mode 100644 index 353e90dfa..000000000 --- a/winsup/mingw/mingwex/fegetexceptflag.c +++ /dev/null @@ -1,15 +0,0 @@ -#include <fenv.h> - - -/* 7.6.2.2 - The fegetexceptflag function stores an implementation-defined - representation of the exception flags indicated by the argument - excepts in the object pointed to by the argument flagp. */ - -int fegetexceptflag (fexcept_t * flagp, int excepts) -{ - unsigned short _sw; - __asm__ ("fnstsw %%ax;": "=a" (_sw)); - *flagp = _sw & excepts & FE_ALL_EXCEPT; - return 0; -} diff --git a/winsup/mingw/mingwex/fegetround.c b/winsup/mingw/mingwex/fegetround.c deleted file mode 100644 index 076b1068c..000000000 --- a/winsup/mingw/mingwex/fegetround.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <fenv.h> - -/* 7.6.3.1 - The fegetround function returns the value of the rounding direction - macro representing the current rounding direction. */ - -int -fegetround (void) -{ - unsigned short _cw; - __asm__ ("fnstcw %0;" : "=m" (_cw)); - return _cw - & (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); -} diff --git a/winsup/mingw/mingwex/feholdexcept.c b/winsup/mingw/mingwex/feholdexcept.c deleted file mode 100644 index df486afb3..000000000 --- a/winsup/mingw/mingwex/feholdexcept.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <fenv.h> - -/* 7.6.4.2 - The feholdexcept function saves the current floating-point - environment in the object pointed to by envp, clears the exception - flags, and then installs a non-stop (continue on exceptions) mode, - if available, for all exceptions. */ - -int feholdexcept (fenv_t * envp) -{ - fenv_t tmp_env; - __asm__ ("fnstenv %0;" : "=m" (* envp)); /* save current into envp */ - tmp_env = * envp; - tmp_env.__status_word &= ~FE_ALL_EXCEPT; /* clear exception flags */ - tmp_env.__control_word |= FE_ALL_EXCEPT; /* set cw to non-stop */ - __asm__ volatile ("fldenv %0;" : : "m" (tmp_env)); /* install the copy */ - return 0; -} diff --git a/winsup/mingw/mingwex/feraiseexcept.c b/winsup/mingw/mingwex/feraiseexcept.c deleted file mode 100644 index b1ba87006..000000000 --- a/winsup/mingw/mingwex/feraiseexcept.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <fenv.h> - -/* 7.6.2.3 - The feraiseexcept function raises the supported exceptions - represented by its argument The order in which these exceptions - are raised is unspecified, except as stated in F.7.6. - Whether the feraiseexcept function additionally raises - the inexact exception whenever it raises the overflow - or underflow exception is implementation-defined. */ - -int feraiseexcept (int excepts) -{ - fenv_t _env; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); - _env.__status_word |= excepts & FE_ALL_EXCEPT; - __asm__ volatile ("fldenv %0;" - "fwait;" : : "m" (_env)); - return 0; -} diff --git a/winsup/mingw/mingwex/fesetenv.c b/winsup/mingw/mingwex/fesetenv.c deleted file mode 100644 index 1e8090cc3..000000000 --- a/winsup/mingw/mingwex/fesetenv.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <fenv.h> -#include <float.h> - -/* 7.6.4.3 - The fesetenv function establishes the floating-point environment - represented by the object pointed to by envp. The argument envp - points to an object set by a call to fegetenv or feholdexcept, or - equal the macro FE_DFL_ENV or an implementation-defined environment - macro. Note that fesetenv merely installs the state of the exception - flags represented through its argument, and does not raise these - exceptions. - */ - -extern void (*_imp___fpreset)( void ) ; - -int fesetenv (const fenv_t * envp) -{ - if (envp == FE_PC64_ENV) - /* - * fninit initializes the control register to 0x37f, - * the status register to zero and the tag word to 0FFFFh. - * The other registers are unaffected. - */ - __asm__ ("fninit"); - - else if (envp == FE_PC53_ENV) - /* - * MS _fpreset() does same *except* it sets control word - * to 0x27f (53-bit precison). - * We force calling _fpreset in msvcrt.dll - */ - - (*_imp___fpreset)(); - - else if (envp == FE_DFL_ENV) - /* Use the choice made at app startup */ - _fpreset(); - - else - __asm__ ("fldenv %0;" : : "m" (*envp)); - return 0; -} diff --git a/winsup/mingw/mingwex/fesetexceptflag.c b/winsup/mingw/mingwex/fesetexceptflag.c deleted file mode 100644 index 7f4b8e562..000000000 --- a/winsup/mingw/mingwex/fesetexceptflag.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <fenv.h> - -/* 7.6.2.4 - The fesetexceptflag function sets the complete status for those - exception flags indicated by the argument excepts, according to the - representation in the object pointed to by flagp. The value of - *flagp shall have been set by a previous call to fegetexceptflag - whose second argument represented at least those exceptions - represented by the argument excepts. This function does not raise - exceptions, but only sets the state of the flags. */ - -int fesetexceptflag (const fexcept_t * flagp, int excepts) -{ - fenv_t _env; - - excepts &= FE_ALL_EXCEPT; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); - _env.__status_word &= ~excepts; - _env.__status_word |= (*flagp & excepts); - __asm__ volatile ("fldenv %0;" : : "m" (_env)); - return 0; -} diff --git a/winsup/mingw/mingwex/fesetround.c b/winsup/mingw/mingwex/fesetround.c deleted file mode 100644 index a8cef86a4..000000000 --- a/winsup/mingw/mingwex/fesetround.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <fenv.h> - /* 7.6.3.2 - The fesetround function establishes the rounding direction - represented by its argument round. If the argument is not equal - to the value of a rounding direction macro, the rounding direction - is not changed. */ - -int fesetround (int mode) -{ - unsigned short _cw; - if ((mode & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - != 0) - return -1; - __asm__ volatile ("fnstcw %0;": "=m" (_cw)); - _cw &= ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); - _cw |= mode; - __asm__ volatile ("fldcw %0;" : : "m" (_cw)); - return 0; -} diff --git a/winsup/mingw/mingwex/fetestexcept.c b/winsup/mingw/mingwex/fetestexcept.c deleted file mode 100644 index 6934ed925..000000000 --- a/winsup/mingw/mingwex/fetestexcept.c +++ /dev/null @@ -1,15 +0,0 @@ -#include <fenv.h> -/* 7.6.2.5 - The fetestexcept function determines which of a specified subset of - the exception flags are currently set. The excepts argument - specifies the exception flags to be queried. - The fetestexcept function returns the value of the bitwise OR of the - exception macros corresponding to the currently set exceptions - included in excepts. */ - -int fetestexcept (int excepts) -{ - unsigned short _sw; - __asm__ ("fnstsw %%ax" : "=a" (_sw)); - return _sw & excepts & FE_ALL_EXCEPT; -} diff --git a/winsup/mingw/mingwex/feupdateenv.c b/winsup/mingw/mingwex/feupdateenv.c deleted file mode 100644 index f414837f5..000000000 --- a/winsup/mingw/mingwex/feupdateenv.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <fenv.h> - -/* 7.6.4.4 - The feupdateenv function saves the currently raised exceptions in - its automatic storage, installs the floating-point environment - represented by the object pointed to by envp, and then raises the - saved exceptions. The argument envp shall point to an object - set by a call to feholdexcept or fegetenv, or equal the macro - FE_DFL_ENV or an implementation-defined environment macro. */ - -/* FIXME: this works but surely there must be a better way. */ - -int feupdateenv (const fenv_t * envp) -{ - unsigned int _fexcept = fetestexcept (FE_ALL_EXCEPT); /*save excepts */ - fesetenv (envp); /* install the env */ - feraiseexcept (_fexcept); /* raise the execept */ - return 0; -} - diff --git a/winsup/mingw/mingwex/fwide.c b/winsup/mingw/mingwex/fwide.c deleted file mode 100644 index fc8bf5bf5..000000000 --- a/winsup/mingw/mingwex/fwide.c +++ /dev/null @@ -1,25 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - This is a minimal implementation for environments where - internationalization is not considered important. - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -int -fwide(stream, mode) - FILE *stream; - int mode; - { - return -1; /* limited to byte orientation */ - } - diff --git a/winsup/mingw/mingwex/getopt.c b/winsup/mingw/mingwex/getopt.c deleted file mode 100644 index 6b19df7dd..000000000 --- a/winsup/mingw/mingwex/getopt.c +++ /dev/null @@ -1,507 +0,0 @@ -/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ - -/*- - * Copyright (c) 2000 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Dieter Baron and Thomas Klausner. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include <assert.h> -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <getopt.h> -#include <stdarg.h> -#include <stdio.h> - -#define REPLACE_GETOPT - -#define _DIAGASSERT(x) do {} while (0) - -#ifdef REPLACE_GETOPT -#ifdef __weak_alias -__weak_alias(getopt,_getopt) -#endif -int opterr = 1; /* if error message should be printed */ -int optind = 1; /* index into parent argv vector */ -int optopt = '?'; /* character checked for validity */ -int optreset; /* reset getopt */ -char *optarg; /* argument associated with option */ -#endif - -#ifdef __weak_alias -__weak_alias(getopt_long,_getopt_long) -#endif - -#ifndef __CYGWIN__ -#define __progname __argv[0] -#else -extern char __declspec(dllimport) *__progname; -#endif - -#define IGNORE_FIRST (*options == '-' || *options == '+') -#define PRINT_ERROR ((opterr) && ((*options != ':') \ - || (IGNORE_FIRST && options[1] != ':'))) - -/* This differs from the cygwin implementation, which effectively defaults to - PC, but is consistent with the NetBSD implementation and doc's. */ -#ifndef IS_POSIXLY_CORRECT -#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) -#endif - -#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) -/* XXX: GNU ignores PC if *options == '-' */ -#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') - -/* return values */ -#define BADCH (int)'?' -#define BADARG ((IGNORE_FIRST && options[1] == ':') \ - || (*options == ':') ? (int)':' : (int)'?') -#define INORDER (int)1 - -static char EMSG[1]; - -static int getopt_internal (int, char * const *, const char *); -static int gcd (int, int); -static void permute_args (int, int, int, char * const *); - -static char *place = EMSG; /* option letter processing */ - -/* XXX: set optreset to 1 rather than these two */ -static int nonopt_start = -1; /* first non option argument (for permute) */ -static int nonopt_end = -1; /* first option after non options (for permute) */ - -/* Error messages */ -static const char recargchar[] = "option requires an argument -- %c"; -static const char recargstring[] = "option requires an argument -- %s"; -static const char ambig[] = "ambiguous option -- %.*s"; -static const char noarg[] = "option doesn't take an argument -- %.*s"; -static const char illoptchar[] = "unknown option -- %c"; -static const char illoptstring[] = "unknown option -- %s"; - -static void -_vwarnx(const char *fmt, va_list ap) -{ - (void)fprintf(stderr, "%s: ", __progname); - if (fmt != NULL) - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, "\n"); -} - -static void -warnx(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - _vwarnx(fmt, ap); - va_end(ap); -} - -/* - * Compute the greatest common divisor of a and b. - */ -static int -gcd(a, b) - int a; - int b; -{ - int c; - - c = a % b; - while (c != 0) { - a = b; - b = c; - c = a % b; - } - - return b; -} - -/* - * Exchange the block from nonopt_start to nonopt_end with the block - * from nonopt_end to opt_end (keeping the same order of arguments - * in each block). - */ -static void -permute_args(panonopt_start, panonopt_end, opt_end, nargv) - int panonopt_start; - int panonopt_end; - int opt_end; - char * const *nargv; -{ - int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; - char *swap; - - _DIAGASSERT(nargv != NULL); - - /* - * compute lengths of blocks and number and size of cycles - */ - nnonopts = panonopt_end - panonopt_start; - nopts = opt_end - panonopt_end; - ncycle = gcd(nnonopts, nopts); - cyclelen = (opt_end - panonopt_start) / ncycle; - - for (i = 0; i < ncycle; i++) { - cstart = panonopt_end+i; - pos = cstart; - for (j = 0; j < cyclelen; j++) { - if (pos >= panonopt_end) - pos -= nnonopts; - else - pos += nopts; - swap = nargv[pos]; - /* LINTED const cast */ - ((char **) nargv)[pos] = nargv[cstart]; - /* LINTED const cast */ - ((char **)nargv)[cstart] = swap; - } - } -} - -/* - * getopt_internal -- - * Parse argc/argv argument vector. Called by user level routines. - * Returns -2 if -- is found (can be long option or end of options marker). - */ -static int -getopt_internal(nargc, nargv, options) - int nargc; - char * const *nargv; - const char *options; -{ - char *oli; /* option letter list index */ - int optchar; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - - optarg = NULL; - - /* - * XXX Some programs (like rsyncd) expect to be able to - * XXX re-initialize optind to 0 and have getopt_long(3) - * XXX properly function again. Work around this braindamage. - */ - if (optind == 0) - optind = 1; - - if (optreset) - nonopt_start = nonopt_end = -1; -start: - if (optreset || !*place) { /* update scanning pointer */ - optreset = 0; - if (optind >= nargc) { /* end of argument vector */ - place = EMSG; - if (nonopt_end != -1) { - /* do permutation, if we have to */ - permute_args(nonopt_start, nonopt_end, - optind, nargv); - optind -= nonopt_end - nonopt_start; - } - else if (nonopt_start != -1) { - /* - * If we skipped non-options, set optind - * to the first of them. - */ - optind = nonopt_start; - } - nonopt_start = nonopt_end = -1; - return -1; - } - if ((*(place = nargv[optind]) != '-') - || (place[1] == '\0')) { /* found non-option */ - place = EMSG; - if (IN_ORDER) { - /* - * GNU extension: - * return non-option as argument to option 1 - */ - optarg = nargv[optind++]; - return INORDER; - } - if (!PERMUTE) { - /* - * if no permutation wanted, stop parsing - * at first non-option - */ - return -1; - } - /* do permutation */ - if (nonopt_start == -1) - nonopt_start = optind; - else if (nonopt_end != -1) { - permute_args(nonopt_start, nonopt_end, - optind, nargv); - nonopt_start = optind - - (nonopt_end - nonopt_start); - nonopt_end = -1; - } - optind++; - /* process next argument */ - goto start; - } - if (nonopt_start != -1 && nonopt_end == -1) - nonopt_end = optind; - if (place[1] && *++place == '-') { /* found "--" */ - place++; - return -2; - } - } - if ((optchar = (int)*place++) == (int)':' || - (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) { - /* option letter unknown or ':' */ - if (!*place) - ++optind; - if (PRINT_ERROR) - warnx(illoptchar, optchar); - optopt = optchar; - return BADCH; - } - if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ - /* XXX: what if no long options provided (called by getopt)? */ - if (*place) - return -2; - - if (++optind >= nargc) { /* no arg */ - place = EMSG; - if (PRINT_ERROR) - warnx(recargchar, optchar); - optopt = optchar; - return BADARG; - } else /* white space */ - place = nargv[optind]; - /* - * Handle -W arg the same as --arg (which causes getopt to - * stop parsing). - */ - return -2; - } - if (*++oli != ':') { /* doesn't take argument */ - if (!*place) - ++optind; - } else { /* takes (optional) argument */ - optarg = NULL; - if (*place) /* no white space */ - optarg = place; - /* XXX: disable test for :: if PC? (GNU doesn't) */ - else if (oli[1] != ':') { /* arg not optional */ - if (++optind >= nargc) { /* no arg */ - place = EMSG; - if (PRINT_ERROR) - warnx(recargchar, optchar); - optopt = optchar; - return BADARG; - } else - optarg = nargv[optind]; - } - place = EMSG; - ++optind; - } - /* dump back option letter */ - return optchar; -} - -#ifdef REPLACE_GETOPT -/* - * getopt -- - * Parse argc/argv argument vector. - * - * [eventually this will replace the real getopt] - */ -int -getopt(nargc, nargv, options) - int nargc; - char * const *nargv; - const char *options; -{ - int retval; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - - if ((retval = getopt_internal(nargc, nargv, options)) == -2) { - ++optind; - /* - * We found an option (--), so if we skipped non-options, - * we have to permute. - */ - if (nonopt_end != -1) { - permute_args(nonopt_start, nonopt_end, optind, - nargv); - optind -= nonopt_end - nonopt_start; - } - nonopt_start = nonopt_end = -1; - retval = -1; - } - return retval; -} -#endif - -/* - * getopt_long -- - * Parse argc/argv argument vector. - */ -int -getopt_long(nargc, nargv, options, long_options, idx) - int nargc; - char * const *nargv; - const char *options; - const struct option *long_options; - int *idx; -{ - int retval; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - _DIAGASSERT(long_options != NULL); - /* idx may be NULL */ - - if ((retval = getopt_internal(nargc, nargv, options)) == -2) { - char *current_argv, *has_equal; - size_t current_argv_len; - int i, match; - - current_argv = place; - match = -1; - - optind++; - place = EMSG; - - if (*current_argv == '\0') { /* found "--" */ - /* - * We found an option (--), so if we skipped - * non-options, we have to permute. - */ - if (nonopt_end != -1) { - permute_args(nonopt_start, nonopt_end, - optind, nargv); - optind -= nonopt_end - nonopt_start; - } - nonopt_start = nonopt_end = -1; - return -1; - } - if ((has_equal = strchr(current_argv, '=')) != NULL) { - /* argument found (--option=arg) */ - current_argv_len = has_equal - current_argv; - has_equal++; - } else - current_argv_len = strlen(current_argv); - - for (i = 0; long_options[i].name; i++) { - /* find matching long option */ - if (strncmp(current_argv, long_options[i].name, - current_argv_len)) - continue; - - if (strlen(long_options[i].name) == - (unsigned)current_argv_len) { - /* exact match */ - match = i; - break; - } - if (match == -1) /* partial match */ - match = i; - else { - /* ambiguous abbreviation */ - if (PRINT_ERROR) - warnx(ambig, (int)current_argv_len, - current_argv); - optopt = 0; - return BADCH; - } - } - if (match != -1) { /* option found */ - if (long_options[match].has_arg == no_argument - && has_equal) { - if (PRINT_ERROR) - warnx(noarg, (int)current_argv_len, - current_argv); - /* - * XXX: GNU sets optopt to val regardless of - * flag - */ - if (long_options[match].flag == NULL) - optopt = long_options[match].val; - else - optopt = 0; - return BADARG; - } - if (long_options[match].has_arg == required_argument || - long_options[match].has_arg == optional_argument) { - if (has_equal) - optarg = has_equal; - else if (long_options[match].has_arg == - required_argument) { - /* - * optional argument doesn't use - * next nargv - */ - optarg = nargv[optind++]; - } - } - if ((long_options[match].has_arg == required_argument) - && (optarg == NULL)) { - /* - * Missing argument; leading ':' - * indicates no error should be generated - */ - if (PRINT_ERROR) - warnx(recargstring, current_argv); - /* - * XXX: GNU sets optopt to val regardless - * of flag - */ - if (long_options[match].flag == NULL) - optopt = long_options[match].val; - else - optopt = 0; - --optind; - return BADARG; - } - } else { /* unknown option */ - if (PRINT_ERROR) - warnx(illoptstring, current_argv); - optopt = 0; - return BADCH; - } - if (long_options[match].flag) { - *long_options[match].flag = long_options[match].val; - retval = 0; - } else - retval = long_options[match].val; - if (idx) - *idx = match; - } - return retval; -} diff --git a/winsup/mingw/mingwex/imaxabs.c b/winsup/mingw/mingwex/imaxabs.c deleted file mode 100644 index b643ceab6..000000000 --- a/winsup/mingw/mingwex/imaxabs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. -*/ - -#include <inttypes.h> - -intmax_t -imaxabs (intmax_t _j) - { return _j >= 0 ? _j : -_j; } - -long long __attribute__ ((alias ("imaxabs"))) llabs (long long); diff --git a/winsup/mingw/mingwex/imaxdiv.c b/winsup/mingw/mingwex/imaxdiv.c deleted file mode 100644 index 6acfcf6cb..000000000 --- a/winsup/mingw/mingwex/imaxdiv.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - -*/ - -#include <inttypes.h> - -imaxdiv_t -imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - result.quot = numer / denom; - result.rem = numer % denom; - return result; -} - -long long __attribute__ ((alias ("imaxdiv"))) -lldiv (long long, long long); diff --git a/winsup/mingw/mingwex/ldtoa.c b/winsup/mingw/mingwex/ldtoa.c deleted file mode 100644 index 09dc7911b..000000000 --- a/winsup/mingw/mingwex/ldtoa.c +++ /dev/null @@ -1,614 +0,0 @@ -/* This file is extracted from S L Moshier's ioldoubl.c, - * modified for use in MinGW - * - * Extended precision arithmetic functions for long double I/O. - * This program has been placed in the public domain. - */ - - -/* - * Revision history: - * - * 5 Jan 84 PDP-11 assembly language version - * 6 Dec 86 C language version - * 30 Aug 88 100 digit version, improved rounding - * 15 May 92 80-bit long double support - * - * Author: S. L. Moshier. - * - * 6 Oct 02 Modified for MinGW by inlining utility routines, - * removing global variables and splitting out strtold - * from _IO_ldtoa and _IO_ldtostr. - * - * Danny Smith <dannysmith@users.sourceforge.net> - * - */ - - -#ifdef USE_LDTOA - -#include "math/cephes_emath.h" - -#if NE == 10 - -/* 1.0E0 */ -static const unsigned short __eone[NE] = - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff,}; - -#else - -static const unsigned short __eone[NE] = { -0, 0000000,0000000,0000000,0100000,0x3fff,}; -#endif - - -#if NE == 10 -static const unsigned short __etens[NTEN + 1][NE] = -{ - {0x6576, 0x4a92, 0x804a, 0x153f, - 0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */ - {0x6a32, 0xce52, 0x329a, 0x28ce, - 0xa74d, 0x5de4, 0xc53d, 0x3b5d, 0x9e8b, 0x5a92,}, /* 10**2048 */ - {0x526c, 0x50ce, 0xf18b, 0x3d28, - 0x650d, 0x0c17, 0x8175, 0x7586, 0xc976, 0x4d48,}, - {0x9c66, 0x58f8, 0xbc50, 0x5c54, - 0xcc65, 0x91c6, 0xa60e, 0xa0ae, 0xe319, 0x46a3,}, - {0x851e, 0xeab7, 0x98fe, 0x901b, - 0xddbb, 0xde8d, 0x9df9, 0xebfb, 0xaa7e, 0x4351,}, - {0x0235, 0x0137, 0x36b1, 0x336c, - 0xc66f, 0x8cdf, 0x80e9, 0x47c9, 0x93ba, 0x41a8,}, - {0x50f8, 0x25fb, 0xc76b, 0x6b71, - 0x3cbf, 0xa6d5, 0xffcf, 0x1f49, 0xc278, 0x40d3,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0xf020, 0xb59d, 0x2b70, 0xada8, 0x9dc5, 0x4069,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0400, 0xc9bf, 0x8e1b, 0x4034,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x2000, 0xbebc, 0x4019,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x9c40, 0x400c,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xc800, 0x4005,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */ -}; - -#else -static const unsigned short __etens[NTEN+1][NE] = { -{0xc94c,0x979a,0x8a20,0x5202,0xc460,0x7525,},/* 10**4096 */ -{0xa74d,0x5de4,0xc53d,0x3b5d,0x9e8b,0x5a92,},/* 10**2048 */ -{0x650d,0x0c17,0x8175,0x7586,0xc976,0x4d48,}, -{0xcc65,0x91c6,0xa60e,0xa0ae,0xe319,0x46a3,}, -{0xddbc,0xde8d,0x9df9,0xebfb,0xaa7e,0x4351,}, -{0xc66f,0x8cdf,0x80e9,0x47c9,0x93ba,0x41a8,}, -{0x3cbf,0xa6d5,0xffcf,0x1f49,0xc278,0x40d3,}, -{0xf020,0xb59d,0x2b70,0xada8,0x9dc5,0x4069,}, -{0x0000,0x0000,0x0400,0xc9bf,0x8e1b,0x4034,}, -{0x0000,0x0000,0x0000,0x2000,0xbebc,0x4019,}, -{0x0000,0x0000,0x0000,0x0000,0x9c40,0x400c,}, -{0x0000,0x0000,0x0000,0x0000,0xc800,0x4005,}, -{0x0000,0x0000,0x0000,0x0000,0xa000,0x4002,}, /* 10**1 */ -}; -#endif - -#if NE == 10 -static const unsigned short __emtens[NTEN + 1][NE] = -{ - {0x2030, 0xcffc, 0xa1c3, 0x8123, - 0x2de3, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */ - {0x8264, 0xd2cb, 0xf2ea, 0x12d4, - 0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */ - {0xf53f, 0xf698, 0x6bd3, 0x0158, - 0x87a6, 0xc0bd, 0xda57, 0x82a5, 0xa2a6, 0x32b5,}, - {0xe731, 0x04d4, 0xe3f2, 0xd332, - 0x7132, 0xd21c, 0xdb23, 0xee32, 0x9049, 0x395a,}, - {0xa23e, 0x5308, 0xfefb, 0x1155, - 0xfa91, 0x1939, 0x637a, 0x4325, 0xc031, 0x3cac,}, - {0xe26d, 0xdbde, 0xd05d, 0xb3f6, - 0xac7c, 0xe4a0, 0x64bc, 0x467c, 0xddd0, 0x3e55,}, - {0x2a20, 0x6224, 0x47b3, 0x98d7, - 0x3f23, 0xe9a5, 0xa539, 0xea27, 0xa87f, 0x3f2a,}, - {0x0b5b, 0x4af2, 0xa581, 0x18ed, - 0x67de, 0x94ba, 0x4539, 0x1ead, 0xcfb1, 0x3f94,}, - {0xbf71, 0xa9b3, 0x7989, 0xbe68, - 0x4c2e, 0xe15b, 0xc44d, 0x94be, 0xe695, 0x3fc9,}, - {0x3d4d, 0x7c3d, 0x36ba, 0x0d2b, - 0xfdc2, 0xcefc, 0x8461, 0x7711, 0xabcc, 0x3fe4,}, - {0xc155, 0xa4a8, 0x404e, 0x6113, - 0xd3c3, 0x652b, 0xe219, 0x1758, 0xd1b7, 0x3ff1,}, - {0xd70a, 0x70a3, 0x0a3d, 0xa3d7, - 0x3d70, 0xd70a, 0x70a3, 0x0a3d, 0xa3d7, 0x3ff8,}, - {0xcccd, 0xcccc, 0xcccc, 0xcccc, - 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */ -}; - -#else -static const unsigned short __emtens[NTEN+1][NE] = { -{0x2de4,0x9fde,0xd2ce,0x04c8,0xa6dd,0x0ad8,}, /* 10**-4096 */ -{0x4925,0x2de4,0x3436,0x534f,0xceae,0x256b,}, /* 10**-2048 */ -{0x87a6,0xc0bd,0xda57,0x82a5,0xa2a6,0x32b5,}, -{0x7133,0xd21c,0xdb23,0xee32,0x9049,0x395a,}, -{0xfa91,0x1939,0x637a,0x4325,0xc031,0x3cac,}, -{0xac7d,0xe4a0,0x64bc,0x467c,0xddd0,0x3e55,}, -{0x3f24,0xe9a5,0xa539,0xea27,0xa87f,0x3f2a,}, -{0x67de,0x94ba,0x4539,0x1ead,0xcfb1,0x3f94,}, -{0x4c2f,0xe15b,0xc44d,0x94be,0xe695,0x3fc9,}, -{0xfdc2,0xcefc,0x8461,0x7711,0xabcc,0x3fe4,}, -{0xd3c3,0x652b,0xe219,0x1758,0xd1b7,0x3ff1,}, -{0x3d71,0xd70a,0x70a3,0x0a3d,0xa3d7,0x3ff8,}, -{0xcccd,0xcccc,0xcccc,0xcccc,0xcccc,0x3ffb,}, /* 10**-1 */ -}; -#endif - -/* This routine will not return more than NDEC+1 digits. */ -void __etoasc(short unsigned int * __restrict__ x, - char * __restrict__ string, - const int ndigits, const int outformat, - int* outexp) -{ -long digit; -unsigned short y[NI], t[NI], u[NI], w[NI], equot[NI]; -const unsigned short *r, *p; -const unsigned short *ten; -unsigned short sign; -int i, j, k, expon, ndigs; -char *s, *ss; -unsigned short m; - -ndigs = ndigits; -#ifdef NANS -if( __eisnan(x) ) - { - sprintf( string, " NaN " ); - expon = 9999; - goto bxit; - } -#endif -__emov( x, y ); /* retain external format */ -if( y[NE-1] & 0x8000 ) - { - sign = 0xffff; - y[NE-1] &= 0x7fff; - } -else - { - sign = 0; - } -expon = 0; -ten = &__etens[NTEN][0]; -__emov( __eone, t ); -/* Test for zero exponent */ -if( y[NE-1] == 0 ) - { - for( k=0; k<NE-1; k++ ) - { - if( y[k] != 0 ) - goto tnzro; /* denormalized number */ - } - goto isone; /* legal all zeros */ - } -tnzro: - -/* Test for infinity. - */ -if( y[NE-1] == 0x7fff ) - { - if( sign ) - sprintf( string, " -Infinity " ); - else - sprintf( string, " Infinity " ); - expon = 9999; - goto bxit; - } - -/* Test for exponent nonzero but significand denormalized. - * This is an error condition. - */ -if( (y[NE-1] != 0) && ((y[NE-2] & 0x8000) == 0) ) - { - mtherr( "etoasc", DOMAIN ); - sprintf( string, "NaN" ); - expon = 9999; - goto bxit; - } - -/* Compare to 1.0 */ -i = __ecmp( __eone, y ); -if( i == 0 ) - goto isone; - -if( i < 0 ) - { /* Number is greater than 1 */ -/* Convert significand to an integer and strip trailing decimal zeros. */ - __emov( y, u ); - u[NE-1] = EXONE + NBITS - 1; - - p = &__etens[NTEN-4][0]; - m = 16; -do - { - __ediv( p, u, t); - __efloor( t, w ); - for( j=0; j<NE-1; j++ ) - { - if( t[j] != w[j] ) - goto noint; - } - __emov( t, u ); - expon += (int )m; -noint: - p += NE; - m >>= 1; - } -while( m != 0 ); - -/* Rescale from integer significand */ - u[NE-1] += y[NE-1] - (unsigned int )(EXONE + NBITS - 1); - __emov( u, y ); -/* Find power of 10 */ - __emov( __eone, t ); - m = MAXP; - p = &__etens[0][0]; - while( __ecmp( ten, u ) <= 0 ) - { - if( __ecmp( p, u ) <= 0 ) - { - __ediv( p, u, u ); - __emul( p, t, t ); - expon += (int )m; - } - m >>= 1; - if( m == 0 ) - break; - p += NE; - } - } -else - { /* Number is less than 1.0 */ -/* Pad significand with trailing decimal zeros. */ - if( y[NE-1] == 0 ) - { - while( (y[NE-2] & 0x8000) == 0 ) - { - __emul( ten, y, y ); - expon -= 1; - } - } - else - { - __emovi( y, w ); - for( i=0; i<NDEC+1; i++ ) - { - if( (w[NI-1] & 0x7) != 0 ) - break; -/* multiply by 10 */ - __emovz( w, u ); - __eshdn1( u ); - __eshdn1( u ); - __eaddm( w, u ); - u[1] += 3; - while( u[2] != 0 ) - { - __eshdn1(u); - u[1] += 1; - } - if( u[NI-1] != 0 ) - break; - if( __eone[NE-1] <= u[1] ) - break; - __emovz( u, w ); - expon -= 1; - } - __emovo( w, y ); - } - k = -MAXP; - p = &__emtens[0][0]; - r = &__etens[0][0]; - __emov( y, w ); - __emov( __eone, t ); - while( __ecmp( __eone, w ) > 0 ) - { - if( __ecmp( p, w ) >= 0 ) - { - __emul( r, w, w ); - __emul( r, t, t ); - expon += k; - } - k /= 2; - if( k == 0 ) - break; - p += NE; - r += NE; - } - __ediv( t, __eone, t ); - } -isone: -/* Find the first (leading) digit. */ -__emovi( t, w ); -__emovz( w, t ); -__emovi( y, w ); -__emovz( w, y ); -__eiremain( t, y, equot); -digit = equot[NI-1]; -while( (digit == 0) && (__eiszero(y) == 0) ) - { - __eshup1( y ); - __emovz( y, u ); - __eshup1( u ); - __eshup1( u ); - __eaddm( u, y ); - __eiremain( t, y, equot); - digit = equot[NI-1]; - expon -= 1; - } -s = string; -if( sign ) - *s++ = '-'; -else - *s++ = ' '; -/* Examine number of digits requested by caller. */ -if( outformat == 3 ) - ndigs += expon; -/* -else if( ndigs < 0 ) - ndigs = 0; -*/ -if( ndigs > NDEC ) - ndigs = NDEC; -if( digit == 10 ) - { - *s++ = '1'; - *s++ = '.'; - if( ndigs > 0 ) - { - *s++ = '0'; - ndigs -= 1; - } - expon += 1; - if( ndigs < 0 ) - { - ss = s; - goto doexp; - } - } -else - { - *s++ = (char )digit + '0'; - *s++ = '.'; - } -/* Generate digits after the decimal point. */ -for( k=0; k<=ndigs; k++ ) - { -/* multiply current number by 10, without normalizing */ - __eshup1( y ); - __emovz( y, u ); - __eshup1( u ); - __eshup1( u ); - __eaddm( u, y ); - __eiremain( t, y, equot); - *s++ = (char )equot[NI-1] + '0'; - } -digit = equot[NI-1]; ---s; -ss = s; -/* round off the ASCII string */ -if( digit > 4 ) - { -/* Test for critical rounding case in ASCII output. */ - if( digit == 5 ) - { - if( __eiiszero(y) == 0 ) - goto roun; /* round to nearest */ - if( (*(s-1) & 1) == 0 ) - goto doexp; /* round to even */ - } -/* Round up and propagate carry-outs */ -roun: - --s; - k = *s & 0x7f; -/* Carry out to most significant digit? */ - if( ndigs < 0 ) - { - /* This will print like "1E-6". */ - *s = '1'; - - expon += 1; - goto doexp; - } - else if( k == '.' ) - { - --s; - k = *s; - k += 1; - *s = (char )k; -/* Most significant digit carries to 10? */ - if( k > '9' ) - { - expon += 1; - *s = '1'; - } - goto doexp; - } -/* Round up and carry out from less significant digits */ - k += 1; - *s = (char )k; - if( k > '9' ) - { - *s = '0'; - goto roun; - } - } -doexp: -#if defined (__GO32__) || defined (__MINGW32__) -if( expon >= 0 ) - sprintf( ss, "e+%02d", expon ); -else - sprintf( ss, "e-%02d", -expon ); -#else - sprintf( ss, "E%d", expon ); -#endif -bxit: - -if (outexp) - *outexp = expon; -} - - -/* FIXME: Not thread safe */ -static char outstr[128]; - - char * -_IO_ldtoa(long double d, int mode, int ndigits, int *decpt, - int *sign, char **rve) -{ -unsigned short e[NI]; -char *s, *p; -int k; -int outexpon = 0; - -union - { - unsigned short int us[6]; - long double ld; - } xx; -xx.ld = d; -__e64toe(xx.us, e ); -if( __eisneg(e) ) - *sign = 1; -else - *sign = 0; -/* Mode 3 is "f" format. */ -if( mode != 3 ) - ndigits -= 1; -/* Mode 0 is for %.999 format, which is supposed to give a - minimum length string that will convert back to the same binary value. - For now, just ask for 20 digits which is enough but sometimes too many. */ -if( mode == 0 ) - ndigits = 20; -/* This sanity limit must agree with the corresponding one in etoasc, to - keep straight the returned value of outexpon. */ -if( ndigits > NDEC ) - ndigits = NDEC; - -__etoasc( e, outstr, ndigits, mode, &outexpon ); -s = outstr; -if( __eisinf(e) || __eisnan(e) ) - { - *decpt = 9999; - goto stripspaces; - } -*decpt = outexpon + 1; - -/* Transform the string returned by etoasc into what the caller wants. */ - -/* Look for decimal point and delete it from the string. */ -s = outstr; -while( *s != '\0' ) - { - if( *s == '.' ) - goto yesdecpt; - ++s; - } -goto nodecpt; - -yesdecpt: - -/* Delete the decimal point. */ -while( *s != '\0' ) - { - *s = *(s+1); - ++s; - } - -nodecpt: - -/* Back up over the exponent field. */ -while( *s != 'E' && *s != 'e' && s > outstr) - --s; -*s = '\0'; - -stripspaces: - -/* Strip leading spaces and sign. */ -p = outstr; -while( *p == ' ' || *p == '-') - ++p; - -/* Find new end of string. */ -s = outstr; -while( (*s++ = *p++) != '\0' ) - ; ---s; - -/* Strip trailing zeros. */ -if( mode == 2 ) - k = 1; -else if( ndigits > outexpon ) - k = ndigits; -else - k = outexpon; - -while( *(s-1) == '0' && ((s - outstr) > k)) - *(--s) = '\0'; - -/* In f format, flush small off-scale values to zero. - Rounding has been taken care of by etoasc. */ -if( mode == 3 && ((ndigits + outexpon) < 0)) - { - s = outstr; - *s = '\0'; - *decpt = 0; - } - -if( rve ) - *rve = s; -return outstr; -} - -void -_IO_ldtostr(long double *x, char *string, int ndigs, int flags, char fmt) -{ -unsigned short w[NI]; -char *t, *u; -int outexpon = 0; -int outformat = -1; -char dec_sym = *(localeconv()->decimal_point); - -__e64toe( (unsigned short *)x, w ); -__etoasc( w, string, ndigs, outformat, &outexpon ); - -if( ndigs == 0 && flags == 0 ) - { - /* Delete the decimal point unless alternate format. */ - t = string; - while( *t != '.' ) - ++t; - u = t + 1; - while( *t != '\0' ) - *t++ = *u++; - } -if (*string == ' ') - { - t = string; - u = t + 1; - while( *t != '\0' ) - *t++ = *u++; - } -if (fmt == 'E') - { - t = string; - while( *t != 'e' ) - ++t; - *t = 'E'; - } -if (dec_sym != '.') - { - t = string; - while (*t != '.') - ++t; - *t = dec_sym; - } -} - -#endif /* USE_LDTOA */ diff --git a/winsup/mingw/mingwex/lltoa.c b/winsup/mingw/mingwex/lltoa.c deleted file mode 100644 index 28248a834..000000000 --- a/winsup/mingw/mingwex/lltoa.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -char* lltoa(long long _n, char * _c, int _i) - { return _i64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/lltow.c b/winsup/mingw/mingwex/lltow.c deleted file mode 100644 index cdf45b742..000000000 --- a/winsup/mingw/mingwex/lltow.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -wchar_t* lltow(long long _n, wchar_t * _w, int _i) - { return _i64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/math/acosf.c b/winsup/mingw/mingwex/math/acosf.c deleted file mode 100644 index 364f6a90c..000000000 --- a/winsup/mingw/mingwex/math/acosf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - -#include <math.h> - -float -acosf (float x) -{ - float res; - - /* acosl = atanl (sqrtl(1 - x^2) / x) */ - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrtl (1 - x^2) */ - "fxch %%st(1)\n\t" - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/acosl.c b/winsup/mingw/mingwex/math/acosl.c deleted file mode 100644 index f98d2cdc1..000000000 --- a/winsup/mingw/mingwex/math/acosl.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -acosl (long double x) -{ - long double res; - - /* acosl = atanl (sqrtl(1 - x^2) / x) */ - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrtl (1 - x^2) */ - "fxch %%st(1)\n\t" - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/asinf.c b/winsup/mingw/mingwex/math/asinf.c deleted file mode 100644 index e79429ec8..000000000 --- a/winsup/mingw/mingwex/math/asinf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - -/* asin = atan (x / sqrt(1 - x^2)) */ - -float asinf (float x) -{ - float res; - - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrt (1 - x^2) */ - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/asinl.c b/winsup/mingw/mingwex/math/asinl.c deleted file mode 100644 index a2ac32b39..000000000 --- a/winsup/mingw/mingwex/math/asinl.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for long double type by Danny Smith <dannysmith@users.sourceforge.net>. - */ - -/* asin = atan (x / sqrt(1 - x^2)) */ - -long double asinl (long double x) -{ - long double res; - - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrt (1 - x^2) */ - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atan2f.c b/winsup/mingw/mingwex/math/atan2f.c deleted file mode 100644 index 52ec6f672..000000000 --- a/winsup/mingw/mingwex/math/atan2f.c +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - */ - -#include <math.h> - -float -atan2f (float y, float x) -{ - float res; - asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atan2l.c b/winsup/mingw/mingwex/math/atan2l.c deleted file mode 100644 index efd62c1ec..000000000 --- a/winsup/mingw/mingwex/math/atan2l.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -atan2l (long double y, long double x) -{ - long double res; - asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atanf.c b/winsup/mingw/mingwex/math/atanf.c deleted file mode 100644 index ae70d5daa..000000000 --- a/winsup/mingw/mingwex/math/atanf.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - */ - -#include <math.h> - -float -atanf (float x) -{ - float res; - - asm ("fld1\n\t" - "fpatan" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/atanl.c b/winsup/mingw/mingwex/math/atanl.c deleted file mode 100644 index 5de06d35b..000000000 --- a/winsup/mingw/mingwex/math/atanl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -atanl (long double x) -{ - long double res; - - asm ("fld1\n\t" - "fpatan" - : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/cbrt.c b/winsup/mingw/mingwex/math/cbrt.c deleted file mode 100644 index 93f5c819c..000000000 --- a/winsup/mingw/mingwex/math/cbrt.c +++ /dev/null @@ -1,162 +0,0 @@ -/* cbrt.c - * - * Cube root - * - * - * - * SYNOPSIS: - * - * double x, y, cbrt(); - * - * y = cbrt( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used three times to converge to an accurate - * result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * DEC -10,10 200000 1.8e-17 6.2e-18 - * IEEE 0,1e308 30000 1.5e-16 5.0e-17 - * - */ -/* cbrt.c */ - -/* -Cephes Math Library Release 2.2: January, 1991 -Copyright 1984, 1991 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include <math.h> -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - - -static const double CBRT2 = 1.2599210498948731647672; -static const double CBRT4 = 1.5874010519681994747517; -static const double CBRT2I = 0.79370052598409973737585; -static const double CBRT4I = 0.62996052494743658238361; - -#ifndef __MINGW32__ -#ifdef ANSIPROT -extern double frexp ( double, int * ); -extern double ldexp ( double, int ); -extern int isnan ( double ); -extern int isfinite ( double ); -#else -double frexp(), ldexp(); -int isnan(), isfinite(); -#endif -#endif - -double cbrt(x) -double x; -{ -int e, rem, sign; -double z; - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0 ) - return x; -#else - -#ifdef NANS -if( isnan(x) ) - return x; -#endif -#ifdef INFINITIES -if( !isfinite(x) ) - return x; -#endif -if( x == 0 ) - return( x ); - -#endif /* __MINGW32__ */ - -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexp( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 9.2e-6 - */ -x = (((-1.3466110473359520655053e-1 * x - + 5.4664601366395524503440e-1) * x - - 9.5438224771509446525043e-1) * x - + 1.1399983354717293273738e0 ) * x - + 4.0238979564544752126924e-1; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } - - -/* argument less than 1 */ - -else - { - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2I; - else if( rem == 2 ) - x *= CBRT4I; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexp( x, e ); - -/* Newton iteration */ -x -= ( x - (z/(x*x)) )*0.33333333333333333333; -#ifdef DEC -x -= ( x - (z/(x*x)) )/3.0; -#else -x -= ( x - (z/(x*x)) )*0.33333333333333333333; -#endif - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/cbrtf.c b/winsup/mingw/mingwex/math/cbrtf.c deleted file mode 100644 index 537cf8d98..000000000 --- a/winsup/mingw/mingwex/math/cbrtf.c +++ /dev/null @@ -1,147 +0,0 @@ -/* cbrtf.c - * - * Cube root - * - * - * - * SYNOPSIS: - * - * float x, y, cbrtf(); - * - * y = cbrtf( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used to converge to an accurate result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,1e38 100000 7.6e-8 2.7e-8 - * - */ -/* cbrt.c */ - -/* -Cephes Math Library Release 2.2: June, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include <math.h> -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -static const float CBRT2 = 1.25992104989487316477; -static const float CBRT4 = 1.58740105196819947475; - -#ifndef __MINGW32__ -#ifdef ANSIC -float frexpf(float, int *), ldexpf(float, int); - -float cbrtf( float xx ) -#else -float frexpf(), ldexpf(); - -float cbrtf(xx) -double xx; -#endif -{ -int e, rem, sign; -float x, z; - -x = xx; - -#else /* __MINGW32__ */ -float cbrtf (float x) -{ -int e, rem, sign; -float z; -#endif /* __MINGW32__ */ - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0.0F ) - return x; -#else -if( x == 0 ) - return( 0.0 ); -#endif -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexpf( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 9.2e-6 - */ -x = (((-0.13466110473359520655053 * x - + 0.54664601366395524503440 ) * x - - 0.95438224771509446525043 ) * x - + 1.1399983354717293273738 ) * x - + 0.40238979564544752126924; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } - - -/* argument less than 1 */ - -else - { - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x /= CBRT2; - else if( rem == 2 ) - x /= CBRT4; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexpf( x, e ); - -/* Newton iteration */ -x -= ( x - (z/(x*x)) ) * 0.333333333333; - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/cbrtl.c b/winsup/mingw/mingwex/math/cbrtl.c deleted file mode 100644 index 36bd48f70..000000000 --- a/winsup/mingw/mingwex/math/cbrtl.c +++ /dev/null @@ -1,161 +0,0 @@ -/* cbrtl.c - * - * Cube root, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, cbrtl(); - * - * y = cbrtl( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used three times to converge to an accurate - * result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE .125,8 80000 7.0e-20 2.2e-20 - * IEEE exp(+-707) 100000 7.0e-20 2.4e-20 - * - */ - - -/* -Cephes Math Library Release 2.2: January, 1991 -Copyright 1984, 1991 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -static const long double CBRT2 = 1.2599210498948731647672L; -static const long double CBRT4 = 1.5874010519681994747517L; -static const long double CBRT2I = 0.79370052598409973737585L; -static const long double CBRT4I = 0.62996052494743658238361L; - -#ifndef __MINGW32__ - -#ifdef ANSIPROT -extern long double frexpl ( long double, int * ); -extern long double ldexpl ( long double, int ); -extern int isnanl ( long double ); -#else -long double frexpl(), ldexpl(); -extern int isnanl(); -#endif - -#ifdef INFINITIES -extern long double INFINITYL; -#endif - -#endif /* __MINGW32__ */ - -long double cbrtl(x) -long double x; -{ -int e, rem, sign; -long double z; - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0.0L) - return(x); -#else - -#ifdef NANS -if(isnanl(x)) - return(x); -#endif -#ifdef INFINITIES -if( x == INFINITYL) - return(x); -if( x == -INFINITYL) - return(x); -#endif -if( x == 0 ) - return( x ); - -#endif /* __MINGW32__ */ - -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexpl( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 1.2e-6 - */ -x = (((( 1.3584464340920900529734e-1L * x - - 6.3986917220457538402318e-1L) * x - + 1.2875551670318751538055e0L) * x - - 1.4897083391357284957891e0L) * x - + 1.3304961236013647092521e0L) * x - + 3.7568280825958912391243e-1L; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } -else - { /* argument less than 1 */ - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2I; - else if( rem == 2 ) - x *= CBRT4I; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexpl( x, e ); - -/* Newton iteration */ - -x -= ( x - (z/(x*x)) )*0.3333333333333333333333L; -x -= ( x - (z/(x*x)) )*0.3333333333333333333333L; - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/ceilf.S b/winsup/mingw/mingwex/math/ceilf.S deleted file mode 100644 index ffcdfc687..000000000 --- a/winsup/mingw/mingwex/math/ceilf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "ceilf.S" - .text - .align 4 -.globl _ceilf - .def _ceilf; .scl 2; .type 32; .endef -_ceilf: - flds 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x0800,%edx /* round towards +oo */ - orl 4(%esp),%edx - andl $0xfbff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/ceill.S b/winsup/mingw/mingwex/math/ceill.S deleted file mode 100644 index 29cb27a62..000000000 --- a/winsup/mingw/mingwex/math/ceill.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - */ - - - .file "ceill.S" - .text - .align 4 -.globl _ceill - .def _ceill; .scl 2; .type 32; .endef -_ceill: - fldt 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x0800,%edx /* round towards +oo */ - orl 4(%esp),%edx - andl $0xfbff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/cephes_emath.c b/winsup/mingw/mingwex/math/cephes_emath.c deleted file mode 100644 index ab798a2d2..000000000 --- a/winsup/mingw/mingwex/math/cephes_emath.c +++ /dev/null @@ -1,1318 +0,0 @@ -/* This file is extracted from S L Moshier's ioldoubl.c, - * modified for use in MinGW - * - * Extended precision arithmetic functions for long double I/O. - * This program has been placed in the public domain. - */ - - - -/* - * Revision history: - * - * 5 Jan 84 PDP-11 assembly language version - * 6 Dec 86 C language version - * 30 Aug 88 100 digit version, improved rounding - * 15 May 92 80-bit long double support - * - * Author: S. L. Moshier. - * - * 6 Oct 02 Modified for MinGW by inlining utility routines, - * removing global variables and splitting out strtold - * from _IO_ldtoa and _IO_ldtostr. - * - * Danny Smith <dannysmith@users.sourceforge.net> - * - */ - - -#include "cephes_emath.h" - -/* - * The constants are for 64 bit precision. - */ - - -/* Move in external format number, - * converting it to internal format. - */ -void __emovi(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b) -{ -register const unsigned short *p; -register unsigned short *q; -int i; - -q = b; -p = a + (NE-1); /* point to last word of external number */ -/* get the sign bit */ -if( *p & 0x8000 ) - *q++ = 0xffff; -else - *q++ = 0; -/* get the exponent */ -*q = *p--; -*q++ &= 0x7fff; /* delete the sign bit */ -#ifdef INFINITY -if( (*(q-1) & 0x7fff) == 0x7fff ) - { -#ifdef NANS - if( __eisnan(a) ) - { - *q++ = 0; - for( i=3; i<NI; i++ ) - *q++ = *p--; - return; - } -#endif - for( i=2; i<NI; i++ ) - *q++ = 0; - return; - } -#endif -/* clear high guard word */ -*q++ = 0; -/* move in the significand */ -for( i=0; i<NE-1; i++ ) - *q++ = *p--; -/* clear low guard word */ -*q = 0; -} - - -/* -; Add significands -; x + y replaces y -*/ - -void __eaddm(const short unsigned int * __restrict__ x, - short unsigned int * __restrict__ y) -{ -register unsigned long a; -int i; -unsigned int carry; - -x += NI-1; -y += NI-1; -carry = 0; -for( i=M; i<NI; i++ ) - { - a = (unsigned long )(*x) + (unsigned long )(*y) + carry; - if( a & 0x10000 ) - carry = 1; - else - carry = 0; - *y = (unsigned short )a; - --x; - --y; - } -} - -/* -; Subtract significands -; y - x replaces y -*/ - -void __esubm(const short unsigned int * __restrict__ x, - short unsigned int * __restrict__ y) -{ -unsigned long a; -int i; -unsigned int carry; - -x += NI-1; -y += NI-1; -carry = 0; -for( i=M; i<NI; i++ ) - { - a = (unsigned long )(*y) - (unsigned long )(*x) - carry; - if( a & 0x10000 ) - carry = 1; - else - carry = 0; - *y = (unsigned short )a; - --x; - --y; - } -} - - -/* Multiply significand of e-type number b -by 16-bit quantity a, e-type result to c. */ - -static void __m16m(short unsigned int a, - short unsigned int * __restrict__ b, - short unsigned int * __restrict__ c) -{ -register unsigned short *pp; -register unsigned long carry; -unsigned short *ps; -unsigned short p[NI]; -unsigned long aa, m; -int i; - -aa = a; -pp = &p[NI-2]; -*pp++ = 0; -*pp = 0; -ps = &b[NI-1]; - -for( i=M+1; i<NI; i++ ) - { - if( *ps == 0 ) - { - --ps; - --pp; - *(pp-1) = 0; - } - else - { - m = (unsigned long) aa * *ps--; - carry = (m & 0xffff) + *pp; - *pp-- = (unsigned short )carry; - carry = (carry >> 16) + (m >> 16) + *pp; - *pp = (unsigned short )carry; - *(pp-1) = carry >> 16; - } - } -for( i=M; i<NI; i++ ) - c[i] = p[i]; -} - - -/* Divide significands. Neither the numerator nor the denominator -is permitted to have its high guard word nonzero. */ - - -int __edivm(short unsigned int * __restrict__ den, - short unsigned int * __restrict__ num) -{ -int i; -register unsigned short *p; -unsigned long tnum; -unsigned short j, tdenm, tquot; -unsigned short tprod[NI+1]; -unsigned short equot[NI]; - -p = &equot[0]; -*p++ = num[0]; -*p++ = num[1]; - -for( i=M; i<NI; i++ ) - { - *p++ = 0; - } -__eshdn1( num ); -tdenm = den[M+1]; -for( i=M; i<NI; i++ ) - { - /* Find trial quotient digit (the radix is 65536). */ - tnum = (((unsigned long) num[M]) << 16) + num[M+1]; - - /* Do not execute the divide instruction if it will overflow. */ - if( (tdenm * 0xffffUL) < tnum ) - tquot = 0xffff; - else - tquot = tnum / tdenm; - - /* Prove that the divide worked. */ -/* - tcheck = (unsigned long )tquot * tdenm; - if( tnum - tcheck > tdenm ) - tquot = 0xffff; -*/ - /* Multiply denominator by trial quotient digit. */ - __m16m( tquot, den, tprod ); - /* The quotient digit may have been overestimated. */ - if( __ecmpm( tprod, num ) > 0 ) - { - tquot -= 1; - __esubm( den, tprod ); - if( __ecmpm( tprod, num ) > 0 ) - { - tquot -= 1; - __esubm( den, tprod ); - } - } - __esubm( tprod, num ); - equot[i] = tquot; - __eshup6(num); - } -/* test for nonzero remainder after roundoff bit */ -p = &num[M]; -j = 0; -for( i=M; i<NI; i++ ) - { - j |= *p++; - } -if( j ) - j = 1; - -for( i=0; i<NI; i++ ) - num[i] = equot[i]; - -return( (int )j ); -} - - - -/* Multiply significands */ -int __emulm(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b) -{ -const unsigned short *p; -unsigned short *q; -unsigned short pprod[NI]; -unsigned short equot[NI]; -unsigned short j; -int i; - -equot[0] = b[0]; -equot[1] = b[1]; -for( i=M; i<NI; i++ ) - equot[i] = 0; - -j = 0; -p = &a[NI-1]; -q = &equot[NI-1]; -for( i=M+1; i<NI; i++ ) - { - if( *p == 0 ) - { - --p; - } - else - { - __m16m( *p--, b, pprod ); - __eaddm(pprod, equot); - } - j |= *q; - __eshdn6(equot); - } - -for( i=0; i<NI; i++ ) - b[i] = equot[i]; - -/* return flag for lost nonzero bits */ -return( (int)j ); -} - - - -/* - * Normalize and round off. - * - * The internal format number to be rounded is "s". - * Input "lost" indicates whether the number is exact. - * This is the so-called sticky bit. - * - * Input "subflg" indicates whether the number was obtained - * by a subtraction operation. In that case if lost is nonzero - * then the number is slightly smaller than indicated. - * - * Input "exp" is the biased exponent, which may be negative. - * the exponent field of "s" is ignored but is replaced by - * "exp" as adjusted by normalization and rounding. - * - * Input "rcntrl" is the rounding control. - * - * Input "rnprc" is precison control (64 or NBITS). - */ - -void __emdnorm(short unsigned int *s, int lost, int subflg, long int exp, int rcntrl, int rndprc) -{ -int i, j; -unsigned short r; -int rw = NI-1; /* low guard word */ -int re = NI-2; -const unsigned short rmsk = 0xffff; -const unsigned short rmbit = 0x8000; -#if NE == 6 -unsigned short rbit[NI] = {0,0,0,0,0,0,0,1,0}; -#else -unsigned short rbit[NI] = {0,0,0,0,0,0,0,0,0,0,0,1,0}; -#endif - -/* Normalize */ -j = __enormlz( s ); - -/* a blank significand could mean either zero or infinity. */ -#ifndef INFINITY -if( j > NBITS ) - { - __ecleazs( s ); - return; - } -#endif -exp -= j; -#ifndef INFINITY -if( exp >= 32767L ) - goto overf; -#else -if( (j > NBITS) && (exp < 32767L) ) - { - __ecleazs( s ); - return; - } -#endif -if( exp < 0L ) - { - if( exp > (long )(-NBITS-1) ) - { - j = (int )exp; - i = __eshift( s, j ); - if( i ) - lost = 1; - } - else - { - __ecleazs( s ); - return; - } - } -/* Round off, unless told not to by rcntrl. */ -if( rcntrl == 0 ) - goto mdfin; -if (rndprc == 64) - { - rw = 7; - re = 6; - rbit[NI-2] = 0; - rbit[6] = 1; - } - -/* Shift down 1 temporarily if the data structure has an implied - * most significant bit and the number is denormal. - * For rndprc = 64 or NBITS, there is no implied bit. - * But Intel long double denormals lose one bit of significance even so. - */ -#if IBMPC -if( (exp <= 0) && (rndprc != NBITS) ) -#else -if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) ) -#endif - { - lost |= s[NI-1] & 1; - __eshdn1(s); - } -/* Clear out all bits below the rounding bit, - * remembering in r if any were nonzero. - */ -r = s[rw] & rmsk; -if( rndprc < NBITS ) - { - i = rw + 1; - while( i < NI ) - { - if( s[i] ) - r |= 1; - s[i] = 0; - ++i; - } - } -s[rw] &= ~rmsk; -if( (r & rmbit) != 0 ) - { - if( r == rmbit ) - { - if( lost == 0 ) - { /* round to even */ - if( (s[re] & 1) == 0 ) - goto mddone; - } - else - { - if( subflg != 0 ) - goto mddone; - } - } - __eaddm( rbit, s ); - } -mddone: -#if IBMPC -if( (exp <= 0) && (rndprc != NBITS) ) -#else -if( (exp <= 0) && (rndprc != 64) && (rndprc != NBITS) ) -#endif - { - __eshup1(s); - } -if( s[2] != 0 ) - { /* overflow on roundoff */ - __eshdn1(s); - exp += 1; - } -mdfin: -s[NI-1] = 0; -if( exp >= 32767L ) - { -#ifndef INFINITY -overf: -#endif -#ifdef INFINITY - s[1] = 32767; - for( i=2; i<NI-1; i++ ) - s[i] = 0; -#else - s[1] = 32766; - s[2] = 0; - for( i=M+1; i<NI-1; i++ ) - s[i] = 0xffff; - s[NI-1] = 0; - if( (rndprc < 64) || (rndprc == 113) ) - s[rw] &= ~rmsk; -#endif - return; - } -if( exp < 0 ) - s[1] = 0; -else - s[1] = (unsigned short )exp; -} - - -/* -; Multiply. -; -; unsigned short a[NE], b[NE], c[NE]; -; emul( a, b, c ); c = b * a -*/ -void __emul(const short unsigned int *a, - const short unsigned int *b, - short unsigned int *c) -{ -unsigned short ai[NI], bi[NI]; -int i, j; -long lt, lta, ltb; - -#ifdef NANS -/* NaN times anything is the same NaN. */ -if( __eisnan(a) ) - { - __emov(a,c); - return; - } -if( __eisnan(b) ) - { - __emov(b,c); - return; - } -/* Zero times infinity is a NaN. */ -if( (__eisinf(a) && __eiiszero(b)) - || (__eisinf(b) && __eiiszero(a)) ) - { - mtherr( "emul", DOMAIN ); - __enan_NBITS( c ); - return; - } -#endif -/* Infinity times anything else is infinity. */ -#ifdef INFINITY -if( __eisinf(a) || __eisinf(b) ) - { - if( __eisneg(a) ^ __eisneg(b) ) - *(c+(NE-1)) = 0x8000; - else - *(c+(NE-1)) = 0; - __einfin(c); - return; - } -#endif -__emovi( a, ai ); -__emovi( b, bi ); -lta = ai[E]; -ltb = bi[E]; -if( ai[E] == 0 ) - { - for( i=1; i<NI-1; i++ ) - { - if( ai[i] != 0 ) - { - lta -= __enormlz( ai ); - goto mnzer1; - } - } - __eclear(c); - return; - } -mnzer1: - -if( bi[E] == 0 ) - { - for( i=1; i<NI-1; i++ ) - { - if( bi[i] != 0 ) - { - ltb -= __enormlz( bi ); - goto mnzer2; - } - } - __eclear(c); - return; - } -mnzer2: - -/* Multiply significands */ -j = __emulm( ai, bi ); -/* calculate exponent */ -lt = lta + ltb - (EXONE - 1); -__emdnorm( bi, j, 0, lt, 64, NBITS ); -/* calculate sign of product */ -if( ai[0] == bi[0] ) - bi[0] = 0; -else - bi[0] = 0xffff; -__emovo( bi, c ); -} - - -/* move out internal format to ieee long double */ -void __toe64(short unsigned int *a, short unsigned int *b) -{ -register unsigned short *p, *q; -unsigned short i; - -#ifdef NANS -if( __eiisnan(a) ) - { - __enan_64( b ); - return; - } -#endif -#ifdef IBMPC -/* Shift Intel denormal significand down 1. */ -if( a[E] == 0 ) - __eshdn1(a); -#endif -p = a; -#ifdef MIEEE -q = b; -#else -q = b + 4; /* point to output exponent */ -#if 1 -/* NOTE: if data type is 96 bits wide, clear the last word here. */ -*(q+1)= 0; -#endif -#endif - -/* combine sign and exponent */ -i = *p++; -#ifdef MIEEE -if( i ) - *q++ = *p++ | 0x8000; -else - *q++ = *p++; -*q++ = 0; -#else -if( i ) - *q-- = *p++ | 0x8000; -else - *q-- = *p++; -#endif -/* skip over guard word */ -++p; -/* move the significand */ -#ifdef MIEEE -for( i=0; i<4; i++ ) - *q++ = *p++; -#else -#ifdef INFINITY -if (__eiisinf (a)) - { - /* Intel long double infinity. */ - *q-- = 0x8000; - *q-- = 0; - *q-- = 0; - *q = 0; - return; - } -#endif -for( i=0; i<4; i++ ) - *q-- = *p++; -#endif -} - - -/* Compare two e type numbers. - * - * unsigned short a[NE], b[NE]; - * ecmp( a, b ); - * - * returns +1 if a > b - * 0 if a == b - * -1 if a < b - * -2 if either a or b is a NaN. - */ -int __ecmp(const short unsigned int * __restrict__ a, - const short unsigned int * __restrict__ b) -{ -unsigned short ai[NI], bi[NI]; -register unsigned short *p, *q; -register int i; -int msign; - -#ifdef NANS -if (__eisnan (a) || __eisnan (b)) - return( -2 ); -#endif -__emovi( a, ai ); -p = ai; -__emovi( b, bi ); -q = bi; - -if( *p != *q ) - { /* the signs are different */ -/* -0 equals + 0 */ - for( i=1; i<NI-1; i++ ) - { - if( ai[i] != 0 ) - goto nzro; - if( bi[i] != 0 ) - goto nzro; - } - return(0); -nzro: - if( *p == 0 ) - return( 1 ); - else - return( -1 ); - } -/* both are the same sign */ -if( *p == 0 ) - msign = 1; -else - msign = -1; -i = NI-1; -do - { - if( *p++ != *q++ ) - { - goto diff; - } - } -while( --i > 0 ); - -return(0); /* equality */ - - - -diff: - -if( *(--p) > *(--q) ) - return( msign ); /* p is bigger */ -else - return( -msign ); /* p is littler */ -} - -/* -; Shift significand -; -; Shifts significand area up or down by the number of bits -; given by the variable sc. -*/ -int __eshift(short unsigned int *x, int sc) -{ -unsigned short lost; -unsigned short *p; - -if( sc == 0 ) - return( 0 ); - -lost = 0; -p = x + NI-1; - -if( sc < 0 ) - { - sc = -sc; - while( sc >= 16 ) - { - lost |= *p; /* remember lost bits */ - __eshdn6(x); - sc -= 16; - } - - while( sc >= 8 ) - { - lost |= *p & 0xff; - __eshdn8(x); - sc -= 8; - } - - while( sc > 0 ) - { - lost |= *p & 1; - __eshdn1(x); - sc -= 1; - } - } -else - { - while( sc >= 16 ) - { - __eshup6(x); - sc -= 16; - } - - while( sc >= 8 ) - { - __eshup8(x); - sc -= 8; - } - - while( sc > 0 ) - { - __eshup1(x); - sc -= 1; - } - } -if( lost ) - lost = 1; -return( (int )lost ); -} - - - -/* -; normalize -; -; Shift normalizes the significand area pointed to by argument -; shift count (up = positive) is returned. -*/ -int __enormlz(short unsigned int *x) -{ -register unsigned short *p; -int sc; - -sc = 0; -p = &x[M]; -if( *p != 0 ) - goto normdn; -++p; -if( *p & 0x8000 ) - return( 0 ); /* already normalized */ -while( *p == 0 ) - { - __eshup6(x); - sc += 16; -/* With guard word, there are NBITS+16 bits available. - * return true if all are zero. - */ - if( sc > NBITS ) - return( sc ); - } -/* see if high byte is zero */ -while( (*p & 0xff00) == 0 ) - { - __eshup8(x); - sc += 8; - } -/* now shift 1 bit at a time */ -while( (*p & 0x8000) == 0) - { - __eshup1(x); - sc += 1; - if( sc > (NBITS+16) ) - { - mtherr( "enormlz", UNDERFLOW ); - return( sc ); - } - } -return( sc ); - -/* Normalize by shifting down out of the high guard word - of the significand */ -normdn: - -if( *p & 0xff00 ) - { - __eshdn8(x); - sc -= 8; - } -while( *p != 0 ) - { - __eshdn1(x); - sc -= 1; - - if( sc < -NBITS ) - { - mtherr( "enormlz", OVERFLOW ); - return( sc ); - } - } -return( sc ); -} - - -/* Move internal format number out, - * converting it to external format. - */ -void __emovo(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b) -{ -register const unsigned short *p; -register unsigned short *q; -unsigned short i; - -p = a; -q = b + (NE-1); /* point to output exponent */ -/* combine sign and exponent */ -i = *p++; -if( i ) - *q-- = *p++ | 0x8000; -else - *q-- = *p++; -#ifdef INFINITY -if( *(p-1) == 0x7fff ) - { -#ifdef NANS - if( __eiisnan(a) ) - { - __enan_NBITS( b ); - return; - } -#endif - __einfin(b); - return; - } -#endif -/* skip over guard word */ -++p; -/* move the significand */ -for( i=0; i<NE-1; i++ ) - *q-- = *p++; -} - - -#if USE_LDTOA - - -void __eiremain(short unsigned int *den, short unsigned int *num, - short unsigned int *equot ) -{ -long ld, ln; -unsigned short j; - -ld = den[E]; -ld -= __enormlz( den ); -ln = num[E]; -ln -= __enormlz( num ); -__ecleaz( equot ); -while( ln >= ld ) - { - if( __ecmpm(den,num) <= 0 ) - { - __esubm(den, num); - j = 1; - } - else - { - j = 0; - } - __eshup1(equot); - equot[NI-1] |= j; - __eshup1(num); - ln -= 1; - } -__emdnorm( num, 0, 0, ln, 0, NBITS ); -} - - -void __eadd1(const short unsigned int * __restrict__ a, - const short unsigned int * __restrict__ b, - short unsigned int * __restrict__ c, - int subflg) -{ -unsigned short ai[NI], bi[NI], ci[NI]; -int i, lost, j, k; -long lt, lta, ltb; - -#ifdef INFINITY -if( __eisinf(a) ) - { - __emov(a,c); - if( subflg ) - __eneg(c); - return; - } -if( __eisinf(b) ) - { - __emov(b,c); - return; - } -#endif -__emovi( a, ai ); -__emovi( b, bi ); -if( sub ) - ai[0] = ~ai[0]; - -/* compare exponents */ -lta = ai[E]; -ltb = bi[E]; -lt = lta - ltb; -if( lt > 0L ) - { /* put the larger number in bi */ - __emovz( bi, ci ); - __emovz( ai, bi ); - __emovz( ci, ai ); - ltb = bi[E]; - lt = -lt; - } -lost = 0; -if( lt != 0L ) - { - if( lt < (long )(-NBITS-1) ) - goto done; /* answer same as larger addend */ - k = (int )lt; - lost = __eshift( ai, k ); /* shift the smaller number down */ - } -else - { -/* exponents were the same, so must compare significands */ - i = __ecmpm( ai, bi ); - if( i == 0 ) - { /* the numbers are identical in magnitude */ - /* if different signs, result is zero */ - if( ai[0] != bi[0] ) - { - __eclear(c); - return; - } - /* if same sign, result is double */ - /* double denomalized tiny number */ - if( (bi[E] == 0) && ((bi[3] & 0x8000) == 0) ) - { - __eshup1( bi ); - goto done; - } - /* add 1 to exponent unless both are zero! */ - for( j=1; j<NI-1; j++ ) - { - if( bi[j] != 0 ) - { -/* This could overflow, but let emovo take care of that. */ - ltb += 1; - break; - } - } - bi[E] = (unsigned short )ltb; - goto done; - } - if( i > 0 ) - { /* put the larger number in bi */ - __emovz( bi, ci ); - __emovz( ai, bi ); - __emovz( ci, ai ); - } - } -if( ai[0] == bi[0] ) - { - __eaddm( ai, bi ); - subflg = 0; - } -else - { - __esubm( ai, bi ); - subflg = 1; - } -__emdnorm( bi, lost, subflg, ltb, 64, NBITS); - -done: -__emovo( bi, c ); -} - - -/* y = largest integer not greater than x - * (truncated toward minus infinity) - * - * unsigned short x[NE], y[NE] - * - * efloor( x, y ); - */ - - -void __efloor(short unsigned int *x, short unsigned int *y) -{ -register unsigned short *p; -int e, expon, i; -unsigned short f[NE]; -const unsigned short bmask[] = { -0xffff, -0xfffe, -0xfffc, -0xfff8, -0xfff0, -0xffe0, -0xffc0, -0xff80, -0xff00, -0xfe00, -0xfc00, -0xf800, -0xf000, -0xe000, -0xc000, -0x8000, -0x0000, -}; - -__emov( x, f ); /* leave in external format */ -expon = (int )f[NE-1]; -e = (expon & 0x7fff) - (EXONE - 1); -if( e <= 0 ) - { - __eclear(y); - goto isitneg; - } -/* number of bits to clear out */ -e = NBITS - e; -__emov( f, y ); -if( e <= 0 ) - return; - -p = &y[0]; -while( e >= 16 ) - { - *p++ = 0; - e -= 16; - } -/* clear the remaining bits */ -*p &= bmask[e]; -/* truncate negatives toward minus infinity */ -isitneg: - -if( (unsigned short )expon & (unsigned short )0x8000 ) - { - for( i=0; i<NE-1; i++ ) - { - if( f[i] != y[i] ) - { - __esub( __eone, y, y ); - break; - } - } - } -} - -/* -; Subtract external format numbers. -; -; unsigned short a[NE], b[NE], c[NE]; -; esub( a, b, c ); c = b - a -*/ - - -void __esub(const short unsigned int * a, - const short unsigned int * b, - short unsigned int * c) -{ - -#ifdef NANS -if( __eisnan(a) ) - { - __emov (a, c); - return; - } -if( __eisnan(b) ) - { - __emov(b,c); - return; - } -/* Infinity minus infinity is a NaN. - * Test for subtracting infinities of the same sign. - */ -if( __eisinf(a) && __eisinf(b) && ((__eisneg (a) ^ __eisneg (b)) == 0)) - { - mtherr( "esub", DOMAIN ); - __enan_NBITS( c ); - return; - } -#endif -__eadd1( a, b, c, 1 ); -} - - - -/* -; Divide. -; -; unsigned short a[NI], b[NI], c[NI]; -; ediv( a, b, c ); c = b / a -*/ - -void __ediv(const short unsigned int *a, - const short unsigned int *b, - short unsigned int *c) -{ -unsigned short ai[NI], bi[NI]; -int i; -long lt, lta, ltb; - -#ifdef NANS -/* Return any NaN input. */ -if( __eisnan(a) ) - { - __emov(a,c); - return; - } -if( __eisnan(b) ) - { - __emov(b,c); - return; - } -/* Zero over zero, or infinity over infinity, is a NaN. */ -if( (__eiszero(a) && __eiszero(b)) - || (__eisinf (a) && __eisinf (b)) ) - { - mtherr( "ediv", DOMAIN ); - __enan_NBITS( c ); - return; - } -#endif -/* Infinity over anything else is infinity. */ -#ifdef INFINITY -if( __eisinf(b) ) - { - if( __eisneg(a) ^ __eisneg(b) ) - *(c+(NE-1)) = 0x8000; - else - *(c+(NE-1)) = 0; - __einfin(c); - return; - } -if( __eisinf(a) ) - { - __eclear(c); - return; - } -#endif -__emovi( a, ai ); -__emovi( b, bi ); -lta = ai[E]; -ltb = bi[E]; -if( bi[E] == 0 ) - { /* See if numerator is zero. */ - for( i=1; i<NI-1; i++ ) - { - if( bi[i] != 0 ) - { - ltb -= __enormlz( bi ); - goto dnzro1; - } - } - __eclear(c); - return; - } -dnzro1: - -if( ai[E] == 0 ) - { /* possible divide by zero */ - for( i=1; i<NI-1; i++ ) - { - if( ai[i] != 0 ) - { - lta -= __enormlz( ai ); - goto dnzro2; - } - } - if( ai[0] == bi[0] ) - *(c+(NE-1)) = 0; - else - *(c+(NE-1)) = 0x8000; - __einfin(c); - mtherr( "ediv", SING ); - return; - } -dnzro2: - -i = __edivm( ai, bi ); -/* calculate exponent */ -lt = ltb - lta + EXONE; -__emdnorm( bi, i, 0, lt, 64, NBITS ); -/* set the sign */ -if( ai[0] == bi[0] ) - bi[0] = 0; -else - bi[0] = 0Xffff; -__emovo( bi, c ); -} - -void __e64toe(short unsigned int *pe, short unsigned int *y) -{ -unsigned short yy[NI]; -unsigned short *p, *q, *e; -int i; - -e = pe; -p = yy; -for( i=0; i<NE-5; i++ ) - *p++ = 0; -#ifdef IBMPC -for( i=0; i<5; i++ ) - *p++ = *e++; -#endif -#ifdef DEC -for( i=0; i<5; i++ ) - *p++ = *e++; -#endif -#ifdef MIEEE -p = &yy[0] + (NE-1); -*p-- = *e++; -++e; -for( i=0; i<4; i++ ) - *p-- = *e++; -#endif - -#ifdef IBMPC -/* For Intel long double, shift denormal significand up 1 - -- but only if the top significand bit is zero. */ -if((yy[NE-1] & 0x7fff) == 0 && (yy[NE-2] & 0x8000) == 0) - { - unsigned short temp[NI+1]; - __emovi(yy, temp); - __eshup1(temp); - __emovo(temp,y); - return; - } -#endif -#ifdef INFINITY -/* Point to the exponent field. */ -p = &yy[NE-1]; -if( *p == 0x7fff ) - { -#ifdef NANS -#ifdef IBMPC - for( i=0; i<4; i++ ) - { - if((i != 3 && pe[i] != 0) - /* Check for Intel long double infinity pattern. */ - || (i == 3 && pe[i] != 0x8000)) - { - __enan_NBITS( y ); - return; - } - } -#else - for( i=1; i<=4; i++ ) - { - if( pe[i] != 0 ) - { - __enan_NBITS( y ); - return; - } - } -#endif -#endif /* NANS */ - __eclear( y ); - __einfin( y ); - if( *p & 0x8000 ) - __eneg(y); - return; - } -#endif -p = yy; -q = y; -for( i=0; i<NE; i++ ) - *q++ = *p++; -} - -#endif /* USE_LDTOA */ diff --git a/winsup/mingw/mingwex/math/cephes_emath.h b/winsup/mingw/mingwex/math/cephes_emath.h deleted file mode 100644 index 78112bf18..000000000 --- a/winsup/mingw/mingwex/math/cephes_emath.h +++ /dev/null @@ -1,715 +0,0 @@ -#ifndef _CEPHES_EMATH_H -#define _CEPHES_EMATH_H - -/* This file is extracted from S L Moshier's ioldoubl.c, - * modified for use in MinGW - * - * Extended precision arithmetic functions for long double I/O. - * This program has been placed in the public domain. - */ - - - -/* - * Revision history: - * - * 5 Jan 84 PDP-11 assembly language version - * 6 Dec 86 C language version - * 30 Aug 88 100 digit version, improved rounding - * 15 May 92 80-bit long double support - * - * Author: S. L. Moshier. - * - * 6 Oct 02 Modified for MinGW by inlining utility routines, - * removing global variables, and splitting out strtold - * from _IO_ldtoa and _IO_ldtostr. - * - * Danny Smith <dannysmith@users.sourceforge.net> - * - */ - - - -/* ieee.c - * - * Extended precision IEEE binary floating point arithmetic routines - * - * Numbers are stored in C language as arrays of 16-bit unsigned - * short integers. The arguments of the routines are pointers to - * the arrays. - * - * - * External e type data structure, simulates Intel 8087 chip - * temporary real format but possibly with a larger significand: - * - * NE-1 significand words (least significant word first, - * most significant bit is normally set) - * exponent (value = EXONE for 1.0, - * top bit is the sign) - * - * - * Internal data structure of a number (a "word" is 16 bits): - * - * ei[0] sign word (0 for positive, 0xffff for negative) - * ei[1] biased __exponent (value = EXONE for the number 1.0) - * ei[2] high guard word (always zero after normalization) - * ei[3] - * to ei[NI-2] significand (NI-4 significand words, - * most significant word first, - * most significant bit is set) - * ei[NI-1] low guard word (0x8000 bit is rounding place) - * - * - * - * Routines for external format numbers - * - * __asctoe64( string, &d ) ASCII string to long double - * __asctoeg( string, e, prec ) ASCII string to specified precision - * __e64toe( &d, e ) IEEE long double precision to e type - * __eadd( a, b, c ) c = b + a - * __eclear(e) e = 0 - * __ecmp (a, b) Returns 1 if a > b, 0 if a == b, - * -1 if a < b, -2 if either a or b is a NaN. - * __ediv( a, b, c ) c = b / a - * __efloor( a, b ) truncate to integer, toward -infinity - * __efrexp( a, exp, s ) extract exponent and significand - * __eifrac( e, &l, frac ) e to long integer and e type fraction - * __euifrac( e, &l, frac ) e to unsigned long integer and e type fraction - * __einfin( e ) set e to infinity, leaving its sign alone - * __eldexp( a, n, b ) multiply by 2**n - * __emov( a, b ) b = a - * __emul( a, b, c ) c = b * a - * __eneg(e) e = -e - * __eround( a, b ) b = nearest integer value to a - * __esub( a, b, c ) c = b - a - * __e24toasc( &f, str, n ) single to ASCII string, n digits after decimal - * __e53toasc( &d, str, n ) double to ASCII string, n digits after decimal - * __e64toasc( &d, str, n ) long double to ASCII string - * __etoasc( e, str, n ) e to ASCII string, n digits after decimal - * __etoe24( e, &f ) convert e type to IEEE single precision - * __etoe53( e, &d ) convert e type to IEEE double precision - * __etoe64( e, &d ) convert e type to IEEE long double precision - * __eisneg( e ) 1 if sign bit of e != 0, else 0 - * __eisinf( e ) 1 if e has maximum exponent (non-IEEE) - * or is infinite (IEEE) - * __eisnan( e ) 1 if e is a NaN - * __esqrt( a, b ) b = square root of a - * - * - * Routines for internal format numbers - * - * __eaddm( ai, bi ) add significands, bi = bi + ai - * __ecleaz(ei) ei = 0 - * __ecleazs(ei) set ei = 0 but leave its sign alone - * __ecmpm( ai, bi ) compare significands, return 1, 0, or -1 - * __edivm( ai, bi ) divide significands, bi = bi / ai - * __emdnorm(ai,l,s,exp) normalize and round off - * __emovi( a, ai ) convert external a to internal ai - * __emovo( ai, a ) convert internal ai to external a - * __emovz( ai, bi ) bi = ai, low guard word of bi = 0 - * __emulm( ai, bi ) multiply significands, bi = bi * ai - * __enormlz(ei) left-justify the significand - * __eshdn1( ai ) shift significand and guards down 1 bit - * __eshdn8( ai ) shift down 8 bits - * __eshdn6( ai ) shift down 16 bits - * __eshift( ai, n ) shift ai n bits up (or down if n < 0) - * __eshup1( ai ) shift significand and guards up 1 bit - * __eshup8( ai ) shift up 8 bits - * __eshup6( ai ) shift up 16 bits - * __esubm( ai, bi ) subtract significands, bi = bi - ai - * - * - * The result is always normalized and rounded to NI-4 word precision - * after each arithmetic operation. - * - * Exception flags are NOT fully supported. - * - * Define INFINITY in mconf.h for support of infinity; otherwise a - * saturation arithmetic is implemented. - * - * Define NANS for support of Not-a-Number items; otherwise the - * arithmetic will never produce a NaN output, and might be confused - * by a NaN input. - * If NaN's are supported, the output of ecmp(a,b) is -2 if - * either a or b is a NaN. This means asking if(ecmp(a,b) < 0) - * may not be legitimate. Use if(ecmp(a,b) == -1) for less-than - * if in doubt. - * Signaling NaN's are NOT supported; they are treated the same - * as quiet NaN's. - * - * Denormals are always supported here where appropriate (e.g., not - * for conversion to DEC numbers). - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <math.h> -#include <locale.h> -#include <ctype.h> - -#define alloca __builtin_alloca - -/* Don't build non-ANSI _IO_ldtoa. It is not thread safe. */ -#ifndef USE_LDTOA -#define USE_LDTOA 0 -#endif - - - /* Number of 16 bit words in external x type format */ -#define NE 6 - - /* Number of 16 bit words in internal format */ -#define NI (NE+3) - - /* Array offset to exponent */ -#define E 1 - - /* Array offset to high guard word */ -#define M 2 - - /* Number of bits of precision */ -#define NBITS ((NI-4)*16) - - /* Maximum number of decimal digits in ASCII conversion - * = NBITS*log10(2) - */ -#define NDEC (NBITS*8/27) - - /* The exponent of 1.0 */ -#define EXONE (0x3fff) - - -#define mtherr(x,y) - - -extern long double strtold (const char * __restrict__ s, char ** __restrict__ se); -extern int __asctoe64(const char * __restrict__ ss, - short unsigned int * __restrict__ y); -extern void __emul(const short unsigned int * a, - const short unsigned int * b, - short unsigned int * c); -extern int __ecmp(const short unsigned int * __restrict__ a, - const short unsigned int * __restrict__ b); -extern int __enormlz(short unsigned int *x); -extern int __eshift(short unsigned int *x, int sc); -extern void __eaddm(const short unsigned int * __restrict__ x, - short unsigned int * __restrict__ y); -extern void __esubm(const short unsigned int * __restrict__ x, - short unsigned int * __restrict__ y); -extern void __emdnorm(short unsigned int *s, int lost, int subflg, - long int exp, int rcntrl, const int rndprc); -extern void __toe64(short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b); -extern int __edivm(short unsigned int * __restrict__ den, - short unsigned int * __restrict__ num); -extern int __emulm(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b); -extern void __emovi(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b); -extern void __emovo(const short unsigned int * __restrict__ a, - short unsigned int * __restrict__ b); - -#if USE_LDTOA - -extern char * _IO_ldtoa(long double, int, int, int *, int *, char **); -extern void _IO_ldtostr(long double *x, char *string, int ndigs, - int flags, char fmt); - -extern void __eiremain(short unsigned int * __restrict__ den, - short unsigned int *__restrict__ num, - short unsigned int *__restrict__ equot); -extern void __efloor(short unsigned int *x, short unsigned int *y); -extern void __eadd1(const short unsigned int * __restrict__ a, - const short unsigned int * __restrict__ b, - short unsigned int * __restrict__ c, - int subflg); -extern void __esub(const short unsigned int *a, const short unsigned int *b, - short unsigned int *c); -extern void __ediv(const short unsigned int *a, const short unsigned int *b, - short unsigned int *c); -extern void __e64toe(short unsigned int *pe, short unsigned int *y); - - -#endif - -static __inline__ int __eisneg(const short unsigned int *x); -static __inline__ int __eisinf(const short unsigned int *x); -static __inline__ int __eisnan(const short unsigned int *x); -static __inline__ int __eiszero(const short unsigned int *a); -static __inline__ void __emovz(register const short unsigned int * __restrict__ a, - register short unsigned int * __restrict__ b); -static __inline__ void __eclear(register short unsigned int *x); -static __inline__ void __ecleaz(register short unsigned int *xi); -static __inline__ void __ecleazs(register short unsigned int *xi); -static __inline__ int __eiisinf(const short unsigned int *x); -static __inline__ int __eiisnan(const short unsigned int *x); -static __inline__ int __eiiszero(const short unsigned int *x); -static __inline__ void __enan_64(short unsigned int *nan); -static __inline__ void __enan_NBITS (short unsigned int *nan); -static __inline__ void __enan_NI16 (short unsigned int *nan); -static __inline__ void __einfin(register short unsigned int *x); -static __inline__ void __eneg(short unsigned int *x); -static __inline__ void __eshup1(register short unsigned int *x); -static __inline__ void __eshup8(register short unsigned int *x); -static __inline__ void __eshup6(register short unsigned int *x); -static __inline__ void __eshdn1(register short unsigned int *x); -static __inline__ void __eshdn8(register short unsigned int *x); -static __inline__ void __eshdn6(register short unsigned int *x); - - - -/* Intel IEEE, low order words come first: - */ -#define IBMPC 1 - -/* Define 1 for ANSI C atan2() function - * See atan.c and clog.c. - */ -#define ANSIC 1 - -/*define VOLATILE volatile*/ -#define VOLATILE - -/* For 12-byte long doubles on an i386, pad a 16-bit short 0 - * to the end of real constants initialized by integer arrays. - * - * #define XPD 0, - * - * Otherwise, the type is 10 bytes long and XPD should be - * defined blank. - * - * #define XPD - */ -#define XPD 0, -/* #define XPD */ -#define NANS - -/* NaN's require infinity support. */ -#ifdef NANS -#ifndef INFINITY -#define INFINITY -#endif -#endif - -/* This handles 64-bit long ints. */ -#define LONGBITS (8 * sizeof(long)) - - -#define NTEN 12 -#define MAXP 4096 - -extern const unsigned short __etens[NTEN + 1][NE]; - -/* -; Clear out entire external format number. -; -; unsigned short x[]; -; eclear( x ); -*/ - -static __inline__ void __eclear(register short unsigned int *x) -{ - memset(x, 0, NE * sizeof(unsigned short)); -} - - -/* Move external format number from a to b. - * - * emov( a, b ); - */ - -static __inline__ void __emov(register const short unsigned int * __restrict__ a, - register short unsigned int * __restrict__ b) -{ - memcpy(b, a, NE * sizeof(unsigned short)); -} - - -/* -; Negate external format number -; -; unsigned short x[NE]; -; eneg( x ); -*/ - -static __inline__ void __eneg(short unsigned int *x) -{ - -#ifdef NANS -if( __eisnan(x) ) - return; -#endif -x[NE-1] ^= 0x8000; /* Toggle the sign bit */ -} - - -/* Return 1 if external format number is negative, - * else return zero. - */ -static __inline__ int __eisneg(const short unsigned int *x) -{ - -#ifdef NANS -if( __eisnan(x) ) - return( 0 ); -#endif -if( x[NE-1] & 0x8000 ) - return( 1 ); -else - return( 0 ); -} - - -/* Return 1 if external format number has maximum possible exponent, - * else return zero. - */ -static __inline__ int __eisinf(const short unsigned int *x) -{ - -if( (x[NE-1] & 0x7fff) == 0x7fff ) - { -#ifdef NANS - if( __eisnan(x) ) - return( 0 ); -#endif - return( 1 ); - } -else - return( 0 ); -} - -/* Check if e-type number is not a number. - */ -static __inline__ int __eisnan(const short unsigned int *x) -{ -#ifdef NANS -int i; -/* NaN has maximum __exponent */ -if( (x[NE-1] & 0x7fff) == 0x7fff ) -/* ... and non-zero significand field. */ - for( i=0; i<NE-1; i++ ) - { - if( *x++ != 0 ) - return (1); - } -#endif -return (0); -} - -/* -; Fill __entire number, including __exponent and significand, with -; largest possible number. These programs implement a saturation -; value that is an ordinary, legal number. A special value -; "infinity" may also be implemented; this would require tests -; for that value and implementation of special rules for arithmetic -; operations involving inifinity. -*/ - -static __inline__ void __einfin(register short unsigned int *x) -{ -register int i; - -#ifdef INFINITY -for( i=0; i<NE-1; i++ ) - *x++ = 0; -*x |= 32767; -#else -for( i=0; i<NE-1; i++ ) - *x++ = 0xffff; -*x |= 32766; -*(x-5) = 0; -#endif -} - -/* Clear out internal format number. - */ - -static __inline__ void __ecleaz(register short unsigned int *xi) -{ - memset(xi, 0, NI * sizeof(unsigned short)); -} - -/* same, but don't touch the sign. */ - -static __inline__ void __ecleazs(register short unsigned int *xi) -{ - ++xi; - memset(xi, 0, (NI-1) * sizeof(unsigned short)); -} - - - -/* Move internal format number from a to b. - */ -static __inline__ void __emovz(register const short unsigned int * __restrict__ a, - register short unsigned int * __restrict__ b) -{ - memcpy(b, a, (NI-1) * sizeof(unsigned short)); - b[NI-1]=0; -} - -/* Return nonzero if internal format number is a NaN. - */ - -static __inline__ int __eiisnan (const short unsigned int *x) -{ -int i; - -if( (x[E] & 0x7fff) == 0x7fff ) - { - for( i=M+1; i<NI; i++ ) - { - if( x[i] != 0 ) - return(1); - } - } -return(0); -} - -/* Return nonzero if external format number is zero. */ - -static __inline__ int -__eiszero(const short unsigned int * a) -{ -if (*((long double*) a) == 0) - return (1); -return (0); -} - -/* Return nonzero if internal format number is zero. */ - -static __inline__ int -__eiiszero(const short unsigned int * ai) -{ - int i; - /* skip the sign word */ - for( i=1; i<NI-1; i++ ) - { - if( ai[i] != 0 ) - return (0); - } - return (1); -} - - -/* Return nonzero if internal format number is infinite. */ - -static __inline__ int -__eiisinf (const unsigned short *x) -{ - -#ifdef NANS - if (__eiisnan (x)) - return (0); -#endif - if ((x[E] & 0x7fff) == 0x7fff) - return (1); - return (0); -} - -/* -; Compare significands of numbers in internal format. -; Guard words are included in the comparison. -; -; unsigned short a[NI], b[NI]; -; cmpm( a, b ); -; -; for the significands: -; returns +1 if a > b -; 0 if a == b -; -1 if a < b -*/ -static __inline__ int __ecmpm(register const short unsigned int * __restrict__ a, - register const short unsigned int * __restrict__ b) -{ -int i; - -a += M; /* skip up to significand area */ -b += M; -for( i=M; i<NI; i++ ) - { - if( *a++ != *b++ ) - goto difrnt; - } -return(0); - -difrnt: -if( *(--a) > *(--b) ) - return(1); -else - return(-1); -} - - -/* -; Shift significand down by 1 bit -*/ - -static __inline__ void __eshdn1(register short unsigned int *x) -{ -register unsigned short bits; -int i; - -x += M; /* point to significand area */ - -bits = 0; -for( i=M; i<NI; i++ ) - { - if( *x & 1 ) - bits |= 1; - *x >>= 1; - if( bits & 2 ) - *x |= 0x8000; - bits <<= 1; - ++x; - } -} - -/* -; Shift significand up by 1 bit -*/ - -static __inline__ void __eshup1(register short unsigned int *x) -{ -register unsigned short bits; -int i; - -x += NI-1; -bits = 0; - -for( i=M; i<NI; i++ ) - { - if( *x & 0x8000 ) - bits |= 1; - *x <<= 1; - if( bits & 2 ) - *x |= 1; - bits <<= 1; - --x; - } -} - - - -/* -; Shift significand down by 8 bits -*/ - -static __inline__ void __eshdn8(register short unsigned int *x) -{ -register unsigned short newbyt, oldbyt; -int i; - -x += M; -oldbyt = 0; -for( i=M; i<NI; i++ ) - { - newbyt = *x << 8; - *x >>= 8; - *x |= oldbyt; - oldbyt = newbyt; - ++x; - } -} - -/* -; Shift significand up by 8 bits -*/ - -static __inline__ void __eshup8(register short unsigned int *x) -{ -int i; -register unsigned short newbyt, oldbyt; - -x += NI-1; -oldbyt = 0; - -for( i=M; i<NI; i++ ) - { - newbyt = *x >> 8; - *x <<= 8; - *x |= oldbyt; - oldbyt = newbyt; - --x; - } -} - -/* -; Shift significand up by 16 bits -*/ - -static __inline__ void __eshup6(register short unsigned int *x) -{ -int i; -register unsigned short *p; - -p = x + M; -x += M + 1; - -for( i=M; i<NI-1; i++ ) - *p++ = *x++; - -*p = 0; -} - -/* -; Shift significand down by 16 bits -*/ - -static __inline__ void __eshdn6(register short unsigned int *x) -{ -int i; -register unsigned short *p; - -x += NI-1; -p = x + 1; - -for( i=M; i<NI-1; i++ ) - *(--p) = *(--x); - -*(--p) = 0; -} - -/* -; Add significands -; x + y replaces y -*/ - -static __inline__ void __enan_64(unsigned short* nan) -{ - - int i; - for( i=0; i<3; i++ ) - *nan++ = 0; - *nan++ = 0xc000; - *nan++ = 0x7fff; - *nan = 0; - return; -} - -static __inline__ void __enan_NBITS(unsigned short* nan) -{ - int i; - for( i=0; i<NE-2; i++ ) - *nan++ = 0; - *nan++ = 0xc000; - *nan = 0x7fff; - return; -} - -static __inline__ void __enan_NI16(unsigned short* nan) -{ - int i; - *nan++ = 0; - *nan++ = 0x7fff; - *nan++ = 0; - *nan++ = 0xc000; - for( i=4; i<NI; i++ ) - *nan++ = 0; - return; -} - -#endif /* _CEPHES_EMATH_H */ - diff --git a/winsup/mingw/mingwex/math/cephes_mconf.h b/winsup/mingw/mingwex/math/cephes_mconf.h deleted file mode 100644 index 9818c4546..000000000 --- a/winsup/mingw/mingwex/math/cephes_mconf.h +++ /dev/null @@ -1,395 +0,0 @@ -#include <math.h> -#include <errno.h> - - -#define IBMPC 1 -#define ANSIPROT 1 -#define MINUSZERO 1 -#define INFINITIES 1 -#define NANS 1 -#define DENORMAL 1 -#define VOLATILE -#define mtherr(fname, code) -#define XPD 0, - -#define _CEPHES_USE_ERRNO - -#ifdef _CEPHES_USE_ERRNO -#define _SET_ERRNO(x) errno = (x) -#else -#define _SET_ERRNO(x) -#endif - -/* constants used by cephes functions */ - -/* double */ -#define MAXNUM 1.7976931348623158E308 -#define MAXLOG 7.09782712893383996843E2 -#define MINLOG -7.08396418532264106224E2 -#define LOGE2 6.93147180559945309417E-1 -#define LOG2E 1.44269504088896340736 -#define PI 3.14159265358979323846 -#define PIO2 1.57079632679489661923 -#define PIO4 7.85398163397448309616E-1 - -#define NEGZERO (-0.0) -#undef NAN -#undef INFINITY -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITY __builtin_huge_val() -#define NAN __builtin_nan("") -#else -extern double __INF; -#define INFINITY (__INF) -extern double __QNAN; -#define NAN (__QNAN) -#endif - -/*long double*/ -#define MAXNUML 1.189731495357231765021263853E4932L -#define MAXLOGL 1.1356523406294143949492E4L -#define MINLOGL -1.13994985314888605586758E4L -#define LOGE2L 6.9314718055994530941723E-1L -#define LOG2EL 1.4426950408889634073599E0L -#define PIL 3.1415926535897932384626L -#define PIO2L 1.5707963267948966192313L -#define PIO4L 7.8539816339744830961566E-1L - -#define isfinitel isfinite -#define isinfl isinf -#define isnanl isnan -#define signbitl signbit - -#define NEGZEROL (-0.0L) - -#undef NANL -#undef INFINITYL -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITYL __builtin_huge_vall() -#define NANL __builtin_nanl("") -#else -extern long double __INFL; -#define INFINITYL (__INFL) -extern long double __QNANL; -#define NANL (__QNANL) -#endif - -/* float */ - -#define MAXNUMF 3.4028234663852885981170418348451692544e38F -#define MAXLOGF 88.72283905206835F -#define MINLOGF -103.278929903431851103F /* log(2^-149) */ -#define LOG2EF 1.44269504088896341F -#define LOGE2F 0.693147180559945309F -#define PIF 3.141592653589793238F -#define PIO2F 1.5707963267948966192F -#define PIO4F 0.7853981633974483096F - -#define isfinitef isfinite -#define isinff isinf -#define isnanf isnan -#define signbitf signbit - -#define NEGZEROF (-0.0F) - -#undef NANF -#undef INFINITYF -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITYF __builtin_huge_valf() -#define NANF __builtin_nanf("") -#else -extern float __INFF; -#define INFINITYF (__INFF) -extern float __QNANF; -#define NANF (__QNANF) -#endif - - -/* double */ - -/* -Cephes Math Library Release 2.2: July, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - - -/* polevl.c - * p1evl.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * double x, y, coef[N+1], polevl[]; - * - * y = polevl( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evl() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevl(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* Polynomial evaluator: - * P[0] x^n + P[1] x^(n-1) + ... + P[n] - */ -static __inline__ double polevl( x, p, n ) -double x; -const void *p; -int n; -{ -register double y; -register double *P = (double *)p; - -y = *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return(y); -} - - - -/* Polynomial evaluator: - * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] - */ -static __inline__ double p1evl( x, p, n ) -double x; -const void *p; -int n; -{ -register double y; -register double *P = (double *)p; - -n -= 1; -y = x + *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return( y ); -} - - -/* long double */ -/* -Cephes Math Library Release 2.2: July, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - - -/* polevll.c - * p1evll.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * long double x, y, coef[N+1], polevl[]; - * - * y = polevll( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evll() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevll(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* Polynomial evaluator: - * P[0] x^n + P[1] x^(n-1) + ... + P[n] - */ -static __inline__ long double polevll( x, p, n ) -long double x; -const void *p; -int n; -{ -register long double y; -register long double *P = (long double *)p; - -y = *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return(y); -} - - - -/* Polynomial evaluator: - * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] - */ -static __inline__ long double p1evll( x, p, n ) -long double x; -const void *p; -int n; -{ -register long double y; -register long double *P = (long double *)p; - -n -= 1; -y = x + *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return( y ); -} - -/* Float version */ - -/* polevlf.c - * p1evlf.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * float x, y, coef[N+1], polevlf[]; - * - * y = polevlf( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evl() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevl(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* -Cephes Math Library Release 2.1: December, 1988 -Copyright 1984, 1987, 1988 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -static __inline__ float polevlf(float x, const float* coef, int N ) -{ -float ans; -float *p; -int i; - -p = (float*)coef; -ans = *p++; - -/* -for( i=0; i<N; i++ ) - ans = ans * x + *p++; -*/ - -i = N; -do - ans = ans * x + *p++; -while( --i ); - -return( ans ); -} - -/* p1evl() */ -/* N - * Evaluate polynomial when coefficient of x is 1.0. - * Otherwise same as polevl. - */ - -static __inline__ float p1evlf( float x, const float *coef, int N ) -{ -float ans; -float *p; -int i; - -p = (float*)coef; -ans = x + *p++; -i = N-1; - -do - ans = ans * x + *p++; -while( --i ); - -return( ans ); -} diff --git a/winsup/mingw/mingwex/math/copysign.S b/winsup/mingw/mingwex/math/copysign.S deleted file mode 100644 index 60d6c72db..000000000 --- a/winsup/mingw/mingwex/math/copysign.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "copysign.S" - .text - .align 4 -.globl _copysign - .def _copysign; .scl 2; .type 32; .endef -_copysign: - movl 16(%esp),%edx - movl 8(%esp),%eax - andl $0x80000000,%edx - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,8(%esp) - fldl 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/copysignf.S b/winsup/mingw/mingwex/math/copysignf.S deleted file mode 100644 index 8a60c463c..000000000 --- a/winsup/mingw/mingwex/math/copysignf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "copysignf.S" - .text - .align 4 -.globl _copysignf - .def _copysignf; .scl 2; .type 32; .endef -_copysignf: - movl 8(%esp),%edx - movl 4(%esp),%eax - andl $0x80000000,%edx - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,4(%esp) - flds 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/copysignl.S b/winsup/mingw/mingwex/math/copysignl.S deleted file mode 100644 index 4143b37f8..000000000 --- a/winsup/mingw/mingwex/math/copysignl.S +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "copysignl.S" - .text - .align 4 -.globl _copysignl - .def _copysignl; .scl 2; .type 32; .endef -_copysignl: - movl 24(%esp),%edx - movl 12(%esp),%eax - andl $0x8000,%edx - andl $0x7fff,%eax - orl %edx,%eax - movl %eax,12(%esp) - fldt 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/cosf.S b/winsup/mingw/mingwex/math/cosf.S deleted file mode 100644 index 862f6ce6c..000000000 --- a/winsup/mingw/mingwex/math/cosf.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Removed glibc header dependancy by Danny Smith - * <dannysmith@users.sourceforge.net> - */ - .file "cosf.S" - .text - .align 4 -.globl _cosl - .def _cosf; .scl 2; .type 32; .endef -_cosf: - flds 4(%esp) - fcos - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fcos - ret diff --git a/winsup/mingw/mingwex/math/coshf.c b/winsup/mingw/mingwex/math/coshf.c deleted file mode 100644 index 4e44f0811..000000000 --- a/winsup/mingw/mingwex/math/coshf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float coshf (float x) - {return (float) cosh (x);} diff --git a/winsup/mingw/mingwex/math/coshl.c b/winsup/mingw/mingwex/math/coshl.c deleted file mode 100644 index c698e50c0..000000000 --- a/winsup/mingw/mingwex/math/coshl.c +++ /dev/null @@ -1,110 +0,0 @@ -/* coshl.c - * - * Hyperbolic cosine, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, coshl(); - * - * y = coshl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic cosine of argument in the range MINLOGL to - * MAXLOGL. - * - * cosh(x) = ( exp(x) + exp(-x) )/2. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE +-10000 30000 1.1e-19 2.8e-20 - * - * - * ERROR MESSAGES: - * - * message condition value returned - * cosh overflow |x| > MAXLOGL+LOGE2L INFINITYL - * - * - */ - - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1985, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - - -#ifndef __MINGW32__ -extern long double MAXLOGL, MAXNUML, LOGE2L; -#ifdef ANSIPROT -extern long double expl ( long double ); -extern int isnanl ( long double ); -#else -long double expl(), isnanl(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#endif /* __MINGW32__ */ - -long double coshl(x) -long double x; -{ -long double y; - -#ifdef NANS -if( isnanl(x) ) - { - _SET_ERRNO(EDOM); - return(x); - } -#endif -if( x < 0 ) - x = -x; -if( x > (MAXLOGL + LOGE2L) ) - { - mtherr( "coshl", OVERFLOW ); - _SET_ERRNO(ERANGE); -#ifdef INFINITIES - return( INFINITYL ); -#else - return( MAXNUML ); -#endif - } -if( x >= (MAXLOGL - LOGE2L) ) - { - y = expl(0.5L * x); - y = (0.5L * y) * y; - return(y); - } -y = expl(x); -y = 0.5L * (y + 1.0L / y); -return( y ); -} diff --git a/winsup/mingw/mingwex/math/cosl.S b/winsup/mingw/mingwex/math/cosl.S deleted file mode 100644 index 59d9858b3..000000000 --- a/winsup/mingw/mingwex/math/cosl.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Removed glibc header dependancy by Danny Smith - * <dannysmith@users.sourceforge.net> - */ - .file "cosl.S" - .text - .align 4 -.globl _cosl - .def _cosl; .scl 2; .type 32; .endef -_cosl: - fldt 4(%esp) - fcos - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fcos - ret diff --git a/winsup/mingw/mingwex/math/exp2.S b/winsup/mingw/mingwex/math/exp2.S deleted file mode 100644 index 320065726..000000000 --- a/winsup/mingw/mingwex/math/exp2.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2.S" - .text - .align 4 -.globl _exp2 - .def _exp2; .scl 2; .type 32; .endef -_exp2: - fldl 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/exp2f.S b/winsup/mingw/mingwex/math/exp2f.S deleted file mode 100644 index 0707a0cc6..000000000 --- a/winsup/mingw/mingwex/math/exp2f.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2f.S" - .text - .align 4 -.globl _exp2f - .def _exp2f; .scl 2; .type 32; .endef -_exp2f: - flds 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/exp2l.S b/winsup/mingw/mingwex/math/exp2l.S deleted file mode 100644 index 2457c26f4..000000000 --- a/winsup/mingw/mingwex/math/exp2l.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2l.S" - .text - .align 4 -.globl _exp2l - .def _exp2l; .scl 2; .type 32; .endef -_exp2l: - fldt 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/expf.c b/winsup/mingw/mingwex/math/expf.c deleted file mode 100644 index e56e0bc6e..000000000 --- a/winsup/mingw/mingwex/math/expf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float expf (float x) - {return (float) exp (x);} diff --git a/winsup/mingw/mingwex/math/expl.c b/winsup/mingw/mingwex/math/expl.c deleted file mode 100644 index 5f8face2c..000000000 --- a/winsup/mingw/mingwex/math/expl.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -/* - * The 8087 method for the exponential function is to calculate - * exp(x) = 2^(x log2(e)) - * after separating integer and fractional parts - * x log2(e) = i + f, |f| <= .5 - * 2^i is immediate but f needs to be precise for long double accuracy. - * Suppress range reduction error in computing f by the following. - * Separate x into integer and fractional parts - * x = xi + xf, |xf| <= .5 - * Separate log2(e) into the sum of an exact number c0 and small part c1. - * c0 + c1 = log2(e) to extra precision - * Then - * f = (c0 xi - i) + c0 xf + c1 x - * where c0 xi is exact and so also is (c0 xi - i). - * -- moshier@na-net.ornl.gov - */ - -#include <math.h> - -static long double c0 = 1.44268798828125L; -static long double c1 = 7.05260771340735992468e-6L; - -long double -expl (long double x) -{ - long double res; - -/* I added the following ugly construct because expl(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - asm ("fxam\n\t" /* Is NaN or +-Inf? */ - "fstsw %%ax\n\t" - "movb $0x45, %%dh\n\t" - "andb %%ah, %%dh\n\t" - "cmpb $0x05, %%dh\n\t" - "je 1f\n\t" /* Is +-Inf, jump. */ - "fldl2e\n\t" /* 1 log2(e) */ - "fmul %%st(1),%%st\n\t" /* 1 x log2(e) */ - "frndint\n\t" /* 1 i */ - "fld %%st(1)\n\t" /* 2 x */ - "frndint\n\t" /* 2 xi */ - "fld %%st(1)\n\t" /* 3 i */ - "fldt %2\n\t" /* 4 c0 */ - "fld %%st(2)\n\t" /* 5 xi */ - "fmul %%st(1),%%st\n\t" /* 5 c0 xi */ - "fsubp %%st,%%st(2)\n\t" /* 4 f = c0 xi - i */ - "fld %%st(4)\n\t" /* 5 x */ - "fsub %%st(3),%%st\n\t" /* 5 xf = x - xi */ - "fmulp %%st,%%st(1)\n\t" /* 4 c0 xf */ - "faddp %%st,%%st(1)\n\t" /* 3 f = f + c0 xf */ - "fldt %3\n\t" /* 4 */ - "fmul %%st(4),%%st\n\t" /* 4 c1 * x */ - "faddp %%st,%%st(1)\n\t" /* 3 f = f + c1 * x */ - "f2xm1\n\t" /* 3 2^(fract(x * log2(e))) - 1 */ - "fld1\n\t" /* 4 1.0 */ - "faddp\n\t" /* 3 2^(fract(x * log2(e))) */ - "fstp %%st(1)\n\t" /* 2 */ - "fscale\n\t" /* 2 scale factor is st(1); e^x */ - "fstp %%st(1)\n\t" /* 1 */ - "fstp %%st(1)\n\t" /* 0 */ - "jmp 2f\n\t" - "1:\ttestl $0x200, %%eax\n\t" /* Test sign. */ - "jz 2f\n\t" /* If positive, jump. */ - "fstp %%st\n\t" - "fldz\n\t" /* Set result to 0. */ - "2:\t\n" - : "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx"); - return res; -} diff --git a/winsup/mingw/mingwex/math/fabs.c b/winsup/mingw/mingwex/math/fabs.c deleted file mode 100644 index c2074e8cb..000000000 --- a/winsup/mingw/mingwex/math/fabs.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -double -fabs (double x) -{ - double res; - - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fabsf.c b/winsup/mingw/mingwex/math/fabsf.c deleted file mode 100644 index 6580f955c..000000000 --- a/winsup/mingw/mingwex/math/fabsf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -float -fabsf (float x) -{ - float res; - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fabsl.c b/winsup/mingw/mingwex/math/fabsl.c deleted file mode 100644 index eead724d4..000000000 --- a/winsup/mingw/mingwex/math/fabsl.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long double -fabsl (long double x) -{ - long double res; - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fdim.c b/winsup/mingw/mingwex/math/fdim.c deleted file mode 100644 index 330b09241..000000000 --- a/winsup/mingw/mingwex/math/fdim.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fdim (double x, double y) -{ - return (isgreater(x, y) ? (x - y) : 0.0); -} diff --git a/winsup/mingw/mingwex/math/fdimf.c b/winsup/mingw/mingwex/math/fdimf.c deleted file mode 100644 index 02bfc6e5e..000000000 --- a/winsup/mingw/mingwex/math/fdimf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fdimf (float x, float y) -{ - return (isgreater(x, y) ? (x - y) : 0.0F); -} diff --git a/winsup/mingw/mingwex/math/fdiml.c b/winsup/mingw/mingwex/math/fdiml.c deleted file mode 100644 index 1c3d0aaaa..000000000 --- a/winsup/mingw/mingwex/math/fdiml.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fdiml (long double x, long double y) -{ - return (isgreater(x, y) ? (x - y) : 0.0L); -} diff --git a/winsup/mingw/mingwex/math/floorf.S b/winsup/mingw/mingwex/math/floorf.S deleted file mode 100644 index 8ae8100a7..000000000 --- a/winsup/mingw/mingwex/math/floorf.S +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "floorf.S" - .text - .align 4 -.globl _floorf - .def _floorf; .scl 2; .type 32; .endef -_floorf: - flds 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/floorl.S b/winsup/mingw/mingwex/math/floorl.S deleted file mode 100644 index 5ab9214b5..000000000 --- a/winsup/mingw/mingwex/math/floorl.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * - */ - .file "floorl.S" - .text - .align 4 -.globl _floorl - .def _floorl; .scl 2; .type 32; .endef -_floorl: - fldt 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/fma.S b/winsup/mingw/mingwex/math/fma.S deleted file mode 100644 index d6226653c..000000000 --- a/winsup/mingw/mingwex/math/fma.S +++ /dev/null @@ -1,12 +0,0 @@ - .file "fma.S" - .text - .align 2 - .p2align 4,,15 -.globl _fma - .def _fma; .scl 2; .type 32; .endef -_fma: - fldl 4(%esp) - fmull 12(%esp) - fldl 20(%esp) - faddp - ret diff --git a/winsup/mingw/mingwex/math/fmaf.S b/winsup/mingw/mingwex/math/fmaf.S deleted file mode 100644 index 0d64ac2f1..000000000 --- a/winsup/mingw/mingwex/math/fmaf.S +++ /dev/null @@ -1,12 +0,0 @@ - .file "fmaf.S" - .text - .align 2 - .p2align 4,,15 -.globl _fmaf - .def _fmaf; .scl 2; .type 32; .endef -_fmaf: - flds 4(%esp) - fmuls 8(%esp) - flds 12(%esp) - faddp - ret diff --git a/winsup/mingw/mingwex/math/fmal.c b/winsup/mingw/mingwex/math/fmal.c deleted file mode 100644 index 1fbd41d28..000000000 --- a/winsup/mingw/mingwex/math/fmal.c +++ /dev/null @@ -1,5 +0,0 @@ -long double -fmal ( long double _x, long double _y, long double _z) -{ - return ((_x * _y) + _z); -} diff --git a/winsup/mingw/mingwex/math/fmax.c b/winsup/mingw/mingwex/math/fmax.c deleted file mode 100644 index 35c1f45e5..000000000 --- a/winsup/mingw/mingwex/math/fmax.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fmax (double _x, double _y) -{ - return ( isgreaterequal (_x, _y)|| __isnan (_y) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmaxf.c b/winsup/mingw/mingwex/math/fmaxf.c deleted file mode 100644 index 079a7e746..000000000 --- a/winsup/mingw/mingwex/math/fmaxf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fmaxf (float _x, float _y) -{ - return (( isgreaterequal(_x, _y) || __isnanf (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmaxl.c b/winsup/mingw/mingwex/math/fmaxl.c deleted file mode 100644 index 4e38da476..000000000 --- a/winsup/mingw/mingwex/math/fmaxl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fmaxl (long double _x, long double _y) -{ - return (( isgreaterequal(_x, _y) || __isnanl (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmin.c b/winsup/mingw/mingwex/math/fmin.c deleted file mode 100644 index 96a6ed111..000000000 --- a/winsup/mingw/mingwex/math/fmin.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fmin (double _x, double _y) -{ - return ((islessequal(_x, _y) || __isnan (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fminf.c b/winsup/mingw/mingwex/math/fminf.c deleted file mode 100644 index f3d71480d..000000000 --- a/winsup/mingw/mingwex/math/fminf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fminf (float _x, float _y) -{ - return ((islessequal(_x, _y) || _isnan (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fminl.c b/winsup/mingw/mingwex/math/fminl.c deleted file mode 100644 index d8a3fea2c..000000000 --- a/winsup/mingw/mingwex/math/fminl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fminl (long double _x, long double _y) -{ - return ((islessequal(_x, _y) || __isnanl (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmodf.c b/winsup/mingw/mingwex/math/fmodf.c deleted file mode 100644 index 6405d725f..000000000 --- a/winsup/mingw/mingwex/math/fmodf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for float type by Danny Smith - * <dannysmith@users.sourceforge.net>. - */ - -#include <math.h> - -float -fmodf (float x, float y) -{ - float res; - - asm ("1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/fmodl.c b/winsup/mingw/mingwex/math/fmodl.c deleted file mode 100644 index f1c97f10b..000000000 --- a/winsup/mingw/mingwex/math/fmodl.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -fmodl (long double x, long double y) -{ - long double res; - - asm ("1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/fp_consts.c b/winsup/mingw/mingwex/math/fp_consts.c deleted file mode 100644 index 285c9d7dc..000000000 --- a/winsup/mingw/mingwex/math/fp_consts.c +++ /dev/null @@ -1,14 +0,0 @@ - -#include "fp_consts.h" -const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP }; -const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP }; -const union _ieee_rep __INF = { __DOUBLE_INF_REP }; -const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP }; - -/* ISO C99 */ -#undef nan -/* FIXME */ -double nan (const char * tagp __attribute__((unused)) ) - { return __QNAN.double_val; } - - diff --git a/winsup/mingw/mingwex/math/fp_consts.h b/winsup/mingw/mingwex/math/fp_consts.h deleted file mode 100644 index 249339501..000000000 --- a/winsup/mingw/mingwex/math/fp_consts.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _FP_CONSTS_H -#define _FP_CONSTS_H - -/* -According to IEEE 754 a QNaN has exponent bits of all 1 values and -initial significand bit of 1. A SNaN has has an exponent of all 1 -values and initial significand bit of 0 (with one or more other -significand bits of 1). An Inf has significand of 0 and -exponent of all 1 values. A denormal value has all exponent bits of 0. - -The following does _not_ follow those rules, but uses values -equal to those exported from MS C++ runtime lib, msvcprt.dll -for float and double. MSVC however, does not have long doubles. -*/ - - -#define __DOUBLE_INF_REP { 0, 0, 0, 0x7ff0 } -#define __DOUBLE_QNAN_REP { 0, 0, 0, 0xfff8 } /* { 0, 0, 0, 0x7ff8 } */ -#define __DOUBLE_SNAN_REP { 0, 0, 0, 0xfff0 } /* { 1, 0, 0, 0x7ff0 } */ -#define __DOUBLE_DENORM_REP {1, 0, 0, 0} - -#define D_NAN_MASK 0x7ff0000000000000LL /* this will mask NaN's and Inf's */ - -#define __FLOAT_INF_REP { 0, 0x7f80 } -#define __FLOAT_QNAN_REP { 0, 0xffc0 } /* { 0, 0x7fc0 } */ -#define __FLOAT_SNAN_REP { 0, 0xff80 } /* { 1, 0x7f80 } */ -#define __FLOAT_DENORM_REP {1,0} - -#define F_NAN_MASK 0x7f800000 - -/* - This assumes no implicit (hidden) bit in extended mode. - Padded to 96 bits - */ -#define __LONG_DOUBLE_INF_REP { 0, 0, 0, 0x8000, 0x7fff, 0 } -#define __LONG_DOUBLE_QNAN_REP { 0, 0, 0, 0xc000, 0xffff, 0 } -#define __LONG_DOUBLE_SNAN_REP { 0, 0, 0, 0x8000, 0xffff, 0 } -#define __LONG_DOUBLE_DENORM_REP {1, 0, 0, 0, 0, 0} - -union _ieee_rep -{ - unsigned short rep[6]; - float float_val; - double double_val; - long double ldouble_val; -} ; - -#endif diff --git a/winsup/mingw/mingwex/math/fp_constsf.c b/winsup/mingw/mingwex/math/fp_constsf.c deleted file mode 100644 index 5a4afef2b..000000000 --- a/winsup/mingw/mingwex/math/fp_constsf.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "fp_consts.h" - -const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP }; -const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP }; -const union _ieee_rep __INFF = { __FLOAT_INF_REP }; -const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP }; - -/* ISO C99 */ -#undef nanf -/* FIXME */ -float nanf(const char * tagp __attribute__((unused)) ) - { return __QNANF.float_val;} diff --git a/winsup/mingw/mingwex/math/fp_constsl.c b/winsup/mingw/mingwex/math/fp_constsl.c deleted file mode 100644 index 44fdb7fd3..000000000 --- a/winsup/mingw/mingwex/math/fp_constsl.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "fp_consts.h" - -const union _ieee_rep __QNANL = { __LONG_DOUBLE_QNAN_REP }; -const union _ieee_rep __SNANL = { __LONG_DOUBLE_SNAN_REP }; -const union _ieee_rep __INFL = { __LONG_DOUBLE_INF_REP }; -const union _ieee_rep __DENORML = { __LONG_DOUBLE_DENORM_REP }; - - -#undef nanl -/* FIXME */ -long double nanl (const char * tagp __attribute__((unused)) ) - { return __QNANL.ldouble_val; } diff --git a/winsup/mingw/mingwex/math/fpclassify.c b/winsup/mingw/mingwex/math/fpclassify.c deleted file mode 100644 index f8cd8cb44..000000000 --- a/winsup/mingw/mingwex/math/fpclassify.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> - -/* 'fxam' sets FPU flags C3,C2,C0 'fstsw' stores: - FP_NAN 001 0x0100 - FP_NORMAL 010 0x0400 - FP_INFINITE 011 0x0500 - FP_ZERO 100 0x4000 - FP_SUBNORMAL 110 0x4400 - -and sets C1 flag (signbit) if neg */ - -int __fpclassify (double _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/fpclassifyf.c b/winsup/mingw/mingwex/math/fpclassifyf.c deleted file mode 100644 index aca4e59f1..000000000 --- a/winsup/mingw/mingwex/math/fpclassifyf.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> -int __fpclassifyf (float _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/fpclassifyl.c b/winsup/mingw/mingwex/math/fpclassifyl.c deleted file mode 100644 index 9979d6278..000000000 --- a/winsup/mingw/mingwex/math/fpclassifyl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> -int __fpclassifyl (long double _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/frexpf.c b/winsup/mingw/mingwex/math/frexpf.c deleted file mode 100644 index df262abc5..000000000 --- a/winsup/mingw/mingwex/math/frexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float frexpf (float x, int* expn) - {return (float)frexp(x, expn);} diff --git a/winsup/mingw/mingwex/math/frexpl.S b/winsup/mingw/mingwex/math/frexpl.S deleted file mode 100644 index 2b691c87f..000000000 --- a/winsup/mingw/mingwex/math/frexpl.S +++ /dev/null @@ -1,71 +0,0 @@ -/* - Cephes Math Library Release 2.7: May, 1998 - Copyright 1984, 1987, 1988, 1992, 1998 by Stephen L. Moshier - - Extracted from floorl.387 for use in libmingwex.a by - Danny Smith <dannysmith@users.sourceforge.net> - 2002-06-20 -*/ - -/* - * frexpl(long double x, int* expnt) extracts the exponent from x. - * It returns an integer power of two to expnt and the significand - * between 0.5 and 1 to y. Thus x = y * 2**expn. - */ - .align 2 -.globl _frexpl -_frexpl: - pushl %ebp - movl %esp,%ebp - subl $24,%esp - pushl %esi - pushl %ebx - fldt 8(%ebp) - movl 20(%ebp),%ebx - fld %st(0) - fstpt -12(%ebp) - leal -4(%ebp),%ecx - movw -4(%ebp),%dx - andl $32767,%edx - jne L25 - fldz - fucompp - fnstsw %ax - andb $68,%ah - xorb $64,%ah - jne L21 - movl $0,(%ebx) - fldz - jmp L24 - .align 2,0x90 - .align 2,0x90 -L21: - fldt -12(%ebp) - fadd %st(0),%st - fstpt -12(%ebp) - decl %edx - movw (%ecx),%si - andl $32767,%esi - jne L22 - cmpl $-66,%edx - jg L21 -L22: - addl %esi,%edx - jmp L19 - .align 2,0x90 -L25: - fstp %st(0) -L19: - addl $-16382,%edx - movl %edx,(%ebx) - movw (%ecx),%ax - andl $-32768,%eax - orl $16382,%eax - movw %ax,(%ecx) - fldt -12(%ebp) -L24: - leal -32(%ebp),%esp - popl %ebx - popl %esi - leave - ret diff --git a/winsup/mingw/mingwex/math/fucom.c b/winsup/mingw/mingwex/math/fucom.c deleted file mode 100644 index 80c937262..000000000 --- a/winsup/mingw/mingwex/math/fucom.c +++ /dev/null @@ -1,11 +0,0 @@ -int -__fp_unordered_compare (long double x, long double y){ - unsigned short retval; - __asm__ ( - "fucom %%st(1);" - "fnstsw;" - : "=a" (retval) - : "t" (x), "u" (y) - ); - return retval; -} diff --git a/winsup/mingw/mingwex/math/hypotf.c b/winsup/mingw/mingwex/math/hypotf.c deleted file mode 100644 index ee67a45dc..000000000 --- a/winsup/mingw/mingwex/math/hypotf.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <math.h> - -float hypotf (float x, float y) - { return (float) _hypot (x, y);} diff --git a/winsup/mingw/mingwex/math/hypotl.c b/winsup/mingw/mingwex/math/hypotl.c deleted file mode 100644 index 2a25b82c3..000000000 --- a/winsup/mingw/mingwex/math/hypotl.c +++ /dev/null @@ -1,73 +0,0 @@ -#include <math.h> -#include <float.h> -#include <errno.h> - -/* -This implementation is based largely on Cephes library -function cabsl (cmplxl.c), which bears the following notice: - -Cephes Math Library Release 2.1: January, 1989 -Copyright 1984, 1987, 1989 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for use in libmingwex.a - 02 Sept 2002 Danny Smith <dannysmith@users.sourceforege.net> - Calls to ldexpl replaced by logbl and calls to frexpl replaced - by scalbnl to avoid duplicated range checks. -*/ - -extern long double __INFL; -#define PRECL 32 - -long double -hypotl (long double x, long double y) -{ - int exx; - int eyy; - int scale; - long double xx =fabsl(x); - long double yy =fabsl(y); - if (!isfinite(xx) || !isfinite(yy)) - return xx + yy; /* Return INF or NAN. */ - - if (xx == 0.0L) - return yy; - if (yy == 0.0L) - return xx; - - /* Get exponents */ - exx = logbl (xx); - eyy = logbl (yy); - - /* Check if large differences in scale */ - scale = exx - eyy; - if ( scale > PRECL) - return xx; - if ( scale < -PRECL) - return yy; - - /* Exponent of approximate geometric mean (x 2) */ - scale = (exx + eyy) >> 1; - - /* Rescale: Geometric mean is now about 2 */ - x = scalbnl(xx, -scale); - y = scalbnl(yy, -scale); - - xx = sqrtl(x * x + y * y); - - /* Check for overflow and underflow */ - exx = logbl(xx); - exx += scale; - if (exx > LDBL_MAX_EXP) - { - errno = ERANGE; - return __INFL; - } - if (exx < LDBL_MIN_EXP) - return 0.0L; - - /* Undo scaling */ - return (scalbnl (xx, scale)); -} diff --git a/winsup/mingw/mingwex/math/ilogb.S b/winsup/mingw/mingwex/math/ilogb.S deleted file mode 100644 index 2335b5146..000000000 --- a/winsup/mingw/mingwex/math/ilogb.S +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - - .file "ilogb.S" - .text - .align 4 -.globl _ilogb - .def _ilogb; .scl 2; .type 32; .endef -_ilogb: - - fldl 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/ilogbf.S b/winsup/mingw/mingwex/math/ilogbf.S deleted file mode 100644 index fa3e78e84..000000000 --- a/winsup/mingw/mingwex/math/ilogbf.S +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "ilogbf.S" - .text - .align 4 -.globl _ilogbf - .def _ilogbf; .scl 2; .type 32; .endef -_ilogbf: - flds 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/ilogbl.S b/winsup/mingw/mingwex/math/ilogbl.S deleted file mode 100644 index b9dc6ea72..000000000 --- a/winsup/mingw/mingwex/math/ilogbl.S +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "ilogbl.S" - .text - .align 4 -.globl _ilogbl - .def _ilogbl; .scl 2; .type 32; .endef -_ilogbl: - fldt 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/isnan.c b/winsup/mingw/mingwex/math/isnan.c deleted file mode 100644 index b38bc290e..000000000 --- a/winsup/mingw/mingwex/math/isnan.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <math.h> - -int -__isnan (double _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x)); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -#undef isnan -int __attribute__ ((alias ("__isnan"))) isnan (double); diff --git a/winsup/mingw/mingwex/math/isnanf.c b/winsup/mingw/mingwex/math/isnanf.c deleted file mode 100644 index 73fe0eb02..000000000 --- a/winsup/mingw/mingwex/math/isnanf.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <math.h> -int -__isnanf (float _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x) ); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -int __attribute__ ((alias ("__isnanf"))) isnanf (float); diff --git a/winsup/mingw/mingwex/math/isnanl.c b/winsup/mingw/mingwex/math/isnanl.c deleted file mode 100644 index 86d0088b4..000000000 --- a/winsup/mingw/mingwex/math/isnanl.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <math.h> - -int -__isnanl (long double _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x)); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -int __attribute__ ((alias ("__isnanl"))) isnanl (long double); diff --git a/winsup/mingw/mingwex/math/ldexpf.c b/winsup/mingw/mingwex/math/ldexpf.c deleted file mode 100644 index 5d01a0184..000000000 --- a/winsup/mingw/mingwex/math/ldexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float ldexpf (float x, int expn) - {return (float) ldexp (x, expn);} diff --git a/winsup/mingw/mingwex/math/ldexpl.c b/winsup/mingw/mingwex/math/ldexpl.c deleted file mode 100644 index 19a3d56e3..000000000 --- a/winsup/mingw/mingwex/math/ldexpl.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <errno.h> - -long double ldexpl(long double x, int expn) -{ - long double res; - if (!isfinite (x) || x == 0.0L) - return x; - - __asm__ ("fscale" - : "=t" (res) - : "0" (x), "u" ((long double) expn)); - - if (!isfinite (res) || res == 0.0L) - errno = ERANGE; - - return res; -} - diff --git a/winsup/mingw/mingwex/math/lgamma.c b/winsup/mingw/mingwex/math/lgamma.c deleted file mode 100644 index f85094957..000000000 --- a/winsup/mingw/mingwex/math/lgamma.c +++ /dev/null @@ -1,359 +0,0 @@ -/* lgam() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * double x, y, __lgamma_r(); - * int* sgngam; - * y = __lgamma_r( x, sgngam ); - * - * double x, y, lgamma(); - * y = lgamma( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version, the sign (+1 or -1) of the gamma function is returned - * in the variable referenced by sgngam. - * - * For arguments greater than 13, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula using a polynomial approximation of - * degree 4. Arguments between -33 and +33 are reduced by - * recurrence to the interval [2,3] of a rational approximation. - * The cosecant reflection formula is employed for arguments - * less than -33. - * - * Arguments greater than MAXLGM return MAXNUM and an error - * message. MAXLGM = 2.035093e36 for DEC - * arithmetic or 2.556348e305 for IEEE arithmetic. - * - * - * - * ACCURACY: - * - * - * arithmetic domain # trials peak rms - * DEC 0, 3 7000 5.2e-17 1.3e-17 - * DEC 2.718, 2.035e36 5000 3.9e-17 9.9e-18 - * IEEE 0, 3 28000 5.4e-16 1.1e-16 - * IEEE 2.718, 2.556e305 40000 3.5e-16 8.3e-17 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * - * The following test used the relative error criterion, though - * at certain points the relative error could be much higher than - * indicated. - * IEEE -200, -4 10000 4.8e-16 1.3e-16 - * - */ - -/* - * Cephes Math Library Release 2.8: June, 2000 - * Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier - */ - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#ifdef ANSIPROT -extern double pow ( double, double ); -extern double log ( double ); -extern double exp ( double ); -extern double sin ( double ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double floor ( double ); -extern double fabs ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -#else -double pow(), log(), exp(), sin(), polevl(), p1evl(), floor(), fabs(); -int isnan(), isfinite(); -#endif -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#else /* __MINGW32__ */ -#include "cephes_mconf.h" -#endif /* __MINGW32__ */ - - -/* A[]: Stirling's formula expansion of log gamma - * B[], C[]: log gamma function between 2 and 3 - */ -#ifdef UNK -static double A[] = { - 8.11614167470508450300E-4, --5.95061904284301438324E-4, - 7.93650340457716943945E-4, --2.77777777730099687205E-3, - 8.33333333333331927722E-2 -}; -static double B[] = { --1.37825152569120859100E3, --3.88016315134637840924E4, --3.31612992738871184744E5, --1.16237097492762307383E6, --1.72173700820839662146E6, --8.53555664245765465627E5 -}; -static double C[] = { -/* 1.00000000000000000000E0, */ --3.51815701436523470549E2, --1.70642106651881159223E4, --2.20528590553854454839E5, --1.13933444367982507207E6, --2.53252307177582951285E6, --2.01889141433532773231E6 -}; -/* log( sqrt( 2*pi ) ) */ -static double LS2PI = 0.91893853320467274178; -#define MAXLGM 2.556348e305 -static double LOGPI = 1.14472988584940017414; -#endif - -#ifdef DEC -static const unsigned short A[] = { -0035524,0141201,0034633,0031405, -0135433,0176755,0126007,0045030, -0035520,0006371,0003342,0172730, -0136066,0005540,0132605,0026407, -0037252,0125252,0125252,0125132 -}; -static const unsigned short B[] = { -0142654,0044014,0077633,0035410, -0144027,0110641,0125335,0144760, -0144641,0165637,0142204,0047447, -0145215,0162027,0146246,0155211, -0145322,0026110,0010317,0110130, -0145120,0061472,0120300,0025363 -}; -static const unsigned short C[] = { -/*0040200,0000000,0000000,0000000*/ -0142257,0164150,0163630,0112622, -0143605,0050153,0156116,0135272, -0144527,0056045,0145642,0062332, -0145213,0012063,0106250,0001025, -0145432,0111254,0044577,0115142, -0145366,0071133,0050217,0005122 -}; -/* log( sqrt( 2*pi ) ) */ -static const unsigned short LS2P[] = {040153,037616,041445,0172645,}; -#define LS2PI *(double *)LS2P -#define MAXLGM 2.035093e36 -static const unsigned short LPI[4] = { -0040222,0103202,0043475,0006750, -}; -#define LOGPI *(double *)LPI - -#endif - -#ifdef IBMPC -static const unsigned short A[] = { -0x6661,0x2733,0x9850,0x3f4a, -0xe943,0xb580,0x7fbd,0xbf43, -0x5ebb,0x20dc,0x019f,0x3f4a, -0xa5a1,0x16b0,0xc16c,0xbf66, -0x554b,0x5555,0x5555,0x3fb5 -}; -static const unsigned short B[] = { -0x6761,0x8ff3,0x8901,0xc095, -0xb93e,0x355b,0xf234,0xc0e2, -0x89e5,0xf890,0x3d73,0xc114, -0xdb51,0xf994,0xbc82,0xc131, -0xf20b,0x0219,0x4589,0xc13a, -0x055e,0x5418,0x0c67,0xc12a -}; -static const unsigned short C[] = { -/*0x0000,0x0000,0x0000,0x3ff0,*/ -0x12b2,0x1cf3,0xfd0d,0xc075, -0xd757,0x7b89,0xaa0d,0xc0d0, -0x4c9b,0xb974,0xeb84,0xc10a, -0x0043,0x7195,0x6286,0xc131, -0xf34c,0x892f,0x5255,0xc143, -0xe14a,0x6a11,0xce4b,0xc13e -}; -/* log( sqrt( 2*pi ) ) */ -static const unsigned short LS2P[] = { -0xbeb5,0xc864,0x67f1,0x3fed -}; -#define LS2PI *(double *)LS2P -#define MAXLGM 2.556348e305 -static const unsigned short LPI[4] = { -0xa1bd,0x48e7,0x50d0,0x3ff2, -}; -#define LOGPI *(double *)LPI -#endif - -#ifdef MIEEE -static const unsigned short A[] = { -0x3f4a,0x9850,0x2733,0x6661, -0xbf43,0x7fbd,0xb580,0xe943, -0x3f4a,0x019f,0x20dc,0x5ebb, -0xbf66,0xc16c,0x16b0,0xa5a1, -0x3fb5,0x5555,0x5555,0x554b -}; -static const unsigned short B[] = { -0xc095,0x8901,0x8ff3,0x6761, -0xc0e2,0xf234,0x355b,0xb93e, -0xc114,0x3d73,0xf890,0x89e5, -0xc131,0xbc82,0xf994,0xdb51, -0xc13a,0x4589,0x0219,0xf20b, -0xc12a,0x0c67,0x5418,0x055e -}; -static const unsigned short C[] = { -0xc075,0xfd0d,0x1cf3,0x12b2, -0xc0d0,0xaa0d,0x7b89,0xd757, -0xc10a,0xeb84,0xb974,0x4c9b, -0xc131,0x6286,0x7195,0x0043, -0xc143,0x5255,0x892f,0xf34c, -0xc13e,0xce4b,0x6a11,0xe14a -}; -/* log( sqrt( 2*pi ) ) */ -static const unsigned short LS2P[] = { -0x3fed,0x67f1,0xc864,0xbeb5 -}; -#define LS2PI *(double *)LS2P -#define MAXLGM 2.556348e305 -static unsigned short LPI[4] = { -0x3ff2,0x50d0,0x48e7,0xa1bd, -}; -#define LOGPI *(double *)LPI -#endif - - -/* Logarithm of gamma function */ -/* Reentrant version */ - -double __lgamma_r(double x, int* sgngam) -{ -double p, q, u, w, z; -int i; - -*sgngam = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif - -#ifdef INFINITIES -if( !isfinite(x) ) - return(INFINITY); -#endif - -if( x < -34.0 ) - { - q = -x; - w = __lgamma_r(q, sgngam); /* note this modifies sgngam! */ - p = floor(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgam", SING ); -#ifdef INFINITIES - return (INFINITY); -#else - return (MAXNUM); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngam = -1; - else - *sgngam = 1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = p - q; - } - z = q * sin( PI * z ); - if( z == 0.0 ) - goto lgsing; -/* z = log(PI) - log( z ) - w;*/ - z = LOGPI - log( z ) - w; - return( z ); - } - -if( x < 13.0 ) - { - z = 1.0; - p = 0.0; - u = x; - while( u >= 3.0 ) - { - p -= 1.0; - u = x + p; - z *= u; - } - while( u < 2.0 ) - { - if( u == 0.0 ) - goto lgsing; - z /= u; - p += 1.0; - u = x + p; - } - if( z < 0.0 ) - { - *sgngam = -1; - z = -z; - } - else - *sgngam = 1; - if( u == 2.0 ) - return( log(z) ); - p -= 2.0; - x = x + p; - p = x * polevl( x, B, 5 ) / p1evl( x, C, 6); - return( log(z) + p ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngam * INFINITY ); -#else - return( *sgngam * MAXNUM ); -#endif - } - -q = ( x - 0.5 ) * log(x) - x + LS2PI; -if( x > 1.0e8 ) - return( q ); - -p = 1.0/(x*x); -if( x >= 1000.0 ) - q += (( 7.9365079365079365079365e-4 * p - - 2.7777777777777777777778e-3) *p - + 0.0833333333333333333333) / x; -else - q += polevl( p, A, 4 ) / x; -return( q ); -} - -/* This is the C99 version */ - -double lgamma(double x) -{ - int local_sgngam=0; - return (__lgamma_r(x, &local_sgngam)); -} diff --git a/winsup/mingw/mingwex/math/lgammaf.c b/winsup/mingw/mingwex/math/lgammaf.c deleted file mode 100644 index 20982f999..000000000 --- a/winsup/mingw/mingwex/math/lgammaf.c +++ /dev/null @@ -1,253 +0,0 @@ -/* lgamf() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * float x, y, __lgammaf_r(); - * int* sgngamf; - * y = __lgammaf_r( x, sgngamf ); - * - * float x, y, lgammaf(); - * y = lgammaf( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version the sign (+1 or -1) of the gamma function is returned in - * variable referenced by sgngamf. - * - * For arguments greater than 6.5, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula. Arguments between 0 and +6.5 are reduced by - * by recurrence to the interval [.75,1.25] or [1.5,2.5] of a rational - * approximation. The cosecant reflection formula is employed for - * arguments less than zero. - * - * Arguments greater than MAXLGM = 2.035093e36 return MAXNUM and an - * error message. - * - * - * - * ACCURACY: - * - * - * - * arithmetic domain # trials peak rms - * IEEE -100,+100 500,000 7.4e-7 6.8e-8 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * The routine has low relative error for positive arguments. - * - * The following test used the relative error criterion. - * IEEE -2, +3 100000 4.0e-7 5.6e-8 - * - */ - - -/* - Cephes Math Library Release 2.7: July, 1998 - Copyright 1984, 1987, 1989, 1992, 1998 by Stephen L. Moshier -*/ - -/* - 26-11-2002 Modified for mingw. - Danny Smith <dannysmith@users.sourceforge.net> -*/ - - -/* log gamma(x+2), -.5 < x < .5 */ -static const float B[] = { - 6.055172732649237E-004, --1.311620815545743E-003, - 2.863437556468661E-003, --7.366775108654962E-003, - 2.058355474821512E-002, --6.735323259371034E-002, - 3.224669577325661E-001, - 4.227843421859038E-001 -}; - -/* log gamma(x+1), -.25 < x < .25 */ -static const float C[] = { - 1.369488127325832E-001, --1.590086327657347E-001, - 1.692415923504637E-001, --2.067882815621965E-001, - 2.705806208275915E-001, --4.006931650563372E-001, - 8.224670749082976E-001, --5.772156501719101E-001 -}; - -/* log( sqrt( 2*pi ) ) */ -static const float LS2PI = 0.91893853320467274178; -#define MAXLGM 2.035093e36 -static const float PIINV = 0.318309886183790671538; - -#ifndef __MINGW32__ -#include "mconf.h" -float floorf(float); -float polevlf( float, float *, int ); -float p1evlf( float, float *, int ); -#else -#include "cephes_mconf.h" -#endif - -/* Reentrant version */ -/* Logarithm of gamma function */ - -float __lgammaf_r( float x, int* sgngamf ) -{ -float p, q, w, z; -float nx, tx; -int i, direction; - -*sgngamf = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif - -#ifdef INFINITIES -if( !isfinite(x) ) - return(x); -#endif - - -if( x < 0.0 ) - { - q = -x; - w = __lgammaf_r(q, sgngamf); /* note this modifies sgngam! */ - p = floorf(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgamf", SING ); -#ifdef INFINITIES - return (INFINITYF); -#else - return( *sgngamf * MAXNUMF ); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngamf = -1; - else - *sgngamf = 1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = p - q; - } - z = q * sinf( PIF * z ); - if( z == 0.0 ) - goto lgsing; - z = -logf( PIINV*z ) - w; - return( z ); - } - -if( x < 6.5 ) - { - direction = 0; - z = 1.0; - tx = x; - nx = 0.0; - if( x >= 1.5 ) - { - while( tx > 2.5 ) - { - nx -= 1.0; - tx = x + nx; - z *=tx; - } - x += nx - 2.0; -iv1r5: - p = x * polevlf( x, B, 7 ); - goto cont; - } - if( x >= 1.25 ) - { - z *= x; - x -= 1.0; /* x + 1 - 2 */ - direction = 1; - goto iv1r5; - } - if( x >= 0.75 ) - { - x -= 1.0; - p = x * polevlf( x, C, 7 ); - q = 0.0; - goto contz; - } - while( tx < 1.5 ) - { - if( tx == 0.0 ) - goto lgsing; - z *=tx; - nx += 1.0; - tx = x + nx; - } - direction = 1; - x += nx - 2.0; - p = x * polevlf( x, B, 7 ); - -cont: - if( z < 0.0 ) - { - *sgngamf = -1; - z = -z; - } - else - { - *sgngamf = 1; - } - q = logf(z); - if( direction ) - q = -q; -contz: - return( p + q ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgamf", OVERFLOW ); -#ifdef INFINITIES - return( *sgngamf * INFINITYF ); -#else - return( *sgngamf * MAXNUMF ); -#endif - - } - -/* Note, though an asymptotic formula could be used for x >= 3, - * there is cancellation error in the following if x < 6.5. */ -q = LS2PI - x; -q += ( x - 0.5 ) * logf(x); - -if( x <= 1.0e4 ) - { - z = 1.0/x; - p = z * z; - q += (( 6.789774945028216E-004 * p - - 2.769887652139868E-003 ) * p - + 8.333316229807355E-002 ) * z; - } -return( q ); -} - -/* This is the C99 version */ - -float lgammaf(float x) -{ - int local_sgngamf=0; - return (__lgammaf_r(x, &local_sgngamf)); -} diff --git a/winsup/mingw/mingwex/math/lgammal.c b/winsup/mingw/mingwex/math/lgammal.c deleted file mode 100644 index d2b306afd..000000000 --- a/winsup/mingw/mingwex/math/lgammal.c +++ /dev/null @@ -1,416 +0,0 @@ -/* lgaml() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * long double x, y, __lgammal_r(); - * int* sgngaml; - * y = __lgammal_r( x, sgngaml ); - * - * long double x, y, lgammal(); - * y = lgammal( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version, the sign (+1 or -1) of the gamma function is returned - * in the variable referenced by sgngaml. - * - * For arguments greater than 33, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula using a polynomial approximation of - * degree 4. Arguments between -33 and +33 are reduced by - * recurrence to the interval [2,3] of a rational approximation. - * The cosecant reflection formula is employed for arguments - * less than -33. - * - * Arguments greater than MAXLGML (10^4928) return MAXNUML. - * - * - * - * ACCURACY: - * - * - * arithmetic domain # trials peak rms - * IEEE -40, 40 100000 2.2e-19 4.6e-20 - * IEEE 10^-2000,10^+2000 20000 1.6e-19 3.3e-20 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * - */ - -/* - * Copyright 1994 by Stephen L. Moshier - */ - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#ifndef __MINGW32__ -#include "mconf.h" -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double lgaml ( long double ); -extern long double logl ( long double ); -extern long double expl ( long double ); -extern long double gammal ( long double ); -extern long double sinl ( long double ); -extern long double floorl ( long double ); -extern long double powl ( long double, long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -#else -long double fabsl(), lgaml(), logl(), expl(), gammal(), sinl(); -long double floorl(), powl(), polevll(), p1evll(), isnanl(), isfinitel(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#else /* __MINGW32__ */ -#include "cephes_mconf.h" -#endif /* __MINGW32__ */ - -#if UNK -static long double S[9] = { --1.193945051381510095614E-3L, - 7.220599478036909672331E-3L, --9.622023360406271645744E-3L, --4.219773360705915470089E-2L, - 1.665386113720805206758E-1L, --4.200263503403344054473E-2L, --6.558780715202540684668E-1L, - 5.772156649015328608253E-1L, - 1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short S[] = { -0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD -0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD -0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD -0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD -0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD -0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD -0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD -0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static long S[27] = { -0xbff50000,0x9c7e25e5,0xd6d3baeb, -0x3ff70000,0xec9ac74e,0xceb4fe9a, -0xbff80000,0x9da5b0e9,0xdfef9225, -0xbffa0000,0xacd787dc,0xec1710b0, -0x3ffc0000,0xaa891905,0x75156b8d, -0xbffa0000,0xac0af47d,0x126bf183, -0xbffe0000,0xa7e7a013,0x57d17bf6, -0x3ffe0000,0x93c467e3,0x7db0c7a9, -0x3fff0000,0x80000000,0x00000000, -}; -#endif - -#if UNK -static long double SN[9] = { - 1.133374167243894382010E-3L, - 7.220837261893170325704E-3L, - 9.621911155035976733706E-3L, --4.219773343731191721664E-2L, --1.665386113944413519335E-1L, --4.200263503402112910504E-2L, - 6.558780715202536547116E-1L, - 5.772156649015328608727E-1L, --1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned SN[] = { -0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD -0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD -0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD -0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD -0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD -0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD -0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD -0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0xbfff, XPD -}; -#endif -#if MIEEE -static long SN[27] = { -0x3ff50000,0x948db9f7,0x02de5dd1, -0x3ff70000,0xec9cc5f1,0xdd68989b, -0x3ff80000,0x9da5386f,0x18f02ca1, -0xbffa0000,0xacd787d1,0x41dd783f, -0xbffc0000,0xaa891905,0xd76d7a5b, -0xbffa0000,0xac0af47d,0x12347f64, -0x3ffe0000,0xa7e7a013,0x57d15e26, -0x3ffe0000,0x93c467e3,0x7db0c7aa, -0xbfff0000,0x80000000,0x00000000, -}; -#endif - - -/* A[]: Stirling's formula expansion of log gamma - * B[], C[]: log gamma function between 2 and 3 - */ - - -/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x A(1/x^2) - * x >= 8 - * Peak relative error 1.51e-21 - * Relative spread of error peaks 5.67e-21 - */ -#if UNK -static long double A[7] = { - 4.885026142432270781165E-3L, --1.880801938119376907179E-3L, - 8.412723297322498080632E-4L, --5.952345851765688514613E-4L, - 7.936507795855070755671E-4L, --2.777777777750349603440E-3L, - 8.333333333333331447505E-2L, -}; -#endif -#if IBMPC -static const unsigned short A[] = { -0xd984,0xcc08,0x91c2,0xa012,0x3ff7, XPD -0x3d91,0x0304,0x3da1,0xf685,0xbff5, XPD -0x3bdc,0xaad1,0xd492,0xdc88,0x3ff4, XPD -0x8b20,0x9fce,0x844e,0x9c09,0xbff4, XPD -0xf8f2,0x30e5,0x0092,0xd00d,0x3ff4, XPD -0x4d88,0x03a8,0x60b6,0xb60b,0xbff6, XPD -0x9fcc,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD -}; -#endif -#if MIEEE -static long A[21] = { -0x3ff70000,0xa01291c2,0xcc08d984, -0xbff50000,0xf6853da1,0x03043d91, -0x3ff40000,0xdc88d492,0xaad13bdc, -0xbff40000,0x9c09844e,0x9fce8b20, -0x3ff40000,0xd00d0092,0x30e5f8f2, -0xbff60000,0xb60b60b6,0x03a84d88, -0x3ffb0000,0xaaaaaaaa,0xaaaa9fcc, -}; -#endif - -/* log gamma(x+2) = x B(x)/C(x) - * 0 <= x <= 1 - * Peak relative error 7.16e-22 - * Relative spread of error peaks 4.78e-20 - */ -#if UNK -static long double B[7] = { --2.163690827643812857640E3L, --8.723871522843511459790E4L, --1.104326814691464261197E6L, --6.111225012005214299996E6L, --1.625568062543700591014E7L, --2.003937418103815175475E7L, --8.875666783650703802159E6L, -}; -static long double C[7] = { -/* 1.000000000000000000000E0L,*/ --5.139481484435370143617E2L, --3.403570840534304670537E4L, --6.227441164066219501697E5L, --4.814940379411882186630E6L, --1.785433287045078156959E7L, --3.138646407656182662088E7L, --2.099336717757895876142E7L, -}; -#endif -#if IBMPC -static const unsigned short B[] = { -0x9557,0x4995,0x0da1,0x873b,0xc00a, XPD -0xfe44,0x9af8,0x5b8c,0xaa63,0xc00f, XPD -0x5aa8,0x7cf5,0x3684,0x86ce,0xc013, XPD -0x259a,0x258c,0xf206,0xba7f,0xc015, XPD -0xbe18,0x1ca3,0xc0a0,0xf80a,0xc016, XPD -0x168f,0x2c42,0x6717,0x98e3,0xc017, XPD -0x2051,0x9d55,0x92c8,0x876e,0xc016, XPD -}; -static const unsigned short C[] = { -/*0x0000,0x0000,0x0000,0x8000,0x3fff, XPD*/ -0xaa77,0xcf2f,0xae76,0x807c,0xc008, XPD -0xb280,0x0d74,0xb55a,0x84f3,0xc00e, XPD -0xa505,0xcd30,0x81dc,0x9809,0xc012, XPD -0x3369,0x4246,0xb8c2,0x92f0,0xc015, XPD -0x63cf,0x6aee,0xbe6f,0x8837,0xc017, XPD -0x26bb,0xccc7,0xb009,0xef75,0xc017, XPD -0x462b,0xbae8,0xab96,0xa02a,0xc017, XPD -}; -#endif -#if MIEEE -static long B[21] = { -0xc00a0000,0x873b0da1,0x49959557, -0xc00f0000,0xaa635b8c,0x9af8fe44, -0xc0130000,0x86ce3684,0x7cf55aa8, -0xc0150000,0xba7ff206,0x258c259a, -0xc0160000,0xf80ac0a0,0x1ca3be18, -0xc0170000,0x98e36717,0x2c42168f, -0xc0160000,0x876e92c8,0x9d552051, -}; -static long C[21] = { -/*0x3fff0000,0x80000000,0x00000000,*/ -0xc0080000,0x807cae76,0xcf2faa77, -0xc00e0000,0x84f3b55a,0x0d74b280, -0xc0120000,0x980981dc,0xcd30a505, -0xc0150000,0x92f0b8c2,0x42463369, -0xc0170000,0x8837be6f,0x6aee63cf, -0xc0170000,0xef75b009,0xccc726bb, -0xc0170000,0xa02aab96,0xbae8462b, -}; -#endif - -/* log( sqrt( 2*pi ) ) */ -static const long double LS2PI = 0.91893853320467274178L; -#define MAXLGM 1.04848146839019521116e+4928L - - -/* Logarithm of gamma function */ -/* Reentrant version */ - -long double __lgammal_r(long double x, int* sgngaml) -{ -long double p, q, w, z, f, nx; -int i; - -*sgngaml = 1; -#ifdef NANS -if( isnanl(x) ) - return(NANL); -#endif -#ifdef INFINITIES -if( !isfinitel(x) ) - return(INFINITYL); -#endif -if( x < -34.0L ) - { - q = -x; - w = __lgammal_r(q, sgngaml); /* note this modifies sgngam! */ - p = floorl(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgammal", SING ); -#ifdef INFINITIES - return (INFINITYL); -#else - return (MAXNUML); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngaml = -1; - else - *sgngaml = 1; - z = q - p; - if( z > 0.5L ) - { - p += 1.0L; - z = p - q; - } - z = q * sinl( PIL * z ); - if( z == 0.0L ) - goto lgsing; -/* z = LOGPI - logl( z ) - w; */ - z = logl( PIL/z ) - w; - return( z ); - } - -if( x < 13.0L ) - { - z = 1.0L; - nx = floorl( x + 0.5L ); - f = x - nx; - while( x >= 3.0L ) - { - nx -= 1.0L; - x = nx + f; - z *= x; - } - while( x < 2.0L ) - { - if( fabsl(x) <= 0.03125 ) - goto lsmall; - z /= nx + f; - nx += 1.0L; - x = nx + f; - } - if( z < 0.0L ) - { - *sgngaml = -1; - z = -z; - } - else - *sgngaml = 1; - if( x == 2.0L ) - return( logl(z) ); - x = (nx - 2.0L) + f; - p = x * polevll( x, B, 6 ) / p1evll( x, C, 7); - return( logl(z) + p ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgammal", OVERFLOW ); -#ifdef INFINITIES - return( *sgngaml * INFINITYL ); -#else - return( *sgngaml * MAXNUML ); -#endif - } - -q = ( x - 0.5L ) * logl(x) - x + LS2PI; -if( x > 1.0e10L ) - return(q); -p = 1.0L/(x*x); -q += polevll( p, A, 6 ) / x; -return( q ); - - -lsmall: -if( x == 0.0L ) - goto lgsing; -if( x < 0.0L ) - { - x = -x; - q = z / (x * polevll( x, SN, 8 )); - } -else - q = z / (x * polevll( x, S, 8 )); -if( q < 0.0L ) - { - *sgngaml = -1; - q = -q; - } -else - *sgngaml = 1; -q = logl( q ); -return(q); -} - -/* This is the C99 version */ - -long double lgammal(long double x) -{ - int local_sgngaml=0; - return (__lgammal_r(x, &local_sgngaml)); -} diff --git a/winsup/mingw/mingwex/math/llrint.c b/winsup/mingw/mingwex/math/llrint.c deleted file mode 100644 index b6d9f3273..000000000 --- a/winsup/mingw/mingwex/math/llrint.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long long llrint (double x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/llrintf.c b/winsup/mingw/mingwex/math/llrintf.c deleted file mode 100644 index 7fa67dbdf..000000000 --- a/winsup/mingw/mingwex/math/llrintf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long long llrintf (float x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/llrintl.c b/winsup/mingw/mingwex/math/llrintl.c deleted file mode 100644 index 948d96265..000000000 --- a/winsup/mingw/mingwex/math/llrintl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long long llrintl (long double x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/llround.c b/winsup/mingw/mingwex/math/llround.c deleted file mode 100644 index 45b754c75..000000000 --- a/winsup/mingw/mingwex/math/llround.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long long -llround (double x) -{ - /* Add +/- 0.5, then round towards zero. */ - double tmp = trunc (x + (x >= 0.0 ? 0.5 : -0.5)); - if (!isfinite (tmp) - || tmp > (double)LONG_LONG_MAX - || tmp < (double)LONG_LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN; */ - } - return (long long)tmp; -} diff --git a/winsup/mingw/mingwex/math/llroundf.c b/winsup/mingw/mingwex/math/llroundf.c deleted file mode 100644 index 6a6e9b51e..000000000 --- a/winsup/mingw/mingwex/math/llroundf.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long long -llroundf (float x) -{ - /* Add +/- 0.5, then round towards zero. */ - float tmp = truncf (x + (x >= 0.0F ? 0.5F : -0.5F)); - if (!isfinite (tmp) - || tmp > (float)LONG_LONG_MAX - || tmp < (float)LONG_LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0F ? LONG_LONG_MAX : LONG_LONG_MIN; */ - } - return (long long)tmp; -} diff --git a/winsup/mingw/mingwex/math/llroundl.c b/winsup/mingw/mingwex/math/llroundl.c deleted file mode 100644 index 9d2217411..000000000 --- a/winsup/mingw/mingwex/math/llroundl.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long long -llroundl (long double x) -{ - /* Add +/- 0.5, then round towards zero. */ - long double tmp = truncl (x + (x >= 0.0L ? 0.5L : -0.5L)); - if (!isfinite (tmp) - || tmp > (long double)LONG_LONG_MAX - || tmp < (long double)LONG_LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0L ? LONG_LONG_MAX : LONG_LONG_MIN; */ - } - return (long long)tmp; -} diff --git a/winsup/mingw/mingwex/math/log10f.S b/winsup/mingw/mingwex/math/log10f.S deleted file mode 100644 index 90fc9af92..000000000 --- a/winsup/mingw/mingwex/math/log10f.S +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "log10f.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log10f - .def _log10f; .scl 2; .type 32; .endef -_log10f: - fldlg2 // log10(2) - flds 4(%esp) // x : log10(2) - fxam - fnstsw - fld %st // x : x : log10(2) - sahf - jc 3f // in case x is NaN or ±Inf -4: fsubl one // x-1 : x : log10(2) - fld %st // x-1 : x-1 : x : log10(2) - fabs // |x-1| : x-1 : x : log10(2) - fcompl limit // x-1 : x : log10(2) - fnstsw // x-1 : x : log10(2) - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : log10(2) - fyl2xp1 // log10(x) - ret - -2: fstp %st(0) // x : log10(2) - fyl2x // log10(x) - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log10l.S b/winsup/mingw/mingwex/math/log10l.S deleted file mode 100644 index 8c046a09d..000000000 --- a/winsup/mingw/mingwex/math/log10l.S +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log10l.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log10l - .def _log10l; .scl 2; .type 32; .endef -_log10l: - fldlg2 // log10(2) - fldt 4(%esp) // x : log10(2) - fxam - fnstsw - fld %st // x : x : log10(2) - sahf - jc 3f // in case x is NaN or ±Inf -4: fsubl one // x-1 : x : log10(2) - fld %st // x-1 : x-1 : x : log10(2) - fabs // |x-1| : x-1 : x : log10(2) - fcompl limit // x-1 : x : log10(2) - fnstsw // x-1 : x : log10(2) - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : log10(2) - fyl2xp1 // log10(x) - ret - -2: fstp %st(0) // x : log10(2) - fyl2x // log10(x) - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1p.S b/winsup/mingw/mingwex/math/log1p.S deleted file mode 100644 index a38816cb3..000000000 --- a/winsup/mingw/mingwex/math/log1p.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1p.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .double 0.29 -one: .double 1.0 -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1p; - .def _log1p; .scl 2; .type 32; .endef -_log1p: - fldln2 - fldl 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f // in case x is NaN or ±Inf - -4: fabs - fcompl limit - fnstsw - sahf - jc 2f - faddl one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1pf.S b/winsup/mingw/mingwex/math/log1pf.S deleted file mode 100644 index 1d9949f2a..000000000 --- a/winsup/mingw/mingwex/math/log1pf.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1pf.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .float 0.29 -one: .float 1.0 -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1pf; - .def _log1pf; .scl 2; .type 32; .endef -_log1pf: - fldln2 - flds 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f // in case x is NaN or ±Inf - -4: fabs - fcomps limit - fnstsw - sahf - jc 2f - fadds one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1pl.S b/winsup/mingw/mingwex/math/log1pl.S deleted file mode 100644 index 5ce4fbaaa..000000000 --- a/winsup/mingw/mingwex/math/log1pl.S +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -* Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1pl.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .tfloat 0.29 - /* Please note: we use a double value here. Since 1.0 has - an exact representation this does not effect the accuracy - but it helps to optimize the code. */ -one: .double 1.0 - -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1pl; - .def _log1pl; .scl 2; .type 32; .endef -_log1pl: - fldln2 - fldt 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f // in case x is NaN or ±Inf -4: - fabs - fldt limit - fcompp - fnstsw - sahf - jnc 2f - faddl one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2.S b/winsup/mingw/mingwex/math/log2.S deleted file mode 100644 index 08f008310..000000000 --- a/winsup/mingw/mingwex/math/log2.S +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log2.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2 - .def _log2; .scl 2; .type 32; .endef -_log2: - fldl one - fldl 4(%esp) // x : 1 - fxam - fnstsw - fld %st // x : x : 1 - sahf - jc 3f // in case x is NaN or ±Inf -4: fsub %st(2), %st // x-1 : x : 1 - fld %st // x-1 : x-1 : x : 1 - fabs // |x-1| : x-1 : x : 1 - fcompl limit // x-1 : x : 1 - fnstsw // x-1 : x : 1 - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : 1 - fyl2xp1 // log(x) - ret - -2: fstp %st(0) // x : 1 - fyl2x // log(x) - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2f.S b/winsup/mingw/mingwex/math/log2f.S deleted file mode 100644 index 211abba3d..000000000 --- a/winsup/mingw/mingwex/math/log2f.S +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log2f.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2f - .def _log2f; .scl 2; .type 32; .endef -_log2f: - fldl one - flds 4(%esp) // x : 1 - fxam - fnstsw - fld %st // x : x : 1 - sahf - jc 3f // in case x is NaN or ±Inf -4: fsub %st(2), %st // x-1 : x : 1 - fld %st // x-1 : x-1 : x : 1 - fabs // |x-1| : x-1 : x : 1 - fcompl limit // x-1 : x : 1 - fnstsw // x-1 : x : 1 - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : 1 - fyl2xp1 // log(x) - ret - -2: fstp %st(0) // x : 1 - fyl2x // log(x) - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2l.S b/winsup/mingw/mingwex/math/log2l.S deleted file mode 100644 index 52503fc52..000000000 --- a/winsup/mingw/mingwex/math/log2l.S +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "log2l.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2l - .def _log2l; .scl 2; .type 32; .endef -_log2l: - fldl one - fldt 4(%esp) // x : 1 - fxam - fnstsw - fld %st // x : x : 1 - sahf - jc 3f // in case x is NaN or ±Inf -4: fsub %st(2), %st // x-1 : x : 1 - fld %st // x-1 : x-1 : x : 1 - fabs // |x-1| : x-1 : x : 1 - fcompl limit // x-1 : x : 1 - fnstsw // x-1 : x : 1 - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : 1 - fyl2xp1 // log(x) - ret - -2: fstp %st(0) // x : 1 - fyl2x // log(x) - ret - -3: jp 4b // in case x is ±Inf - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/logb.c b/winsup/mingw/mingwex/math/logb.c deleted file mode 100644 index cdff13647..000000000 --- a/winsup/mingw/mingwex/math/logb.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -double -logb (double x) -{ - double res; - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logbf.c b/winsup/mingw/mingwex/math/logbf.c deleted file mode 100644 index b5f57d2e1..000000000 --- a/winsup/mingw/mingwex/math/logbf.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -float -logbf (float x) -{ - float res; - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logbl.c b/winsup/mingw/mingwex/math/logbl.c deleted file mode 100644 index f1448eb99..000000000 --- a/winsup/mingw/mingwex/math/logbl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -long double -logbl (long double x) -{ - long double res; - - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logf.S b/winsup/mingw/mingwex/math/logf.S deleted file mode 100644 index 32119ecde..000000000 --- a/winsup/mingw/mingwex/math/logf.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for float by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "logf.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _logf - .def _logf; .scl 2; .type 32; .endef -_logf: - fldln2 // log(2) - flds 4(%esp) // x : log(2) - fld %st // x : x : log(2) - fsubl one // x-1 : x : log(2) - fld %st // x-1 : x-1 : x : log(2) - fabs // |x-1| : x-1 : x : log(2) - fcompl limit // x-1 : x : log(2) - fnstsw // x-1 : x : log(2) - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : log(2) - fyl2xp1 // log(x) - ret - -2: fstp %st(0) // x : log(2) - fyl2x // log(x) - ret diff --git a/winsup/mingw/mingwex/math/logl.S b/winsup/mingw/mingwex/math/logl.S deleted file mode 100644 index 8dc144915..000000000 --- a/winsup/mingw/mingwex/math/logl.S +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "logl.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _logl - .def _logl; .scl 2; .type 32; .endef -_logl: - fldln2 // log(2) - fldt 4(%esp) // x : log(2) - fld %st // x : x : log(2) - fsubl one // x-1 : x : log(2) - fld %st // x-1 : x-1 : x : log(2) - fabs // |x-1| : x-1 : x : log(2) - fcompl limit // x-1 : x : log(2) - fnstsw // x-1 : x : log(2) - andb $0x45, %ah - jz 2f - fstp %st(1) // x-1 : log(2) - fyl2xp1 // log(x) - ret - -2: fstp %st(0) // x : log(2) - fyl2x // log(x) - ret diff --git a/winsup/mingw/mingwex/math/lrint.c b/winsup/mingw/mingwex/math/lrint.c deleted file mode 100644 index 7dfa233a8..000000000 --- a/winsup/mingw/mingwex/math/lrint.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long lrint (double x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/lrintf.c b/winsup/mingw/mingwex/math/lrintf.c deleted file mode 100644 index 24b7a7d07..000000000 --- a/winsup/mingw/mingwex/math/lrintf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long lrintf (float x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/lrintl.c b/winsup/mingw/mingwex/math/lrintl.c deleted file mode 100644 index f55599332..000000000 --- a/winsup/mingw/mingwex/math/lrintl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long lrintl (long double x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/lround.c b/winsup/mingw/mingwex/math/lround.c deleted file mode 100644 index 7ee50df90..000000000 --- a/winsup/mingw/mingwex/math/lround.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long -lround (double x) -{ - /* Add +/- 0.5 then then round towards zero. */ - double tmp = trunc (x + (x >= 0.0 ? 0.5 : -0.5)); - if (!isfinite (tmp) - || tmp > (double)LONG_MAX - || tmp < (double)LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0 ? LONG_MAX : LONG_MIN; */ - } - return (long)tmp; -} diff --git a/winsup/mingw/mingwex/math/lroundf.c b/winsup/mingw/mingwex/math/lroundf.c deleted file mode 100644 index 82df69842..000000000 --- a/winsup/mingw/mingwex/math/lroundf.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long -lroundf (float x) -{ - /* Add +/- 0.5, then round towards zero. */ - float tmp = truncf (x + (x >= 0.0F ? 0.5F : -0.5F)); - if (!isfinite (tmp) - || tmp > (float)LONG_MAX - || tmp < (float)LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0F ? LONG_MAX : LONG_MIN; */ - } - return (long)tmp; -} diff --git a/winsup/mingw/mingwex/math/lroundl.c b/winsup/mingw/mingwex/math/lroundl.c deleted file mode 100644 index 7a6348124..000000000 --- a/winsup/mingw/mingwex/math/lroundl.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <limits.h> -#include <errno.h> - -long -lroundl (long double x) -{ - /* Add +/- 0.5, then round towards zero. */ - long double tmp = truncl (x + (x >= 0.0L ? 0.5L : -0.5L)); - if (!isfinite (tmp) - || tmp > (long double)LONG_MAX - || tmp < (long double)LONG_MIN) - { - errno = ERANGE; - /* Undefined behaviour, so we could return anything. */ - /* return tmp > 0.0L ? LONG_MAX : LONG_MIN; */ - } - return (long)tmp; -} diff --git a/winsup/mingw/mingwex/math/modff.c b/winsup/mingw/mingwex/math/modff.c deleted file mode 100644 index 072faace0..000000000 --- a/winsup/mingw/mingwex/math/modff.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <fenv.h> -#include <math.h> -#include <errno.h> -#define FE_ROUNDING_MASK \ - (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO) - -float -modff (float value, float* iptr) -{ - float int_part; - unsigned short saved_cw; - unsigned short tmp_cw; - /* truncate */ - asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; - asm ("fldcw %0;" : : "m" (tmp_cw)); - asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ - asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ - if (iptr) - *iptr = int_part; - return (isinf (value) ? 0.0F : value - int_part); -} diff --git a/winsup/mingw/mingwex/math/modfl.c b/winsup/mingw/mingwex/math/modfl.c deleted file mode 100644 index c7ea2cbce..000000000 --- a/winsup/mingw/mingwex/math/modfl.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <fenv.h> -#include <math.h> -#include <errno.h> -#define FE_ROUNDING_MASK \ - (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO) - -long double -modfl (long double value, long double* iptr) -{ - long double int_part; - unsigned short saved_cw; - unsigned short tmp_cw; - /* truncate */ - asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; - asm ("fldcw %0;" : : "m" (tmp_cw)); - asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ - asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ - if (iptr) - *iptr = int_part; - return (isinf (value) ? 0.0L : value - int_part); -} diff --git a/winsup/mingw/mingwex/math/nearbyint.S b/winsup/mingw/mingwex/math/nearbyint.S deleted file mode 100644 index 9730aeebf..000000000 --- a/winsup/mingw/mingwex/math/nearbyint.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyint.S" - .text - .align 4 -.globl _nearbyint - .def _nearbyint; .scl 2; .type 32; .endef -_nearbyint: - fldl 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nearbyintf.S b/winsup/mingw/mingwex/math/nearbyintf.S deleted file mode 100644 index 1c5734084..000000000 --- a/winsup/mingw/mingwex/math/nearbyintf.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyintf.S" - .text - .align 4 -.globl _nearbyintf - .def _nearbyintf; .scl 2; .type 32; .endef -_nearbyintf: - flds 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nearbyintl.S b/winsup/mingw/mingwex/math/nearbyintl.S deleted file mode 100644 index 7dbc2a8b7..000000000 --- a/winsup/mingw/mingwex/math/nearbyintl.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adaptedfor use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyintl.S" - .text - .align 4 -.globl _nearbyintl - .def _nearbyintl; .scl 2; .type 32; .endef -_nearbyintl: - fldt 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nextafterf.c b/winsup/mingw/mingwex/math/nextafterf.c deleted file mode 100644 index ac1fbee26..000000000 --- a/winsup/mingw/mingwex/math/nextafterf.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <math.h> - -float -nextafterf (float x, float y) -{ - union - { - float f; - unsigned int i; - } u; - if (isnan (y) || isnan (x)) - return x + y; - if (x == y ) - return x; - u.f = x; - if (u.i == 0u) - { - if (y > 0.0F) - u.i = 1; - else - u.i = 0x80000001; - return u.f; - } - if (((x > 0.0F) ^ (y > x)) == 0) - u.i++; - else - u.i--; - return u.f; -} diff --git a/winsup/mingw/mingwex/math/pow.c b/winsup/mingw/mingwex/math/pow.c deleted file mode 100644 index 1fa548e5e..000000000 --- a/winsup/mingw/mingwex/math/pow.c +++ /dev/null @@ -1,781 +0,0 @@ -/* pow.c - * - * Power function - * - * - * - * SYNOPSIS: - * - * double x, y, z, pow(); - * - * z = pow( x, y ); - * - * - * - * DESCRIPTION: - * - * Computes x raised to the yth power. Analytically, - * - * x**y = exp( y log(x) ). - * - * Following Cody and Waite, this program uses a lookup table - * of 2**-i/16 and pseudo extended precision arithmetic to - * obtain an extra three bits of accuracy in both the logarithm - * and the exponential. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -26,26 30000 4.2e-16 7.7e-17 - * DEC -26,26 60000 4.8e-17 9.1e-18 - * 1/26 < x < 26, with log(x) uniformly distributed. - * -26 < y < 26, y uniformly distributed. - * IEEE 0,8700 30000 1.5e-14 2.1e-15 - * 0.99 < x < 1.01, 0 < y < 8700, uniformly distributed. - * - * - * ERROR MESSAGES: - * - * message condition value returned - * pow overflow x**y > MAXNUM INFINITY - * pow underflow x**y < 1/MAXNUM 0.0 - * pow domain x<0 and y noninteger 0.0 - * - */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-09-27 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -static char fname[] = {"pow"}; -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#define SQRTH 0.70710678118654752440 - -#ifdef UNK -static double P[] = { - 4.97778295871696322025E-1, - 3.73336776063286838734E0, - 7.69994162726912503298E0, - 4.66651806774358464979E0 -}; -static double Q[] = { -/* 1.00000000000000000000E0, */ - 9.33340916416696166113E0, - 2.79999886606328401649E1, - 3.35994905342304405431E1, - 1.39995542032307539578E1 -}; -/* 2^(-i/16), IEEE precision */ -static double A[] = { - 1.00000000000000000000E0, - 9.57603280698573700036E-1, - 9.17004043204671215328E-1, - 8.78126080186649726755E-1, - 8.40896415253714502036E-1, - 8.05245165974627141736E-1, - 7.71105412703970372057E-1, - 7.38413072969749673113E-1, - 7.07106781186547572737E-1, - 6.77127773468446325644E-1, - 6.48419777325504820276E-1, - 6.20928906036742001007E-1, - 5.94603557501360513449E-1, - 5.69394317378345782288E-1, - 5.45253866332628844837E-1, - 5.22136891213706877402E-1, - 5.00000000000000000000E-1 -}; -static double B[] = { - 0.00000000000000000000E0, - 1.64155361212281360176E-17, - 4.09950501029074826006E-17, - 3.97491740484881042808E-17, --4.83364665672645672553E-17, - 1.26912513974441574796E-17, - 1.99100761573282305549E-17, --1.52339103990623557348E-17, - 0.00000000000000000000E0 -}; -static double R[] = { - 1.49664108433729301083E-5, - 1.54010762792771901396E-4, - 1.33335476964097721140E-3, - 9.61812908476554225149E-3, - 5.55041086645832347466E-2, - 2.40226506959099779976E-1, - 6.93147180559945308821E-1 -}; - -#define douba(k) A[k] -#define doubb(k) B[k] -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -#ifdef DEC -static unsigned short P[] = { -0037776,0156313,0175332,0163602, -0040556,0167577,0052366,0174245, -0040766,0062753,0175707,0055564, -0040625,0052035,0131344,0155636, -}; -static unsigned short Q[] = { -/*0040200,0000000,0000000,0000000,*/ -0041025,0052644,0154404,0105155, -0041337,0177772,0007016,0047646, -0041406,0062740,0154273,0020020, -0041137,0177054,0106127,0044555, -}; -static unsigned short A[] = { -0040200,0000000,0000000,0000000, -0040165,0022575,0012444,0103314, -0040152,0140306,0163735,0022071, -0040140,0146336,0166052,0112341, -0040127,0042374,0145326,0116553, -0040116,0022214,0012437,0102201, -0040105,0063452,0010525,0003333, -0040075,0004243,0117530,0006067, -0040065,0002363,0031771,0157145, -0040055,0054076,0165102,0120513, -0040045,0177326,0124661,0050471, -0040036,0172462,0060221,0120422, -0040030,0033760,0050615,0134251, -0040021,0141723,0071653,0010703, -0040013,0112701,0161752,0105727, -0040005,0125303,0063714,0044173, -0040000,0000000,0000000,0000000 -}; -static unsigned short B[] = { -0000000,0000000,0000000,0000000, -0021473,0040265,0153315,0140671, -0121074,0062627,0042146,0176454, -0121413,0003524,0136332,0066212, -0121767,0046404,0166231,0012553, -0121257,0015024,0002357,0043574, -0021736,0106532,0043060,0056206, -0121310,0020334,0165705,0035326, -0000000,0000000,0000000,0000000 -}; - -static unsigned short R[] = { -0034173,0014076,0137624,0115771, -0035041,0076763,0003744,0111311, -0035656,0141766,0041127,0074351, -0036435,0112533,0073611,0116664, -0037143,0054106,0134040,0152223, -0037565,0176757,0176026,0025551, -0040061,0071027,0173721,0147572 -}; - -/* -static double R[] = { -0.14928852680595608186e-4, -0.15400290440989764601e-3, -0.13333541313585784703e-2, -0.96181290595172416964e-2, -0.55504108664085595326e-1, -0.24022650695909537056e0, -0.69314718055994529629e0 -}; -*/ -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 2031.0 -#define MNEXP -2031.0 -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0x5cf0,0x7f5b,0xdb99,0x3fdf, -0xdf15,0xea9e,0xddef,0x400d, -0xeb6f,0x7f78,0xccbd,0x401e, -0x9b74,0xb65c,0xaa83,0x4012, -}; -static const unsigned short Q[] = { -/*0x0000,0x0000,0x0000,0x3ff0,*/ -0x914e,0x9b20,0xaab4,0x4022, -0xc9f5,0x41c1,0xffff,0x403b, -0x6402,0x1b17,0xccbc,0x4040, -0xe92e,0x918a,0xffc5,0x402b, -}; -static const unsigned short A[] = { -0x0000,0x0000,0x0000,0x3ff0, -0x90da,0xa2a4,0xa4af,0x3fee, -0xa487,0xdcfb,0x5818,0x3fed, -0x529c,0xdd85,0x199b,0x3fec, -0xd3ad,0x995a,0xe89f,0x3fea, -0xf090,0x82a3,0xc491,0x3fe9, -0xa0db,0x422a,0xace5,0x3fe8, -0x0187,0x73eb,0xa114,0x3fe7, -0x3bcd,0x667f,0xa09e,0x3fe6, -0x5429,0xdd48,0xab07,0x3fe5, -0x2a27,0xd536,0xbfda,0x3fe4, -0x3422,0x4c12,0xdea6,0x3fe3, -0xb715,0x0a31,0x06fe,0x3fe3, -0x6238,0x6e75,0x387a,0x3fe2, -0x517b,0x3c7d,0x72b8,0x3fe1, -0x890f,0x6cf9,0xb558,0x3fe0, -0x0000,0x0000,0x0000,0x3fe0 -}; -static const unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000, -0x3707,0xd75b,0xed02,0x3c72, -0xcc81,0x345d,0xa1cd,0x3c87, -0x4b27,0x5686,0xe9f1,0x3c86, -0x6456,0x13b2,0xdd34,0xbc8b, -0x42e2,0xafec,0x4397,0x3c6d, -0x82e4,0xd231,0xf46a,0x3c76, -0x8a76,0xb9d7,0x9041,0xbc71, -0x0000,0x0000,0x0000,0x0000 -}; -static const unsigned short R[] = { -0x937f,0xd7f2,0x6307,0x3eef, -0x9259,0x60fc,0x2fbe,0x3f24, -0xef1d,0xc84a,0xd87e,0x3f55, -0x33b7,0x6ef1,0xb2ab,0x3f83, -0x1a92,0xd704,0x6b08,0x3fac, -0xc56d,0xff82,0xbfbd,0x3fce, -0x39ef,0xfefa,0x2e42,0x3fe6 -}; - -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -#ifdef MIEEE -static unsigned short P[] = { -0x3fdf,0xdb99,0x7f5b,0x5cf0, -0x400d,0xddef,0xea9e,0xdf15, -0x401e,0xccbd,0x7f78,0xeb6f, -0x4012,0xaa83,0xb65c,0x9b74 -}; -static unsigned short Q[] = { -0x4022,0xaab4,0x9b20,0x914e, -0x403b,0xffff,0x41c1,0xc9f5, -0x4040,0xccbc,0x1b17,0x6402, -0x402b,0xffc5,0x918a,0xe92e -}; -static unsigned short A[] = { -0x3ff0,0x0000,0x0000,0x0000, -0x3fee,0xa4af,0xa2a4,0x90da, -0x3fed,0x5818,0xdcfb,0xa487, -0x3fec,0x199b,0xdd85,0x529c, -0x3fea,0xe89f,0x995a,0xd3ad, -0x3fe9,0xc491,0x82a3,0xf090, -0x3fe8,0xace5,0x422a,0xa0db, -0x3fe7,0xa114,0x73eb,0x0187, -0x3fe6,0xa09e,0x667f,0x3bcd, -0x3fe5,0xab07,0xdd48,0x5429, -0x3fe4,0xbfda,0xd536,0x2a27, -0x3fe3,0xdea6,0x4c12,0x3422, -0x3fe3,0x06fe,0x0a31,0xb715, -0x3fe2,0x387a,0x6e75,0x6238, -0x3fe1,0x72b8,0x3c7d,0x517b, -0x3fe0,0xb558,0x6cf9,0x890f, -0x3fe0,0x0000,0x0000,0x0000 -}; -static unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000, -0x3c72,0xed02,0xd75b,0x3707, -0x3c87,0xa1cd,0x345d,0xcc81, -0x3c86,0xe9f1,0x5686,0x4b27, -0xbc8b,0xdd34,0x13b2,0x6456, -0x3c6d,0x4397,0xafec,0x42e2, -0x3c76,0xf46a,0xd231,0x82e4, -0xbc71,0x9041,0xb9d7,0x8a76, -0x0000,0x0000,0x0000,0x0000 -}; -static unsigned short R[] = { -0x3eef,0x6307,0xd7f2,0x937f, -0x3f24,0x2fbe,0x60fc,0x9259, -0x3f55,0xd87e,0xc84a,0xef1d, -0x3f83,0xb2ab,0x6ef1,0x33b7, -0x3fac,0x6b08,0xd704,0x1a92, -0x3fce,0xbfbd,0xff82,0xc56d, -0x3fe6,0x2e42,0xfefa,0x39ef -}; - -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -/* log2(e) - 1 */ -#define LOG2EA 0.44269504088896340736 - -#define F W -#define Fa Wa -#define Fb Wb -#define G W -#define Ga Wa -#define Gb u -#define H W -#define Ha Wb -#define Hb Wb - -#ifdef __MINGW32__ -static __inline__ double reduc( double ); -extern double __powi ( double, int ); -extern double pow ( double x, double y); - -#else /* __MINGW32__ */ - -#ifdef ANSIPROT -extern double floor ( double ); -extern double fabs ( double ); -extern double frexp ( double, int * ); -extern double ldexp ( double, int ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double __powi ( double, int ); -extern int signbit ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -static double reduc ( double ); -#else -double floor(), fabs(), frexp(), ldexp(); -double polevl(), p1evl(), __powi(); -int signbit(), isnan(), isfinite(); -static double reduc(); -#endif -extern double MAXNUM; -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#ifdef MINUSZERO -extern double NEGZERO; -#endif - -#endif /* __MINGW32__ */ - -double pow( x, y ) -double x, y; -{ -double w, z, W, Wa, Wb, ya, yb, u; -/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */ -double aw, ay, wy; -int e, i, nflg, iyflg, yoddint; - -if( y == 0.0 ) - return( 1.0 ); -#ifdef NANS -if( isnan(x) || isnan(y) ) - { - _SET_ERRNO (EDOM); - return( x + y ); - } -#endif -if( y == 1.0 ) - return( x ); - - -#ifdef INFINITIES -if( !isfinite(y) && (x == 1.0 || x == -1.0) ) - { - mtherr( "pow", DOMAIN ); -#ifdef NANS - return( NAN ); -#else - return( INFINITY ); -#endif - } -#endif - -if( x == 1.0 ) - return( 1.0 ); - -if( y >= MAXNUM ) - { - _SET_ERRNO (ERANGE); -#ifdef INFINITIES - if( x > 1.0 ) - return( INFINITY ); -#else - if( x > 1.0 ) - return( MAXNUM ); -#endif - if( x > 0.0 && x < 1.0 ) - return( 0.0); - if( x < -1.0 ) - { -#ifdef INFINITIES - return( INFINITY ); -#else - return( MAXNUM ); -#endif - } - if( x > -1.0 && x < 0.0 ) - return( 0.0 ); - } -if( y <= -MAXNUM ) - { - _SET_ERRNO (ERANGE); - if( x > 1.0 ) - return( 0.0 ); -#ifdef INFINITIES - if( x > 0.0 && x < 1.0 ) - return( INFINITY ); -#else - if( x > 0.0 && x < 1.0 ) - return( MAXNUM ); -#endif - if( x < -1.0 ) - return( 0.0 ); -#ifdef INFINITIES - if( x > -1.0 && x < 0.0 ) - return( INFINITY ); -#else - if( x > -1.0 && x < 0.0 ) - return( MAXNUM ); -#endif - } -if( x >= MAXNUM ) - { -#if INFINITIES - if( y > 0.0 ) - return( INFINITY ); -#else - if( y > 0.0 ) - return( MAXNUM ); -#endif - return(0.0); - } -/* Set iyflg to 1 if y is an integer. */ -iyflg = 0; -w = floor(y); -if( w == y ) - iyflg = 1; - -/* Test for odd integer y. */ -yoddint = 0; -if( iyflg ) - { - ya = fabs(y); - ya = floor(0.5 * ya); - yb = 0.5 * fabs(w); - if( ya != yb ) - yoddint = 1; - } - -if( x <= -MAXNUM ) - { - if( y > 0.0 ) - { -#ifdef INFINITIES - if( yoddint ) - return( -INFINITY ); - return( INFINITY ); -#else - if( yoddint ) - return( -MAXNUM ); - return( MAXNUM ); -#endif - } - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - } - -nflg = 0; /* flag = 1 if x<0 raised to integer power */ -if( x <= 0.0 ) - { - if( x == 0.0 ) - { - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( signbit(x) && yoddint ) - return( -INFINITY ); -#endif -#ifdef INFINITIES - return( INFINITY ); -#else - return( MAXNUM ); -#endif - } - if( y > 0.0 ) - { -#ifdef MINUSZERO - if( signbit(x) && yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - return( 1.0 ); - } - else - { - if( iyflg == 0 ) - { /* noninteger power of negative number */ - mtherr( fname, DOMAIN ); - _SET_ERRNO (EDOM); -#ifdef NANS - return(NAN); -#else - return(0.0L); -#endif - } - nflg = 1; - } - } - -/* Integer power of an integer. */ - -if( iyflg ) - { - i = w; - w = floor(x); - if( (w == x) && (fabs(y) < 32768.0) ) - { - w = __powi( x, (int) y ); - return( w ); - } - } - -if( nflg ) - x = fabs(x); - -/* For results close to 1, use a series expansion. */ -w = x - 1.0; -aw = fabs(w); -ay = fabs(y); -wy = w * y; -ya = fabs(wy); -if((aw <= 1.0e-3 && ay <= 1.0) - || (ya <= 1.0e-3 && ay >= 1.0)) - { - z = (((((w*(y-5.)/720. + 1./120.)*w*(y-4.) + 1./24.)*w*(y-3.) - + 1./6.)*w*(y-2.) + 0.5)*w*(y-1.) )*wy + wy + 1.; - goto done; - } -/* These are probably too much trouble. */ -#if 0 -w = y * log(x); -if (aw > 1.0e-3 && fabs(w) < 1.0e-3) - { - z = (((((( - w/7. + 1.)*w/6. + 1.)*w/5. + 1.)*w/4. + 1.)*w/3. + 1.)*w/2. + 1.)*w + 1.; - goto done; - } - -if(ya <= 1.0e-3 && aw <= 1.0e-4) - { - z = ((((( - wy*1./720. - + (-w*1./48. + 1./120.) )*wy - + ((w*17./144. - 1./12.)*w + 1./24.) )*wy - + (((-w*5./16. + 7./24.)*w - 1./4.)*w + 1./6.) )*wy - + ((((w*137./360. - 5./12.)*w + 11./24.)*w - 1./2.)*w + 1./2.) )*wy - + (((((-w*1./6. + 1./5.)*w - 1./4)*w + 1./3.)*w -1./2.)*w ) )*wy - + wy + 1.0; - goto done; - } -#endif - -/* separate significand from exponent */ -x = frexp( x, &e ); - -#if 0 -/* For debugging, check for gross overflow. */ -if( (e * y) > (MEXP + 1024) ) - goto overflow; -#endif - -/* Find significand of x in antilog table A[]. */ -i = 1; -if( x <= douba(9) ) - i = 9; -if( x <= douba(i+4) ) - i += 4; -if( x <= douba(i+2) ) - i += 2; -if( x >= douba(1) ) - i = -1; -i += 1; - - -/* Find (x - A[i])/A[i] - * in order to compute log(x/A[i]): - * - * log(x) = log( a x/a ) = log(a) + log(x/a) - * - * log(x/a) = log(1+v), v = x/a - 1 = (x-a)/a - */ -x -= douba(i); -x -= doubb(i/2); -x /= douba(i); - - -/* rational approximation for log(1+v): - * - * log(1+v) = v - v**2/2 + v**3 P(v) / Q(v) - */ -z = x*x; -w = x * ( z * polevl( x, P, 3 ) / p1evl( x, Q, 4 ) ); -w = w - ldexp( z, -1 ); /* w - 0.5 * z */ - -/* Convert to base 2 logarithm: - * multiply by log2(e) - */ -w = w + LOG2EA * w; -/* Note x was not yet added in - * to above rational approximation, - * so do it now, while multiplying - * by log2(e). - */ -z = w + LOG2EA * x; -z = z + x; - -/* Compute exponent term of the base 2 logarithm. */ -w = -i; -w = ldexp( w, -4 ); /* divide by 16 */ -w += e; -/* Now base 2 log of x is w + z. */ - -/* Multiply base 2 log by y, in extended precision. */ - -/* separate y into large part ya - * and small part yb less than 1/16 - */ -ya = reduc(y); -yb = y - ya; - - -F = z * y + w * yb; -Fa = reduc(F); -Fb = F - Fa; - -G = Fa + w * ya; -Ga = reduc(G); -Gb = G - Ga; - -H = Fb + Gb; -Ha = reduc(H); -w = ldexp( Ga+Ha, 4 ); - -/* Test the power of 2 for overflow */ -if( w > MEXP ) - { -#ifndef INFINITIES - mtherr( fname, OVERFLOW ); -#endif -#ifdef INFINITIES - if( nflg && yoddint ) - return( -INFINITY ); - return( INFINITY ); -#else - if( nflg && yoddint ) - return( -MAXNUM ); - return( MAXNUM ); -#endif - } - -if( w < (MNEXP - 1) ) - { -#ifndef DENORMAL - mtherr( fname, UNDERFLOW ); -#endif -#ifdef MINUSZERO - if( nflg && yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - -e = w; -Hb = H - Ha; - -if( Hb > 0.0 ) - { - e += 1; - Hb -= 0.0625; - } - -/* Now the product y * log2(x) = Hb + e/16.0. - * - * Compute base 2 exponential of Hb, - * where -0.0625 <= Hb <= 0. - */ -z = Hb * polevl( Hb, R, 6 ); /* z = 2**Hb - 1 */ - -/* Express e/16 as an integer plus a negative number of 16ths. - * Find lookup table entry for the fractional power of 2. - */ -if( e < 0 ) - i = 0; -else - i = 1; -i = e/16 + i; -e = 16*i - e; -w = douba( e ); -z = w + w * z; /* 2**-e * ( 1 + (2**Hb-1) ) */ -z = ldexp( z, i ); /* multiply by integer power of 2 */ - -done: - -/* Negate if odd integer power of negative number */ -if( nflg && yoddint ) - { -#ifdef MINUSZERO - if( z == 0.0 ) - z = NEGZERO; - else -#endif - z = -z; - } -return( z ); -} - - -/* Find a multiple of 1/16 that is within 1/16 of x. */ -static __inline__ double reduc(x) -double x; -{ -double t; - -t = ldexp( x, 4 ); -t = floor( t ); -t = ldexp( t, -4 ); -return(t); -} diff --git a/winsup/mingw/mingwex/math/powf.c b/winsup/mingw/mingwex/math/powf.c deleted file mode 100644 index 1af4d2d8f..000000000 --- a/winsup/mingw/mingwex/math/powf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float powf (float x, float y) - {return (float) pow (x, y);} diff --git a/winsup/mingw/mingwex/math/powi.c b/winsup/mingw/mingwex/math/powi.c deleted file mode 100644 index 9dd0c3d82..000000000 --- a/winsup/mingw/mingwex/math/powi.c +++ /dev/null @@ -1,200 +0,0 @@ -/* powi.c - * - * Real raised to integer power - * - * - * - * SYNOPSIS: - * - * double x, y, __powi(); - * int n; - * - * y = __powi( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * DEC .04,26 -26,26 100000 2.7e-16 4.3e-17 - * IEEE .04,26 -26,26 50000 2.0e-15 3.8e-16 - * IEEE 1,2 -1022,1023 50000 8.6e-14 1.6e-14 - * - * Returns MAXNUM on overflow, zero on underflow. - * - */ - -/* powi.c */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#ifdef ANSIPROT -extern double log ( double ); -extern double frexp ( double, int * ); -extern int signbit ( double ); -#else -double log(), frexp(); -int signbit(); -#endif -extern double NEGZERO, INFINITY, MAXNUM, MAXLOG, MINLOG, LOGE2; -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -double __powi( x, nn ) -double x; -int nn; -{ -int n, e, sign, asign, lx; -double w, y, s; - -/* See pow.c for these tests. */ -if( x == 0.0 ) - { - if( nn == 0 ) - return( 1.0 ); - else if( nn < 0 ) - return( INFINITY ); - else - { - if( nn & 1 ) - return( x ); - else - return( 0.0 ); - } - } - -if( nn == 0 ) - return( 1.0 ); - -if( nn == -1 ) - return( 1.0/x ); - -if( x < 0.0 ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Even power will be positive. */ -if( (n & 1) == 0 ) - asign = 0; - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = frexp( x, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1) / (s + 7.0710678118654752e-1); - s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2; - } -else - { - s = LOGE2 * e; - } - -if( s > MAXLOG ) - { - mtherr( "powi", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITY; - goto done; - } - -#if DENORMAL -if( s < MINLOG ) - { - y = 0.0; - goto done; - } - -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( (s < (-MAXLOG+2.0)) && (sign < 0) ) - { - x = 1.0/x; - sign = -sign; - } -#else -/* do not produce denormal answer */ -if( s < -MAXLOG ) - return(0.0); -#endif - - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - y = 1.0; - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - -if( sign < 0 ) - y = 1.0/y; - -done: - -if( asign ) - { - /* odd power of negative number */ - if( y == 0.0 ) - y = NEGZERO; - else - y = -y; - } -return(y); -} diff --git a/winsup/mingw/mingwex/math/powif.c b/winsup/mingw/mingwex/math/powif.c deleted file mode 100644 index 160fb5476..000000000 --- a/winsup/mingw/mingwex/math/powif.c +++ /dev/null @@ -1,198 +0,0 @@ -/* powi.c - * - * Real raised to integer power - * - * - * - * SYNOPSIS: - * - * float x, y, __powif(); - * int n; - * - * y = powi( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * DEC .04,26 -26,26 100000 2.7e-16 4.3e-17 - * IEEE .04,26 -26,26 50000 2.0e-15 3.8e-16 - * IEEE 1,2 -1022,1023 50000 8.6e-14 1.6e-14 - * - * Returns MAXNUM on overflow, zero on underflow. - * - */ - -/* powi.c */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for float from powi.c and adapted to mingw -2002-10-01 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#ifdef ANSIPROT -extern float logf ( float ); -extern float frexpf ( float, int * ); -extern int signbitf ( float ); -#else -float logf(), frexpf(); -int signbitf(); -#endif -extern float NEGZEROF, INFINITYF, MAXNUMF, MAXLOGF, MINLOGF, LOGE2F; -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -float __powif( float x, int nn ) -{ -int n, e, sign, asign, lx; -float w, y, s; - -/* See pow.c for these tests. */ -if( x == 0.0F ) - { - if( nn == 0 ) - return( 1.0F ); - else if( nn < 0 ) - return( INFINITYF ); - else - { - if( nn & 1 ) - return( x ); - else - return( 0.0 ); - } - } - -if( nn == 0 ) - return( 1.0 ); - -if( nn == -1 ) - return( 1.0/x ); - -if( x < 0.0 ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Even power will be positive. */ -if( (n & 1) == 0 ) - asign = 0; - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = frexpf( x, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1) / (s + 7.0710678118654752e-1); - s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2F; - } -else - { - s = LOGE2F * e; - } - -if( s > MAXLOGF ) - { - mtherr( "__powif", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITYF; - goto done; - } - -#if DENORMAL -if( s < MINLOGF ) - { - y = 0.0; - goto done; - } - -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( (s < (-MAXLOGF+2.0)) && (sign < 0) ) - { - x = 1.0/x; - sign = -sign; - } -#else -/* do not produce denormal answer */ -if( s < -MAXLOGF ) - return(0.0); -#endif - - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - y = 1.0; - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - -if( sign < 0 ) - y = 1.0/y; - -done: - -if( asign ) - { - /* odd power of negative number */ - if( y == 0.0 ) - y = NEGZEROF; - else - y = -y; - } -return(y); -} diff --git a/winsup/mingw/mingwex/math/powil.c b/winsup/mingw/mingwex/math/powil.c deleted file mode 100644 index ec7a2866b..000000000 --- a/winsup/mingw/mingwex/math/powil.c +++ /dev/null @@ -1,179 +0,0 @@ -/* __powil.c - * - * Real raised to integer power, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, __powil(); - * int n; - * - * y = __powil( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * IEEE .001,1000 -1022,1023 50000 4.3e-17 7.8e-18 - * IEEE 1,2 -1022,1023 20000 3.9e-17 7.6e-18 - * IEEE .99,1.01 0,8700 10000 3.6e-16 7.2e-17 - * - * Returns INFINITY on overflow, zero on underflow. - * - */ - -/* __powil.c */ - -/* -Cephes Math Library Release 2.2: December, 1990 -Copyright 1984, 1990 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -extern long double MAXNUML, MAXLOGL, MINLOGL; -extern long double LOGE2L; -#ifdef ANSIPROT -extern long double frexpl ( long double, int * ); -#else -long double frexpl(); -#endif -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -long double __powil( x, nn ) -long double x; -int nn; -{ -long double w, y; -long double s; -int n, e, sign, asign, lx; - -if( x == 0.0L ) - { - if( nn == 0 ) - return( 1.0L ); - else if( nn < 0 ) - return( INFINITYL ); - else - return( 0.0L ); - } - -if( nn == 0 ) - return( 1.0L ); - - -if( x < 0.0L ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = x; -s = frexpl( s, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1L) / (s + 7.0710678118654752e-1L); - s = (2.9142135623730950L * s - 0.5L + lx) * nn * LOGE2L; - } -else - { - s = LOGE2L * e; - } - -if( s > MAXLOGL ) - { - mtherr( "__powil", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITYL; - goto done; - } - -if( s < MINLOGL ) - { - mtherr( "__powil", UNDERFLOW ); - _SET_ERRNO(ERANGE); - return(0.0L); - } -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( s < (-MAXLOGL+2.0L) ) - { - x = 1.0L/x; - sign = -sign; - } - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - { - y = 1.0L; - asign = 0; - } - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - - -done: - -if( asign ) - y = -y; /* odd power of negative number */ -if( sign < 0 ) - y = 1.0L/y; -return(y); -} diff --git a/winsup/mingw/mingwex/math/powl.c b/winsup/mingw/mingwex/math/powl.c deleted file mode 100644 index 19910bd66..000000000 --- a/winsup/mingw/mingwex/math/powl.c +++ /dev/null @@ -1,783 +0,0 @@ -/* powl.c - * - * Power function, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, z, powl(); - * - * z = powl( x, y ); - * - * - * - * DESCRIPTION: - * - * Computes x raised to the yth power. Analytically, - * - * x**y = exp( y log(x) ). - * - * Following Cody and Waite, this program uses a lookup table - * of 2**-i/32 and pseudo extended precision arithmetic to - * obtain several extra bits of accuracy in both the logarithm - * and the exponential. - * - * - * - * ACCURACY: - * - * The relative error of pow(x,y) can be estimated - * by y dl ln(2), where dl is the absolute error of - * the internally computed base 2 logarithm. At the ends - * of the approximation interval the logarithm equal 1/32 - * and its relative error is about 1 lsb = 1.1e-19. Hence - * the predicted relative error in the result is 2.3e-21 y . - * - * Relative error: - * arithmetic domain # trials peak rms - * - * IEEE +-1000 40000 2.8e-18 3.7e-19 - * .001 < x < 1000, with log(x) uniformly distributed. - * -1000 < y < 1000, y uniformly distributed. - * - * IEEE 0,8700 60000 6.5e-18 1.0e-18 - * 0.99 < x < 1.01, 0 < y < 8700, uniformly distributed. - * - * - * ERROR MESSAGES: - * - * message condition value returned - * pow overflow x**y > MAXNUM INFINITY - * pow underflow x**y < 1/MAXNUM 0.0 - * pow domain x<0 and y noninteger 0.0 - * - */ - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1984, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" - -static char fname[] = {"powl"}; -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - - -/* Table size */ -#define NXT 32 -/* log2(Table size) */ -#define LNXT 5 - -#ifdef UNK -/* log(1+x) = x - .5x^2 + x^3 * P(z)/Q(z) - * on the domain 2^(-1/32) - 1 <= x <= 2^(1/32) - 1 - */ -static long double P[] = { - 8.3319510773868690346226E-4L, - 4.9000050881978028599627E-1L, - 1.7500123722550302671919E0L, - 1.4000100839971580279335E0L, -}; -static long double Q[] = { -/* 1.0000000000000000000000E0L,*/ - 5.2500282295834889175431E0L, - 8.4000598057587009834666E0L, - 4.2000302519914740834728E0L, -}; -/* A[i] = 2^(-i/32), rounded to IEEE long double precision. - * If i is even, A[i] + B[i/2] gives additional accuracy. - */ -static long double A[33] = { - 1.0000000000000000000000E0L, - 9.7857206208770013448287E-1L, - 9.5760328069857364691013E-1L, - 9.3708381705514995065011E-1L, - 9.1700404320467123175367E-1L, - 8.9735453750155359320742E-1L, - 8.7812608018664974155474E-1L, - 8.5930964906123895780165E-1L, - 8.4089641525371454301892E-1L, - 8.2287773907698242225554E-1L, - 8.0524516597462715409607E-1L, - 7.8799042255394324325455E-1L, - 7.7110541270397041179298E-1L, - 7.5458221379671136985669E-1L, - 7.3841307296974965571198E-1L, - 7.2259040348852331001267E-1L, - 7.0710678118654752438189E-1L, - 6.9195494098191597746178E-1L, - 6.7712777346844636413344E-1L, - 6.6261832157987064729696E-1L, - 6.4841977732550483296079E-1L, - 6.3452547859586661129850E-1L, - 6.2092890603674202431705E-1L, - 6.0762367999023443907803E-1L, - 5.9460355750136053334378E-1L, - 5.8186242938878875689693E-1L, - 5.6939431737834582684856E-1L, - 5.5719337129794626814472E-1L, - 5.4525386633262882960438E-1L, - 5.3357020033841180906486E-1L, - 5.2213689121370692017331E-1L, - 5.1094857432705833910408E-1L, - 5.0000000000000000000000E-1L, -}; -static long double B[17] = { - 0.0000000000000000000000E0L, - 2.6176170809902549338711E-20L, --1.0126791927256478897086E-20L, - 1.3438228172316276937655E-21L, - 1.2207982955417546912101E-20L, --6.3084814358060867200133E-21L, - 1.3164426894366316434230E-20L, --1.8527916071632873716786E-20L, - 1.8950325588932570796551E-20L, - 1.5564775779538780478155E-20L, - 6.0859793637556860974380E-21L, --2.0208749253662532228949E-20L, - 1.4966292219224761844552E-20L, - 3.3540909728056476875639E-21L, --8.6987564101742849540743E-22L, --1.2327176863327626135542E-20L, - 0.0000000000000000000000E0L, -}; - -/* 2^x = 1 + x P(x), - * on the interval -1/32 <= x <= 0 - */ -static long double R[] = { - 1.5089970579127659901157E-5L, - 1.5402715328927013076125E-4L, - 1.3333556028915671091390E-3L, - 9.6181291046036762031786E-3L, - 5.5504108664798463044015E-2L, - 2.4022650695910062854352E-1L, - 6.9314718055994530931447E-1L, -}; - -#define douba(k) A[k] -#define doubb(k) B[k] -#define MEXP (NXT*16384.0L) -/* The following if denormal numbers are supported, else -MEXP: */ -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16384.0L) -#endif -/* log2(e) - 1 */ -#define LOG2EA 0.44269504088896340735992L -#endif - - -#ifdef IBMPC -static const unsigned short P[] = { -0xb804,0xa8b7,0xc6f4,0xda6a,0x3ff4, XPD -0x7de9,0xcf02,0x58c0,0xfae1,0x3ffd, XPD -0x405a,0x3722,0x67c9,0xe000,0x3fff, XPD -0xcd99,0x6b43,0x87ca,0xb333,0x3fff, XPD -}; -static const unsigned short Q[] = { -/* 0x0000,0x0000,0x0000,0x8000,0x3fff, */ -0x6307,0xa469,0x3b33,0xa800,0x4001, XPD -0xfec2,0x62d7,0xa51c,0x8666,0x4002, XPD -0xda32,0xd072,0xa5d7,0x8666,0x4001, XPD -}; -static const unsigned short A[] = { -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -0x033a,0x722a,0xb2db,0xfa83,0x3ffe, XPD -0xcc2c,0x2486,0x7d15,0xf525,0x3ffe, XPD -0xf5cb,0xdcda,0xb99b,0xefe4,0x3ffe, XPD -0x392f,0xdd24,0xc6e7,0xeac0,0x3ffe, XPD -0x48a8,0x7c83,0x06e7,0xe5b9,0x3ffe, XPD -0xe111,0x2a94,0xdeec,0xe0cc,0x3ffe, XPD -0x3755,0xdaf2,0xb797,0xdbfb,0x3ffe, XPD -0x6af4,0xd69d,0xfcca,0xd744,0x3ffe, XPD -0xe45a,0xf12a,0x1d91,0xd2a8,0x3ffe, XPD -0x80e4,0x1f84,0x8c15,0xce24,0x3ffe, XPD -0x27a3,0x6e2f,0xbd86,0xc9b9,0x3ffe, XPD -0xdadd,0x5506,0x2a11,0xc567,0x3ffe, XPD -0x9456,0x6670,0x4cca,0xc12c,0x3ffe, XPD -0x36bf,0x580c,0xa39f,0xbd08,0x3ffe, XPD -0x9ee9,0x62fb,0xaf47,0xb8fb,0x3ffe, XPD -0x6484,0xf9de,0xf333,0xb504,0x3ffe, XPD -0x2590,0xd2ac,0xf581,0xb123,0x3ffe, XPD -0x4ac6,0x42a1,0x3eea,0xad58,0x3ffe, XPD -0x0ef8,0xea7c,0x5ab4,0xa9a1,0x3ffe, XPD -0x38ea,0xb151,0xd6a9,0xa5fe,0x3ffe, XPD -0x6819,0x0c49,0x4303,0xa270,0x3ffe, XPD -0x11ae,0x91a1,0x3260,0x9ef5,0x3ffe, XPD -0x5539,0xd54e,0x39b9,0x9b8d,0x3ffe, XPD -0xa96f,0x8db8,0xf051,0x9837,0x3ffe, XPD -0x0961,0xfef7,0xefa8,0x94f4,0x3ffe, XPD -0xc336,0xab11,0xd373,0x91c3,0x3ffe, XPD -0x53c0,0x45cd,0x398b,0x8ea4,0x3ffe, XPD -0xd6e7,0xea8b,0xc1e3,0x8b95,0x3ffe, XPD -0x8527,0x92da,0x0e80,0x8898,0x3ffe, XPD -0x7b15,0xcc48,0xc367,0x85aa,0x3ffe, XPD -0xa1d7,0xac2b,0x8698,0x82cd,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3ffe, XPD -}; -static const unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000,0x0000, XPD -0x1f87,0xdb30,0x18f5,0xf73a,0x3fbd, XPD -0xac15,0x3e46,0x2932,0xbf4a,0xbfbc, XPD -0x7944,0xba66,0xa091,0xcb12,0x3fb9, XPD -0xff78,0x40b4,0x2ee6,0xe69a,0x3fbc, XPD -0xc895,0x5069,0xe383,0xee53,0xbfbb, XPD -0x7cde,0x9376,0x4325,0xf8ab,0x3fbc, XPD -0xa10c,0x25e0,0xc093,0xaefd,0xbfbd, XPD -0x7d3e,0xea95,0x1366,0xb2fb,0x3fbd, XPD -0x5d89,0xeb34,0x5191,0x9301,0x3fbd, XPD -0x80d9,0xb883,0xfb10,0xe5eb,0x3fbb, XPD -0x045d,0x288c,0xc1ec,0xbedd,0xbfbd, XPD -0xeded,0x5c85,0x4630,0x8d5a,0x3fbd, XPD -0x9d82,0xe5ac,0x8e0a,0xfd6d,0x3fba, XPD -0x6dfd,0xeb58,0xaf14,0x8373,0xbfb9, XPD -0xf938,0x7aac,0x91cf,0xe8da,0xbfbc, XPD -0x0000,0x0000,0x0000,0x0000,0x0000, XPD -}; -static const unsigned short R[] = { -0xa69b,0x530e,0xee1d,0xfd2a,0x3fee, XPD -0xc746,0x8e7e,0x5960,0xa182,0x3ff2, XPD -0x63b6,0xadda,0xfd6a,0xaec3,0x3ff5, XPD -0xc104,0xfd99,0x5b7c,0x9d95,0x3ff8, XPD -0xe05e,0x249d,0x46b8,0xe358,0x3ffa, XPD -0x5d1d,0x162c,0xeffc,0xf5fd,0x3ffc, XPD -0x79aa,0xd1cf,0x17f7,0xb172,0x3ffe, XPD -}; - -/* 10 byte sizes versus 12 byte */ -#define douba(k) (*(long double *)(&A[(sizeof( long double )/2)*(k)])) -#define doubb(k) (*(long double *)(&B[(sizeof( long double )/2)*(k)])) -#define MEXP (NXT*16384.0L) -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16384.0L) -#endif -static const -union -{ - unsigned short L[6]; - long double ld; -} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}}; - -#define LOG2EA (log2ea.ld) -/* -#define LOG2EA 0.44269504088896340735992L -*/ -#endif - -#ifdef MIEEE -static long P[] = { -0x3ff40000,0xda6ac6f4,0xa8b7b804, -0x3ffd0000,0xfae158c0,0xcf027de9, -0x3fff0000,0xe00067c9,0x3722405a, -0x3fff0000,0xb33387ca,0x6b43cd99, -}; -static long Q[] = { -/* 0x3fff0000,0x80000000,0x00000000, */ -0x40010000,0xa8003b33,0xa4696307, -0x40020000,0x8666a51c,0x62d7fec2, -0x40010000,0x8666a5d7,0xd072da32, -}; -static long A[] = { -0x3fff0000,0x80000000,0x00000000, -0x3ffe0000,0xfa83b2db,0x722a033a, -0x3ffe0000,0xf5257d15,0x2486cc2c, -0x3ffe0000,0xefe4b99b,0xdcdaf5cb, -0x3ffe0000,0xeac0c6e7,0xdd24392f, -0x3ffe0000,0xe5b906e7,0x7c8348a8, -0x3ffe0000,0xe0ccdeec,0x2a94e111, -0x3ffe0000,0xdbfbb797,0xdaf23755, -0x3ffe0000,0xd744fcca,0xd69d6af4, -0x3ffe0000,0xd2a81d91,0xf12ae45a, -0x3ffe0000,0xce248c15,0x1f8480e4, -0x3ffe0000,0xc9b9bd86,0x6e2f27a3, -0x3ffe0000,0xc5672a11,0x5506dadd, -0x3ffe0000,0xc12c4cca,0x66709456, -0x3ffe0000,0xbd08a39f,0x580c36bf, -0x3ffe0000,0xb8fbaf47,0x62fb9ee9, -0x3ffe0000,0xb504f333,0xf9de6484, -0x3ffe0000,0xb123f581,0xd2ac2590, -0x3ffe0000,0xad583eea,0x42a14ac6, -0x3ffe0000,0xa9a15ab4,0xea7c0ef8, -0x3ffe0000,0xa5fed6a9,0xb15138ea, -0x3ffe0000,0xa2704303,0x0c496819, -0x3ffe0000,0x9ef53260,0x91a111ae, -0x3ffe0000,0x9b8d39b9,0xd54e5539, -0x3ffe0000,0x9837f051,0x8db8a96f, -0x3ffe0000,0x94f4efa8,0xfef70961, -0x3ffe0000,0x91c3d373,0xab11c336, -0x3ffe0000,0x8ea4398b,0x45cd53c0, -0x3ffe0000,0x8b95c1e3,0xea8bd6e7, -0x3ffe0000,0x88980e80,0x92da8527, -0x3ffe0000,0x85aac367,0xcc487b15, -0x3ffe0000,0x82cd8698,0xac2ba1d7, -0x3ffe0000,0x80000000,0x00000000, -}; -static long B[51] = { -0x00000000,0x00000000,0x00000000, -0x3fbd0000,0xf73a18f5,0xdb301f87, -0xbfbc0000,0xbf4a2932,0x3e46ac15, -0x3fb90000,0xcb12a091,0xba667944, -0x3fbc0000,0xe69a2ee6,0x40b4ff78, -0xbfbb0000,0xee53e383,0x5069c895, -0x3fbc0000,0xf8ab4325,0x93767cde, -0xbfbd0000,0xaefdc093,0x25e0a10c, -0x3fbd0000,0xb2fb1366,0xea957d3e, -0x3fbd0000,0x93015191,0xeb345d89, -0x3fbb0000,0xe5ebfb10,0xb88380d9, -0xbfbd0000,0xbeddc1ec,0x288c045d, -0x3fbd0000,0x8d5a4630,0x5c85eded, -0x3fba0000,0xfd6d8e0a,0xe5ac9d82, -0xbfb90000,0x8373af14,0xeb586dfd, -0xbfbc0000,0xe8da91cf,0x7aacf938, -0x00000000,0x00000000,0x00000000, -}; -static long R[] = { -0x3fee0000,0xfd2aee1d,0x530ea69b, -0x3ff20000,0xa1825960,0x8e7ec746, -0x3ff50000,0xaec3fd6a,0xadda63b6, -0x3ff80000,0x9d955b7c,0xfd99c104, -0x3ffa0000,0xe35846b8,0x249de05e, -0x3ffc0000,0xf5fdeffc,0x162c5d1d, -0x3ffe0000,0xb17217f7,0xd1cf79aa, -}; - -#define douba(k) (*(long double *)&A[3*(k)]) -#define doubb(k) (*(long double *)&B[3*(k)]) -#define MEXP (NXT*16384.0L) -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16382.0L) -#endif -static long L[3] = {0x3ffd0000,0xe2a8eca5,0x705fc2ef}; -#define LOG2EA (*(long double *)(&L[0])) -#endif - - -#define F W -#define Fa Wa -#define Fb Wb -#define G W -#define Ga Wa -#define Gb u -#define H W -#define Ha Wb -#define Hb Wb - -#ifndef __MINGW32__ -extern long double MAXNUML; -#endif - -static VOLATILE long double z; -static long double w, W, Wa, Wb, ya, yb, u; - -#ifdef __MINGW32__ -static __inline__ long double reducl( long double ); -extern long double __powil ( long double, int ); -extern long double powl ( long double x, long double y); -#else -#ifdef ANSIPROT -extern long double floorl ( long double ); -extern long double fabsl ( long double ); -extern long double frexpl ( long double, int * ); -extern long double ldexpl ( long double, int ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern long double __powil ( long double, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -static long double reducl( long double ); -extern int signbitl ( long double ); -#else -long double floorl(), fabsl(), frexpl(), ldexpl(); -long double polevll(), p1evll(), __powil(); -static long double reducl(); -int isnanl(), isfinitel(), signbitl(); -#endif - -#ifdef INFINITIES -extern long double INFINITYL; -#else -#define INFINITYL MAXNUML -#endif - -#ifdef NANS -extern long double NANL; -#endif -#ifdef MINUSZERO -extern long double NEGZEROL; -#endif - -#endif /* __MINGW32__ */ - -long double powl( x, y ) -long double x, y; -{ -/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */ -int i, nflg, iyflg, yoddint; -long e; - -if( y == 0.0L ) - return( 1.0L ); - -#ifdef NANS -if( isnanl(x) ) - { - _SET_ERRNO (EDOM); - return( x ); - } -if( isnanl(y) ) - { - _SET_ERRNO (EDOM); - return( y ); - } -#endif - -if( y == 1.0L ) - return( x ); - -if( isinfl(y) && (x == -1.0L || x == 1.0L) ) - return( y ); - -if( x == 1.0L ) - return( 1.0L ); - -if( y >= MAXNUML ) - { - _SET_ERRNO (ERANGE); -#ifdef INFINITIES - if( x > 1.0L ) - return( INFINITYL ); -#else - if( x > 1.0L ) - return( MAXNUML ); -#endif - if( x > 0.0L && x < 1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x < -1.0L ) - return( INFINITYL ); -#else - if( x < -1.0L ) - return( MAXNUML ); -#endif - if( x > -1.0L && x < 0.0L ) - return( 0.0L ); - } -if( y <= -MAXNUML ) - { - _SET_ERRNO (ERANGE); - if( x > 1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x > 0.0L && x < 1.0L ) - return( INFINITYL ); -#else - if( x > 0.0L && x < 1.0L ) - return( MAXNUML ); -#endif - if( x < -1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x > -1.0L && x < 0.0L ) - return( INFINITYL ); -#else - if( x > -1.0L && x < 0.0L ) - return( MAXNUML ); -#endif - } -if( x >= MAXNUML ) - { -#if INFINITIES - if( y > 0.0L ) - return( INFINITYL ); -#else - if( y > 0.0L ) - return( MAXNUML ); -#endif - return( 0.0L ); - } - -w = floorl(y); -/* Set iyflg to 1 if y is an integer. */ -iyflg = 0; -if( w == y ) - iyflg = 1; - -/* Test for odd integer y. */ -yoddint = 0; -if( iyflg ) - { - ya = fabsl(y); - ya = floorl(0.5L * ya); - yb = 0.5L * fabsl(w); - if( ya != yb ) - yoddint = 1; - } - -if( x <= -MAXNUML ) - { - if( y > 0.0L ) - { -#ifdef INFINITIES - if( yoddint ) - return( -INFINITYL ); - return( INFINITYL ); -#else - if( yoddint ) - return( -MAXNUML ); - return( MAXNUML ); -#endif - } - if( y < 0.0L ) - { -#ifdef MINUSZERO - if( yoddint ) - return( NEGZEROL ); -#endif - return( 0.0 ); - } - } - - -nflg = 0; /* flag = 1 if x<0 raised to integer power */ -if( x <= 0.0L ) - { - if( x == 0.0L ) - { - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( signbitl(x) && yoddint ) - return( -INFINITYL ); -#endif -#ifdef INFINITIES - return( INFINITYL ); -#else - return( MAXNUML ); -#endif - } - if( y > 0.0 ) - { -#ifdef MINUSZERO - if( signbitl(x) && yoddint ) - return( NEGZEROL ); -#endif - return( 0.0 ); - } - if( y == 0.0L ) - return( 1.0L ); /* 0**0 */ - else - return( 0.0L ); /* 0**y */ - } - else - { - if( iyflg == 0 ) - { /* noninteger power of negative number */ - mtherr( fname, DOMAIN ); - _SET_ERRNO (EDOM); -#ifdef NANS - return(NANL); -#else - return(0.0L); -#endif - } - nflg = 1; - } - } - -/* Integer power of an integer. */ - -if( iyflg ) - { - i = w; - w = floorl(x); - if( (w == x) && (fabsl(y) < 32768.0) ) - { - w = __powil( x, (int) y ); - return( w ); - } - } - - -if( nflg ) - x = fabsl(x); - -/* separate significand from exponent */ -x = frexpl( x, &i ); -e = i; - -/* find significand in antilog table A[] */ -i = 1; -if( x <= douba(17) ) - i = 17; -if( x <= douba(i+8) ) - i += 8; -if( x <= douba(i+4) ) - i += 4; -if( x <= douba(i+2) ) - i += 2; -if( x >= douba(1) ) - i = -1; -i += 1; - - -/* Find (x - A[i])/A[i] - * in order to compute log(x/A[i]): - * - * log(x) = log( a x/a ) = log(a) + log(x/a) - * - * log(x/a) = log(1+v), v = x/a - 1 = (x-a)/a - */ -x -= douba(i); -x -= doubb(i/2); -x /= douba(i); - - -/* rational approximation for log(1+v): - * - * log(1+v) = v - v**2/2 + v**3 P(v) / Q(v) - */ -z = x*x; -w = x * ( z * polevll( x, P, 3 ) / p1evll( x, Q, 3 ) ); -w = w - ldexpl( z, -1 ); /* w - 0.5 * z */ - -/* Convert to base 2 logarithm: - * multiply by log2(e) = 1 + LOG2EA - */ -z = LOG2EA * w; -z += w; -z += LOG2EA * x; -z += x; - -/* Compute exponent term of the base 2 logarithm. */ -w = -i; -w = ldexpl( w, -LNXT ); /* divide by NXT */ -w += e; -/* Now base 2 log of x is w + z. */ - -/* Multiply base 2 log by y, in extended precision. */ - -/* separate y into large part ya - * and small part yb less than 1/NXT - */ -ya = reducl(y); -yb = y - ya; - -/* (w+z)(ya+yb) - * = w*ya + w*yb + z*y - */ -F = z * y + w * yb; -Fa = reducl(F); -Fb = F - Fa; - -G = Fa + w * ya; -if (isinf (G)) - { - /* Bail out: G - reducl(G) will result in NAN - that will propagate through rest of calculations */ - _SET_ERRNO (ERANGE); - mtherr( fname, OVERFLOW ); - return( MAXNUML ); - } -Ga = reducl(G); -Gb = G - Ga; - -H = Fb + Gb; -Ha = reducl(H); -w = ldexpl( Ga+Ha, LNXT ); - -/* Test the power of 2 for overflow */ -if( w > MEXP ) - { -/* printf( "w = %.4Le ", w ); */ - _SET_ERRNO (ERANGE); - mtherr( fname, OVERFLOW ); - return( MAXNUML ); - } - -if( w < MNEXP ) - { -/* printf( "w = %.4Le ", w ); */ - _SET_ERRNO (ERANGE); - mtherr( fname, UNDERFLOW ); - return( 0.0L ); - } - -e = w; -Hb = H - Ha; - -if( Hb > 0.0L ) - { - e += 1; - Hb -= (1.0L/NXT); /*0.0625L;*/ - } - -/* Now the product y * log2(x) = Hb + e/NXT. - * - * Compute base 2 exponential of Hb, - * where -0.0625 <= Hb <= 0. - */ -z = Hb * polevll( Hb, R, 6 ); /* z = 2**Hb - 1 */ - -/* Express e/NXT as an integer plus a negative number of (1/NXT)ths. - * Find lookup table entry for the fractional power of 2. - */ -if( e < 0 ) - i = 0; -else - i = 1; -i = e/NXT + i; -e = NXT*i - e; -w = douba( e ); -z = w * z; /* 2**-e * ( 1 + (2**Hb-1) ) */ -z = z + w; -z = ldexpl( z, i ); /* multiply by integer power of 2 */ - -if( nflg ) - { -/* For negative x, - * find out if the integer exponent - * is odd or even. - */ - w = ldexpl( y, -1 ); - w = floorl(w); - w = ldexpl( w, 1 ); - if( w != y ) - z = -z; /* odd exponent */ - } - -return( z ); -} - - -/* Find a multiple of 1/NXT that is within 1/NXT of x. */ -static __inline__ long double reducl(x) -long double x; -{ -long double t; - -t = ldexpl( x, LNXT ); -t = floorl( t ); -t = ldexpl( t, -LNXT ); -return(t); -} - diff --git a/winsup/mingw/mingwex/math/remainder.S b/winsup/mingw/mingwex/math/remainder.S deleted file mode 100644 index 01930d3ba..000000000 --- a/winsup/mingw/mingwex/math/remainder.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "remainder.S" - .text - .align 4 -.globl _remainder - .def _remainder; .scl 2; .type 32; .endef -_remainder: - fldl 12(%esp) - fldl 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remainderf.S b/winsup/mingw/mingwex/math/remainderf.S deleted file mode 100644 index 81e78415a..000000000 --- a/winsup/mingw/mingwex/math/remainderf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "remainderf.S" - .text - .align 4 -.globl _remainder - .def _remainderf; .scl 2; .type 32; .endef -_remainderf: - flds 8(%esp) - flds 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remainderl.S b/winsup/mingw/mingwex/math/remainderl.S deleted file mode 100644 index b5ce3736d..000000000 --- a/winsup/mingw/mingwex/math/remainderl.S +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "remainderl.S" - .text - .align 4 -.globl _remainderl - .def _remainderl; .scl 2; .type 32; .endef -_remainderl: - fldt 16(%esp) - fldt 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remquo.S b/winsup/mingw/mingwex/math/remquo.S deleted file mode 100644 index 987c37ca5..000000000 --- a/winsup/mingw/mingwex/math/remquo.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.ne - * Public domain. - */ - - .file "remquo.S" - .text - .align 4; -.globl _remquo; -_remquo: - fldl 4 +8(%esp) - fldl 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +8 +8(%esp), %ecx - movl 4 +4(%esp), %edx - xorl 4 +8 +4(%esp), %edx - testl $0x80000000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/remquof.S b/winsup/mingw/mingwex/math/remquof.S deleted file mode 100644 index af540ef5b..000000000 --- a/winsup/mingw/mingwex/math/remquof.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.ne - * Public domain. - */ - - .file "remquo.S" - .text - .align 4; -.globl _remquof; -_remquof: - flds 4 +4(%esp) - flds 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +4 +4(%esp), %ecx - movl 4(%esp), %edx - xorl 4 +4(%esp), %edx - testl $0x80000000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/remquol.S b/winsup/mingw/mingwex/math/remquol.S deleted file mode 100644 index e6f1b5420..000000000 --- a/winsup/mingw/mingwex/math/remquol.S +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - * Public domain. - */ - .text - .align 4; -.globl _remquol; - _remquol: - fldt 4 +12(%esp) - fldt 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +12 +12(%esp), %ecx - movl 4 +8(%esp), %edx - xorl 4 +12 +8(%esp), %edx - testl $0x8000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/rint.c b/winsup/mingw/mingwex/math/rint.c deleted file mode 100644 index 3198f4b26..000000000 --- a/winsup/mingw/mingwex/math/rint.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <math.h> -double rint (double x){ - double retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/rintf.c b/winsup/mingw/mingwex/math/rintf.c deleted file mode 100644 index 0b05e8f89..000000000 --- a/winsup/mingw/mingwex/math/rintf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float rintf (float x){ - float retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/rintl.c b/winsup/mingw/mingwex/math/rintl.c deleted file mode 100644 index ffc9d1107..000000000 --- a/winsup/mingw/mingwex/math/rintl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double rintl (long double x){ - long double retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/round.c b/winsup/mingw/mingwex/math/round.c deleted file mode 100644 index d2d4cab5e..000000000 --- a/winsup/mingw/mingwex/math/round.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <math.h> - -double -round (double x) -{ - /* Add +/- 0.5 then then round towards zero. */ - return trunc ( x + (x >= 0.0 ? 0.5 : -0.5)); -} diff --git a/winsup/mingw/mingwex/math/roundf.c b/winsup/mingw/mingwex/math/roundf.c deleted file mode 100644 index b50d950a7..000000000 --- a/winsup/mingw/mingwex/math/roundf.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <math.h> - -float -roundf (float x) -{ - /* Add +/- 0.5 then then round towards zero. */ - return truncf ( x + (x >= 0.0F ? 0.5F : -0.5F)); -} diff --git a/winsup/mingw/mingwex/math/roundl.c b/winsup/mingw/mingwex/math/roundl.c deleted file mode 100644 index 9c5f0aca1..000000000 --- a/winsup/mingw/mingwex/math/roundl.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <math.h> - -long double -roundl (long double x) -{ - /* Add +/- 0.5 then then round towards zero. */ - return truncl ( x + (x >= 0.0L ? 0.5L : -0.5L)); -} diff --git a/winsup/mingw/mingwex/math/s_erf.c b/winsup/mingw/mingwex/math/s_erf.c deleted file mode 100644 index 3cba24dd2..000000000 --- a/winsup/mingw/mingwex/math/s_erf.c +++ /dev/null @@ -1,345 +0,0 @@ - -/* @(#)s_erf.c 1.3 95/01/18 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunSoft, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* double erf(double x) - * double erfc(double x) - * x - * 2 |\ - * erf(x) = --------- | exp(-t*t)dt - * sqrt(pi) \| - * 0 - * - * erfc(x) = 1-erf(x) - * Note that - * erf(-x) = -erf(x) - * erfc(-x) = 2 - erfc(x) - * - * Method: - * 1. For |x| in [0, 0.84375] - * erf(x) = x + x*R(x^2) - * erfc(x) = 1 - erf(x) if x in [-.84375,0.25] - * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375] - * where R = P/Q where P is an odd poly of degree 8 and - * Q is an odd poly of degree 10. - * -57.90 - * | R - (erf(x)-x)/x | <= 2 - * - * - * Remark. The formula is derived by noting - * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....) - * and that - * 2/sqrt(pi) = 1.128379167095512573896158903121545171688 - * is close to one. The interval is chosen because the fix - * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is - * near 0.6174), and by some experiment, 0.84375 is chosen to - * guarantee the error is less than one ulp for erf. - * - * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and - * c = 0.84506291151 rounded to single (24 bits) - * erf(x) = sign(x) * (c + P1(s)/Q1(s)) - * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0 - * 1+(c+P1(s)/Q1(s)) if x < 0 - * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06 - * Remark: here we use the taylor series expansion at x=1. - * erf(1+s) = erf(1) + s*Poly(s) - * = 0.845.. + P1(s)/Q1(s) - * That is, we use rational approximation to approximate - * erf(1+s) - (c = (single)0.84506291151) - * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] - * where - * P1(s) = degree 6 poly in s - * Q1(s) = degree 6 poly in s - * - * 3. For x in [1.25,1/0.35(~2.857143)], - * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1) - * erf(x) = 1 - erfc(x) - * where - * R1(z) = degree 7 poly in z, (z=1/x^2) - * S1(z) = degree 8 poly in z - * - * 4. For x in [1/0.35,28] - * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0 - * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0 - * = 2.0 - tiny (if x <= -6) - * erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else - * erf(x) = sign(x)*(1.0 - tiny) - * where - * R2(z) = degree 6 poly in z, (z=1/x^2) - * S2(z) = degree 7 poly in z - * - * Note1: - * To compute exp(-x*x-0.5625+R/S), let s be a single - * precision number and s := x; then - * -x*x = -s*s + (s-x)*(s+x) - * exp(-x*x-0.5626+R/S) = - * exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S); - * Note2: - * Here 4 and 5 make use of the asymptotic series - * exp(-x*x) - * erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) ) - * x*sqrt(pi) - * We use rational approximation to approximate - * g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625 - * Here is the error bound for R1/S1 and R2/S2 - * |R1/S1 - f(x)| < 2**(-62.57) - * |R2/S2 - f(x)| < 2**(-61.52) - * - * 5. For inf > x >= 28 - * erf(x) = sign(x) *(1 - tiny) (raise inexact) - * erfc(x) = tiny*tiny (raise underflow) if x > 0 - * = 2 - tiny if x<0 - * - * 7. Special case: - * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, - * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, - * erfc/erf(NaN) is NaN - */ - - -/* #include "fdlibm.h" */ - -#include <math.h> -#include <stdint.h> -#include <errno.h> - -#define __ieee754_exp exp - -typedef union -{ - double value; - struct - { - uint32_t lsw; - uint32_t msw; - } parts; -} ieee_double_shape_type; - - -static inline int __get_hi_word(const double x) -{ - ieee_double_shape_type u; - u.value = x; - return u.parts.msw; -} - -static inline void __trunc_lo_word(double *x) -{ - ieee_double_shape_type u; - u.value = *x; - u.parts.lsw = 0; - *x = u.value; -} - - -#ifdef __STDC__ -static const double -#else -static double -#endif -tiny = 1e-300, -half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ -one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ -two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */ - /* c = (float)0.84506291151 */ -erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */ -/* - * Coefficients for approximation to erf on [0,0.84375] - */ -efx = 1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */ -efx8= 1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */ -pp0 = 1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */ -pp1 = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */ -pp2 = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */ -pp3 = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */ -pp4 = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */ -qq1 = 3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */ -qq2 = 6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */ -qq3 = 5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */ -qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */ -qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */ -/* - * Coefficients for approximation to erf in [0.84375,1.25] - */ -pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */ -pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */ -pa2 = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */ -pa3 = 3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */ -pa4 = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */ -pa5 = 3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */ -pa6 = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */ -qa1 = 1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */ -qa2 = 5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */ -qa3 = 7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */ -qa4 = 1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */ -qa5 = 1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */ -qa6 = 1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */ -/* - * Coefficients for approximation to erfc in [1.25,1/0.35] - */ -ra0 = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */ -ra1 = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */ -ra2 = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */ -ra3 = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */ -ra4 = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */ -ra5 = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */ -ra6 = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */ -ra7 = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */ -sa1 = 1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */ -sa2 = 1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */ -sa3 = 4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */ -sa4 = 6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */ -sa5 = 4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */ -sa6 = 1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */ -sa7 = 6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */ -sa8 = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */ -/* - * Coefficients for approximation to erfc in [1/.35,28] - */ -rb0 = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */ -rb1 = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */ -rb2 = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */ -rb3 = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */ -rb4 = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */ -rb5 = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */ -rb6 = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */ -sb1 = 3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */ -sb2 = 3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */ -sb3 = 1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */ -sb4 = 3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */ -sb5 = 2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */ -sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */ -sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ - -#ifdef __STDC__ - double erf(double x) -#else - double erf(x) - double x; -#endif -{ - int hx,ix,i; - double R,S,P,Q,s,y,z,r; - hx = __get_hi_word(x); - ix = hx&0x7fffffff; - if(ix>=0x7ff00000) { /* erf(nan)=nan */ - i = ((unsigned)hx>>31)<<1; - return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */ - } - - if(ix < 0x3feb0000) { /* |x|<0.84375 */ - if(ix < 0x3e300000) { /* |x|<2**-28 */ - if (ix < 0x00800000) - return 0.125*(8.0*x+efx8*x); /*avoid underflow */ - return x + efx*x; - } - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - return x + x*y; - } - if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */ - s = fabs(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) return erx + P/Q; else return -erx - P/Q; - } - if (ix >= 0x40180000) { /* inf>|x|>=6 */ - if(hx>=0) return one-tiny; else return tiny-one; - } - x = fabs(x); - s = one/(x*x); - if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/0.35 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - z = x; - __trunc_lo_word(&z); - r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S); - if(hx>=0) return one-r/x; else return r/x-one; -} - -#ifdef __STDC__ - double erfc(double x) -#else - double erfc(x) - double x; -#endif -{ - int hx,ix; - double R,S,P,Q,s,y,z,r; - hx = __get_hi_word(x); - ix = hx&0x7fffffff; - if(ix>=0x7ff00000) { /* erfc(nan)=nan */ - /* erfc(+-inf)=0,2 */ - return (double)(((unsigned)hx>>31)<<1)+one/x; - } - - if(ix < 0x3feb0000) { /* |x|<0.84375 */ - if(ix < 0x3c700000) /* |x|<2**-56 */ - return one-x; - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - if(hx < 0x3fd00000) { /* x<1/4 */ - return one-(x+x*y); - } else { - r = x*y; - r += (x-half); - return half - r ; - } - } - if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */ - s = fabs(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) { - z = one-erx; return z - P/Q; - } else { - z = erx+P/Q; return one+z; - } - } - if (ix < 0x403c0000) { /* |x|<28 */ - x = fabs(x); - s = one/(x*x); - if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/.35 ~ 2.857143 */ - if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - z = x; - __trunc_lo_word(&z); - r = __ieee754_exp(-z*z-0.5625)* - __ieee754_exp((z-x)*(z+x)+R/S); - if(hx>0) return r/x; else return two-r/x; - } else { - /* set range error */ - errno = ERANGE; - if(hx>0) return tiny*tiny; else return two-tiny; - } -} diff --git a/winsup/mingw/mingwex/math/scalbn.S b/winsup/mingw/mingwex/math/scalbn.S deleted file mode 100644 index 76e2d396e..000000000 --- a/winsup/mingw/mingwex/math/scalbn.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "scalbn.S" - .text - .align 4 -.globl _scalbn - .def _scalbn; .scl 2; .type 32; .endef -_scalbn: - fildl 12(%esp) - fldl 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalbln - .set _scalbln,_scalbn diff --git a/winsup/mingw/mingwex/math/scalbnf.S b/winsup/mingw/mingwex/math/scalbnf.S deleted file mode 100644 index 1fe42a3de..000000000 --- a/winsup/mingw/mingwex/math/scalbnf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "scalbnf.S" - .text - .align 4 -.globl _scalbnf - .def _scalbnf; .scl 2; .type 32; .endef -_scalbnf: - fildl 8(%esp) - flds 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalblnf - .set _scalblnf,_scalbnf diff --git a/winsup/mingw/mingwex/math/scalbnl.S b/winsup/mingw/mingwex/math/scalbnl.S deleted file mode 100644 index 77eaff7be..000000000 --- a/winsup/mingw/mingwex/math/scalbnl.S +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "scalbnl.S" - .text - .align 4 -.globl _scalbnl - .def _scalbnl; .scl 2; .type 32; .endef -_scalbnl: - fildl 16(%esp) - fldt 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalblnl - .set _scalblnl,_scalbnl diff --git a/winsup/mingw/mingwex/math/sf_erf.c b/winsup/mingw/mingwex/math/sf_erf.c deleted file mode 100644 index 1fca80e94..000000000 --- a/winsup/mingw/mingwex/math/sf_erf.c +++ /dev/null @@ -1,264 +0,0 @@ -/* sf_erf.c -- float version of s_erf.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* -#include "fdlibm.h" -*/ -#include <math.h> -#include <stdint.h> -#include <errno.h> - -#define __ieee754_expf expf - - - -typedef union -{ - float value; - uint32_t word; -} ieee_float_shape_type; - -/* Get a 32 bit int from a float. */ - -static inline int -__get_float_word(float d) -{ - ieee_float_shape_type u; - u.value = d; - return u.word; -} - -/* Set a float from a 32 bit int. */ - -#define SET_FLOAT_WORD(d,i) \ -do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ -} while (0) - -static inline void __trunc_float_word(float * x) -{ - ieee_float_shape_type u; - u.value = * x; - u.word &= 0xfffff000; -} - -#ifdef __v810__ -#define const -#endif - -#ifdef __STDC__ -static const float -#else -static float -#endif -tiny = 1e-30, -half= 5.0000000000e-01, /* 0x3F000000 */ -one = 1.0000000000e+00, /* 0x3F800000 */ -two = 2.0000000000e+00, /* 0x40000000 */ - /* c = (subfloat)0.84506291151 */ -erx = 8.4506291151e-01, /* 0x3f58560b */ -/* - * Coefficients for approximation to erf on [0,0.84375] - */ -efx = 1.2837916613e-01, /* 0x3e0375d4 */ -efx8= 1.0270333290e+00, /* 0x3f8375d4 */ -pp0 = 1.2837916613e-01, /* 0x3e0375d4 */ -pp1 = -3.2504209876e-01, /* 0xbea66beb */ -pp2 = -2.8481749818e-02, /* 0xbce9528f */ -pp3 = -5.7702702470e-03, /* 0xbbbd1489 */ -pp4 = -2.3763017452e-05, /* 0xb7c756b1 */ -qq1 = 3.9791721106e-01, /* 0x3ecbbbce */ -qq2 = 6.5022252500e-02, /* 0x3d852a63 */ -qq3 = 5.0813062117e-03, /* 0x3ba68116 */ -qq4 = 1.3249473704e-04, /* 0x390aee49 */ -qq5 = -3.9602282413e-06, /* 0xb684e21a */ -/* - * Coefficients for approximation to erf in [0.84375,1.25] - */ -pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */ -pa1 = 4.1485610604e-01, /* 0x3ed46805 */ -pa2 = -3.7220788002e-01, /* 0xbebe9208 */ -pa3 = 3.1834661961e-01, /* 0x3ea2fe54 */ -pa4 = -1.1089469492e-01, /* 0xbde31cc2 */ -pa5 = 3.5478305072e-02, /* 0x3d1151b3 */ -pa6 = -2.1663755178e-03, /* 0xbb0df9c0 */ -qa1 = 1.0642088205e-01, /* 0x3dd9f331 */ -qa2 = 5.4039794207e-01, /* 0x3f0a5785 */ -qa3 = 7.1828655899e-02, /* 0x3d931ae7 */ -qa4 = 1.2617121637e-01, /* 0x3e013307 */ -qa5 = 1.3637083583e-02, /* 0x3c5f6e13 */ -qa6 = 1.1984500103e-02, /* 0x3c445aa3 */ -/* - * Coefficients for approximation to erfc in [1.25,1/0.35] - */ -ra0 = -9.8649440333e-03, /* 0xbc21a093 */ -ra1 = -6.9385856390e-01, /* 0xbf31a0b7 */ -ra2 = -1.0558626175e+01, /* 0xc128f022 */ -ra3 = -6.2375331879e+01, /* 0xc2798057 */ -ra4 = -1.6239666748e+02, /* 0xc322658c */ -ra5 = -1.8460508728e+02, /* 0xc3389ae7 */ -ra6 = -8.1287437439e+01, /* 0xc2a2932b */ -ra7 = -9.8143291473e+00, /* 0xc11d077e */ -sa1 = 1.9651271820e+01, /* 0x419d35ce */ -sa2 = 1.3765776062e+02, /* 0x4309a863 */ -sa3 = 4.3456588745e+02, /* 0x43d9486f */ -sa4 = 6.4538726807e+02, /* 0x442158c9 */ -sa5 = 4.2900814819e+02, /* 0x43d6810b */ -sa6 = 1.0863500214e+02, /* 0x42d9451f */ -sa7 = 6.5702495575e+00, /* 0x40d23f7c */ -sa8 = -6.0424413532e-02, /* 0xbd777f97 */ -/* - * Coefficients for approximation to erfc in [1/.35,28] - */ -rb0 = -9.8649431020e-03, /* 0xbc21a092 */ -rb1 = -7.9928326607e-01, /* 0xbf4c9dd4 */ -rb2 = -1.7757955551e+01, /* 0xc18e104b */ -rb3 = -1.6063638306e+02, /* 0xc320a2ea */ -rb4 = -6.3756646729e+02, /* 0xc41f6441 */ -rb5 = -1.0250950928e+03, /* 0xc480230b */ -rb6 = -4.8351919556e+02, /* 0xc3f1c275 */ -sb1 = 3.0338060379e+01, /* 0x41f2b459 */ -sb2 = 3.2579251099e+02, /* 0x43a2e571 */ -sb3 = 1.5367296143e+03, /* 0x44c01759 */ -sb4 = 3.1998581543e+03, /* 0x4547fdbb */ -sb5 = 2.5530502930e+03, /* 0x451f90ce */ -sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ -sb7 = -2.2440952301e+01; /* 0xc1b38712 */ - -#ifdef __STDC__ - float erff(float x) -#else - float erff(x) - float x; -#endif -{ - int32_t hx,ix,i; - float R,S,P,Q,s,y,z,r; - hx = __get_float_word(x); - ix = hx&0x7fffffff; - if(!(ix<0x7f800000L)) { /* erf(nan)=nan */ - i = ((uint32_t)hx>>31)<<1; - return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */ - } - - if(ix < 0x3f580000) { /* |x|<0.84375 */ - if(ix < 0x31800000) { /* |x|<2**-28 */ - if (ix < 0x04000000) - /*avoid underflow */ - return (float)0.125*((float)8.0*x+efx8*x); - return x + efx*x; - } - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - return x + x*y; - } - if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */ - s = fabsf(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) return erx + P/Q; else return -erx - P/Q; - } - if (ix >= 0x40c00000) { /* inf>|x|>=6 */ - if(hx>=0) return one-tiny; else return tiny-one; - } - x = fabsf(x); - s = one/(x*x); - if(ix< 0x4036DB6E) { /* |x| < 1/0.35 */ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/0.35 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - __trunc_float_word (&z); - r = __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S); - if(hx>=0) return one-r/x; else return r/x-one; -} - -#ifdef __STDC__ - float erfcf(float x) -#else - float erfcf(x) - float x; -#endif -{ - int32_t hx,ix; - float R,S,P,Q,s,y,z,r; - hx = __get_float_word(x); - ix = hx&0x7fffffff; - if(!(ix<0x7f800000L)) { /* erfc(nan)=nan */ - /* erfc(+-inf)=0,2 */ - return (float)(((uint32_t)hx>>31)<<1)+one/x; - } - - if(ix < 0x3f580000) { /* |x|<0.84375 */ - if(ix < 0x23800000) /* |x|<2**-56 */ - return one-x; - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - if(hx < 0x3e800000) { /* x<1/4 */ - return one-(x+x*y); - } else { - r = x*y; - r += (x-half); - return half - r ; - } - } - if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */ - s = fabsf(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) { - z = one-erx; return z - P/Q; - } else { - z = erx+P/Q; return one+z; - } - } - - if (ix < 0x41e00000) { /* |x|<28 */ - x = fabsf(x); - s = one/(x*x); - if(ix< 0x4036DB6D) { /* |x| < 1/.35 ~ 2.857143*/ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/.35 ~ 2.857143 */ - if(hx<0&&ix>=0x40c00000) return two-tiny;/* x < -6 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - __trunc_float_word (&z); - r = __ieee754_expf(-z*z-(float)0.5625)* - __ieee754_expf((z-x)*(z+x)+R/S); - if(hx>0) return r/x; else return two-r/x; - } else { - /* set range error */ - errno = ERANGE; - if(hx>0) return tiny*tiny; else return two-tiny; - } -} diff --git a/winsup/mingw/mingwex/math/signbit.c b/winsup/mingw/mingwex/math/signbit.c deleted file mode 100644 index 7f86c86a3..000000000 --- a/winsup/mingw/mingwex/math/signbit.c +++ /dev/null @@ -1,13 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbit (double x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return sw & __FP_SIGNBIT; -} - -#undef signbit -int __attribute__ ((alias ("__signbit"))) signbit (double); - diff --git a/winsup/mingw/mingwex/math/signbitf.c b/winsup/mingw/mingwex/math/signbitf.c deleted file mode 100644 index 5bbf675ad..000000000 --- a/winsup/mingw/mingwex/math/signbitf.c +++ /dev/null @@ -1,10 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbitf (float x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return sw & __FP_SIGNBIT; -} -int __attribute__ ((alias ("__signbitf"))) signbitf (float); diff --git a/winsup/mingw/mingwex/math/signbitl.c b/winsup/mingw/mingwex/math/signbitl.c deleted file mode 100644 index 78f990350..000000000 --- a/winsup/mingw/mingwex/math/signbitl.c +++ /dev/null @@ -1,11 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbitl (long double x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return sw & __FP_SIGNBIT; -} - -int __attribute__ ((alias ("__signbitl"))) signbitl (long double); diff --git a/winsup/mingw/mingwex/math/sinf.S b/winsup/mingw/mingwex/math/sinf.S deleted file mode 100644 index 23e986d11..000000000 --- a/winsup/mingw/mingwex/math/sinf.S +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "sinf.S" - .text - .align 4 -.globl _sinf - .def _sinf; .scl 2; .type 32; .endef -_sinf: - flds 4(%esp) - fsin - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsin - ret diff --git a/winsup/mingw/mingwex/math/sinhf.c b/winsup/mingw/mingwex/math/sinhf.c deleted file mode 100644 index 3d6bcff41..000000000 --- a/winsup/mingw/mingwex/math/sinhf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float sinhf (float x) - {return (float) sinh (x);} diff --git a/winsup/mingw/mingwex/math/sinhl.c b/winsup/mingw/mingwex/math/sinhl.c deleted file mode 100644 index ca6a370b9..000000000 --- a/winsup/mingw/mingwex/math/sinhl.c +++ /dev/null @@ -1,172 +0,0 @@ -/* sinhl.c - * - * Hyperbolic sine, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, sinhl(); - * - * y = sinhl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic sine of argument in the range MINLOGL to - * MAXLOGL. - * - * The range is partitioned into two segments. If |x| <= 1, a - * rational function of the form x + x**3 P(x)/Q(x) is employed. - * Otherwise the calculation is sinh(x) = ( exp(x) - exp(-x) )/2. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -2,2 10000 1.5e-19 3.9e-20 - * IEEE +-10000 30000 1.1e-19 2.8e-20 - * - */ - -/* -Cephes Math Library Release 2.7: January, 1998 -Copyright 1984, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#ifdef UNK -static long double P[] = { - 1.7550769032975377032681E-6L, - 4.1680702175874268714539E-4L, - 3.0993532520425419002409E-2L, - 9.9999999999999999998002E-1L, -}; -static long double Q[] = { - 1.7453965448620151484660E-8L, --5.9116673682651952419571E-6L, - 1.0599252315677389339530E-3L, --1.1403880487744749056675E-1L, - 6.0000000000000000000200E0L, -}; -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0xec6a,0xd942,0xfbb3,0xeb8f,0x3feb, XPD -0x365e,0xb30a,0xe437,0xda86,0x3ff3, XPD -0x8890,0x01f6,0x2612,0xfde6,0x3ff9, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -static const unsigned short Q[] = { -0x4edd,0x4c21,0xad09,0x95ed,0x3fe5, XPD -0x4376,0x9b70,0xd605,0xc65c,0xbfed, XPD -0xc8ad,0x5d21,0x3069,0x8aed,0x3ff5, XPD -0x9c32,0x6374,0x2d4b,0xe98d,0xbffb, XPD -0x0000,0x0000,0x0000,0xc000,0x4001, XPD -}; -#endif - -#ifdef MIEEE -static long P[] = { -0x3feb0000,0xeb8ffbb3,0xd942ec6a, -0x3ff30000,0xda86e437,0xb30a365e, -0x3ff90000,0xfde62612,0x01f68890, -0x3fff0000,0x80000000,0x00000000, -}; -static long Q[] = { -0x3fe50000,0x95edad09,0x4c214edd, -0xbfed0000,0xc65cd605,0x9b704376, -0x3ff50000,0x8aed3069,0x5d21c8ad, -0xbffb0000,0xe98d2d4b,0x63749c32, -0x40010000,0xc0000000,0x00000000, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXNUML, MAXLOGL, MINLOGL, LOGE2L; -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double expl ( long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -#else -long double fabsl(), expl(), polevll(), p1evll(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#endif /* __MINGW32__ */ - -long double sinhl(x) -long double x; -{ -long double a; - -#ifdef MINUSZERO -if( x == 0.0 ) - return(x); -#endif -#ifdef NANS -if (isnanl(x)) - { - _SET_ERRNO(EDOM); - } -#endif -a = fabsl(x); -if( (x > (MAXLOGL + LOGE2L)) || (x > -(MINLOGL-LOGE2L) ) ) - { - mtherr( "sinhl", DOMAIN ); - _SET_ERRNO(ERANGE); -#ifdef INFINITIES - if( x > 0.0L ) - return( INFINITYL ); - else - return( -INFINITYL ); -#else - if( x > 0.0L ) - return( MAXNUML ); - else - return( -MAXNUML ); -#endif - } -if( a > 1.0L ) - { - if( a >= (MAXLOGL - LOGE2L) ) - { - a = expl(0.5L*a); - a = (0.5L * a) * a; - if( x < 0.0L ) - a = -a; - return(a); - } - a = expl(a); - a = 0.5L*a - (0.5L/a); - if( x < 0.0L ) - a = -a; - return(a); - } - -a *= a; -return( x + x * a * (polevll(a,P,3)/polevll(a,Q,4)) ); -} diff --git a/winsup/mingw/mingwex/math/sinl.S b/winsup/mingw/mingwex/math/sinl.S deleted file mode 100644 index 16b2d9e50..000000000 --- a/winsup/mingw/mingwex/math/sinl.S +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "sinl.S" - .text - .align 4 -.globl _sinl - .def _sinl; .scl 2; .type 32; .endef -_sinl: - fldt 4(%esp) - fsin - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsin - ret diff --git a/winsup/mingw/mingwex/math/sqrtf.c b/winsup/mingw/mingwex/math/sqrtf.c deleted file mode 100644 index b1029cad8..000000000 --- a/winsup/mingw/mingwex/math/sqrtf.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> -#include <errno.h> - -extern float __QNANF; - -float -sqrtf (float x) -{ - if (x < 0.0F ) - { - errno = EDOM; - return __QNANF; - } - else - { - float res; - asm ("fsqrt" : "=t" (res) : "0" (x)); - return res; - } -} diff --git a/winsup/mingw/mingwex/math/sqrtl.c b/winsup/mingw/mingwex/math/sqrtl.c deleted file mode 100644 index dba68d878..000000000 --- a/winsup/mingw/mingwex/math/sqrtl.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> -#include <errno.h> - -extern long double __QNANL; - -long double -sqrtl (long double x) -{ - if (x < 0.0L ) - { - errno = EDOM; - return __QNANL; - } - else - { - long double res; - asm ("fsqrt" : "=t" (res) : "0" (x)); - return res; - } -} diff --git a/winsup/mingw/mingwex/math/tanf.S b/winsup/mingw/mingwex/math/tanf.S deleted file mode 100644 index 540fc6836..000000000 --- a/winsup/mingw/mingwex/math/tanf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "tanf.S" - .text - .align 4 -.globl _tanf - .def _tanf; .scl 2; .type 32; .endef -_tanf: - flds 4(%esp) - fptan - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstp %st(0) - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fptan - fstp %st(0) - ret diff --git a/winsup/mingw/mingwex/math/tanhf.c b/winsup/mingw/mingwex/math/tanhf.c deleted file mode 100644 index b7c56f05c..000000000 --- a/winsup/mingw/mingwex/math/tanhf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float tanhf (float x) - {return (float) tanh (x);} diff --git a/winsup/mingw/mingwex/math/tanhl.c b/winsup/mingw/mingwex/math/tanhl.c deleted file mode 100644 index d5d86d0ae..000000000 --- a/winsup/mingw/mingwex/math/tanhl.c +++ /dev/null @@ -1,151 +0,0 @@ -/* tanhl.c - * - * Hyperbolic tangent, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, tanhl(); - * - * y = tanhl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic tangent of argument in the range MINLOGL to - * MAXLOGL. - * - * A rational function is used for |x| < 0.625. The form - * x + x**3 P(x)/Q(x) of Cody _& Waite is employed. - * Otherwise, - * tanh(x) = sinh(x)/cosh(x) = 1 - 2/(exp(2x) + 1). - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -2,2 30000 1.3e-19 2.4e-20 - * - */ - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1984, 1987, 1989, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#ifdef UNK -static long double P[] = { --6.8473739392677100872869E-5L, --9.5658283111794641589011E-1L, --8.4053568599672284488465E1L, --1.3080425704712825945553E3L, -}; -static long double Q[] = { -/* 1.0000000000000000000000E0L,*/ - 9.6259501838840336946872E1L, - 1.8218117903645559060232E3L, - 3.9241277114138477845780E3L, -}; -#endif - -#ifdef IBMPC -static unsigned short P[] = { -0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD -0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD -0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD -0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD -}; -static unsigned short Q[] = { -/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/ -0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD -0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD -0xd5a2,0x1f9c,0x0b1b,0xf542,0x400a, XPD -}; -#endif - -#ifdef MIEEE -static long P[] = { -0xbff10000,0x8f998f15,0x1b0cd2a4, -0xbffe0000,0xf4e29cc7,0x91115959, -0xc0050000,0xa81b6d57,0xef5eb576, -0xc0090000,0xa3815cbc,0xbfbde3be, -}; -static long Q[] = { -/*0x3fff0000,0x80000000,0x00000000,*/ -0x40050000,0xc084dd6c,0xce24687f, -0x40090000,0xe3b9fa2f,0xc95f3793, -0x400a0000,0xf5420b1b,0x1f9cd5a2, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXLOGL; -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double expl ( long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -#else -long double fabsl(), expl(), polevll(), p1evll(); -#endif -#endif /* __MINGW32__ */ - -long double tanhl(x) -long double x; -{ -long double s, z; - -#ifdef MINUSZERO -if( x == 0.0L ) - return(x); -#endif -if (isnanl(x)) - { - _SET_ERRNO (EDOM); - return x; - } - -z = fabsl(x); -if( z > 0.5L * MAXLOGL ) - { - _SET_ERRNO (ERANGE); - if( x > 0 ) - return( 1.0L ); - else - return( -1.0L ); - } -if( z >= 0.625L ) - { - s = expl(2.0*z); - z = 1.0L - 2.0/(s + 1.0L); - if( x < 0 ) - z = -z; - } -else - { - s = x * x; - z = polevll( s, P, 3 )/p1evll(s, Q, 3); - z = x * s * z; - z = x + z; - } -return( z ); -} diff --git a/winsup/mingw/mingwex/math/tanl.S b/winsup/mingw/mingwex/math/tanl.S deleted file mode 100644 index fd30019a8..000000000 --- a/winsup/mingw/mingwex/math/tanl.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "tanl.S" - .text - .align 4 -.globl _tanl - .def _tanl; .scl 2; .type 32; .endef -_tanl: - fldt 4(%esp) - fptan - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstp %st(0) - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fptan - fstp %st(0) - ret diff --git a/winsup/mingw/mingwex/math/tgamma.c b/winsup/mingw/mingwex/math/tgamma.c deleted file mode 100644 index d04a5f4a5..000000000 --- a/winsup/mingw/mingwex/math/tgamma.c +++ /dev/null @@ -1,385 +0,0 @@ -/* gamma.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * double x, y, __tgamma_r(); - * int* sgngam; - * y = __tgamma_r( x, sgngam ); - * - * double x, y, tgamma(); - * y = tgamma( x) - * - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngam. - * - * Arguments |x| <= 34 are reduced by recurrence and the function - * approximated by a rational function of degree 6/7 in the - * interval (2,3). Large arguments are handled by Stirling's - * formula. Large negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * DEC -34, 34 10000 1.3e-16 2.5e-17 - * IEEE -170,-33 20000 2.3e-15 3.3e-16 - * IEEE -33, 33 20000 9.4e-16 2.2e-16 - * IEEE 33, 171.6 20000 2.3e-15 3.2e-16 - * - * Error for arguments outside the test range will be larger - * owing to error amplification by the exponential function. - * - */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -#ifdef UNK -static const double P[] = { - 1.60119522476751861407E-4, - 1.19135147006586384913E-3, - 1.04213797561761569935E-2, - 4.76367800457137231464E-2, - 2.07448227648435975150E-1, - 4.94214826801497100753E-1, - 9.99999999999999996796E-1 -}; -static const double Q[] = { --2.31581873324120129819E-5, - 5.39605580493303397842E-4, --4.45641913851797240494E-3, - 1.18139785222060435552E-2, - 3.58236398605498653373E-2, --2.34591795718243348568E-1, - 7.14304917030273074085E-2, - 1.00000000000000000320E0 -}; -#define MAXGAM 171.624376956302725 -static const double LOGPI = 1.14472988584940017414; -#endif - -#ifdef DEC -static const unsigned short P[] = { -0035047,0162701,0146301,0005234, -0035634,0023437,0032065,0176530, -0036452,0137157,0047330,0122574, -0037103,0017310,0143041,0017232, -0037524,0066516,0162563,0164605, -0037775,0004671,0146237,0014222, -0040200,0000000,0000000,0000000 -}; -static const unsigned short Q[] = { -0134302,0041724,0020006,0116565, -0035415,0072121,0044251,0025634, -0136222,0003447,0035205,0121114, -0036501,0107552,0154335,0104271, -0037022,0135717,0014776,0171471, -0137560,0034324,0165024,0037021, -0037222,0045046,0047151,0161213, -0040200,0000000,0000000,0000000 -}; -#define MAXGAM 34.84425627277176174 -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0x2153,0x3998,0xfcb8,0x3f24, -0xbfab,0xe686,0x84e3,0x3f53, -0x14b0,0xe9db,0x57cd,0x3f85, -0x23d3,0x18c4,0x63d9,0x3fa8, -0x7d31,0xdcae,0x8da9,0x3fca, -0xe312,0x3993,0xa137,0x3fdf, -0x0000,0x0000,0x0000,0x3ff0 -}; -static const unsigned short Q[] = { -0xd3af,0x8400,0x487a,0xbef8, -0x2573,0x2915,0xae8a,0x3f41, -0xb44a,0xe750,0x40e4,0xbf72, -0xb117,0x5b1b,0x31ed,0x3f88, -0xde67,0xe33f,0x5779,0x3fa2, -0x87c2,0x9d42,0x071a,0xbfce, -0x3c51,0xc9cd,0x4944,0x3fb2, -0x0000,0x0000,0x0000,0x3ff0 -}; -#define MAXGAM 171.624376956302725 -#endif - -#ifdef MIEEE -static const unsigned short P[] = { -0x3f24,0xfcb8,0x3998,0x2153, -0x3f53,0x84e3,0xe686,0xbfab, -0x3f85,0x57cd,0xe9db,0x14b0, -0x3fa8,0x63d9,0x18c4,0x23d3, -0x3fca,0x8da9,0xdcae,0x7d31, -0x3fdf,0xa137,0x3993,0xe312, -0x3ff0,0x0000,0x0000,0x0000 -}; -static const unsigned short Q[] = { -0xbef8,0x487a,0x8400,0xd3af, -0x3f41,0xae8a,0x2915,0x2573, -0xbf72,0x40e4,0xe750,0xb44a, -0x3f88,0x31ed,0x5b1b,0xb117, -0x3fa2,0x5779,0xe33f,0xde67, -0xbfce,0x071a,0x9d42,0x87c2, -0x3fb2,0x4944,0xc9cd,0x3c51, -0x3ff0,0x0000,0x0000,0x0000 -}; -#define MAXGAM 171.624376956302725 -#endif - -/* Stirling's formula for the gamma function */ -#if UNK -static const double STIR[5] = { - 7.87311395793093628397E-4, --2.29549961613378126380E-4, --2.68132617805781232825E-3, - 3.47222221605458667310E-3, - 8.33333333333482257126E-2, -}; -#define MAXSTIR 143.01608 -static const double SQTPI = 2.50662827463100050242E0; -#endif -#if DEC -static const unsigned short STIR[20] = { -0035516,0061622,0144553,0112224, -0135160,0131531,0037460,0165740, -0136057,0134460,0037242,0077270, -0036143,0107070,0156306,0027751, -0037252,0125252,0125252,0146064, -}; -#define MAXSTIR 26.77 -static const unsigned short SQT[4] = { -0040440,0066230,0177661,0034055, -}; -#define SQTPI *(double *)SQT -#endif -#if IBMPC -static const unsigned short STIR[20] = { -0x7293,0x592d,0xcc72,0x3f49, -0x1d7c,0x27e6,0x166b,0xbf2e, -0x4fd7,0x07d4,0xf726,0xbf65, -0xc5fd,0x1b98,0x71c7,0x3f6c, -0x5986,0x5555,0x5555,0x3fb5, -}; -#define MAXSTIR 143.01608 -static const unsigned short SQT[4] = { -0x2706,0x1ff6,0x0d93,0x4004, -}; -#define SQTPI *(double *)SQT -#endif -#if MIEEE -static const unsigned short STIR[20] = { -0x3f49,0xcc72,0x592d,0x7293, -0xbf2e,0x166b,0x27e6,0x1d7c, -0xbf65,0xf726,0x07d4,0x4fd7, -0x3f6c,0x71c7,0x1b98,0xc5fd, -0x3fb5,0x5555,0x5555,0x5986, -}; -#define MAXSTIR 143.01608 -static const unsigned short SQT[4] = { -0x4004,0x0d93,0x1ff6,0x2706, -}; -#define SQTPI *(double *)SQT -#endif - -#ifndef __MINGW32__ -int sgngam = 0; -extern int sgngam; -extern double MAXLOG, MAXNUM, PI; -#ifdef ANSIPROT -extern double pow ( double, double ); -extern double log ( double ); -extern double exp ( double ); -extern double sin ( double ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double floor ( double ); -extern double fabs ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -static double stirf ( double ); -double lgam ( double ); -#else -double pow(), log(), exp(), sin(), polevl(), p1evl(), floor(), fabs(); -int isnan(), isfinite(); -static double stirf(); -double lgam(); -#endif -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#else /* __MINGW32__ */ -static double stirf ( double ); -#endif - -/* Gamma function computed by Stirling's formula. - * The polynomial STIR is valid for 33 <= x <= 172. - */ -static double stirf(x) -double x; -{ -double y, w, v; - -w = 1.0/x; -w = 1.0 + w * polevl( w, STIR, 4 ); -y = exp(x); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = pow( x, 0.5 * x - 0.25 ); - y = v * (v / y); - } -else - { - y = pow( x, x - 0.5 ) / y; - } -y = SQTPI * y * w; -return( y ); -} - - - -double __tgamma_r(double x, int* sgngam) -{ -double p, q, z; -int i; - -*sgngam = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITY ) - return(x); -if( x == -INFINITY ) - return(NAN); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif -q = fabs(x); - -if( q > 33.0 ) - { - if( x < 0.0 ) - { - p = floor(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgamma", SING ); -#ifdef INFINITIES - return (INFINITY); -#else - return (MAXNUM); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngam = -1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = q - p; - } - z = q * sin( PI * z ); - if( z == 0.0 ) - { - _SET_ERRNO(ERANGE); - mtherr( "tgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngam * INFINITY); -#else - return( *sgngam * MAXNUM); -#endif - } - z = fabs(z); - z = PI/(z * stirf(q) ); - } - else - { - z = stirf(x); - } - return( *sgngam * z ); - } - -z = 1.0; -while( x >= 3.0 ) - { - x -= 1.0; - z *= x; - } - -while( x < 0.0 ) - { - if( x > -1.E-9 ) - goto Small; - z /= x; - x += 1.0; - } - -while( x < 2.0 ) - { - if( x < 1.e-9 ) - goto Small; - z /= x; - x += 1.0; - } - -if( x == 2.0 ) - return(z); - -x -= 2.0; -p = polevl( x, P, 6 ); -q = polevl( x, Q, 7 ); -return( z * p / q ); - -Small: -if( x == 0.0 ) - { - goto gsing; - } -else - return( z/((1.0 + 0.5772156649015329 * x) * x) ); -} - -/* This is the C99 version */ - -double tgamma(double x) -{ - int local_sgngam=0; - return (__tgamma_r(x, &local_sgngam)); -} diff --git a/winsup/mingw/mingwex/math/tgammaf.c b/winsup/mingw/mingwex/math/tgammaf.c deleted file mode 100644 index 07d294971..000000000 --- a/winsup/mingw/mingwex/math/tgammaf.c +++ /dev/null @@ -1,265 +0,0 @@ -/* gammaf.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * float x, y, __tgammaf_r(); - * int* sgngamf; - * y = __tgammaf_r( x, sgngamf ); - * - * float x, y, tgammaf(); - * y = tgammaf( x); - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngamf. - * - * Arguments between 0 and 10 are reduced by recurrence and the - * function is approximated by a polynomial function covering - * the interval (2,3). Large arguments are handled by Stirling's - * formula. Negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,-33 100,000 5.7e-7 1.0e-7 - * IEEE -33,0 100,000 6.1e-7 1.2e-7 - * - * - */ - -/* -Cephes Math Library Release 2.7: July, 1998 -Copyright 1984, 1987, 1989, 1992, 1998 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -/* define MAXGAM 34.84425627277176174 */ - -/* Stirling's formula for the gamma function - * gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) ( 1 + 1/x P(1/x) ) - * .028 < 1/x < .1 - * relative error < 1.9e-11 - */ -static const float STIR[] = { --2.705194986674176E-003, - 3.473255786154910E-003, - 8.333331788340907E-002, -}; -static const float MAXSTIR = 26.77; -static const float SQTPIF = 2.50662827463100050242; /* sqrt( 2 pi ) */ - -#ifndef __MINGW32__ - -extern float MAXLOGF, MAXNUMF, PIF; - -#ifdef ANSIC -float expf(float); -float logf(float); -float powf( float, float ); -float sinf(float); -float gammaf(float); -float floorf(float); -static float stirf(float); -float polevlf( float, float *, int ); -float p1evlf( float, float *, int ); -#else -float expf(), logf(), powf(), sinf(), floorf(); -float polevlf(), p1evlf(); -static float stirf(); -#endif - -#else /* __MINGW32__ */ -static float stirf(float); -#endif - -/* Gamma function computed by Stirling's formula, - * sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x)) - * The polynomial STIR is valid for 33 <= x <= 172. - */ -static float stirf( float x ) -{ -float y, w, v; - -w = 1.0/x; -w = 1.0 + w * polevlf( w, STIR, 2 ); -y = expf( -x ); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = powf( x, 0.5 * x - 0.25 ); - y *= v; - y *= v; - } -else - { - y = powf( x, x - 0.5 ) * y; - } -y = SQTPIF * y * w; -return( y ); -} - - -/* gamma(x+2), 0 < x < 1 */ -static const float P[] = { - 1.536830450601906E-003, - 5.397581592950993E-003, - 4.130370201859976E-003, - 7.232307985516519E-002, - 8.203960091619193E-002, - 4.117857447645796E-001, - 4.227867745131584E-001, - 9.999999822945073E-001, -}; - -float __tgammaf_r( float x, int* sgngamf) -{ -float p, q, z, nz; -int i, direction, negative; - -#ifdef NANS -if( isnan(x) ) - return(x); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITYF ) - return(x); -if( x == -INFINITYF ) - return(NANF); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif - -*sgngamf = 1; -negative = 0; -nz = 0.0; -if( x < 0.0 ) - { - negative = 1; - q = -x; - p = floorf(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgammaf", SING ); -#ifdef INFINITIES - return (INFINITYF); -#else - return (MAXNUMF); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngamf = -1; - nz = q - p; - if( nz > 0.5 ) - { - p += 1.0; - nz = q - p; - } - nz = q * sinf( PIF * nz ); - if( nz == 0.0 ) - { - _SET_ERRNO(ERANGE); - mtherr( "tgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngamf * INFINITYF); -#else - return( *sgngamf * MAXNUMF); -#endif - } - if( nz < 0 ) - nz = -nz; - x = q; - } -if( x >= 10.0 ) - { - z = stirf(x); - } -if( x < 2.0 ) - direction = 1; -else - direction = 0; -z = 1.0; -while( x >= 3.0 ) - { - x -= 1.0; - z *= x; - } -/* -while( x < 0.0 ) - { - if( x > -1.E-4 ) - goto Small; - z *=x; - x += 1.0; - } -*/ -while( x < 2.0 ) - { - if( x < 1.e-4 ) - goto Small; - z *=x; - x += 1.0; - } - -if( direction ) - z = 1.0/z; - -if( x == 2.0 ) - return(z); - -x -= 2.0; -p = z * polevlf( x, P, 7 ); - -gdone: - -if( negative ) - { - p = *sgngamf * PIF/(nz * p ); - } -return(p); - -Small: -if( x == 0.0 ) - { - goto gsing; - } -else - { - p = z / ((1.0 + 0.5772156649015329 * x) * x); - goto gdone; - } -} - -/* This is the C99 version */ - -float tgammaf(float x) -{ - int local_sgngamf=0; - return (__tgammaf_r(x, &local_sgngamf)); -} diff --git a/winsup/mingw/mingwex/math/tgammal.c b/winsup/mingw/mingwex/math/tgammal.c deleted file mode 100644 index 6db4e3af7..000000000 --- a/winsup/mingw/mingwex/math/tgammal.c +++ /dev/null @@ -1,501 +0,0 @@ -/* gammal.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * long double x, y, __tgammal_r(); - * int* sgngaml; - * y = __tgammal_r( x, sgngaml ); - * - * long double x, y, tgammal(); - * y = tgammal( x); * - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngamf. - * - * Arguments |x| <= 13 are reduced by recurrence and the function - * approximated by a rational function of degree 7/8 in the - * interval (2,3). Large arguments are handled by Stirling's - * formula. Large negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -40,+40 10000 3.6e-19 7.9e-20 - * IEEE -1755,+1755 10000 4.8e-18 6.5e-19 - * - * Accuracy for large arguments is dominated by error in powl(). - * - */ - -/* -Copyright 1994 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -/* -gamma(x+2) = gamma(x+2) P(x)/Q(x) -0 <= x <= 1 -Relative error -n=7, d=8 -Peak error = 1.83e-20 -Relative error spread = 8.4e-23 -*/ - -#if UNK -static const long double P[8] = { - 4.212760487471622013093E-5L, - 4.542931960608009155600E-4L, - 4.092666828394035500949E-3L, - 2.385363243461108252554E-2L, - 1.113062816019361559013E-1L, - 3.629515436640239168939E-1L, - 8.378004301573126728826E-1L, - 1.000000000000000000009E0L, -}; -static const long double Q[9] = { --1.397148517476170440917E-5L, - 2.346584059160635244282E-4L, --1.237799246653152231188E-3L, --7.955933682494738320586E-4L, - 2.773706565840072979165E-2L, --4.633887671244534213831E-2L, --2.243510905670329164562E-1L, - 4.150160950588455434583E-1L, - 9.999999999999999999908E-1L, -}; -#endif -#if IBMPC -static const unsigned short P[] = { -0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD -0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD -0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD -0x7f43,0x5196,0xb166,0xc368,0x3ff9, XPD -0x9549,0x8eb5,0x8c3a,0xe3f4,0x3ffb, XPD -0x8d75,0x23af,0xc8e4,0xb9d4,0x3ffd, XPD -0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -static const unsigned short Q[] = { -0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD -0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD -0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD -0x296e,0x7cb1,0x5dfd,0xd08f,0xbff4, XPD -0x0417,0x7989,0xd7bc,0xe338,0x3ff9, XPD -0x3295,0x3698,0xd580,0xbdcd,0xbffa, XPD -0x75ef,0x3ab7,0x4ad3,0xe5bc,0xbffc, XPD -0xe458,0x2ec7,0xfd57,0xd47c,0x3ffd, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static const long P[24] = { -0x3ff00000,0xb0b22bda,0x3f22434a, -0x3ff30000,0xee2e335b,0xe82ff5aa, -0x3ff70000,0x861bc717,0x3757be6c, -0x3ff90000,0xc368b166,0x51967f43, -0x3ffb0000,0xe3f48c3a,0x8eb59549, -0x3ffd0000,0xb9d4c8e4,0x23af8d75, -0x3ffe0000,0xd67a16c8,0x19b329cf, -0x3fff0000,0x80000000,0x00000000, -}; -static const long Q[27] = { -0xbfee0000,0xea671268,0x2de85473, -0x3ff20000,0xf60ea2dd,0xc2f0334b, -0xbff50000,0xa23da691,0x1853beed, -0xbff40000,0xd08f5dfd,0x7cb1296e, -0x3ff90000,0xe338d7bc,0x79890417, -0xbffa0000,0xbdcdd580,0x36983295, -0xbffc0000,0xe5bc4ad3,0x3ab775ef, -0x3ffd0000,0xd47cfd57,0x2ec7e458, -0x3fff0000,0x80000000,0x00000000, -}; -#endif -/* -static const long double P[] = { --3.01525602666895735709e0L, --3.25157411956062339893e1L, --2.92929976820724030353e2L, --1.70730828800510297666e3L, --7.96667499622741999770e3L, --2.59780216007146401957e4L, --5.99650230220855581642e4L, --7.15743521530849602425e4L -}; -static const long double Q[] = { - 1.00000000000000000000e0L, --1.67955233807178858919e1L, - 8.85946791747759881659e1L, - 5.69440799097468430177e1L, --1.98526250512761318471e3L, - 3.31667508019495079814e3L, - 1.60577839621734713377e4L, --2.97045081369399940529e4L, --7.15743521530849602412e4L -}; -*/ -#define MAXGAML 1755.455L -/*static const long double LOGPI = 1.14472988584940017414L;*/ - -/* Stirling's formula for the gamma function -gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x)) -z(x) = x -13 <= x <= 1024 -Relative error -n=8, d=0 -Peak error = 9.44e-21 -Relative error spread = 8.8e-4 -*/ -#if UNK -static const long double STIR[9] = { - 7.147391378143610789273E-4L, --2.363848809501759061727E-5L, --5.950237554056330156018E-4L, - 6.989332260623193171870E-5L, - 7.840334842744753003862E-4L, --2.294719747873185405699E-4L, --2.681327161876304418288E-3L, - 3.472222222230075327854E-3L, - 8.333333333333331800504E-2L, -}; -#endif -#if IBMPC -static const unsigned short STIR[] = { -0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD -0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD -0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD -0x5704,0x1a39,0xb11d,0x9293,0x3ff1, XPD -0x30b7,0x1a21,0x98b2,0xcd87,0x3ff4, XPD -0xbef3,0x7023,0x6a08,0xf09e,0xbff2, XPD -0x3a1c,0x5ac8,0x3478,0xafb9,0xbff6, XPD -0xc3c9,0x906e,0x38e3,0xe38e,0x3ff6, XPD -0xa1d5,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD -}; -#endif -#if MIEEE -static const long STIR[27] = { -0x3ff40000,0xbb5d54e3,0x69f76ede, -0xbfef0000,0xc64b4443,0x0295c395, -0xbff40000,0x9bfb5e47,0x7c59ba6f, -0x3ff10000,0x9293b11d,0x1a395704, -0x3ff40000,0xcd8798b2,0x1a2130b7, -0xbff20000,0xf09e6a08,0x7023bef3, -0xbff60000,0xafb93478,0x5ac83a1c, -0x3ff60000,0xe38e38e3,0x906ec3c9, -0x3ffb0000,0xaaaaaaaa,0xaaaaa1d5, -}; -#endif -#define MAXSTIR 1024.0L -static const long double SQTPI = 2.50662827463100050242E0L; - -/* 1/gamma(x) = z P(z) - * z(x) = 1/x - * 0 < x < 0.03125 - * Peak relative error 4.2e-23 - */ -#if UNK -static const long double S[9] = { --1.193945051381510095614E-3L, - 7.220599478036909672331E-3L, --9.622023360406271645744E-3L, --4.219773360705915470089E-2L, - 1.665386113720805206758E-1L, --4.200263503403344054473E-2L, --6.558780715202540684668E-1L, - 5.772156649015328608253E-1L, - 1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short S[] = { -0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD -0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD -0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD -0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD -0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD -0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD -0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD -0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static const long S[27] = { -0xbff50000,0x9c7e25e5,0xd6d3baeb, -0x3ff70000,0xec9ac74e,0xceb4fe9a, -0xbff80000,0x9da5b0e9,0xdfef9225, -0xbffa0000,0xacd787dc,0xec1710b0, -0x3ffc0000,0xaa891905,0x75156b8d, -0xbffa0000,0xac0af47d,0x126bf183, -0xbffe0000,0xa7e7a013,0x57d17bf6, -0x3ffe0000,0x93c467e3,0x7db0c7a9, -0x3fff0000,0x80000000,0x00000000, -}; -#endif -/* 1/gamma(-x) = z P(z) - * z(x) = 1/x - * 0 < x < 0.03125 - * Peak relative error 5.16e-23 - * Relative error spread = 2.5e-24 - */ -#if UNK -static const long double SN[9] = { - 1.133374167243894382010E-3L, - 7.220837261893170325704E-3L, - 9.621911155035976733706E-3L, --4.219773343731191721664E-2L, --1.665386113944413519335E-1L, --4.200263503402112910504E-2L, - 6.558780715202536547116E-1L, - 5.772156649015328608727E-1L, --1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short SN[] = { -0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD -0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD -0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD -0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD -0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD -0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD -0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD -0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0xbfff, XPD -}; -#endif -#if MIEEE -static const long SN[27] = { -0x3ff50000,0x948db9f7,0x02de5dd1, -0x3ff70000,0xec9cc5f1,0xdd68989b, -0x3ff80000,0x9da5386f,0x18f02ca1, -0xbffa0000,0xacd787d1,0x41dd783f, -0xbffc0000,0xaa891905,0xd76d7a5b, -0xbffa0000,0xac0af47d,0x12347f64, -0x3ffe0000,0xa7e7a013,0x57d15e26, -0x3ffe0000,0x93c467e3,0x7db0c7aa, -0xbfff0000,0x80000000,0x00000000, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXLOGL, MAXNUML, PIL; -/* #define PIL 3.14159265358979323846L */ -/* #define MAXNUML 1.189731495357231765021263853E4932L */ - -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double lgaml ( long double ); -extern long double logl ( long double ); -extern long double expl ( long double ); -extern long double gammal ( long double ); -extern long double sinl ( long double ); -extern long double floorl ( long double ); -extern long double powl ( long double, long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -static long double stirf ( long double ); -#else -long double fabsl(), lgaml(), logl(), expl(), gammal(), sinl(); -long double floorl(), powl(), polevll(), p1evll(), isnanl(), isfinitel(); -static long double stirf(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif - -#else /* __MINGW32__ */ -static long double stirf ( long double ); -#endif - - -/* Gamma function computed by Stirling's formula. */ - -static long double stirf(x) -long double x; -{ -long double y, w, v; - -w = 1.0L/x; -/* For large x, use rational coefficients from the analytical expansion. */ -if( x > 1024.0L ) - w = (((((6.97281375836585777429E-5L * w - + 7.84039221720066627474E-4L) * w - - 2.29472093621399176955E-4L) * w - - 2.68132716049382716049E-3L) * w - + 3.47222222222222222222E-3L) * w - + 8.33333333333333333333E-2L) * w - + 1.0L; -else - w = 1.0L + w * polevll( w, STIR, 8 ); -y = expl(x); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = powl( x, 0.5L * x - 0.25L ); - y = v * (v / y); - } -else - { - y = powl( x, x - 0.5L ) / y; - } -y = SQTPI * y * w; -return( y ); -} - - -long double __tgammal_r(long double x, int* sgngaml) -{ -long double p, q, z; -int i; - -*sgngaml = 1; -#ifdef NANS -if( isnanl(x) ) - return(NANL); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITYL ) - return(x); -if( x == -INFINITYL ) - return(NANL); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif -q = fabsl(x); - -if( q > 13.0L ) - { - if( q > MAXGAML ) - goto goverf; - if( x < 0.0L ) - { - p = floorl(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgammal", SING ); -#ifdef INFINITIES - return (INFINITYL); -#else - return( *sgngaml * MAXNUML); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngaml = -1; - z = q - p; - if( z > 0.5L ) - { - p += 1.0L; - z = q - p; - } - z = q * sinl( PIL * z ); - z = fabsl(z) * stirf(q); - if( z <= PIL/MAXNUML ) - { -goverf: - _SET_ERRNO(ERANGE); - mtherr( "tgammal", OVERFLOW ); -#ifdef INFINITIES - return( *sgngaml * INFINITYL); -#else - return( *sgngaml * MAXNUML); -#endif - } - z = PIL/z; - } - else - { - z = stirf(x); - } - return( *sgngaml * z ); - } - -z = 1.0L; -while( x >= 3.0L ) - { - x -= 1.0L; - z *= x; - } - -while( x < -0.03125L ) - { - z /= x; - x += 1.0L; - } - -if( x <= 0.03125L ) - goto Small; - -while( x < 2.0L ) - { - z /= x; - x += 1.0L; - } - -if( x == 2.0L ) - return(z); - -x -= 2.0L; -p = polevll( x, P, 7 ); -q = polevll( x, Q, 8 ); -return( z * p / q ); - -Small: -if( x == 0.0L ) - { - goto gsing; - } -else - { - if( x < 0.0L ) - { - x = -x; - q = z / (x * polevll( x, SN, 8 )); - } - else - q = z / (x * polevll( x, S, 8 )); - } -return q; -} - - -/* This is the C99 version. */ - -long double tgammal(long double x) -{ - int local_sgngaml=0; - return (__tgammal_r(x, &local_sgngaml)); -} - diff --git a/winsup/mingw/mingwex/math/trunc.c b/winsup/mingw/mingwex/math/trunc.c deleted file mode 100644 index 5c7dc68cb..000000000 --- a/winsup/mingw/mingwex/math/trunc.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <fenv.h> -#include <math.h> - -double -trunc (double _x){ - double retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/math/truncf.c b/winsup/mingw/mingwex/math/truncf.c deleted file mode 100644 index 8869e377f..000000000 --- a/winsup/mingw/mingwex/math/truncf.c +++ /dev/null @@ -1,17 +0,0 @@ -#include <fenv.h> -#include <math.h> - -float -truncf (float _x) -{ - float retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/math/truncl.c b/winsup/mingw/mingwex/math/truncl.c deleted file mode 100644 index e34b21ba9..000000000 --- a/winsup/mingw/mingwex/math/truncl.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <fenv.h> -#include <math.h> - -long double -truncl (long double _x){ - long double retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/mbsinit.c b/winsup/mingw/mingwex/mbsinit.c deleted file mode 100644 index c130afebd..000000000 --- a/winsup/mingw/mingwex/mbsinit.c +++ /dev/null @@ -1,21 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -int -mbsinit(ps) - const mbstate_t *ps; - { - return 1; /* don't have shift states */ - } - diff --git a/winsup/mingw/mingwex/mingw-fseek.c b/winsup/mingw/mingwex/mingw-fseek.c deleted file mode 100644 index 1ea011fa6..000000000 --- a/winsup/mingw/mingwex/mingw-fseek.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Workaround for limitations on win9x where a file contents are - * not zero'd out if you seek past the end and then write. - * Copied from ming local-patch to binutils/bfd/libbfd.c written by - * Mumit Khan <khan@xraylith.wisc.edu> - */ - -#include <windows.h> -#include <stdio.h> -#include <io.h> -#include <stdlib.h> - -#define ZEROBLOCKSIZE 512 -static int __mingw_fseek_called; - -/* The fseek in Win9x runtime does not zero out the file if seeking past - the end; if you don't want random stuff from your disk included in your - output DLL/executable, use this version instead. On WinNT/Win2k, it - just calls runtime fseek(). - - CHECK/FIXME: Does this work for both text and binary modes?? */ - - -int -__mingw_fseek (FILE *fp, long offset, int whence) -{ -# undef fseek - __mingw_fseek_called = 1; - return fseek (fp, offset, whence); -} - -int -__mingw_fwrite (const void *buffer, size_t size, size_t count, FILE *fp) -{ -# undef fwrite - if ((_osver & 0x8000) && __mingw_fseek_called) - { - DWORD actual_length, current_position; - __mingw_fseek_called = 0; - fflush (fp); - actual_length = GetFileSize ((HANDLE) _get_osfhandle (fileno (fp)), - NULL); - current_position = SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_CURRENT); -#ifdef DEBUG - printf ("__mingw_fwrite: current %ld, actual %ld\n", - current_position, actual_length); -#endif /* DEBUG */ - if (current_position > actual_length) - { - static char __mingw_zeros[ZEROBLOCKSIZE]; - long numleft; - - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_END); - numleft = current_position - actual_length; - -#ifdef DEBUG - printf ("__mingw_fwrite: Seeking %ld bytes past end\n", numleft); -#endif /* DEBUG */ - while (numleft > 0) - { - DWORD nzeros = (numleft > ZEROBLOCKSIZE) - ? ZEROBLOCKSIZE : numleft; - DWORD written; - if (! WriteFile ((HANDLE) _get_osfhandle (fileno (fp)), - __mingw_zeros, nzeros, &written, NULL)) - { - /* Best we can hope for, or at least DJ says so. */ - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_BEGIN); - return -1; - } - if (written < nzeros) - { - /* Likewise. */ - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_BEGIN); - return -1; - } - - numleft -= written; - } - FlushFileBuffers ((HANDLE) _get_osfhandle (fileno (fp))); - } - } - return fwrite (buffer, size, count, fp); -} diff --git a/winsup/mingw/mingwex/sitest.c b/winsup/mingw/mingwex/sitest.c deleted file mode 100644 index 9e06bf164..000000000 --- a/winsup/mingw/mingwex/sitest.c +++ /dev/null @@ -1,1527 +0,0 @@ -/* - sitest -- exercise features of C99 <stdint.h> and <inttypes.h> - - This source code has been placed into the PUBLIC DOMAIN by its author. - - last edit: 1999/11/05 gwyn@arl.mil - - Tries to accommodate pre-C99 versions of <inttypes.h>. - - Takes advantage of __Q8_* symbols defined by a particular - implementation of <stdint.h>, but doesn't require them. - - NOTE: This is not a thorough validation test of the facilities. -*/ - -#include <errno.h> -#include <limits.h> /* for CHAR_BIT */ -#include <stdio.h> -#include <stddef.h> /* for ptrdiff_t */ -#include <stdlib.h> -#include <string.h> - -#include <inttypes.h> /* embeds <stdint.h> */ -#include <signal.h> /* for sig_atomic_t */ -#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ -#include <wchar.h> -#endif - -#include <inttypes.h> /* test idempotency */ - -#if 1 /* __STDC_VERSION__ >= 199901 */ -#ifndef __Q8_QT -#define __Q8_QT long long -#endif -#endif - -#ifdef PRIdMAX -#define HAVE_PRIdMAX -#ifndef __Q8_MT -#define __Q8_MT intmax_t -#endif -#else -#ifdef PRIdLEAST64 -#ifndef __Q8_MT -#define __Q8_MT int_least64_t -#endif -#define PRIdMAX PRIdLEAST64 -#else -#ifndef __Q8_MT -#define __Q8_MT long -#endif -#define PRIdMAX "ld" -#endif -#endif - -#ifdef PRIuMAX -#define HAVE_PRIuMAX -#define U__Q8_MT uintmax_t -#else -#ifdef PRIuLEAST64 -#define U__Q8_MT uint_least64_t -#define PRIuMAX PRIuLEAST64 -#else -#define U__Q8_MT unsigned long -#define PRIuMAX "lu" -#endif -#endif - -#define STR_SUB(s) #s -#define STRINGIZE(s) STR_SUB(s) /* extra level to expand argument */ - -#if defined(SCNo32) || defined(PRIo32) -static int32_t int32; -#endif -static int_least16_t intl16; -static uint_least16_t uintl16; -static uint_fast16_t uintf16; -static intmax_t intmax; -static uintmax_t uintmax; - -int -main() { - int status = 0; /* exit status to be returned */ - - /* <stdint.h> features: */ - - printf("CHAR_BIT=%u\n", (unsigned)CHAR_BIT ); - printf("sizeof(char)=%u\n", (unsigned)sizeof(char)); /* s.b. 1 */ - printf("sizeof(short)=%u\n", (unsigned)sizeof(short)); - printf("sizeof(int)=%u\n", (unsigned)sizeof(int)); - printf("sizeof(long)=%u\n", (unsigned)sizeof(long)); -#ifdef __Q8_QT - printf("sizeof(long long)=%u\n", (unsigned)sizeof(__Q8_QT)); -#endif - printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); - printf("sizeof(ptrdiff_t)=%u\n", (unsigned)sizeof(ptrdiff_t)); - printf("sizeof(size_t)=%u\n", (unsigned)sizeof(size_t)); - printf("sizeof(sig_atomic_t)=%u\n", (unsigned)sizeof(sig_atomic_t)); - printf("sizeof(wchar_t)=%u\n", (unsigned)sizeof(wchar_t)); -#if defined(WINT_MAX) || __STDC_VERSION__ >= 199901 - printf("sizeof(wint_t)=%u\n", (unsigned)sizeof(wint_t)); -#else - printf("*** wint_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT8_MAX - printf("sizeof(int8_t)=%u\n", (unsigned)sizeof(int8_t)); - printf("sizeof(uint8_t)=%u\n", (unsigned)sizeof(uint8_t)); -#endif -#ifdef INT9_MAX - printf("sizeof(int9_t)=%u\n", (unsigned)sizeof(int9_t)); - printf("sizeof(uint9_t)=%u\n", (unsigned)sizeof(uint9_t)); -#endif -#ifdef INT12_MAX - printf("sizeof(int12_t)=%u\n", (unsigned)sizeof(int12_t)); - printf("sizeof(uint12_t)=%u\n", (unsigned)sizeof(uint12_t)); -#endif -#ifdef INT16_MAX - printf("sizeof(int16_t)=%u\n", (unsigned)sizeof(int16_t)); - printf("sizeof(uint16_t)=%u\n", (unsigned)sizeof(uint16_t)); -#endif -#ifdef INT18_MAX - printf("sizeof(int18_t)=%u\n", (unsigned)sizeof(int18_t)); - printf("sizeof(uint18_t)=%u\n", (unsigned)sizeof(uint18_t)); -#endif -#ifdef INT24_MAX - printf("sizeof(int24_t)=%u\n", (unsigned)sizeof(int24_t)); - printf("sizeof(uint24_t)=%u\n", (unsigned)sizeof(uint24_t)); -#endif -#ifdef INT32_MAX - printf("sizeof(int32_t)=%u\n", (unsigned)sizeof(int32_t)); - printf("sizeof(uint32_t)=%u\n", (unsigned)sizeof(uint32_t)); -#endif -#ifdef INT36_MAX - printf("sizeof(int36_t)=%u\n", (unsigned)sizeof(int36_t)); - printf("sizeof(uint36_t)=%u\n", (unsigned)sizeof(uint36_t)); -#endif -#ifdef INT40_MAX - printf("sizeof(int40_t)=%u\n", (unsigned)sizeof(int40_t)); - printf("sizeof(uint40_t)=%u\n", (unsigned)sizeof(uint40_t)); -#endif -#ifdef INT48_MAX - printf("sizeof(int48_t)=%u\n", (unsigned)sizeof(int48_t)); - printf("sizeof(uint48_t)=%u\n", (unsigned)sizeof(uint48_t)); -#endif -#ifdef INT60_MAX - printf("sizeof(int60_t)=%u\n", (unsigned)sizeof(int60_t)); - printf("sizeof(uint60_t)=%u\n", (unsigned)sizeof(uint60_t)); -#endif -#ifdef INT64_MAX - printf("sizeof(int64_t)=%u\n", (unsigned)sizeof(int64_t)); - printf("sizeof(uint64_t)=%u\n", (unsigned)sizeof(uint64_t)); -#endif -#ifdef INT72_MAX - printf("sizeof(int72_t)=%u\n", (unsigned)sizeof(int72_t)); - printf("sizeof(uint72_t)=%u\n", (unsigned)sizeof(uint72_t)); -#endif -#ifdef INT128_MAX - printf("sizeof(int128_t)=%u\n", (unsigned)sizeof(int128_t)); - printf("sizeof(uint128_t)=%u\n", (unsigned)sizeof(uint128_t)); -#endif - printf("sizeof(int_least8_t)=%u\n", (unsigned)sizeof(int_least8_t)); - printf("sizeof(uint_least8_t)=%u\n", (unsigned)sizeof(uint_least8_t)); - printf("sizeof(int_least16_t)=%u\n", (unsigned)sizeof(int_least16_t)); - printf("sizeof(uint_least16_t)=%u\n", (unsigned)sizeof(uint_least16_t)); - printf("sizeof(int_least32_t)=%u\n", (unsigned)sizeof(int_least32_t)); - printf("sizeof(uint_least32_t)=%u\n", (unsigned)sizeof(uint_least32_t)); -#ifdef INT_LEAST64_MAX - printf("sizeof(int_least64_t)=%u\n", (unsigned)sizeof(int_least64_t)); - printf("sizeof(uint_least64_t)=%u\n", (unsigned)sizeof(uint_least64_t)); -#else - printf("*** uint_least64_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT_LEAST128_MAX - printf("sizeof(int_least128_t)=%u\n", (unsigned)sizeof(int_least128_t)); - printf("sizeof(uint_least128_t)=%u\n", - (unsigned)sizeof(uint_least128_t)); -#endif - printf("sizeof(int_fast8_t)=%u\n", (unsigned)sizeof(int_fast8_t)); - printf("sizeof(uint_fast8_t)=%u\n", (unsigned)sizeof(uint_fast8_t)); - printf("sizeof(int_fast16_t)=%u\n", (unsigned)sizeof(int_fast16_t)); - printf("sizeof(uint_fast16_t)=%u\n", (unsigned)sizeof(uint_fast16_t)); - printf("sizeof(int_fast32_t)=%u\n", (unsigned)sizeof(int_fast32_t)); - printf("sizeof(uint_fast32_t)=%u\n", (unsigned)sizeof(uint_fast32_t)); -#ifdef INT_FAST64_MAX - printf("sizeof(int_fast64_t)=%u\n", (unsigned)sizeof(int_fast64_t)); - printf("sizeof(uint_fast64_t)=%u\n", (unsigned)sizeof(uint_fast64_t)); -#else - printf("*** int_fast64_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT_FAST128_MAX - printf("sizeof(int_fast128_t)=%u\n", (unsigned)sizeof(int_fast128_t)); - printf("sizeof(uint_fast128_t)=%u\n", (unsigned)sizeof(uint_fast128_t)); -#endif -#if defined(INTPTR_MAX) - printf("sizeof(intptr_t)=%u\n", (unsigned)sizeof(intptr_t)); -#if defined(UINTPTR_MAX) - printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); -#else - printf("*** intptr_t is defined but uintptr_t isn't ***\n"); - status = EXIT_FAILURE; -#endif -#elif defined(UINTPTR_MAX) - printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); - printf("*** uintptr_t is defined but intptr_t isn't ***\n"); - status = EXIT_FAILURE; -#else - printf("*** neither intptr_t nor uintptr_t is defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INTMAX_MAX - printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); - printf("sizeof(uintmax_t)=%u\n", (unsigned)sizeof(uintmax_t)); -#else - printf("*** intmax_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif - -#ifdef INT8_MAX - printf("INT8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT8_MIN); - printf("INT8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT8_MAX); - printf("UINT8_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT8_MAX); -#endif -#ifdef INT9_MAX - printf("INT9_MIN=%"PRIdMAX"\n", (__Q8_MT)INT9_MIN); - printf("INT9_MAX=%"PRIdMAX"\n", (__Q8_MT)INT9_MAX); - printf("UINT9_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT9_MAX); -#endif -#ifdef INT12_MAX - printf("INT12_MIN=%"PRIdMAX"\n", (__Q8_MT)INT12_MIN); - printf("INT12_MAX=%"PRIdMAX"\n", (__Q8_MT)INT12_MAX); - printf("UINT12_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT12_MAX); -#endif -#ifdef INT16_MAX - printf("INT16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT16_MIN); - printf("INT16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT16_MAX); - printf("UINT16_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT16_MAX); -#endif -#ifdef INT18_MAX - printf("INT18_MIN=%"PRIdMAX"\n", (__Q8_MT)INT18_MIN); - printf("INT18_MAX=%"PRIdMAX"\n", (__Q8_MT)INT18_MAX); - printf("UINT18_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT18_MAX); -#endif -#ifdef INT24_MAX - printf("INT24_MIN=%"PRIdMAX"\n", (__Q8_MT)INT24_MIN); - printf("INT24_MAX=%"PRIdMAX"\n", (__Q8_MT)INT24_MAX); - printf("UINT24_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT24_MAX); -#endif -#ifdef INT32_MAX - printf("INT32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT32_MIN); - printf("INT32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT32_MAX); - printf("UINT32_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT32_MAX); -#endif -#ifdef INT36_MAX - printf("INT36_MIN=%"PRIdMAX"\n", (__Q8_MT)INT36_MIN); - printf("INT36_MAX=%"PRIdMAX"\n", (__Q8_MT)INT36_MAX); - printf("UINT36_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT36_MAX); -#endif -#ifdef INT40_MAX - printf("INT40_MIN=%"PRIdMAX"\n", (__Q8_MT)INT40_MIN); - printf("INT40_MAX=%"PRIdMAX"\n", (__Q8_MT)INT40_MAX); - printf("UINT40_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT40_MAX); -#endif -#ifdef INT48_MAX - printf("INT48_MIN=%"PRIdMAX"\n", (__Q8_MT)INT48_MIN); - printf("INT48_MAX=%"PRIdMAX"\n", (__Q8_MT)INT48_MAX); - printf("UINT48_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT48_MAX); -#endif -#ifdef INT60_MAX - printf("INT60_MIN=%"PRIdMAX"\n", (__Q8_MT)INT60_MIN); - printf("INT60_MAX=%"PRIdMAX"\n", (__Q8_MT)INT60_MAX); - printf("UINT60_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT60_MAX); -#endif -#ifdef INT64_MAX - printf("INT64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT64_MIN); - printf("INT64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT64_MAX); - printf("UINT64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT64_MAX); -#endif -#ifdef INT72_MAX - printf("INT72_MIN=%"PRIdMAX"\n", (__Q8_MT)INT72_MIN); - printf("INT72_MAX=%"PRIdMAX"\n", (__Q8_MT)INT72_MAX); - printf("UINT72_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT72_MAX); -#endif -#ifdef INT128_MAX - printf("INT128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT128_MIN); - printf("INT128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT128_MAX); - printf("UINT128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT128_MAX); -#endif - printf("INT_LEAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MIN); - printf("INT_LEAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MAX); - printf("UINT_LEAST8_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST8_MAX); - printf("INT_LEAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MIN); - printf("INT_LEAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MAX); - printf("UINT_LEAST16_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST16_MAX); - printf("INT_LEAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MIN); - printf("INT_LEAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MAX); - printf("UINT_LEAST32_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST32_MAX); -#ifdef INT_LEAST64_MAX - printf("INT_LEAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MIN); - printf("INT_LEAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MAX); - printf("UINT_LEAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST64_MAX); -#endif -#ifdef INT_LEAST128_MAX - printf("INT_LEAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MIN); - printf("INT_LEAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MAX); - printf("UINT_LEAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST128_MAX); -#endif - printf("INT_FAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MIN); - printf("INT_FAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MAX); - printf("UINT_FAST8_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST8_MAX); - printf("INT_FAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MIN); - printf("INT_FAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MAX); - printf("UINT_FAST16_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST16_MAX); - printf("INT_FAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MIN); - printf("INT_FAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MAX); - printf("UINT_FAST32_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST32_MAX); -#ifdef INT_FAST64_MAX - printf("INT_FAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MIN); - printf("INT_FAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MAX); - printf("UINT_FAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST64_MAX); -#endif -#ifdef INT_FAST128_MAX - printf("INT_FAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MIN); - printf("INT_FAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MAX); - printf("UINT_FAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST128_MAX); -#endif -#ifdef INTPTR_MAX - printf("INTPTR_MIN=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MIN); - printf("INTPTR_MAX=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MAX); -#endif -#ifdef UINTPTR_MAX - printf("UINTPTR_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTPTR_MAX); -#endif -#ifdef INTMAX_MAX - printf("INTMAX_MIN=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MIN); - printf("INTMAX_MAX=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MAX); - printf("UINTMAX_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTMAX_MAX); -#endif -#ifdef PTRDIFF_MAX - printf("PTRDIFF_MIN=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MIN); - printf("PTRDIFF_MAX=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MAX); -#endif -#ifdef SIG_ATOMIC_MAX -#if SIG_ATOMIC_MIN < 0 - printf("SIG_ATOMIC_MIN=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MIN); - printf("SIG_ATOMIC_MAX=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MAX); -#else - printf("SIG_ATOMIC_MIN=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MIN); - printf("SIG_ATOMIC_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MAX); -#endif -#endif -#ifdef SIZE_MAX - printf("SIZE_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIZE_MAX); -#endif - -#ifdef WCHAR_MAX -#if WCHAR_MIN < 0 - printf("WCHAR_MIN=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MIN); - printf("WCHAR_MAX=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MAX); -#else - printf("WCHAR_MIN=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MIN); - printf("WCHAR_MAX=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MAX); -#endif -#endif -#ifdef WINT_MAX -#if WINT_MIN < 0 - printf("WINT_MIN=%"PRIdMAX"\n", (__Q8_MT)WINT_MIN); - printf("WINT_MAX=%"PRIdMAX"\n", (__Q8_MT)WINT_MAX); -#else - printf("WINT_MIN=%"PRIuMAX"\n", (U__Q8_MT)WINT_MIN); - printf("WINT_MAX=%"PRIuMAX"\n", (U__Q8_MT)WINT_MAX); -#endif -#endif - - /* - 7.18.4 Macros for integer constants - */ - - /* INTn_C for n=8 and 16 were at one point unimplementable - on most platforms, so they're treated as "optional": */ -#ifdef INT8_C - if ( INT8_C(-123) != -123 ) - printf("*** INT8_C(-123) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT8_C(-123) - ); - if ( UINT8_C(123) != 123 ) - printf("*** UINT8_C(123) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT8_C(123) - ); -#endif -#ifdef INT16_C - if ( INT16_C(-12345) != -12345 ) - printf("*** INT16_C(-12345) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT16_C(-12345) - ); - if ( UINT16_C(12345) != 12345 ) - printf("*** UINT16_C(12345) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT16_C(12345) - ); -#endif - if ( INT32_C(-123456789) != -123456789 ) - printf("*** INT32_C(-123456789) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT32_C(-123456789) - ); - if ( UINT32_C(123456789) != 123456789 ) - printf("*** UINT32_C(123456789) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT32_C(123456789) - ); -#ifdef INT_LEAST64_MAX - if ( INT64_C(-1234567890123456789) != -1234567890123456789 ) - printf("*** INT64_C(-1234567890123456789) produced %"PRIdMAX - " ***\n", - (__Q8_MT)INT64_C(-1234567890123456789) - ); - if ( UINT64_C(1234567890123456789) != 1234567890123456789 ) - printf("*** UINT64_C(1234567890123456789) produced %"PRIuMAX - " ***\n", - (U__Q8_MT)UINT64_C(1234567890123456789) - ); -#endif -#ifdef INTMAX_MAX - if ( INTMAX_C(-1234567890123456789) != -1234567890123456789 ) - printf("*** INTMAX_C(-1234567890123456789) produced %"PRIdMAX - " ***\n", - (__Q8_MT)INTMAX_C(-1234567890123456789) - ); - if ( UINTMAX_C(1234567890123456789) != 1234567890123456789 ) - printf("*** UINTMAX_C(1234567890123456789) produced %"PRIuMAX - " ***\n", - (U__Q8_MT)UINTMAX_C(1234567890123456789) - ); -#endif - - /* <inttypes.h> features: */ - -#if __STDC_VERSION__ >= 199901 - printf("sizeof(imaxdiv_t)=%u\n", (unsigned)sizeof(imaxdiv_t)); -#endif - - /* - 7.8.1 Macros for format specifiers - */ - - { - /* scanf these strings */ - static const char in_dn[] = "Z119bZ"; - static const char in_dmo[] = "Z-0119bZ"; - static const char in_dspx[] = "Z \t\n +0X119bZ"; - static const char in_dsmx[] = "Z \t\n -0x119bZ"; - static const char in_dsn[] = "Z \t\n 119bZ"; - static const char in_dp[] = "Z+119bZ"; - static const char in_dpx[] = "Z+0X119bz"; - - /* sprintf into this */ - static char buffer[1024]; - -#define SCAN(buf,fs,var,exp) if ( sscanf(buf, "Z%" fs, &var) != 1 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " failed ***\n" \ - ); \ - status = EXIT_FAILURE; \ - } \ - else if ( var != (exp) ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " should be: " STR_SUB(exp) \ - ", was: %" fs " ***\n", var \ - ); \ - status = EXIT_FAILURE; \ - } \ - else - -#define PRINT(fs,var,exp) if ( sprintf(buffer, "%" fs, var ) <= 0 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " failed ***\n" \ - ); \ - status = EXIT_FAILURE; \ - } \ - else if ( strcmp(buffer, STR_SUB(exp)) != 0 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " should be: " STR_SUB(exp) \ - ", was: %s ***\n", buffer \ - ); \ - status = EXIT_FAILURE; \ - } \ - else - -#ifdef SCNo32 - SCAN(in_dn, SCNo32, int32, 9); -#endif -#ifdef PRIo32 - PRINT(PRIo32, int32, 11); -#endif - SCAN(in_dmo, SCNiLEAST16, intl16, -9); - SCAN(in_dspx, SCNdLEAST16, intl16, 0); - SCAN(in_dsmx, SCNiLEAST16, intl16, -4507); - PRINT(PRIdLEAST16, intl16, -4507); - PRINT(PRIiLEAST16, intl16, -4507); - SCAN(in_dsn, SCNxLEAST16, uintl16, 4507); - PRINT(PRIoLEAST16, uintl16, 10633); - PRINT(PRIuLEAST16, uintl16, 4507); - PRINT(PRIxLEAST16, uintl16, 119b); - PRINT(PRIXLEAST16, uintl16, 119B); - SCAN(in_dp, SCNxFAST16, uintf16, 4507); - PRINT(PRIxFAST16, uintf16, 119b); -#ifdef SCNdMAX - SCAN(in_dp, SCNdMAX, intmax, 119); -#endif -#ifdef PRIiMAX - PRINT(PRIiMAX, intmax, 119); -#endif -#ifdef SCNoMAX - SCAN(in_dpx, SCNoMAX, uintmax, 0); -#endif -#ifdef PRIxMAX - PRINT(PRIxMAX, uintmax, 0); -#endif - /* Obviously there should be a much larger battery of such tests. */ - } - -#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ - /* - 7.8.2 Functions for greatest-width integer types - */ - - { - static struct - { - intmax_t input; - intmax_t expect; - } abs_data[] = - { -#ifdef INT8_MAX - {INT8_MAX, INT8_MAX}, - {-INT8_MAX, INT8_MAX}, - {UINT8_MAX, UINT8_MAX}, -#endif - -#ifdef INT16_MAX - { INT16_MAX, INT16_MAX}, - { -INT16_MAX, INT16_MAX}, - { UINT16_MAX, UINT16_MAX}, -#endif -#ifdef INT32_MAX - { INT32_MAX, INT32_MAX}, - { -INT32_MAX, INT32_MAX}, -#ifdef INT_LEAST64_MAX - { UINT32_MAX, UINT32_MAX}, -#endif -#endif -#ifdef INT64_MAX - { INT64_MAX, INT64_MAX}, - { -INT64_MAX, INT64_MAX}, -#endif - { INT_LEAST8_MAX, INT_LEAST8_MAX}, - { -INT_LEAST8_MAX, INT_LEAST8_MAX}, - { UINT_LEAST8_MAX, UINT_LEAST8_MAX}, - { INT_LEAST16_MAX, INT_LEAST16_MAX}, - { -INT_LEAST16_MAX, INT_LEAST16_MAX}, - { UINT_LEAST16_MAX, UINT_LEAST16_MAX}, - { INT_LEAST32_MAX, INT_LEAST32_MAX}, - { -INT_LEAST32_MAX, INT_LEAST32_MAX}, -#ifdef INT_LEAST64_MAX - { UINT_LEAST32_MAX, UINT_LEAST32_MAX}, - { INT_LEAST64_MAX, INT_LEAST64_MAX}, - { -INT_LEAST64_MAX, INT_LEAST64_MAX}, -#endif - { INT_FAST8_MAX, INT_FAST8_MAX}, - { -INT_FAST8_MAX, INT_FAST8_MAX}, - { UINT_FAST8_MAX, UINT_FAST8_MAX}, - { INT_FAST16_MAX, INT_FAST16_MAX}, - { -INT_FAST16_MAX, INT_FAST16_MAX}, - { UINT_FAST16_MAX, UINT_FAST16_MAX}, - { INT_FAST32_MAX, INT_FAST32_MAX}, - { -INT_FAST32_MAX, INT_FAST32_MAX}, -#ifdef INT_FAST64_MAX - { UINT_FAST32_MAX, UINT_FAST32_MAX}, - { INT_FAST64_MAX, INT_FAST64_MAX}, - { -INT_FAST64_MAX, INT_FAST64_MAX}, -#endif -#ifdef INTPTR_MAX - { INTPTR_MAX, INTPTR_MAX}, - { -INTPTR_MAX, INTPTR_MAX}, -#endif -#ifdef UINTPTR_MAX - { UINTPTR_MAX, UINTPTR_MAX}, -#endif - { INTMAX_MAX, INTMAX_MAX}, -#ifdef PTRDIFF_MAX - { PTRDIFF_MAX, PTRDIFF_MAX}, -#endif -#ifdef SIG_ATOMIC_MAX - { SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, -#if SIG_ATOMIC_MIN < 0 - { -SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, -#endif -#endif -#ifdef SIZE_MAX - { SIZE_MAX, SIZE_MAX}, -#endif -#ifdef WCHAR_MAX - { WCHAR_MAX, WCHAR_MAX}, -#if WCHAR_MIN < 0 - { -WCHAR_MAX, WCHAR_MAX}, -#endif -#endif -#ifdef WINT_MAX - { WINT_MAX, WINT_MAX}, -#if WINT_MIN < 0 - { -WINT_MAX, WINT_MAX}, -#endif -#endif - { 127, 127}, - { -127, 127}, - { 128, 128}, - { -127-1, 128}, - { 255, 255}, - { -256+1, 255}, - { 256, 256}, - { -256, 256}, - { 32767, 32767}, - { -32767, 32767}, - { 32768, 32768}, - { -32767-1, 32768}, - { 65535, 65535}, - { -65536+1, 65535}, - { 65536, 65536}, - { -65536, 65536}, - { 2147483647, 2147483647}, - { -2147483647, 2147483647}, - { 2147483648LL, 2147483648LL}, - { -2147483647LL-1, 2147483648LL}, -#ifdef INT_LEAST64_MAX - { 4294967295LL, 4294967295LL}, - { -4294967296LL+1, 4294967295LL}, - { 4294967296LL, 4294967296LL}, - { -4294967296LL, 4294967296LL}, - { 9223372036854775807LL, 9223372036854775807LL}, - { -9223372036854775807LL, 9223372036854775807LL}, - { 1234567890123456789LL, 1234567890123456789LL}, - { -1234567890123456789LL, 1234567890123456789LL}, -#endif - { 1, 1}, - { -1, 1}, - { 2, 2}, - { -2, 2}, - { 10, 10}, - { -10, 10}, - { 16, 16}, - { -16, 16}, - /* Other test cases can be added here. */ - {0, 0} /* terminates the list */ - }, *adp=abs_data; - int count=0; - do{ - intmax = imaxabs(adp->input); - count++; - if (intmax != adp->expect ) - { - - printf("*** imaxabs(%"PRIdMAX") failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", - adp->input, adp->expect, intmax - ); - status = EXIT_FAILURE; - } - } - while ( adp++->input != 0 ); - } - - { - imaxdiv_t result; - static struct - { - intmax_t numer; - intmax_t denom; - intmax_t exp_quot; - intmax_t exp_rem; - } div_data[] = - { - { 0, 1, 0, 0}, - { 0, -1, 0, 0}, - { 0, 2, 0, 0}, - { 0, -2, 0, 0}, - { 0, 5, 0, 0}, - { 0, -5, 0, 0}, - { 1, 1, 1, 0}, - { 1, -1, -1, 0}, - { 1, 2, 0, 1}, - { 1, -2, 0, 1}, - { 1, 5, 0, 1}, - { 1, -5, 0, 1}, - { -1, 1, -1, 0}, - { -1, -1, 1, 0}, - { -1, 2, 0, -1}, - { -1, -2, 0, -1}, - { -1, 5, 0, -1}, - { -1, -5, 0, -1}, - { 2, 1, 2, 0}, - { 2, -1, -2, 0}, - { 2, 2, 1, 0}, - { 2, -2, -1, 0}, - { 2, 5, 0, 2}, - { 2, -5, 0, 2}, - { -2, 1, -2, 0}, - { -2, -1, 2, 0}, - { -2, 2, -1, 0}, - { -2, -2, 1, 0}, - { -2, 5, 0, -2}, - { -2, -5, 0, -2}, - { 17, 5, 3, 2}, - { -17, -5, 3, -2}, - { 17, -5, -3, 2}, - { -17, 5, -3, -2}, - { 2147483647, 1, 2147483647, 0}, - { -2147483647LL, 1, -2147483647LL, 0}, - { 2147483648LL, 1LL, 2147483648LL, 0LL}, - { -2147483647-1LL, 1LL, -2147483647-1LL, 0LL}, - { 2147483647LL, 2LL, 1073741823LL, 1LL}, - { -2147483647LL, 2LL, -1073741823LL, -1LL}, - { 2147483648LL, 2LL, 1073741824LL, 0LL}, - { -2147483647-1LL, 2LL, -1073741824LL, 0LL}, -#ifdef INT_LEAST64_MAX /* else might support only 32 bits */ - { 4294967295LL, 1LL, 4294967295LL, 0LL}, - { -4294967296LL+1LL, 1LL, -4294967296LL+1, 0}, - { 4294967296LL, 1, 4294967296LL, 0}, - { -4294967296LL, 1LL, -4294967296LL, 0LL}, - { 4294967295LL, -1LL, -4294967296+1LL, 0LL}, - { -4294967296+1LL, -1LL, 4294967295LL, 0LL}, - { 4294967296LL, -1LL, -4294967296LL, 0LL}, - { -4294967296LL, -1LL, 4294967296LL, 0LL}, - { 4294967295LL, 2LL, 2147483647LL, 1LL}, - { -4294967296+1LL, 2LL, -2147483647LL, -1LL}, - { 4294967296LL, 2LL, 2147483648LL, 0LL}, - { -4294967296LL, 2LL, -2147483647-1LL, 0LL}, - { 4294967295LL, 2147483647LL, 2LL, 1LL}, - { -4294967296+1LL, 2147483647LL, -2LL, -1LL}, - { 4294967296LL, 2147483647LL, 2LL, 2LL}, - { -4294967296LL, 2147483647LL, -2LL, -2LL}, - { 4294967295LL, -2147483647LL, -2LL, 1LL}, - { -4294967296+1LL, -2147483647LL, 2LL, -1LL}, - { 4294967296LL, -2147483647LL, -2LL, 2LL}, - { -4294967296LL, -2147483647LL, 2LL, -2LL}, - { 4294967295LL, 2147483648LL, 1LL, 2147483647LL}, - { -4294967296+1LL, 2147483648LL, -1LL, -2147483647LL}, - { 4294967296LL, 2147483648LL, 2LL, 0LL}, - { -4294967296LL, 2147483648LL, -2LL, 0LL}, - { 4294967295LL, -2147483647-1LL, -1LL, 2147483647LL}, - { -4294967296+1LL, -2147483647-1LL, 1LL, -2147483647LL}, - { 4294967296LL, -2147483647-1LL, -2LL, 0LL}, - { -4294967296LL, -2147483647-1LL, 2LL, 0LL}, - { 9223372036854775807LL, 1LL, 9223372036854775807LL, 0LL}, - { -9223372036854775807LL, 1LL, -9223372036854775807LL, 0LL}, - { 9223372036854775807LL, 2LL, 4611686018427387903LL, 1LL}, - { -9223372036854775807LL, 2LL, -4611686018427387903LL, -1LL}, -#endif - /* There should be a much larger battery of such tests. */ - { 0, 0, 0, 0} /* 0 denom terminates the list */ - }, *ddp; - - for ( ddp = div_data; ddp->denom != 0; ++ddp ) - if ( (result = imaxdiv(ddp->numer, ddp->denom)).quot - != ddp->exp_quot || result.rem != ddp->exp_rem - ) { - printf("*** imaxdiv(%"PRIdMAX",%"PRIdMAX - ") failed; should be: (%"PRIdMAX",%"PRIdMAX - "), was: (%"PRIdMAX",%"PRIdMAX") ***\n", - ddp->numer, ddp->denom, ddp->exp_quot, - ddp->exp_rem, result.quot, result.rem - ); - status = EXIT_FAILURE; - } - } - - { - char *endptr; - wchar_t *wendptr; - static char saved[64]; /* holds copy of input string */ - static wchar_t wnptr[64]; /* holds wide copy of test string */ - static int warned; /* "warned for null endptr" flag */ - register int i; - static struct - { - char * nptr; - int base; - intmax_t exp_val; - int exp_len; - } str_data[] = - { - { "", 0, 0, 0}, - { "", 2, 0, 0}, - { "", 8, 0, 0}, - { "", 9, 0, 0}, - { "", 10, 0, 0}, - { "", 16, 0, 0}, - { "", 36, 0, 0}, - { "0", 0, 0, 1}, - { "0", 2, 0, 1}, - { "0", 8, 0, 1}, - { "0", 9, 0, 1}, - { "0", 10, 0, 1}, - { "0", 16, 0, 1}, - { "0", 36, 0, 1}, - { "+0", 0, 0, 2}, - { "+0", 2, 0, 2}, - { "+0", 8, 0, 2}, - { "+0", 9, 0, 2}, - { "+0", 10, 0, 2}, - { "+0", 16, 0, 2}, - { "+0", 36, 0, 2}, - { "-0", 0, 0, 2}, - { "-0", 2, 0, 2}, - { "-0", 8, 0, 2}, - { "-0", 9, 0, 2}, - { "-0", 10, 0, 2}, - { "-0", 16, 0, 2}, - { "-0", 36, 0, 2}, - { "Inf", 0, 0, 0}, - { "Inf", 2, 0, 0}, - { "Inf", 8, 0, 0}, - { "Inf", 9, 0, 0}, - { "Inf", 10, 0, 0}, - { "Inf", 16, 0, 0}, - { "Inf", 36, 24171, 3}, - { "+Inf", 0, 0, 0}, - { "+Inf", 2, 0, 0}, - { "+Inf", 8, 0, 0}, - { "+Inf", 9, 0, 0}, - { "+Inf", 10, 0, 0}, - { "+Inf", 16, 0, 0}, - { "+Inf", 36, 24171, 4}, - { "-Inf", 0, 0, 0}, - { "-Inf", 2, 0, 0}, - { "-Inf", 8, 0, 0}, - { "-Inf", 9, 0, 0}, - { "-Inf", 10, 0, 0}, - { "-Inf", 16, 0, 0}, - { "-Inf", 36, -24171, 4}, - { "inf", 0, 0, 0}, - { "inf", 2, 0, 0}, - { "inf", 8, 0, 0}, - { "inf", 9, 0, 0}, - { "inf", 10, 0, 0}, - { "inf", 16, 0, 0}, - { "inf", 36, 24171, 3}, - { "+inf", 0, 0, 0}, - { "+inf", 2, 0, 0}, - { "+inf", 8, 0, 0}, - { "+inf", 9, 0, 0}, - { "+inf", 10, 0, 0}, - { "+inf", 16, 0, 0}, - { "+inf", 36, 24171, 4}, - { "-inf", 0, 0, 0}, - { "-inf", 2, 0, 0}, - { "-inf", 8, 0, 0}, - { "-inf", 9, 0, 0}, - { "-inf", 10, 0, 0}, - { "-inf", 16, 0, 0}, - { "-inf", 36, -24171, 4}, - { "119b8Z", 0, 119, 3}, - { "119bZ", 0, 119, 3}, - { "-0119bZ", 0, -9, 4}, - { " \t\n 0X119bZ", 0, 4507, 10}, - { " \t\n +0X119bZ", 0, 4507, 11}, - { " \t\n -0x119bZ", 0, -4507, 11}, - { " \t\n 119bZ", 0, 119, 7}, - { "+119bZ", 0, 119, 4}, - { "+0X119bz", 0, 4507, 7}, - { "119b8Z", 2, 3, 2}, - { "119bZ", 2, 3, 2}, - { "-0119bZ", 2, -3, 4}, - { " \t\n 0X119bZ", 2, 0, 5}, - { " \t\n +0X119bZ", 2, 0, 6}, - { " \t\n -0x119bZ", 2, 0, 6}, - { " \t\n 119bZ", 2, 3, 6}, - { "+119bZ", 2, 3, 3}, - { "+0X119bz", 2, 0, 2}, - { "119b8Z", 8, 9, 2}, - { "119bZ", 8, 9, 2}, - { "-0119bZ", 8, -9, 4}, - { " \t\n 0X119bZ", 8, 0, 5}, - { " \t\n +0X119bZ", 8, 0, 6}, - { " \t\n -0x119bZ", 8, 0, 6}, - { " \t\n 119bZ", 8, 9, 6}, - { "+119bZ", 8, 9, 3}, - { "+0X119bz", 8, 0, 2}, - { "119b8Z", 9, 10, 2}, - { "119bZ", 9, 10, 2}, - { "-0119bZ", 9, -10, 4}, - { " \t\n 0X119bZ", 9, 0, 5}, - { " \t\n +0X119bZ", 9, 0, 6}, - { " \t\n -0x119bZ", 9, 0, 6}, - { " \t\n 119bZ", 9, 10, 6}, - { "+119bZ", 9, 10, 3}, - { "+0X119bz", 9, 0, 2}, - { "119b8Z", 10, 119, 3}, - { "119bZ", 10, 119, 3}, - { "-0119bZ", 10, -119, 5}, - { " \t\n 0X119bZ", 10, 0, 5}, - { " \t\n +0X119bZ", 10, 0, 6}, - { " \t\n -0x119bZ", 10, 0, 6}, - { " \t\n 119bZ", 10, 119, 7}, - { "+119bZ", 10, 119, 4}, - { "+0X119bz", 10, 0, 2}, - { "119b8Z", 16, 72120, 5}, - { "119bZ", 16, 4507, 4}, - { "-0119bZ", 16, -4507, 6}, - { " \t\n 0X119bZ", 16, 4507, 10}, - { " \t\n +0X119bZ", 16, 4507, 11}, - { " \t\n -0x119bZ", 16, -4507, 11}, - { " \t\n 119bZ", 16, 4507,8}, - { "+119bZ", 16, 4507, 5}, - { "+0X119bz", 16, 4507, 7}, - { "119b8Z", 36, 62580275, 6}, - { "119bZ", 36, 1738367, 5}, - { "-0119bZ", 36, -1738367, 7}, - { " \t\n 0X119bZ", 36, 1997122175, 11}, - { " \t\n +0X119bZ", 36, 1997122175, 12}, - { " \t\n -0x119bZ", 36, -1997122175, 12}, - { " \t\n 119bZ", 36, 1738367, 9}, - { "+119bZ", 36, 1738367, 6}, - { "+0X119bz", 36, 1997122175, 8}, - /* There should be a much larger battery of such tests. */ - { "127", 0, 127, 3}, - { "-127", 0, -127, 4}, - { "128", 0, 128, 3}, - { "-128", 0, -127-1, 4}, - { "255", 0, 255, 3}, - { "-255", 0, -255, 4}, - { "256", 0, 256, 3}, - { "-256", 0, -255-1, 4}, - { "32767", 0, 32767, 5}, - { "-32767", 0, -32767, 6}, - { "32768", 0, 32768, 5}, - { "-32768", 0, -32767-1, 6}, - { "65535", 0, 65535, 5}, - { "-65535", 0, -65536+1, 6}, - { "65536", 0, 65536, 5}, - { "-65536", 0, -65536, 6}, - { "2147483647", 0, 2147483647, 10}, - { "-2147483647", 0, -2147483647, 11}, - { "2147483648", 0, 2147483648LL, 10}, - { "-2147483648", 0, -2147483647LL-1, 11}, - { "4294967295", 0, 4294967295LL, 10}, - { "-4294967295", 0, -4294967296LL+1, 11}, - { "4294967296", 0, 4294967296LL, 10}, - { "-4294967296", 0, -4294967296L, 11}, - { "9223372036854775807", 0, 9223372036854775807LL, 19}, - { "-9223372036854775807", 0, -9223372036854775807LL, 20}, - { "1234567890123456789", 0, 1234567890123456789LL, 19}, - { "-1234567890123456789", 0, -1234567890123456789LL, 20}, - { "1", 0, 1, 1}, - { "-1", 0, -1, 2}, - { "2", 0, 2, 1}, - { "-2", 0, -2, 2}, - { "10", 0, 10, 2}, - { "-10", 0, -10, 3}, - { "16", 0, 16, 2}, - { "-16", 0, -16, 3}, - /* Other test cases can be added here. */ - { NULL, 0, 0, 0 } /* terminates the list */ - }, *sdp; - - for ( sdp = str_data; sdp->nptr != NULL ; ++sdp ) - { - /* - 7.8.2.3 The strtoimax and strtoumax functions - */ - - strcpy(saved, sdp->nptr); - - errno = 0; /* shouldn't be changed */ - - if ( (intmax = strtoimax(sdp->nptr, &endptr, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - printf("*** strtoimax(%s,,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( endptr != sdp->nptr + sdp->exp_len ) - { - int save = errno; - - printf("*** strtoimax(%s,,%d) returned wrong endptr" - " ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** strtoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - printf("*** strtoimax modified its input ***\n"); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = strtoumax(sdp->nptr, &endptr, sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - printf("*** strtoumax(%s,,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( endptr != sdp->nptr + sdp->exp_len ) - { - int save = errno; - - printf("*** strtoumax(%s,,%d) returned wrong " - "endptr ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** strtoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - printf("*** strtoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - } - - /* tests for null endptr */ - -#define WARN() if (!warned) warned = 1, printf("*** Using null endptr: ***\n") - - warned = 0; - errno = 0; /* shouldn't be changed */ - - if ( (intmax = strtoimax(sdp->nptr, (char **)NULL, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** strtoimax(%s,NULL,%d) failed; " - "should be: %"PRIdMAX", was: %"PRIdMAX" ***\n", - sdp->nptr, sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** strtoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - WARN(); - printf("*** strtoimax modified its input ***\n"); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = strtoumax(sdp->nptr, (char **)NULL, - sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** strtoumax(%s,NULL,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** strtoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - WARN(); - printf("*** strtoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - } - - /* - 7.8.2.4 The wcstoimax and wcstoumax functions - */ - - for ( i = 0; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) - break; - - errno = 0; /* shouldn't be changed */ - - if ( (intmax = wcstoimax(wnptr, &wendptr, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - printf("*** wcstoimax(%s,,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( wendptr != wnptr + sdp->exp_len ) - { - int save = errno; - - printf("*** wcstoimax(%s,,%d) returned wrong endptr" - " ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** wcstoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - printf("*** wcstoimax modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = wcstoumax(wnptr, &wendptr, sdp->base) - ) != sdp->exp_val - ) { - int save = errno; - - printf("*** wcstoumax(%s,,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( wendptr != wnptr + sdp->exp_len ) - { - int save = errno; - - printf("*** wcstoumax(%s,,%d) returned wrong " - "endptr ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** wcstoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - printf("*** wcstoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - } - - /* tests for null endptr */ - - warned = 0; - errno = 0; /* shouldn't be changed */ - - if ( (intmax = wcstoimax(wnptr, (wchar_t **)NULL, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** wcstoimax(%s,NULL,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** wcstoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - WARN(); - printf("*** wcstoimax modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = wcstoumax(wnptr, (wchar_t **)NULL, - sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** wcstoumax(%s,NULL,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** wcstoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - WARN(); - printf("*** wcstoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - } - } - - /* - 7.8.2.3 The strtoimax and strtoumax functions (continued) - */ - - if ( (intmax = strtoimax("1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoimax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = strtoimax("+1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoimax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = strtoimax("-1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MIN || errno != ERANGE - ) { - printf("*** strtoimax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("+1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("-1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - /* - 7.8.2.4 The wcstoimax and wcstoumax functions (continued) - */ - - if ( (intmax = wcstoimax(L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoimax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = wcstoimax(L"+1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoimax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = wcstoimax(L"-1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MIN || errno != ERANGE - ) { - printf("*** wcstoimax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"+1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"-1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - } -#endif /* defined(INTMAX_MAX) */ - - if ( status != 0 ) - fprintf(stderr, "sitest failed; see stdout for details\n"); - - return status; - } diff --git a/winsup/mingw/mingwex/stdio/snprintf.c b/winsup/mingw/mingwex/stdio/snprintf.c deleted file mode 100644 index c8d2a7b20..000000000 --- a/winsup/mingw/mingwex/stdio/snprintf.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdarg.h> -#include <stdio.h> - -int snprintf(char* buffer, size_t n, const char* format, ...) -{ - int retval; - va_list argptr; - - va_start( argptr, format ); - retval = _vsnprintf( buffer, n, format, argptr ); - va_end( argptr ); - return retval; -} diff --git a/winsup/mingw/mingwex/stdio/snwprintf.c b/winsup/mingw/mingwex/stdio/snwprintf.c deleted file mode 100644 index 42b05b292..000000000 --- a/winsup/mingw/mingwex/stdio/snwprintf.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdarg.h> -#include <wchar.h> - -int snwprintf(wchar_t* buffer, size_t n, const wchar_t* format, ...) -{ - int retval; - va_list argptr; - - va_start( argptr, format ); - retval = _vsnwprintf( buffer, n, format, argptr ); - va_end( argptr ); - return retval; -} diff --git a/winsup/mingw/mingwex/stdio/vfscanf.c b/winsup/mingw/mingwex/stdio/vfscanf.c deleted file mode 100644 index 41549f9e4..000000000 --- a/winsup/mingw/mingwex/stdio/vfscanf.c +++ /dev/null @@ -1,40 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties */ - -#include <stdarg.h> -#include <stdio.h> - -int vfscanf(FILE * __restrict__ stream, const char * __restrict__ format, va_list arg) { - int ret; - - __asm__( - - /* allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) */ - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // stream - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call fscanf - "call _fscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(stream), "=d"(format) - : "1"(stream), "2"(format), "S"(arg), - "a"(&ret) - : "ebx"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vfwscanf.c b/winsup/mingw/mingwex/stdio/vfwscanf.c deleted file mode 100644 index 8fa33376e..000000000 --- a/winsup/mingw/mingwex/stdio/vfwscanf.c +++ /dev/null @@ -1,42 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <wchar.h> - -int vfwscanf(FILE * __restrict__ stream, const wchar_t * __restrict__ format, - va_list arg) { - - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // stream - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call fscanf - "call _fwscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(stream), "=d"(format) - : "1"(stream), "2"(format), "S"(arg), - "a"(&ret) - : "ebx"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vscanf.c b/winsup/mingw/mingwex/stdio/vscanf.c deleted file mode 100644 index 53f543442..000000000 --- a/winsup/mingw/mingwex/stdio/vscanf.c +++ /dev/null @@ -1,9 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties - -#include <stdarg.h> -#include <stdio.h> - -int vscanf(const char * __restrict__ format, va_list arg) { - return vfscanf(stdin, format, arg); -} diff --git a/winsup/mingw/mingwex/stdio/vsnprintf.c b/winsup/mingw/mingwex/stdio/vsnprintf.c deleted file mode 100644 index f3dce5b67..000000000 --- a/winsup/mingw/mingwex/stdio/vsnprintf.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <stdarg.h> -#include <stdio.h> - -int vsnprintf (char* s, size_t n, const char* format, va_list arg) - { return _vsnprintf ( s, n, format, arg); } diff --git a/winsup/mingw/mingwex/stdio/vsnwprintf.c b/winsup/mingw/mingwex/stdio/vsnwprintf.c deleted file mode 100644 index 1b59a078b..000000000 --- a/winsup/mingw/mingwex/stdio/vsnwprintf.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <stdarg.h> -#include <wchar.h> - -int vsnwprintf(wchar_t *buffer, size_t n, const wchar_t * format, va_list argptr) - { return _vsnwprintf( buffer, n, format, argptr );} diff --git a/winsup/mingw/mingwex/stdio/vsscanf.c b/winsup/mingw/mingwex/stdio/vsscanf.c deleted file mode 100644 index 33fd333ae..000000000 --- a/winsup/mingw/mingwex/stdio/vsscanf.c +++ /dev/null @@ -1,41 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <stdio.h> - - -int vsscanf(const char * __restrict__ s, const char * __restrict__ format, va_list arg) { - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // s - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call sscanf - "call _sscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(s), "=d"(format) - : "1"(s), "2"(format), "S"(arg), - "a"(&ret) - : "ebx"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vswscanf.c b/winsup/mingw/mingwex/stdio/vswscanf.c deleted file mode 100644 index 20a0f85f5..000000000 --- a/winsup/mingw/mingwex/stdio/vswscanf.c +++ /dev/null @@ -1,43 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties */ - -#include <stdarg.h> -#include <wchar.h> - - -int vswscanf(const wchar_t * __restrict__ s, const wchar_t * __restrict__ format, - va_list arg) { - - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // s - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call sscanf - "call _swscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(s), "=d"(format) - : "1"(s), "2"(format), "S"(arg), - "a"(&ret) - : "ebx"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vwscanf.c b/winsup/mingw/mingwex/stdio/vwscanf.c deleted file mode 100644 index c8f53eef2..000000000 --- a/winsup/mingw/mingwex/stdio/vwscanf.c +++ /dev/null @@ -1,9 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <wchar.h> - -int vwscanf(const wchar_t * __restrict__ format, va_list arg) { - return vfwscanf(stdin, format, arg); -} diff --git a/winsup/mingw/mingwex/strtof.c b/winsup/mingw/mingwex/strtof.c deleted file mode 100644 index 62907cb19..000000000 --- a/winsup/mingw/mingwex/strtof.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <stdlib.h> - -float strtof( const char *nptr, char **endptr) -{ - return (strtod(nptr, endptr)); -} diff --git a/winsup/mingw/mingwex/strtoimax.c b/winsup/mingw/mingwex/strtoimax.c deleted file mode 100644 index 9072d4bbb..000000000 --- a/winsup/mingw/mingwex/strtoimax.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ -#include <stdlib.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* Helper macros */ - -/* convert digit character to number, in any base */ -#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ - isupper(c) ? (c) - 'A' + 10 : \ - islower(c) ? (c) - 'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -intmax_t -strtoimax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* in case no conversion's performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space characters */ - - while ( isspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - if ( (minus = *nptr == '-') || *nptr == '+' ) - ++nptr; - - if ( base == 0 ) { - if ( *nptr == '0' ) { - if ( nptr[1] == 'X' || nptr[1] == 'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ - toobig = 1; /* but keep scanning */ - else - accum = base * accum + n; - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* points to first not-valid-digit */ - - if ( minus ) - { - if ( accum > (uintmax_t)INTMAX_MAX + 1 ) - toobig = 1; - } - else - if ( accum > (uintmax_t)INTMAX_MAX ) - toobig = 1; - - if ( toobig ) - { - errno = ERANGE; - return minus ? INTMAX_MIN : INTMAX_MAX; - } - else - return (intmax_t)(minus ? -accum : accum); - } - -long long __attribute__ ((alias ("strtoimax"))) -strtoll (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/strtold.c b/winsup/mingw/mingwex/strtold.c deleted file mode 100644 index 954d3cb7c..000000000 --- a/winsup/mingw/mingwex/strtold.c +++ /dev/null @@ -1,412 +0,0 @@ -/* This file is extracted from S L Moshier's ioldoubl.c, - * modified for use in MinGW - * - * Extended precision arithmetic functions for long double I/O. - * This program has been placed in the public domain. - */ - - - -/* - * Revision history: - * - * 5 Jan 84 PDP-11 assembly language version - * 6 Dec 86 C language version - * 30 Aug 88 100 digit version, improved rounding - * 15 May 92 80-bit long double support - * - * Author: S. L. Moshier. - * - * 6 Oct 02 Modified for MinGW by inlining utility routines, - * removing global variables and splitting out strtold - * from _IO_ldtoa and _IO_ldtostr. - * - * 4 Feb 04 Reorganize __asctoe64 to fix setting error codes, - * and handling special chars. - * - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#include "math/cephes_emath.h" -#if NE == 10 - -/* 1.0E0 */ -static const unsigned short __eone[NE] = - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff,}; -#else -static const unsigned short __eone[NE] = { -0, 0000000,0000000,0000000,0100000,0x3fff,}; -#endif - -#if NE == 10 -static const unsigned short __etens[NTEN + 1][NE] = -{ - {0x6576, 0x4a92, 0x804a, 0x153f, - 0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */ - {0x6a32, 0xce52, 0x329a, 0x28ce, - 0xa74d, 0x5de4, 0xc53d, 0x3b5d, 0x9e8b, 0x5a92,}, /* 10**2048 */ - {0x526c, 0x50ce, 0xf18b, 0x3d28, - 0x650d, 0x0c17, 0x8175, 0x7586, 0xc976, 0x4d48,}, - {0x9c66, 0x58f8, 0xbc50, 0x5c54, - 0xcc65, 0x91c6, 0xa60e, 0xa0ae, 0xe319, 0x46a3,}, - {0x851e, 0xeab7, 0x98fe, 0x901b, - 0xddbb, 0xde8d, 0x9df9, 0xebfb, 0xaa7e, 0x4351,}, - {0x0235, 0x0137, 0x36b1, 0x336c, - 0xc66f, 0x8cdf, 0x80e9, 0x47c9, 0x93ba, 0x41a8,}, - {0x50f8, 0x25fb, 0xc76b, 0x6b71, - 0x3cbf, 0xa6d5, 0xffcf, 0x1f49, 0xc278, 0x40d3,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0xf020, 0xb59d, 0x2b70, 0xada8, 0x9dc5, 0x4069,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0400, 0xc9bf, 0x8e1b, 0x4034,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x2000, 0xbebc, 0x4019,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x9c40, 0x400c,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xc800, 0x4005,}, - {0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */ -}; -#else -static const unsigned short __etens[NTEN+1][NE] = { -{0xc94c,0x979a,0x8a20,0x5202,0xc460,0x7525,},/* 10**4096 */ -{0xa74d,0x5de4,0xc53d,0x3b5d,0x9e8b,0x5a92,},/* 10**2048 */ -{0x650d,0x0c17,0x8175,0x7586,0xc976,0x4d48,}, -{0xcc65,0x91c6,0xa60e,0xa0ae,0xe319,0x46a3,}, -{0xddbc,0xde8d,0x9df9,0xebfb,0xaa7e,0x4351,}, -{0xc66f,0x8cdf,0x80e9,0x47c9,0x93ba,0x41a8,}, -{0x3cbf,0xa6d5,0xffcf,0x1f49,0xc278,0x40d3,}, -{0xf020,0xb59d,0x2b70,0xada8,0x9dc5,0x4069,}, -{0x0000,0x0000,0x0400,0xc9bf,0x8e1b,0x4034,}, -{0x0000,0x0000,0x0000,0x2000,0xbebc,0x4019,}, -{0x0000,0x0000,0x0000,0x0000,0x9c40,0x400c,}, -{0x0000,0x0000,0x0000,0x0000,0xc800,0x4005,}, -{0x0000,0x0000,0x0000,0x0000,0xa000,0x4002,}, /* 10**1 */ -}; -#endif - -int __asctoe64(const char * __restrict__ ss, short unsigned int * __restrict__ y) -{ -unsigned short yy[NI], xt[NI], tt[NI]; -int esign, decflg, nexp, exp, lost; -int k, c; -int valid_lead_string = 0; -int have_non_zero_mant = 0; -int prec = 0; -/* int trail = 0; */ -long lexp; -unsigned short nsign = 0; -const unsigned short *p; -char *sp, *lstr; -char *s; - -const char dec_sym = *(localeconv ()->decimal_point); - -int lenldstr = 0; - -/* Copy the input string. */ -c = strlen (ss) + 2; -lstr = (char *) alloca (c); -s = (char *) ss; -while( isspace ((int)(unsigned char)*s)) /* skip leading spaces */ - { - ++s; - ++lenldstr; - } -sp = lstr; -for( k=0; k<c; k++ ) - { - if( (*sp++ = *s++) == '\0' ) - break; - } -*sp = '\0'; -s = lstr; - -if (*s == '-') - { - nsign = 0xffff; - ++s; - } -else if (*s == '+') - { - ++s; - } - -if (_strnicmp("INF", s , 3) == 0) - { - valid_lead_string = 1; - s += 3; - if ( _strnicmp ("INITY", s, 5) == 0) - s += 5; - __ecleaz(yy); - yy[E] = 0x7fff; /* infinity */ - goto aexit; - } -else if(_strnicmp ("NAN", s, 3) == 0) - { - valid_lead_string = 1; - s += 3; - __enan_NI16( yy ); - goto aexit; - } - -/* FIXME: Handle case of strtold ("NAN(n_char_seq)",endptr) */ - -/* Now get some digits. */ -lost = 0; -decflg = 0; -nexp = 0; -exp = 0; -__ecleaz( yy ); - -/* Ignore leading zeros */ -while (*s == '0') - { - valid_lead_string = 1; - s++; - } - -nxtcom: - -k = *s - '0'; -if( (k >= 0) && (k <= 9) ) - { -#if 0 -/* The use of a special char as a flag for trailing zeroes causes problems when input - actually contains the char */ -/* Identify and strip trailing zeros after the decimal point. */ - if( (trail == 0) && (decflg != 0) ) - { - sp = s; - while( (*sp >= '0') && (*sp <= '9') ) - ++sp; - --sp; - while( *sp == '0' ) - { - *sp-- = (char)-1; - trail++; - } - if( *s == (char)-1 ) - goto donchr; - } -#endif - -/* If enough digits were given to more than fill up the yy register, - * continuing until overflow into the high guard word yy[2] - * guarantees that there will be a roundoff bit at the top - * of the low guard word after normalization. - */ - if( yy[2] == 0 ) - { - if( decflg ) - nexp += 1; /* count digits after decimal point */ - __eshup1( yy ); /* multiply current number by 10 */ - __emovz( yy, xt ); - __eshup1( xt ); - __eshup1( xt ); - __eaddm( xt, yy ); - __ecleaz( xt ); - xt[NI-2] = (unsigned short )k; - __eaddm( xt, yy ); - } - else - { - /* Mark any lost non-zero digit. */ - lost |= k; - /* Count lost digits before the decimal point. */ - if (decflg == 0) - nexp -= 1; - } - have_non_zero_mant |= k; - prec ++; - /* goto donchr; */ - } -else if (*s == dec_sym) - { - if( decflg ) - goto daldone; - ++decflg; - } -else if ((*s == 'E') || (*s == 'e') ) - { - if (prec || valid_lead_string) - goto expnt; - else - goto daldone; - } - -#if 0 -else if (*s == (char)-1) - goto donchr; -#endif - -else /* an invalid char */ - goto daldone; - -/* donchr: */ -++s; -goto nxtcom; - - -/* Exponent interpretation */ -expnt: - -esign = 1; -exp = 0; -++s; -/* check for + or - */ -if( *s == '-' ) - { - esign = -1; - ++s; - } -if( *s == '+' ) - ++s; - -while( (*s >= '0') && (*s <= '9') ) -{ - /* Stop modifying exp if we are going to overflow anyway, - but keep parsing the string. */ - if (exp < 4978) - { - exp *= 10; - exp += *s - '0'; - } - s++; -} - -if( esign < 0 ) - exp = -exp; - -if (exp > 4977) /* maybe overflow */ - { - __ecleaz(yy); - if (have_non_zero_mant) - yy[E] = 0x7fff; - goto aexit; - } -else if (exp < -4977) /* underflow */ - { - __ecleaz(yy); - goto aexit; - } - -daldone: - -nexp = exp - nexp; - -/* Pad trailing zeros to minimize power of 10, per IEEE spec. */ -while( (nexp > 0) && (yy[2] == 0) ) - { - __emovz( yy, xt ); - __eshup1( xt ); - __eshup1( xt ); - __eaddm( yy, xt ); - __eshup1( xt ); - if( xt[2] != 0 ) - break; - nexp -= 1; - __emovz( xt, yy ); - } -if( (k = __enormlz(yy)) > NBITS ) - { - __ecleaz(yy); - goto aexit; - } -lexp = (EXONE - 1 + NBITS) - k; -__emdnorm( yy, lost, 0, lexp, 64, NBITS ); -/* convert to external format */ - - -/* Multiply by 10**nexp. If precision is 64 bits, - * the maximum relative error incurred in forming 10**n - * for 0 <= n <= 324 is 8.2e-20, at 10**180. - * For 0 <= n <= 999, the peak relative error is 1.4e-19 at 10**947. - * For 0 >= n >= -999, it is -1.55e-19 at 10**-435. - */ -lexp = yy[E]; -if( nexp == 0 ) - { - k = 0; - goto expdon; - } -esign = 1; -if( nexp < 0 ) - { - nexp = -nexp; - esign = -1; - if( nexp > 4096 ) - { /* Punt. Can't handle this without 2 divides. */ - __emovi( __etens[0], tt ); - lexp -= tt[E]; - k = __edivm( tt, yy ); - lexp += EXONE; - nexp -= 4096; - } - } -p = &__etens[NTEN][0]; -__emov( __eone, xt ); -exp = 1; -do - { - if( exp & nexp ) - __emul( p, xt, xt ); - p -= NE; - exp = exp + exp; - } -while( exp <= MAXP ); - -__emovi( xt, tt ); -if( esign < 0 ) - { - lexp -= tt[E]; - k = __edivm( tt, yy ); - lexp += EXONE; - } -else - { - lexp += tt[E]; - k = __emulm( tt, yy ); - lexp -= EXONE - 1; - } - -expdon: - -/* Round and convert directly to the destination type */ - -__emdnorm( yy, k, 0, lexp, 64, 64 ); - -aexit: - -yy[0] = nsign; - -__toe64( yy, y ); - -/* Check for overflow, undeflow */ -if (have_non_zero_mant && - (*((long double*) y) == 0.0L || isinf (*((long double*) y)))) - errno = ERANGE; - -if (prec || valid_lead_string) - return (lenldstr + (s - lstr)); -return 0; -} - - -long double strtold (const char * __restrict__ s, char ** __restrict__ se) -{ - int lenldstr; - union - { - unsigned short int us[6]; - long double ld; - } xx = {{0}}; - - lenldstr = __asctoe64( s, xx.us); - if (se) - *se = (char*)s + lenldstr; - - return xx.ld; -} diff --git a/winsup/mingw/mingwex/strtoumax.c b/winsup/mingw/mingwex/strtoumax.c deleted file mode 100644 index 2c052ac06..000000000 --- a/winsup/mingw/mingwex/strtoumax.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ -#include <stdlib.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* Helper macros */ - -/* convert digit character to number, in any base */ -#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ - isupper(c) ? (c) - 'A' + 10 : \ - islower(c) ? (c) - 'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -uintmax_t -strtoumax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register uintmax_t next; /* for computing next value of accum */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen (yes!) */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* in case no conversion's performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space characters */ - - while ( isspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign (yes!) */ - - if ( (minus = *nptr == '-') || *nptr == '+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == '0' ) - { - if ( nptr[1] == 'X' || nptr[1] == 'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ - || (next = base * accum + n) < accum /* minor wrap-around */ - ) - toobig = 1; /* but keep scanning */ - else - accum = next; - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* points to first not-valid-digit */ - - if ( toobig ) - { - errno = ERANGE; - return UINTMAX_MAX; - } - else - return minus ? -accum : accum; /* (yes!) */ - } - -unsigned long long __attribute__ ((alias ("strtoumax"))) -strtoull (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/testwmem.c b/winsup/mingw/mingwex/testwmem.c deleted file mode 100644 index 1310718c9..000000000 --- a/winsup/mingw/mingwex/testwmem.c +++ /dev/null @@ -1,104 +0,0 @@ -#include <memory.h> -#include <wchar.h> -#include <stdio.h> - -wchar_t fmt1[] = L" 1 2 3 4 5"; -wchar_t fmt2[] = L"12345678901234567890123456789012345678901234567890"; - -void test_wmemchr( void ) -{ - wchar_t* dest; - wint_t result; - wint_t ch = L'r'; - wchar_t str[] = L"lazy"; - wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; - - wprintf( L"Wmemchr\n" ); - wprintf( L"String to be searched:\n\t\t%s\n", string1 ); - wprintf( L"\t\t%s\n\t\t%s\n\n", fmt1, fmt2 ); - - wprintf( L"Search char:\t%c\n", ch ); - dest = wmemchr( string1, ch, sizeof( string1 ) ); - result = dest - string1 + 1; - if( dest != NULL ) - wprintf( L"Result:\t\t%c found at position %d\n\n", ch, result ); - else - wprintf( L"Result:\t\t%c not found\n\n" ); -return; -} -void test_wmemset( void ) -{/* 1 2 - 0123456789012345678901234567890 */ - wchar_t buffer[] = L"This is a test of the wmemset function"; - wprintf( L"Before: %s\n", buffer ); - wmemset( buffer+22, L'*', 7 ); - wprintf( L"After: %s\n\n", buffer ); -return; -} - -void test_wmemmove( void ) -{ - wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; - wchar_t string2[60] = L"The quick brown fox jumps over the lazy dog"; - - wprintf( L"Wmemcpy without overlap\n" ); - wprintf( L"Source:\t\t%s\n", string1 + 40 ); - wprintf( L"Destination:\t%s\n", string1 + 16 ); - wmemcpy( string1 + 16, string1 + 40, 3 ); - wprintf( L"Result:\t\t%s\n", string1 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); - wmemcpy( string1 + 16, string2 + 40, 3 ); - - wprintf( L"Wmemmove with overlap\n" ); - wprintf( L"Source:\t\t%s\n", string2 + 4 ); - wprintf( L"Destination:\t%s\n", string2 + 10 ); - wmemmove( string2 + 10, string2 + 4, 40 ); - wprintf( L"Result:\t\t%s\n", string2 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string2 ) ); - - wprintf( L"Wmemcpy with overlap\n" ); - wprintf( L"Source:\t\t%s\n", string1 + 4 ); - wprintf( L"Destination:\t%s\n", string1 + 10 ); - wmemcpy( string1 + 10, string1 + 4, 40 ); - wprintf( L"Result:\t\t%s\n", string1 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); -} - - -void test_wmemcmp( void ) -{ - wchar_t first[] = L"12345678901234567890"; - wchar_t second[] = L"12345678901234567891"; - wint_t result; - wprintf(L"Wmemcmp\n"); - wprintf( L"Compare '%.19s' to '%.19s':\n", first, second ); - result = wmemcmp( first, second, 19 ); - if( result < 0 ) - wprintf( L"First is less than second.\n" ); - else if( result == 0 ) - wprintf( L"First is equal to second.\n" ); - else if( result > 0 ) - wprintf( L"First is greater than second.\n" ); - wprintf( L"\nCompare '%.20s' to '%.20s':\n", first, second ); - result = wmemcmp( first, second, 20 ); - if( result < 0 ) - wprintf( L"First is less than second.\n\n" ); - else if( result == 0 ) - wprintf( L"First is equal to second.\n\n" ); - else if( result > 0 ) - wprintf( L"First is greater than second.\n\n" ); -} - - - -int main(){ -test_wmemset(); -test_wmemmove(); -test_wmemchr(); -test_wmemcmp(); -return 0; -} - - - - diff --git a/winsup/mingw/mingwex/ulltoa.c b/winsup/mingw/mingwex/ulltoa.c deleted file mode 100644 index 8e90de764..000000000 --- a/winsup/mingw/mingwex/ulltoa.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -char* ulltoa(unsigned long long _n, char * _c, int _i) - { return _ui64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/ulltow.c b/winsup/mingw/mingwex/ulltow.c deleted file mode 100644 index 8e4f228f1..000000000 --- a/winsup/mingw/mingwex/ulltow.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i) - { return _ui64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/wcstof.c b/winsup/mingw/mingwex/wcstof.c deleted file mode 100644 index 830f79416..000000000 --- a/winsup/mingw/mingwex/wcstof.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <wchar.h> - -float wcstof( const wchar_t *nptr, wchar_t **endptr) -{ - return (wcstod(nptr, endptr)); -} diff --git a/winsup/mingw/mingwex/wcstoimax.c b/winsup/mingw/mingwex/wcstoimax.c deleted file mode 100644 index 99bacf463..000000000 --- a/winsup/mingw/mingwex/wcstoimax.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ - -#include <wchar.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* convert digit wide character to number, in any base */ - -#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ - iswupper(c) ? (c) - L'A' + 10 : \ - iswlower(c) ? (c) - L'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) - -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -intmax_t -wcstoimax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* in case no conv performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space w.characters */ - - while ( iswspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - - if ( (minus = *nptr == L'-') || *nptr == L'+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == L'0' ) - { - if ( nptr[1] == L'X' || nptr[1] == L'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == L'0' - && (nptr[1] == L'X' || nptr[1] == L'x') - ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToWNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ - toobig = 1; /* but keep scanning */ - else - accum = base * accum + n; - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ - - if ( minus ) - { - if ( accum > (uintmax_t)INTMAX_MAX + 1 ) - toobig = 1; - } - else - if ( accum > (uintmax_t)INTMAX_MAX ) - toobig = 1; - - if ( toobig ) - { - errno = ERANGE; - return minus ? INTMAX_MIN : INTMAX_MAX; - } - else - return (intmax_t)(minus ? -accum : accum); - } - -long long __attribute__ ((alias ("wcstoimax"))) -wcstoll (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wcstold.c b/winsup/mingw/mingwex/wcstold.c deleted file mode 100644 index 85298807c..000000000 --- a/winsup/mingw/mingwex/wcstold.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Wide char wrapper for strtold - * Revision history: - * 6 Nov 2002 Initial version. - * - * Contributor: Danny Smith <dannysmith@users.sourceforege.net> - */ - - /* This routine has been placed in the public domain.*/ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <locale.h> -#include <wchar.h> -#include <stdlib.h> -#include <string.h> - -extern int __asctoe64(const char * __restrict__ ss, - short unsigned int * __restrict__ y); - - -static __inline__ unsigned int get_codepage (void) -{ - char* cp; - - /* - locale :: "lang[_country[.code_page]]" - | ".code_page" - */ - if ((cp = strchr(setlocale(LC_CTYPE, NULL), '.'))) - return atoi( cp + 1); - else - return 0; -} - -long double wcstold (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse) -{ - char * cs; - int i; - int lenldstr; - union - { - unsigned short int us[6]; - long double ld; - } xx; - - unsigned int cp = get_codepage (); - - /* Allocate enough room for (possibly) mb chars */ - cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX); - - if (cp == 0) /* C locale */ - { - for (i = 0; (wcs[i] != 0) && wcs[i] <= 255; i++) - cs[i] = (char) wcs[i]; - cs[i] = '\0'; - } - else - { - int nbytes = -1; - int mb_len = 0; - /* loop through till we hit null or invalid character */ - for (i = 0; (wcs[i] != 0) && (nbytes != 0); i++) - { - nbytes = WideCharToMultiByte(cp, WC_COMPOSITECHECK | WC_SEPCHARS, - wcs + i, 1, cs + mb_len, MB_CUR_MAX, - NULL, NULL); - mb_len += nbytes; - } - cs[mb_len] = '\0'; - } - lenldstr = __asctoe64( cs, xx.us); - free (cs); - if (wcse) - *wcse = (wchar_t*) wcs + lenldstr; - return xx.ld; -} diff --git a/winsup/mingw/mingwex/wcstoumax.c b/winsup/mingw/mingwex/wcstoumax.c deleted file mode 100644 index 9bd6cd704..000000000 --- a/winsup/mingw/mingwex/wcstoumax.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ - -#include <wchar.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* convert digit wide character to number, in any base */ - -#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ - iswupper(c) ? (c) - L'A' + 10 : \ - iswlower(c) ? (c) - L'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) - -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -uintmax_t -wcstoumax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register uintmax_t next; /* for computing next value of accum */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen (yes!) */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* in case no conv performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space w.characters */ - - while ( iswspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - - if ( (minus = *nptr == L'-') || *nptr == L'+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == L'0' ) - { - if ( nptr[1] == L'X' || nptr[1] == L'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == L'0' - && (nptr[1] == L'X' || nptr[1] == L'x') - ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToWNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ - || (next = base * accum + n) < accum /* minor wrap-around */ - ) - toobig = 1; /* but keep scanning */ - else - accum = next; - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ - - if ( toobig ) - { - errno = ERANGE; - return UINTMAX_MAX; - } - else - return minus ? -accum : accum; /* (yes!) */ - } - -unsigned long long __attribute__ ((alias ("wcstoumax"))) -wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wdirent.c b/winsup/mingw/mingwex/wdirent.c deleted file mode 100644 index 4b8cc5054..000000000 --- a/winsup/mingw/mingwex/wdirent.c +++ /dev/null @@ -1,3 +0,0 @@ -#define _UNICODE 1 -#define UNICODE 1 -#include "dirent.c" diff --git a/winsup/mingw/mingwex/wmemchr.c b/winsup/mingw/mingwex/wmemchr.c deleted file mode 100644 index dc5cedd23..000000000 --- a/winsup/mingw/mingwex/wmemchr.c +++ /dev/null @@ -1,28 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -wchar_t* -wmemchr(s, c, n) - register const wchar_t *s; - register wchar_t c; - register size_t n; - { - if ( s != NULL ) - for ( ; n > 0; ++s, --n ) - if ( *s == c ) - return (wchar_t *)s; - - return NULL; - } - diff --git a/winsup/mingw/mingwex/wmemcmp.c b/winsup/mingw/mingwex/wmemcmp.c deleted file mode 100644 index e1e034c7b..000000000 --- a/winsup/mingw/mingwex/wmemcmp.c +++ /dev/null @@ -1,32 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -int -wmemcmp(s1, s2, n) - register const wchar_t *s1; - register const wchar_t *s2; - size_t n; - { - if ( n == 0 || s1 == s2 ) - return 0; /* even for NULL pointers */ - - if ( (s1 != NULL) != (s2 != NULL) ) - return s2 == NULL ? 1 : -1; /* robust */ - - for ( ; n > 0; ++s1, ++s2, --n ) - if ( *s1 != *s2 ) - return *s1 - *s2; - - return 0; - } diff --git a/winsup/mingw/mingwex/wmemcpy.c b/winsup/mingw/mingwex/wmemcpy.c deleted file mode 100644 index d7e7b4cb3..000000000 --- a/winsup/mingw/mingwex/wmemcpy.c +++ /dev/null @@ -1,32 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - - -wchar_t * -wmemcpy(s1, s2, n) - register wchar_t * __restrict__ s1; - register const wchar_t * __restrict__ s2; - register size_t n; - { - wchar_t *orig_s1 = s1; - - if ( s1 == NULL || s2 == NULL || n == 0 ) - return orig_s1; /* robust */ - - for ( ; n > 0; --n ) - *s1++ = *s2++; - - return orig_s1; - } - diff --git a/winsup/mingw/mingwex/wmemmove.c b/winsup/mingw/mingwex/wmemmove.c deleted file mode 100644 index 3c545ac32..000000000 --- a/winsup/mingw/mingwex/wmemmove.c +++ /dev/null @@ -1,43 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <wchar.h> - -wchar_t * -wmemmove(s1, s2, n) - register wchar_t *s1; - register const wchar_t *s2; - register size_t n; - { - wchar_t *orig_s1 = s1; - - if ( s1 == NULL || s2 == NULL || n == 0 ) - return orig_s1; /* robust */ - - /* XXX -- The following test works only within a flat address space! */ - if ( s2 >= s1 ) - for ( ; n > 0; --n ) - *s1++ = *s2++; - else { - s1 += n; - s2 += n; - - for ( ; n > 0; --n ) - *--s1 = *--s2; - } - - return orig_s1; - } - diff --git a/winsup/mingw/mingwex/wmemset.c b/winsup/mingw/mingwex/wmemset.c deleted file mode 100644 index dadd9fb07..000000000 --- a/winsup/mingw/mingwex/wmemset.c +++ /dev/null @@ -1,30 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - - -wchar_t * -wmemset(s, c, n) - register wchar_t *s; - register wchar_t c; - register size_t n; - { - wchar_t *orig_s = s; - - if ( s != NULL ) - for ( ; n > 0; --n ) - *s++ = c; - - return orig_s; - } - diff --git a/winsup/mingw/mingwex/wtoll.c b/winsup/mingw/mingwex/wtoll.c deleted file mode 100644 index 0bff278d1..000000000 --- a/winsup/mingw/mingwex/wtoll.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -long long wtoll(const wchar_t * _w) - { return _wtoi64 (_w); } |