pcc-libs-20200614004075500017500000000000000000001367127322400123405ustar raggewheelpcc-libs-20200614/CVS004075500017500000000000000000001367127322400127735ustar raggewheelpcc-libs-20200614/CVS/Root010064400017500000000000000000111367127322300137040ustar raggewheel/cvsroot pcc-libs-20200614/CVS/Repository010064400017500000000000000000111367127322300151400ustar raggewheelpcc-libs pcc-libs-20200614/CVS/Entries010064400017500000000000000005161367127322400144050ustar raggewheel/Makefile.in/1.5/Sun Aug 21 09:00:54 2011// /config.guess/1.3/Wed Apr 6 16:22:21 2016// /config.sub/1.2/Wed Apr 6 16:22:21 2016// /configure/1.27/Sat Jun 13 14:54:58 2020// /configure.ac/1.27/Sat Jun 13 14:54:58 2020// /install-sh/1.1/Tue May 20 05:29:06 2008// D/csu//// D/libF77//// D/libI77//// D/libpcc//// D/libsoftfloat//// D pcc-libs-20200614/Makefile.in010064400017500000000000000014731162414450600144620ustar raggewheel# $Id: Makefile.in,v 1.5 2011/08/21 09:00:54 plunky Exp $ # # top-level Makefile # @SET_MAKE@ ALL_SUBDIRS= libsoftfloat libpcc csu DIST_SUBDIRS= $(ALL_SUBDIRS) libF77 libI77 all install clean: @for subdir in $(ALL_SUBDIRS); do \ _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ echo "===> $$_nextdir_"; \ (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ echo "<=== $$_nextdir_"; \ done distclean: clean @for subdir in $(DIST_SUBDIRS); do \ _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ echo "===> $$_nextdir_"; \ (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ echo "<=== $$_nextdir_"; \ done /bin/rm -rf Makefile config.log config.status \ configure.lineno config.h autom4te.cache pcc-libs-20200614/config.guess010064400017500000000000001237121270123367500147360ustar raggewheel#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix${UNAME_RELEASE} exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pcc-libs-20200614/config.sub010064400017500000000000001065341270123367500144040ustar raggewheel#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m16c | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | nova | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m16c-* | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | nova-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -litebsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pcc-libs-20200614/configure010075500017500000000000003123301367116430200143210ustar raggewheel#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for pcc-libs 1.2.0.DEVEL. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: pcc@lists.ludd.ltu.se about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pcc-libs' PACKAGE_TARNAME='pcc-libs' PACKAGE_VERSION='1.2.0.DEVEL' PACKAGE_STRING='pcc-libs 1.2.0.DEVEL' PACKAGE_BUGREPORT='pcc@lists.ludd.ltu.se' PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS CFLAGS CPPFLAGS version targmach targos RANLIB AR ac_ct_CC CC ENDIAN_FLAG target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM SET_MAKE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$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 ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 | -n) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 <<_ACEOF \`configure' configures pcc-libs 1.2.0.DEVEL to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pcc-libs] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pcc-libs 1.2.0.DEVEL:";; esac cat <<\_ACEOF Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pcc-libs configure 1.2.0.DEVEL generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pcc-libs $as_me 1.2.0.DEVEL, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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 # AmigaOS /C/install, which installs bootblocks on floppy discs # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&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}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- version=$PACKAGE_VERSION case "$target_os" in apple) targos=apple case "$target_cpu" in m68k) targmach=m68k endian=big ;; esac ;; darwin*) targos=darwin case "$target_cpu" in i?86) targmach=i386 ;; powerpc) targmach=powerpc endian=big ;; x86_64) targmach=amd64 ;; esac ;; dragonfly*) targos=dragonfly case "$target_cpu" in i?86) targmach=i386 ;; esac ;; freebsd*) targos=freebsd case "$target_cpu" in i386) targmach=i386 ;; x86_64) targmach=amd64 ;; esac ;; linux*) targos=linux case "$target_cpu" in i?86) targmach=i386 ;; powerpc*) targmach=powerpc endian=big ;; x86_64) targmach=amd64 ;; aarch64) targmach=aarch64 ;; esac ;; litebsd*) targos=litebsd case "$target_cpu" in mips*) targmach=mips ;; esac ;; midnightbsd*) targos=midnightbsd case "$target_cpu" in i?86) targmach=i386 ;; sparc64) targmach=sparc64 endian=big ;; esac ;; minix*) targos=minix case "$target_os" in minix3) CPPFLAGS="$CPPFLAGS -DSOFTFLOAT_NEED_FIXUNS" ;; minix3.*) ;; esac case "$target_cpu" in i86) targmach=i86 ;; i?86) targmach=i386 ;; arm*) targmach=arm ;; x86_64) targmach=amd64 ;; m68k) targmach=m68k endian=big ;; esac ;; mirbsd*) targos=mirbsd case "$target_cpu" in i?86) targmach=i386 ;; esac ;; netbsd*) targos=netbsd case "$target_cpu" in armeb) targmach=arm endian=big ;; arm*) targmach=arm ;; i?86) targmach=i386 ;; m68k*) targmach=m68k endian=big ;; mipseb) targmach=mips endian=big ;; mips*) targmach=mips ;; pdp10) targmach=pdp10 ;; powerpc) targmach=powerpc endian=big ;; sparc64) targmach=sparc64 endian=big ;; vax) targmach=vax ;; x86_64) targmach=amd64 ;; esac ;; openbsd*) targos=openbsd case "$target_cpu" in i?86) targmach=i386 ;; mips64el) targmach=mips ;; mips64) targmach=mips endian=big ;; powerpc) targmach=powerpc endian=big ;; sparc64) targmach=sparc64 endian=big ;; vax) targmach=vax ;; x86_64) targmach=amd64 ;; esac ;; sysv4*|sunos*|solaris*) targos=sunos case "$target_cpu" in i?86) targmach=i386 ;; sparc*) targmach=sparc64 endian=big ;; esac ;; windows*|pe*) target_alias=i386-pe targos=win32 targmach=i386 ;; *) targos="$target_os" case "$target_cpu" in m16c) targmach=m16c ;; nova) targmach=nova ;; esac ;; esac if test "X$targos" = X -o "X$targmach" = X; then as_fn_error $? "'$target' is not (yet) supported by pcc-libs." "$LINENO" 5 fi if test "X$endian" = "Xbig"; then ENDIAN_FLAG=-DTARGET_BIG_ENDIAN=1 else ENDIAN_FLAG=-DTARGET_LITTLE_ENDIAN=1 fi if test -n "$ac_tool_prefix"; then for ac_prog in pcc gcc cc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in pcc gcc cc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="ar" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_config_files="$ac_config_files Makefile csu/Makefile libsoftfloat/Makefile libpcc/Makefile" cat >confcache <<\_ACEOF # 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, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pcc-libs $as_me 1.2.0.DEVEL, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ pcc-libs config.status 1.2.0.DEVEL configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "csu/Makefile") CONFIG_FILES="$CONFIG_FILES csu/Makefile" ;; "libsoftfloat/Makefile") CONFIG_FILES="$CONFIG_FILES libsoftfloat/Makefile" ;; "libpcc/Makefile") CONFIG_FILES="$CONFIG_FILES libpcc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi pcc-libs-20200614/configure.ac010064400017500000000000000062761367116430200147110ustar raggewheel# Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([pcc-libs], [1.2.0.DEVEL], [pcc@lists.ludd.ltu.se]) AC_PROG_MAKE_SET AC_PROG_INSTALL AC_CANONICAL_TARGET version=$PACKAGE_VERSION case "$target_os" in apple) targos=apple case "$target_cpu" in m68k) targmach=m68k endian=big ;; esac ;; darwin*) targos=darwin case "$target_cpu" in i?86) targmach=i386 ;; powerpc) targmach=powerpc endian=big ;; x86_64) targmach=amd64 ;; esac ;; dragonfly*) targos=dragonfly case "$target_cpu" in i?86) targmach=i386 ;; esac ;; freebsd*) targos=freebsd case "$target_cpu" in i386) targmach=i386 ;; x86_64) targmach=amd64 ;; esac ;; linux*) targos=linux case "$target_cpu" in i?86) targmach=i386 ;; powerpc*) targmach=powerpc endian=big ;; x86_64) targmach=amd64 ;; aarch64) targmach=aarch64 ;; esac ;; litebsd*) targos=litebsd case "$target_cpu" in mips*) targmach=mips ;; esac ;; midnightbsd*) targos=midnightbsd case "$target_cpu" in i?86) targmach=i386 ;; sparc64) targmach=sparc64 endian=big ;; esac ;; minix*) targos=minix case "$target_os" in minix3) CPPFLAGS="$CPPFLAGS -DSOFTFLOAT_NEED_FIXUNS" ;; minix3.*) ;; esac case "$target_cpu" in i86) targmach=i86 ;; i?86) targmach=i386 ;; arm*) targmach=arm ;; x86_64) targmach=amd64 ;; m68k) targmach=m68k endian=big ;; esac ;; mirbsd*) targos=mirbsd case "$target_cpu" in i?86) targmach=i386 ;; esac ;; netbsd*) targos=netbsd case "$target_cpu" in armeb) targmach=arm endian=big ;; arm*) targmach=arm ;; i?86) targmach=i386 ;; m68k*) targmach=m68k endian=big ;; mipseb) targmach=mips endian=big ;; mips*) targmach=mips ;; pdp10) targmach=pdp10 ;; powerpc) targmach=powerpc endian=big ;; sparc64) targmach=sparc64 endian=big ;; vax) targmach=vax ;; x86_64) targmach=amd64 ;; esac ;; openbsd*) targos=openbsd case "$target_cpu" in i?86) targmach=i386 ;; mips64el) targmach=mips ;; mips64) targmach=mips endian=big ;; powerpc) targmach=powerpc endian=big ;; sparc64) targmach=sparc64 endian=big ;; vax) targmach=vax ;; x86_64) targmach=amd64 ;; esac ;; sysv4*|sunos*|solaris*) targos=sunos case "$target_cpu" in i?86) targmach=i386 ;; sparc*) targmach=sparc64 endian=big ;; esac ;; windows*|pe*) target_alias=i386-pe targos=win32 targmach=i386 ;; *) targos="$target_os" case "$target_cpu" in m16c) targmach=m16c ;; nova) targmach=nova ;; esac ;; esac if test "X$targos" = X -o "X$targmach" = X; then AC_MSG_ERROR(['$target' is not (yet) supported by pcc-libs.]) fi if test "X$endian" = "Xbig"; then AC_SUBST([ENDIAN_FLAG],[-DTARGET_BIG_ENDIAN=1]) else AC_SUBST([ENDIAN_FLAG],[-DTARGET_LITTLE_ENDIAN=1]) fi AC_CHECK_TOOLS([CC], [pcc gcc cc]) AC_CHECK_TOOL([AR], [ar], [ar]) AC_PROG_RANLIB AC_SUBST(targos) AC_SUBST(targmach) AC_SUBST(version) AC_SUBST(prefix) AC_SUBST(libdir) AC_SUBST(includedir) AC_SUBST(CPPFLAGS) AC_SUBST(CFLAGS) AC_CONFIG_FILES([Makefile csu/Makefile libsoftfloat/Makefile libpcc/Makefile ]) AC_OUTPUT pcc-libs-20200614/install-sh010075500017500000000000000157221101446064200144160ustar raggewheel#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/#inst.$$# rmtmp=$dstdir/#rm.$$# # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } pcc-libs-20200614/csu004075500017500000000000000000001367127322300131315ustar raggewheelpcc-libs-20200614/csu/CVS004075500017500000000000000000001367127322300135645ustar raggewheelpcc-libs-20200614/csu/CVS/Root010064400017500000000000000000111367127322300144760ustar raggewheel/cvsroot pcc-libs-20200614/csu/CVS/Repository010064400017500000000000000000151367127322300157360ustar raggewheelpcc-libs/csu pcc-libs-20200614/csu/CVS/Entries010064400017500000000000000001741367127322300151760ustar raggewheel/Makefile.in/1.13/Sun Mar 13 09:55:41 2016// /README/1.5/Thu Aug 28 20:29:04 2014// D/darwin//// D/linux//// D/netbsd//// D pcc-libs-20200614/csu/Makefile.in010064400017500000000000000011411267123443500152500ustar raggewheel# $Id: Makefile.in,v 1.13 2016/03/13 09:55:41 ragge Exp $ # # Makefile.in for pcc-libs/csu # @SET_MAKE@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ srcdir = @srcdir@ TARGOS = @targos@ TARGMACH = @targmach@ TARGET = @target@ VERSION = @version@ PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib CC = @CC@ CFLAGS = @CFLAGS@ MFLAGS = CC="$(CC)" MACH="$(TARGMACH)" PCCLIBDIR="$(PCCLIBDIR)" all clean install: if test -f $(srcdir)/$(TARGOS)/Makefile; then \ (cd $(srcdir)/$(TARGOS) && exec $(MAKE) $(MFLAGS) $@) \ || exit $$?; \ fi distclean: clean /bin/rm -f Makefile pcc-libs-20200614/csu/README010064400017500000000000000021321237771042000140600ustar raggewheel$Id: README,v 1.5 2014/08/28 20:29:04 ragge Exp $ OS-dependent and target-dependent: To be provided by the target's libc: (the corresponding code included in this archive is mere incomplete examples, can be possibly useful to replace the platform-provided ones, but only on exceptionally broken platforms) crt0.o startup code for programs (maybe compiled -static) crt1.o a different flavour of startup code (iff the platform needs this in certain platform-specific situations) gcrt[01].o the corresponding profiling startup code for programs crti.o beginning of _init() and _fini() functions (inside .init section) crtn.o end of _init() and _fini() functions (inside .fini section) To be provided by the compiler, needed if constructors/destructors are desired, p++ is generated or library calls expects their existence. crtbegin.o support for calling global ctors/dtors crtend.o end of the ctor/dtor lists if a difference from crtbegin.o/crtend.o is enforced by the platform: crtbeginT.o + for static binary crtendT.o + for static binary crtbeginS.o + for shared library crtendS.o + for shared library pcc-libs-20200614/csu/darwin004075500017500000000000000000001367127322300144155ustar raggewheelpcc-libs-20200614/csu/darwin/CVS004075500017500000000000000000001367127322300150505ustar raggewheelpcc-libs-20200614/csu/darwin/CVS/Root010064400017500000000000000000111367127322300157620ustar raggewheel/cvsroot pcc-libs-20200614/csu/darwin/CVS/Repository010064400017500000000000000000241367127322300172220ustar raggewheelpcc-libs/csu/darwin pcc-libs-20200614/csu/darwin/CVS/Entries010064400017500000000000000003131367127322300164550ustar raggewheel/Makefile/1.10/Mon Oct 13 11:07:26 2014// /common.c/1.4/Fri May 27 07:23:49 2011// /common.h/1.5/Fri May 27 07:23:49 2011// /macho.h/1.2/Fri May 27 07:23:49 2011// D/amd64//// D/i386//// D/powerpc//// D pcc-libs-20200614/csu/darwin/Makefile010064400017500000000000000017551241673115600161410ustar raggewheelMACH ?= powerpc TARGET ?= $(MACH)-darwin VERSION ?= 1.1.0 PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib SRCDIR ?= . CFLAGS = -I$(SRCDIR)$(MACH) -I$(SRCDIR) -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes OBJS = crt0.o crt1.o gcrt1.o dylib1.o all: $(OBJS) crt0.o: $(MACH)/crt0.c $(CC) -r -static -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -O $(CFLAGS) -o $@ $< crt1.o: $(MACH)/crt0.c $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -DDYNAMIC -O $(CFLAGS) -o $@ $< /usr/lib/dyld gcrt1.o: $(MACH)/crt0.c $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -DDYNAMIC -DPROFILE -O $(CFLAGS) -o $@ $< /usr/lib/dyld dylib1.o: $(MACH)/dylib1.c $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DDYNAMIC -O $(CFLAGS) -o $@ $< install: mkdir -p ${DESTDIR}$(PCCLIBDIR) cp $(OBJS) ${DESTDIR}$(PCCLIBDIR) clean: rm -f $(OBJS) pcc-libs-20200614/csu/darwin/common.c010064400017500000000000000056301156765060500161360ustar raggewheel/* $Id: common.c,v 1.4 2011/05/27 07:23:49 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "macho.h" static char * _strrchr(char *p, int ch) { char *save; for (save = NULL;; ++p) { if (*p == ch) save = (char *)p; if (!*p) return(save); } /* NOTREACHED */ } static int _strcmp(char *s1, char *s2) { while (*s1 == *s2++) if (*s1++ == 0) return 0; s2--; return ((long)*s1 - (long)*s2); } #ifdef PROFILE static void _mcleanup(void) { monitor(0, 0, 0, 0, 0); } #endif extern struct mach_header _mh_execute_header; static void _helper(int init) { struct mach_header *hdr = &_mh_execute_header; char *ptr = (char *)(hdr + 1); int i, j, n; #ifdef __LP64__ struct segment_command_64 *segp; struct section_64 *secp; #else struct segment_command_32 *segp; struct section_32 *secp; #endif void (*func)(void); void **addr; for (i = 0; i < (int)hdr->ncmds; i++, ptr += segp->cmdsize) { #ifdef __LP64__ segp = (struct segment_command_64 *)ptr; #else segp = (struct segment_command_32 *)ptr; #endif if (segp->cmd != LC_SEGMENT || segp->nsects == 0) continue; #ifdef __LP64__ secp = (struct section_64 *)(segp + 1); #else secp = (struct section_32 *)(segp + 1); #endif for (j = 0; j < (int)segp->nsects; j++, secp++) { if (init && _strcmp(secp->sectname, "__constructor") != 0) continue; if (!init && _strcmp(secp->sectname, "__destructor") != 0) continue; n = secp->size / 4; addr = (void **)secp->addr; while (n--) { func = *addr++; (*func)(); } } } } void _init(void) { _helper(1); } void _fini(void) { _helper(0); } #ifdef DYNAMIC void _dyld_init(void) { void (*init)(void); _dyld_func_lookup("__dyld_make_delayed_module_initializer_calls", (void *)&init); if (init) init(); } void _dyld_fini(void) { void (*term)(void); _dyld_func_lookup("__dyld_mod_term_funcs", (void *)&term); if (term) term(); } #endif IDENT("$Id: common.c,v 1.4 2011/05/27 07:23:49 gmcgarry Exp $"); pcc-libs-20200614/csu/darwin/common.h010064400017500000000000000032161156765060500161410ustar raggewheel/* $Id: common.h,v 1.5 2011/05/27 07:23:49 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #if defined(__ppc__) #define IDENT(x) asm(".cstring\n\t.ascii \"" x "\\0\"") #elif defined(__i386__) || defined(__x86_64__) #define IDENT(x) asm(".cstring\n\t.ascii \"" x "\\0\"") #endif #define NULL (void *)0 extern int main(int argc, char *argv[], char *envp[]); extern void exit(int); extern int atexit(void (*fcn)(void)); #ifdef CRT static char *_strrchr(char *, int); static int _strcmp(char *, char *); #endif #if PROFILE extern void moninit(void); static void _mcleanup(void); extern void monitor(char *, char *, char *, int, int); #endif #ifdef DYNAMIC extern void _dyld_init(void); extern void _dyld_fini(void); extern int _dyld_func_lookup(const char *, void **); #endif extern int (*mach_init_routine)(void); extern int (*_cthread_init_routine)(void); extern void _init(void); extern void _fini(void); pcc-libs-20200614/csu/darwin/macho.h010064400017500000000000000052351156765060500157430ustar raggewheel/* $Id: macho.h,v 1.2 2011/05/27 07:23:49 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include struct mach_header { uint32_t magic; uint32_t cputype; uint32_t cpusubtype; uint32_t filetype; uint32_t ncmds; uint32_t sizeofcmds; uint32_t flags; }; #define LC_SEGMENT 0x01 struct segment_command_32 { uint32_t cmd; uint32_t cmdsize; char segname[16]; uint32_t vmaddr; uint32_t vmsize; uint32_t fileoff; uint32_t filesize; uint32_t maxprot; uint32_t initprot; uint32_t nsects; uint32_t flags; }; struct segment_command_64 { uint32_t cmd; uint32_t cmdsize; char segname[16]; uint64_t vmaddr; uint64_t vmsize; uint64_t fileoff; uint64_t filesize; uint32_t maxprot; uint32_t initprot; uint32_t nsects; uint32_t flags; }; struct section_32 { char sectname[16]; char segname[16]; uint32_t addr; uint32_t size; uint32_t offset; uint32_t align; uint32_t reloff; uint32_t nreloc; uint32_t flags; uint32_t reserved1; uint32_t reserved2; }; struct section_64 { char sectname[16]; char segname[16]; uint64_t addr; uint64_t size; uint32_t offset; uint32_t align; uint32_t reloff; uint32_t nreloc; uint32_t flags; uint32_t reserved1; uint32_t reserved2; }; pcc-libs-20200614/csu/darwin/amd64004075500017500000000000000000001367127322300153305ustar raggewheelpcc-libs-20200614/csu/darwin/amd64/CVS004075500017500000000000000000001367127322300157635ustar raggewheelpcc-libs-20200614/csu/darwin/amd64/CVS/Root010064400017500000000000000000111367127322300166750ustar raggewheel/cvsroot pcc-libs-20200614/csu/darwin/amd64/CVS/Repository010064400017500000000000000000321367127322300201340ustar raggewheelpcc-libs/csu/darwin/amd64 pcc-libs-20200614/csu/darwin/amd64/CVS/Entries010064400017500000000000000000021367127322300173630ustar raggewheelD pcc-libs-20200614/csu/darwin/i386004075500017500000000000000000001367127322300151065ustar raggewheelpcc-libs-20200614/csu/darwin/i386/CVS004075500017500000000000000000001367127322300155415ustar raggewheelpcc-libs-20200614/csu/darwin/i386/CVS/Root010064400017500000000000000000111367127322300164530ustar raggewheel/cvsroot pcc-libs-20200614/csu/darwin/i386/CVS/Repository010064400017500000000000000000311367127322300177110ustar raggewheelpcc-libs/csu/darwin/i386 pcc-libs-20200614/csu/darwin/i386/CVS/Entries010064400017500000000000000001221367127322300171440ustar raggewheel/crt0.c/1.4/Sat Feb 14 21:02:58 2009// /dylib1.c/1.1/Sat Feb 14 11:40:28 2009// D pcc-libs-20200614/csu/darwin/i386/crt0.c010064400017500000000000000056731114563060200162010ustar raggewheel/* $Id: crt0.c,v 1.4 2009/02/14 21:02:58 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" void _start(int, char **, char **); char **environ; char *__progname = ""; int NXArgc; char **NXArgv; asm( #ifdef DYNAMIC " .text\n" " .symbol_stub\n" " .picsymbol_stub\n" #endif " .text\n" " .globl start\n" " .globl _start\n" " .p2align 2\n" "start:\n" "_start:\n" " pushl $0\n" " movl %esp,%ebp\n" " subl $16,%esp\n" " andl $-16,%esp\n" " movl 4(%ebp),%ebx\n" " movl %ebx,(%esp)\n" " leal 8(%ebp),%ecx\n" " movl %ecx,4(%esp)\n" " addl $1,%ebx\n" " shll $2,%ebx\n" " addl %ecx,%ebx\n" " movl %ebx,8(%esp)\n" " call __start\n" " hlt\n" ); void _start(int argc, char *argv[], char *envp[]) { char *namep; environ = envp; NXArgc = argc; NXArgv = argv; if ((namep = argv[0]) != NULL) { if ((__progname = _strrchr(namep, '/')) == NULL) __progname = namep; else __progname++; } /* * Initialise hooks inside libc */ if (mach_init_routine) (*mach_init_routine)(); if (_cthread_init_routine) (*_cthread_init_routine)(); #ifdef PROFILE atexit(_mcleanup); moninit(); #endif atexit(_fini); _init(); exit(main(argc, argv, environ)); } #ifdef DYNAMIC /* * dylib constructors/destructors */ asm( " .constructor\n" " .p2align 2\n" " .long __dyld_init\n" " .destructor\n" " .p2align 2\n" " .long __dyld_fini\n" ); /* * void _dyld_func_lookup(const char *, void **); * * jump to the linker via the pointer in the __dyld section */ asm( " .text\n" " .private_extern __dyld_func_lookup\n" "__dyld_func_lookup:\n" " jmp *Ldyld_func_lookup\n" ); /* * void dyld_stub_binding_helper(void) */ asm( " .text\n" " .private_extern dyld_stub_binding_helper\n" "dyld_stub_binding_helper:\n" " pushl $__mh_execute_header\n" " jmp *Ldyld_lazy_binder\n" ); /* * __dyld section */ asm( " .dyld\n" " .p2align 2\n" "Ldyld_lazy_binder:\n" " .long 0x8fe01000\n" "Ldyld_func_lookup:\n" " .long 0x8fe01008\n" " .long __mh_execute_header\n" " .long _NXArgc\n" " .long _NXArgv\n" " .long _environ\n" " .long ___progname\n" ); #endif asm("\t.subsections_via_symbols\n"); #include "common.c" IDENT("$Id: crt0.c,v 1.4 2009/02/14 21:02:58 gmcgarry Exp $"); pcc-libs-20200614/csu/darwin/i386/dylib1.c010064400017500000000000000037111114552665400165170ustar raggewheel/* $Id: dylib1.c,v 1.1 2009/02/14 11:40:28 gmcgarry Exp $ */ /*- * Copyright (c) 2009 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" /* * void _dyld_func_lookup(const char *, void **); * * jump to the linker via the pointer in the __dyld section */ asm( " .text\n" " .private_extern __dyld_func_lookup\n" "__dyld_func_lookup:\n" " call L__dyld_func_lookup$pb\n" "L__dyld_func_lookup$pb:\n" " popl %eax\n" " movl Ldyld_func_lookup-L__dyld_func_lookup$pb(%eax),%eax\n" " jmp *%eax\n" ); /* * void dyld_stub_binding_helper(void) */ asm( " .data\n" " .p2align 2\n" "dyld__mach_header:\n" " .long __mh_dylib_header\n" " .text\n" " .private_extern dyld_stub_binding_helper\n" " .p2align 2\n" "dyld_stub_binding_helper:\n" " call Ldyld_stub_binding_helper$pb\n" "Ldyld_stub_binding_helper$pb:\n" " popl %eax\n" " pushl dyld__mach_header-Ldyld_stub_binding_helper$pb(%eax)\n" " movl Ldyld_lazy_binder-Ldyld_stub_binding_helper$pb(%eax),%eax\n" " jmp *%eax\n" ); /* * __dyld section */ asm( " .dyld\n" " .p2align 2\n" "Ldyld_lazy_binder:\n" " .long 0x8fe01000\n" "Ldyld_func_lookup:\n" " .long 0x8fe01008\n" ); asm("\t.subsections_via_symbols\n"); IDENT("$Id: dylib1.c,v 1.1 2009/02/14 11:40:28 gmcgarry Exp $"); pcc-libs-20200614/csu/darwin/powerpc004075500017500000000000000000001367127322300160745ustar raggewheelpcc-libs-20200614/csu/darwin/powerpc/CVS004075500017500000000000000000001367127322300165275ustar raggewheelpcc-libs-20200614/csu/darwin/powerpc/CVS/Root010064400017500000000000000000111367127322300174410ustar raggewheel/cvsroot pcc-libs-20200614/csu/darwin/powerpc/CVS/Repository010064400017500000000000000000341367127322300207020ustar raggewheelpcc-libs/csu/darwin/powerpc pcc-libs-20200614/csu/darwin/powerpc/CVS/Entries010064400017500000000000000001221367127322300201320ustar raggewheel/crt0.c/1.5/Sat Feb 14 21:02:58 2009// /dylib1.c/1.1/Sat Feb 14 11:40:28 2009// D pcc-libs-20200614/csu/darwin/powerpc/crt0.c010064400017500000000000000062031114563060200171550ustar raggewheel/* $Id: crt0.c,v 1.5 2009/02/14 21:02:58 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" void _start(int, char **, char **); char **environ; char *__progname = ""; int NXArgc; char **NXArgv; asm( #ifdef DYNAMIC " .text\n" " .symbol_stub\n" " .picsymbol_stub\n" #endif " .text\n" " .globl start\n" " .globl _start\n" " .p2align 2\n" "start:\n" "_start:\n" " mr r26,r1\n" " subi r1,r1,4\n" " clrrwi r1,r1,5\n" " li r0,0\n" " stw r0,0(r1)\n" " stwu r1,-64(r1)\n" " lwz r3,0(r26)\n" " addi r4,r26,4\n" " addi r27,r3,1\n" " slwi r27,r27,2\n" " add r5,r4,r27\n" " bl __start\n" " trap\n" ); void _start(int argc, char *argv[], char *envp[]) { char *namep; environ = envp; NXArgc = argc; NXArgv = argv; if ((namep = argv[0]) != NULL) { if ((__progname = _strrchr(namep, '/')) == NULL) __progname = namep; else __progname++; } /* * Initialise hooks inside libc */ if (mach_init_routine) (*mach_init_routine)(); if (_cthread_init_routine) (*_cthread_init_routine)(); #ifdef PROFILE atexit(_mcleanup); moninit(); #endif atexit(_fini); _init(); exit(main(argc, argv, environ)); } #ifdef DYNAMIC /* * dylib constructors/destructors */ asm( " .constructor\n" " .p2align 2\n" " .long __dyld_init\n" " .destructor\n" " .p2align 2\n" " .long __dyld_fini\n" ); /* * void _dyld_func_lookup(const char *, void **); * * jump to the linker via the pointer in the __dyld section */ asm( " .text\n" " .p2align 2\n" " .private_extern __dyld_func_lookup\n" "__dyld_func_lookup:\n" " lis r11,ha16(Ldyld_func_lookup)\n" " lwz r11,lo16(Ldyld_func_lookup)(r11)\n" " mtctr r11\n" " bctr\n" ); /* * void dyld_stub_binding_helper(void) */ asm( " .text\n" " .p2align 2\n" " .private_extern dyld_stub_binding_helper\n" "dyld_stub_binding_helper:\n" " lis r12,ha16(Ldyld_lazy_binder)\n" " lwz r12,lo16(Ldyld_lazy_binder)(r12)\n" " mtctr r12\n" " lis r12,ha16(__mh_execute_header)\n" " addi r12,r12,lo16(__mh_execute_header)\n" " bctr\n" ); /* * __dyld section */ asm( " .dyld\n" " .p2align 2\n" "Ldyld_lazy_binder:\n" " .long 0x8fe01000\n" "Ldyld_func_lookup:\n" " .long 0x8fe01008\n" " .long __mh_execute_header\n" " .long _NXArgc\n" " .long _NXArgv\n" " .long _environ\n" " .long ___progname\n" ); #endif asm("\t.subsections_via_symbols\n"); #include "common.c" IDENT("$Id: crt0.c,v 1.5 2009/02/14 21:02:58 gmcgarry Exp $"); pcc-libs-20200614/csu/darwin/powerpc/dylib1.c010064400017500000000000000046341114552665400175120ustar raggewheel/* $Id: dylib1.c,v 1.1 2009/02/14 11:40:28 gmcgarry Exp $ */ /*- * Copyright (c) 2009 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .text\n" " .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32" ); /* * void _dyld_func_lookup(const char *, void **); * * jump to the linker via the pointer in the __dyld section */ asm( " .text\n" " .p2align 2\n" " .private_extern __dyld_func_lookup\n" "__dyld_func_lookup:\n" " mflr r0\n" " bcl 20,31,L__dyld_func_lookup$pb\n" "L__dyld_func_lookup$pb:\n" " mflr r11\n" " mtlr r0\n" " addis r11,r11,ha16(Ldyld_func_lookup-L__dyld_func_lookup$pb)\n" " lwz r11,lo16(Ldyld_func_lookup-L__dyld_func_lookup$pb)(r11)\n" " mtctr r11\n" " bctr\n" ); /* * void dyld_stub_binding_helper(void) */ asm( " .data\n" " .p2align 2\n" "dyld__mach_header:\n" " .long __mh_dylib_header\n" " .text\n" " .p2align 2\n" " .private_extern dyld_stub_binding_helper\n" "dyld_stub_binding_helper:\n" " mflr r0\n" " bcl 20,31,Ldyld_stub_binding_helper$pb\n" "Ldyld_stub_binding_helper$pb:\n" " mflr r12\n" " mtlr r0\n" " mr r0,r12\n" " addis r12,r12,ha16(Ldyld_lazy_binder-Ldyld_stub_binding_helper$pb)\n" " lwz r12,lo16(Ldyld_lazy_binder-Ldyld_stub_binding_helper$pb)(r12)\n" " mtctr r12\n" " mr r12,r0\n" " addis r12,r12,ha16(dyld__mach_header-Ldyld_stub_binding_helper$pb)\n" " lwz r12,lo16(dyld__mach_header-Ldyld_stub_binding_helper$pb)(r12)\n" " bctr\n" ); /* * __dyld section */ asm( " .dyld\n" " .p2align 2\n" "Ldyld_lazy_binder:\n" " .long 0x8fe01000\n" "Ldyld_func_lookup:\n" " .long 0x8fe01008\n" ); asm("\t.subsections_via_symbols\n"); IDENT("$Id: dylib1.c,v 1.1 2009/02/14 11:40:28 gmcgarry Exp $"); pcc-libs-20200614/csu/linux004075500017500000000000000000001367127322300142705ustar raggewheelpcc-libs-20200614/csu/linux/CVS004075500017500000000000000000001367127322300147235ustar raggewheelpcc-libs-20200614/csu/linux/CVS/Root010064400017500000000000000000111367127322300156350ustar raggewheel/cvsroot pcc-libs-20200614/csu/linux/CVS/Repository010064400017500000000000000000231367127322300170740ustar raggewheelpcc-libs/csu/linux pcc-libs-20200614/csu/linux/CVS/Entries010064400017500000000000000003511367127322300163320ustar raggewheel/Makefile/1.10/Mon Oct 13 11:07:26 2014// /common.c/1.4/Fri Jan 23 07:10:09 2009// /common.h/1.5/Sat Feb 14 23:49:40 2009// /crtbegin.c/1.8/Sun Sep 28 08:25:21 2014// /crtend.c/1.4/Tue Apr 12 04:44:19 2011// D/amd64//// D/i386//// D pcc-libs-20200614/csu/linux/Makefile010064400017500000000000000022021241673115600160000ustar raggewheelMACH ?= i386 TARGET ?= $(MACH)-linux VERSION ?= 1.1.0 PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib SRCDIR ?= . CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes #OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o \ # crtbeginS.o crtendS.o crtbeginT.o crtendT.o OBJS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o all: $(OBJS) crt0.o: $(MACH)/crt0.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crt1.o: $(MACH)/crt0.c $(CC) -O2 $(CFLAGS) -c -o $@ $< gcrt1.o: $(MACH)/crt0.c $(CC) -O2 -DPROFILE $(CFLAGS) -c -o $@ $< crti.o: $(MACH)/crti.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crtn.o: $(MACH)/crtn.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crtbegin.o: crtbegin.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crtend.o: crtend.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crtbeginS.o: crtbegin.c $(CC) -O2 $(CFLAGS) -fpic -c -o $@ $< crtendS.o: crtend.c $(CC) -O2 $(CFLAGS) -fpic -c -o $@ $< crtbeginT.o: crtbegin.c $(CC) -O2 $(CFLAGS) -c -o $@ $< crtendT.o: crtend.c $(CC) -O2 $(CFLAGS) -c -o $@ $< install: mkdir -p ${DESTDIR}$(PCCLIBDIR) cp $(OBJS) ${DESTDIR}$(PCCLIBDIR) clean: rm -f $(OBJS) pcc-libs-20200614/csu/linux/common.c010064400017500000000000000017371113626652100160050ustar raggewheel/* $Id: common.c,v 1.4 2009/01/23 07:10:09 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" #ifdef PROFILE asm(" .text\n_eprol:"); #endif IDENT("$Id: common.c,v 1.4 2009/01/23 07:10:09 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/common.h010064400017500000000000000023201114565422400160000ustar raggewheel/* $Id: common.h,v 1.5 2009/02/14 23:49:40 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define IDENT(x) asm(".ident\t\"" x "\"") #define NULL (void *)0 extern int main(int argc, char *argv[], char *envp[]); extern void exit(int); extern int atexit(void (*fcn)(void)); #if PROFILE extern void monstartup(unsigned long, unsigned long); extern void _mcleanup(void); extern unsigned char _etext, _eprol; #endif extern void _init(void); extern void _fini(void); pcc-libs-20200614/csu/linux/crtbegin.c010064400017500000000000000062001241174276100163020ustar raggewheel/* $Id: crtbegin.c,v 1.8 2014/09/28 08:25:21 ragge Exp $ */ /*- * Copyright (c) 1998, 2001, 2002 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Paul Kranenburg, Ross Harvey, and Jason R. Thorpe. * * 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. * * 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. */ /* * Run-time module which handles constructors and destructors. */ #include "common.h" void __do_global_ctors_aux(void); void __do_global_dtors_aux(void); extern void (*__CTOR_LIST__[1])(void); extern void (*__DTOR_LIST__[1])(void); asm( " .section .ctors,\"aw\",@progbits\n" " .align 4\n" "__CTOR_LIST__:\n" #ifdef __x86_64__ " .quad -1\n" #else " .long -1\n" #endif " .section .dtors,\"aw\",@progbits\n" " .align 4\n" "__DTOR_LIST__:\n" #ifdef __x86_64__ " .quad -1\n" #else " .long -1\n" #endif ); static void __ctors(void) { unsigned long i = (unsigned long) __CTOR_LIST__[0]; void (**p)(void); if (i == (unsigned long) -1) { for (i = 1; __CTOR_LIST__[i]; i++) ; i--; } p = __CTOR_LIST__ + i; while (i--) (**p--)(); } static void __dtors(void) { void (**p)(void) = __DTOR_LIST__ + 1; while (*p) (**p++)(); } __attribute__((__visibility__("hidden"), __noinline__)) void __do_global_ctors_aux(void) { static int initialized; if (!initialized) { initialized = 1; __ctors(); } } __attribute__((__visibility__("hidden"), __noinline__)) void __do_global_dtors_aux(void) { static int finished; if (finished) return; __dtors(); finished = 1; } #define MD_CALL_STATIC_FUNCTION(section, func) \ void __call_##func(void); \ void __call_##func(void) \ { \ asm volatile (".section " #section); \ func(); \ asm volatile (".previous"); \ } MD_CALL_STATIC_FUNCTION(.init, __do_global_ctors_aux) MD_CALL_STATIC_FUNCTION(.fini, __do_global_dtors_aux) IDENT("$Id: crtbegin.c,v 1.8 2014/09/28 08:25:21 ragge Exp $"); pcc-libs-20200614/csu/linux/crtend.c010064400017500000000000000022111155075424300157630ustar raggewheel/* $Id: crtend.c,v 1.4 2011/04/12 04:44:19 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .ctors,\"aw\",@progbits\n" #ifdef __x86_64__ " .quad 0\n" #else " .long 0\n" #endif ); asm( " .section .dtors,\"aw\",@progbits\n" #ifdef __x86_64__ " .quad 0\n" #else " .long 0\n" #endif ); IDENT("$Id: crtend.c,v 1.4 2011/04/12 04:44:19 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/amd64004075500017500000000000000000001367127322300152035ustar raggewheelpcc-libs-20200614/csu/linux/amd64/CVS004075500017500000000000000000001367127322300156365ustar raggewheelpcc-libs-20200614/csu/linux/amd64/CVS/Root010064400017500000000000000000111367127322300165500ustar raggewheel/cvsroot pcc-libs-20200614/csu/linux/amd64/CVS/Repository010064400017500000000000000000311367127322300200060ustar raggewheelpcc-libs/csu/linux/amd64 pcc-libs-20200614/csu/linux/amd64/CVS/Entries010064400017500000000000000001671367127322300172520ustar raggewheel/crt0.c/1.2/Thu Sep 20 19:38:24 2012// /crti.c/1.1/Fri Aug 14 02:24:36 2009// /crtn.c/1.1/Fri Aug 14 02:24:36 2009// D pcc-libs-20200614/csu/linux/amd64/crt0.c010064400017500000000000000027371202667026000162770ustar raggewheel/* $Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $ */ /*- * Copyright (c) 2009 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" void __start(int, char **, char **); asm(" .text \n" " .align 4 \n" " .globl _start \n" "_start: \n" " movq %rbx,%r9 \n" " movq %rcx,%r8 \n" " movq %rdx,%rcx \n" " movq (%rsp),%rdi \n" " leaq 16(%rsp,%rdi,8),%rdx \n" " leaq 8(%rsp),%rsi \n" " andq $-16,%rsp \n" " callq __start \n"); /* cannot return */ void __start(int argc, char *argv[], char *envp[]) { #ifdef PROFILE atexit(_mcleanup); monstartup((unsigned long)&_eprol, (unsigned long)&_etext); #endif _init(); atexit(_fini); exit(main(argc, argv, envp)); } #include "common.c" IDENT("$Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $"); pcc-libs-20200614/csu/linux/amd64/crti.c010064400017500000000000000022311124114534400163530ustar raggewheel/* $Id: crti.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $ */ /*- * Copyright (c) 2009 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .init \n" " .globl _init \n" " .align 16 \n" "_init: \n" " subq $8,%rsp \n" " .previous \n"); asm( " .section .fini \n" " .globl _fini \n" " .align 16 \n" "_fini: \n" " subq $8,%rsp \n" " .previous \n"); IDENT("$Id: crti.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/amd64/crtn.c010064400017500000000000000021301124114534400163560ustar raggewheel/* $Id: crtn.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $ */ /*- * Copyright (c) 2009 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .init \n" " addq $8,%rsp \n" " ret \n" " .previous \n"); asm( " .section .fini \n" " addq $8,%rsp \n" " ret \n" " .previous \n"); IDENT("$Id: crtn.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/i386004075500017500000000000000000001367127322300147615ustar raggewheelpcc-libs-20200614/csu/linux/i386/CVS004075500017500000000000000000001367127322300154145ustar raggewheelpcc-libs-20200614/csu/linux/i386/CVS/Root010064400017500000000000000000111367127322300163260ustar raggewheel/cvsroot pcc-libs-20200614/csu/linux/i386/CVS/Repository010064400017500000000000000000301367127322300175630ustar raggewheelpcc-libs/csu/linux/i386 pcc-libs-20200614/csu/linux/i386/CVS/Entries010064400017500000000000000001671367127322300170300ustar raggewheel/crt0.c/1.4/Sat Feb 14 23:49:40 2009// /crti.c/1.2/Wed Jul 2 00:19:20 2008// /crtn.c/1.2/Wed Jul 2 00:19:20 2008// D pcc-libs-20200614/csu/linux/i386/crt0.c010064400017500000000000000030511114565422400160460ustar raggewheel/* $Id: crt0.c,v 1.4 2009/02/14 23:49:40 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" void __start(int, char **, char **); asm(" .text \n" " .align 4 \n" " .globl _start \n" "_start: \n" " xorl %ebp,%ebp \n" " popl %ebx \n" " movl %esp,%ecx \n" " subl $16,%esp \n" " andl $-16,%esp \n" " movl %ebx,(%esp) \n" " movl %ecx,4(%esp) \n" " addl $1,%ebx \n" " shll $2,%ebx \n" " addl %ebx,%ecx \n" " movl %ecx,8(%esp) \n" " call __start \n" " hlt \n"); void __start(int argc, char *argv[], char *envp[]) { #ifdef PROFILE atexit(_mcleanup); monstartup((unsigned long)&_eprol, (unsigned long)&_etext); #endif _init(); atexit(_fini); exit(main(argc, argv, envp)); } #include "common.c" IDENT("$Id: crt0.c,v 1.4 2009/02/14 23:49:40 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/i386/crti.c010064400017500000000000000022751103254461000161360ustar raggewheel/* $Id: crti.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .init \n" " .globl _init \n" " .align 16 \n" "_init: \n" " push %ebp \n" " mov %esp,%ebp \n" " .previous \n"); asm( " .section .fini \n" " .globl _fini \n" " .align 16 \n" "_fini: \n" " push %ebp \n" " mov %esp,%ebp \n" " .previous \n"); IDENT("$Id: crti.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $"); pcc-libs-20200614/csu/linux/i386/crtn.c010064400017500000000000000021141103254461000161330ustar raggewheel/* $Id: crtn.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .init \n" " leave \n" " ret \n" " .previous \n"); asm( " .section .fini \n" " leave \n" " ret \n" " .previous \n"); IDENT("$Id: crtn.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $"); pcc-libs-20200614/csu/netbsd004075500017500000000000000000001367127322300144105ustar raggewheelpcc-libs-20200614/csu/netbsd/CVS004075500017500000000000000000001367127322300150435ustar raggewheelpcc-libs-20200614/csu/netbsd/CVS/Root010064400017500000000000000000111367127322300157550ustar raggewheel/cvsroot pcc-libs-20200614/csu/netbsd/CVS/Repository010064400017500000000000000000241367127322300172150ustar raggewheelpcc-libs/csu/netbsd pcc-libs-20200614/csu/netbsd/CVS/Entries010064400017500000000000000002501367127322300164500ustar raggewheel/Makefile/1.4/Mon Oct 13 11:07:26 2014// /common.h/1.1/Sun Aug 24 05:19:10 2008// /crtbegin.c/1.3/Sun Aug 16 23:07:08 2009// /crtend.c/1.2/Sun Aug 16 23:07:08 2009// D pcc-libs-20200614/csu/netbsd/Makefile010064400017500000000000000007201241673115600161230ustar raggewheelMACH ?= i386 TARGET ?= $(MACH)-netbsd VERSION ?= 1.1.0 PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib SRCDIR ?= . CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes OBJS = crtbegin.o crtend.o all: $(OBJS) crtbegin.o: crtbegin.c $(CC) -O $(CFLAGS) -c -o $@ $< crtend.o: crtend.c $(CC) -O $(CFLAGS) -c -o $@ $< install: mkdir -p $(DESTDIR)$(PCCLIBDIR) cp $(OBJS) $(DESTDIR)$(PCCLIBDIR) clean: rm -f $(OBJS) pcc-libs-20200614/csu/netbsd/common.h010064400017500000000000000017171105416751600161330ustar raggewheel/* $Id: common.h,v 1.1 2008/08/24 05:19:10 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define IDENT(x) asm(".ident\t\"" x "\"") #define NULL (void *)0 extern void _init(void); extern void _fini(void); pcc-libs-20200614/csu/netbsd/crtbegin.c010064400017500000000000000057341124211043400164200ustar raggewheel/* $Id: crtbegin.c,v 1.3 2009/08/16 23:07:08 gmcgarry Exp $ */ /*- * Copyright (c) 1998, 2001, 2002 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Paul Kranenburg, Ross Harvey, and Jason R. Thorpe. * * 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. * * 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. */ /* * Run-time module which handles constructors and destructors. */ #include "common.h" extern void (*__CTOR_LIST__[1])(void); extern void (*__DTOR_LIST__[1])(void); asm( " .section .ctors\n" " .align 2\n" "__CTOR_LIST__:\n" #if defined(__x86_64__) || (__sparc64__) " .quad -1\n" #else " .long -1\n" #endif " .section .dtors\n" " .align 2\n" "__DTOR_LIST__:\n" #if defined(__x86_64__) || (__sparc64__) " .quad -1\n" #else " .long -1\n" #endif ); static void __ctors(void) { unsigned long i = (unsigned long) __CTOR_LIST__[0]; void (**p)(void); if (i == (unsigned long) -1) { for (i = 1; __CTOR_LIST__[i]; i++) ; i--; } p = __CTOR_LIST__ + i; while (i--) (**p--)(); } static void __dtors(void) { void (**p)(void) = __DTOR_LIST__ + 1; while (*p) (**p++)(); } void __do_global_ctors_aux(void) { static int initialized; if (!initialized) { initialized = 1; __ctors(); } } void __do_global_dtors_aux(void) { static int finished; if (finished) return; __dtors(); finished = 1; } #define MD_CALL_STATIC_FUNCTION(section, func) \ void __call_##func(void); \ void __call_##func(void) \ { \ asm volatile (".section " #section); \ func(); \ asm volatile (".previous"); \ } MD_CALL_STATIC_FUNCTION(.init, __do_global_ctors_aux) MD_CALL_STATIC_FUNCTION(.fini, __do_global_dtors_aux) IDENT("$Id: crtbegin.c,v 1.3 2009/08/16 23:07:08 gmcgarry Exp $"); pcc-libs-20200614/csu/netbsd/crtend.c010064400017500000000000000022431124211043400160720ustar raggewheel/* $Id: crtend.c,v 1.2 2009/08/16 23:07:08 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "common.h" asm( " .section .ctors\n" #if defined(__x86_64__) || defined(__sparc64__) " .quad 0\n" #else " .long 0\n" #endif ); asm( " .section .dtors\n" #if defined(__x86_64__) || defined(__sparc64__) " .quad 0\n" #else " .long 0\n" #endif ); IDENT("$Id: crtend.c,v 1.2 2009/08/16 23:07:08 gmcgarry Exp $"); pcc-libs-20200614/libF77004075500017500000000000000000001367127322300133715ustar raggewheelpcc-libs-20200614/libF77/CVS004075500017500000000000000000001367127322300140245ustar raggewheelpcc-libs-20200614/libF77/CVS/Root010064400017500000000000000000111367127322300147360ustar raggewheel/cvsroot pcc-libs-20200614/libF77/CVS/Repository010064400017500000000000000000201367127322300161720ustar raggewheelpcc-libs/libF77 pcc-libs-20200614/libF77/CVS/Entries010064400017500000000000000107331367127322300154400ustar raggewheel/Makefile/1.3/Wed Apr 27 09:12:55 2011// /abort_.c/1.3/Thu Feb 28 16:48:50 2008// /c_abs.c/1.3/Thu Feb 28 16:48:50 2008// /c_cos.c/1.3/Thu Feb 28 16:48:50 2008// /c_div.c/1.3/Thu Feb 28 16:48:50 2008// /c_exp.c/1.3/Thu Feb 28 16:48:50 2008// /c_log.c/1.3/Thu Feb 28 16:48:50 2008// /c_sin.c/1.3/Thu Feb 28 16:48:50 2008// /c_sqrt.c/1.3/Thu Feb 28 16:48:50 2008// /cabs.c/1.3/Thu Feb 28 16:48:50 2008// /complex/1.2/Tue Feb 26 19:54:41 2008// /d_abs.c/1.3/Thu Feb 28 16:48:50 2008// /d_acos.c/1.3/Thu Feb 28 16:48:50 2008// /d_asin.c/1.3/Thu Feb 28 16:48:50 2008// /d_atan.c/1.3/Thu Feb 28 16:48:50 2008// /d_atn2.c/1.3/Thu Feb 28 16:48:50 2008// /d_cnjg.c/1.3/Thu Feb 28 16:48:50 2008// /d_cos.c/1.3/Thu Feb 28 16:48:50 2008// /d_cosh.c/1.3/Thu Feb 28 16:48:50 2008// /d_dim.c/1.3/Thu Feb 28 16:48:50 2008// /d_erf.c/1.3/Thu Feb 28 16:48:50 2008// /d_erfc.c/1.3/Thu Feb 28 16:48:50 2008// /d_exp.c/1.3/Thu Feb 28 16:48:50 2008// /d_imag.c/1.3/Thu Feb 28 16:48:50 2008// /d_int.c/1.3/Thu Feb 28 16:48:50 2008// /d_lg10.c/1.3/Thu Feb 28 16:48:50 2008// /d_log.c/1.3/Thu Feb 28 16:48:50 2008// /d_mod.c/1.3/Thu Feb 28 16:48:50 2008// /d_nint.c/1.3/Thu Feb 28 16:48:50 2008// /d_prod.c/1.3/Thu Feb 28 16:48:50 2008// /d_sign.c/1.3/Thu Feb 28 16:48:50 2008// /d_sin.c/1.3/Thu Feb 28 16:48:50 2008// /d_sinh.c/1.3/Thu Feb 28 16:48:50 2008// /d_sqrt.c/1.3/Thu Feb 28 16:48:50 2008// /d_tan.c/1.3/Thu Feb 28 16:48:50 2008// /d_tanh.c/1.3/Thu Feb 28 16:48:50 2008// /erf.c/1.2/Tue Feb 26 19:54:41 2008// /f77lib.h/1.1/Thu Feb 28 16:48:50 2008// /getarg_.c/1.3/Thu Feb 28 16:48:50 2008// /h_abs.c/1.3/Thu Feb 28 16:48:50 2008// /h_dim.c/1.3/Thu Feb 28 16:48:50 2008// /h_dnnt.c/1.3/Thu Feb 28 16:48:50 2008// /h_indx.c/1.3/Thu Feb 28 16:48:50 2008// /h_len.c/1.3/Thu Feb 28 16:48:50 2008// /h_mod.c/1.3/Thu Feb 28 16:48:50 2008// /h_nint.c/1.3/Thu Feb 28 16:48:50 2008// /h_sign.c/1.3/Thu Feb 28 16:48:50 2008// /hl_ge.c/1.3/Thu Feb 28 16:48:50 2008// /hl_gt.c/1.3/Thu Feb 28 16:48:50 2008// /hl_le.c/1.3/Thu Feb 28 16:48:50 2008// /hl_lt.c/1.3/Thu Feb 28 16:48:50 2008// /i_abs.c/1.3/Thu Feb 28 16:48:50 2008// /i_dim.c/1.3/Thu Feb 28 16:48:50 2008// /i_dnnt.c/1.3/Thu Feb 28 16:48:50 2008// /i_indx.c/1.3/Thu Feb 28 16:48:50 2008// /i_len.c/1.3/Thu Feb 28 16:48:50 2008// /i_mod.c/1.3/Thu Feb 28 16:48:50 2008// /i_nint.c/1.3/Thu Feb 28 16:48:50 2008// /i_sign.c/1.3/Thu Feb 28 16:48:50 2008// /iargc_.c/1.3/Thu Feb 28 16:48:50 2008// /l_ge.c/1.3/Thu Feb 28 16:48:50 2008// /l_gt.c/1.3/Thu Feb 28 16:48:50 2008// /l_le.c/1.3/Thu Feb 28 16:48:50 2008// /l_lt.c/1.3/Thu Feb 28 16:48:50 2008// /main.c/1.3/Thu Feb 28 16:48:50 2008// /pow_ci.c/1.3/Thu Feb 28 16:48:50 2008// /pow_dd.c/1.3/Thu Feb 28 16:48:50 2008// /pow_di.c/1.3/Thu Feb 28 16:48:50 2008// /pow_hh.c/1.3/Thu Feb 28 16:48:50 2008// /pow_ii.c/1.3/Thu Feb 28 16:48:50 2008// /pow_ri.c/1.3/Thu Feb 28 16:48:50 2008// /pow_zi.c/1.3/Wed Feb 27 17:09:54 2008// /pow_zz.c/1.4/Thu Feb 28 16:48:50 2008// /r_abs.c/1.3/Thu Feb 28 16:48:50 2008// /r_acos.c/1.3/Thu Feb 28 16:48:50 2008// /r_asin.c/1.3/Thu Feb 28 16:48:50 2008// /r_atan.c/1.3/Thu Feb 28 16:48:50 2008// /r_atn2.c/1.3/Thu Feb 28 16:48:50 2008// /r_cnjg.c/1.3/Thu Feb 28 16:48:50 2008// /r_cos.c/1.3/Thu Feb 28 16:48:50 2008// /r_cosh.c/1.3/Thu Feb 28 16:48:50 2008// /r_dim.c/1.3/Thu Feb 28 16:48:50 2008// /r_erf.c/1.2/Tue Feb 26 19:54:41 2008// /r_erfc.c/1.2/Tue Feb 26 19:54:41 2008// /r_exp.c/1.3/Thu Feb 28 16:48:50 2008// /r_imag.c/1.3/Thu Feb 28 16:48:50 2008// /r_int.c/1.3/Thu Feb 28 16:48:50 2008// /r_lg10.c/1.3/Thu Feb 28 16:48:50 2008// /r_log.c/1.3/Thu Feb 28 16:48:50 2008// /r_mod.c/1.3/Thu Feb 28 16:48:50 2008// /r_nint.c/1.3/Thu Feb 28 16:48:50 2008// /r_sign.c/1.3/Thu Feb 28 16:48:50 2008// /r_sin.c/1.3/Thu Feb 28 16:48:50 2008// /r_sinh.c/1.3/Thu Feb 28 16:48:50 2008// /r_sqrt.c/1.3/Thu Feb 28 16:48:50 2008// /r_tan.c/1.3/Thu Feb 28 16:48:50 2008// /r_tanh.c/1.3/Thu Feb 28 16:48:50 2008// /s_cat.c/1.3/Thu Feb 28 16:48:50 2008// /s_cmp.c/1.3/Thu Feb 28 16:48:50 2008// /s_copy.c/1.3/Thu Feb 28 16:48:50 2008// /s_paus.c/1.3/Thu Feb 28 16:48:50 2008// /s_rnge.c/1.3/Thu Feb 28 16:48:50 2008// /s_stop.c/1.3/Thu Feb 28 16:48:50 2008// /signal_.c/1.3/Thu Feb 28 16:48:50 2008// /sinh.c/1.2/Tue Feb 26 19:54:41 2008// /tanh.c/1.2/Tue Feb 26 19:54:41 2008// /z_abs.c/1.3/Thu Feb 28 16:48:50 2008// /z_cos.c/1.3/Thu Feb 28 16:48:50 2008// /z_div.c/1.3/Thu Feb 28 16:48:50 2008// /z_exp.c/1.3/Thu Feb 28 16:48:50 2008// /z_log.c/1.3/Thu Feb 28 16:48:50 2008// /z_sin.c/1.3/Thu Feb 28 16:48:50 2008// /z_sqrt.c/1.3/Thu Feb 28 16:48:50 2008// D pcc-libs-20200614/libF77/Makefile010064400017500000000000000024771155575702700151270ustar raggewheel# compile, then strip unnecessary symbols CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes .c.o : cc -O $(CFLAGS) -c $< -ld -r -x $*.o mv a.out $*.o MISC = main.o s_rnge.o abort_.o getarg_.o iargc_.o signal_.o s_stop.o s_paus.o POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\ d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\ d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\ d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\ d_sqrt.o d_tan.o d_tanh.o INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o CHAR = s_cat.o s_cmp.o s_copy.o libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(CHAR) cabs.o ar r libF77.a $? clean distclean: rm -f $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) \ $(CMP) $(CHAR) cabs.o libF77.a pcc-libs-20200614/libF77/abort_.c010064400017500000000000000037651076156276200151000ustar raggewheel/* $Id: abort_.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include "f77lib.h" void abort_(void) { fprintf(stderr, "Fortran abort routine called\n"); abort(); } pcc-libs-20200614/libF77/c_abs.c010064400017500000000000000037151076156276200146740ustar raggewheel/* $Id: c_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" float c_abs(complex *z) { return( fcabs( z->real, z->imag ) ); } pcc-libs-20200614/libF77/c_cos.c010064400017500000000000000040061076156276200147050ustar raggewheel/* $Id: c_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_cos(complex *r, complex *z) { r->real = cos(z->real) * cosh(z->imag); r->imag = - sin(z->real) * sinh(z->imag); } pcc-libs-20200614/libF77/c_div.c010064400017500000000000000047331076156276200147120ustar raggewheel/* $Id: c_div.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_div(complex *c, complex *a, complex *b) { double ratio, den; double abr, abi; if( (abr = b->real) < 0.) abr = - abr; if( (abi = b->imag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->real / b->imag ; den = b->imag * (1 + ratio*ratio); c->real = (a->real*ratio + a->imag) / den; c->imag = (a->imag*ratio - a->real) / den; } else { ratio = b->imag / b->real ; den = b->real * (1 + ratio*ratio); c->real = (a->real + a->imag*ratio) / den; c->imag = (a->imag - a->real*ratio) / den; } } pcc-libs-20200614/libF77/c_exp.c010064400017500000000000000040271076156276200147200ustar raggewheel/* $Id: c_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_exp(complex *r, complex *z) { double expx; expx = exp(z->real); r->real = expx * cos(z->imag); r->imag = expx * sin(z->imag); } pcc-libs-20200614/libF77/c_log.c010064400017500000000000000040021076156276200146760ustar raggewheel/* $Id: c_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_log(complex *r, complex *z) { r->imag = atan2(z->imag, z->real); r->real = log( fcabs(z->real, z->imag) ); } pcc-libs-20200614/libF77/c_sin.c010064400017500000000000000040061076156276200147120ustar raggewheel/* $Id: c_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_sin(complex *r, complex *z) { r->real = sin(z->real) * cosh(z->imag); r->imag = cos(z->real) * sinh(z->imag); } pcc-libs-20200614/libF77/c_sqrt.c010064400017500000000000000043611076156276200151160ustar raggewheel/* $Id: c_sqrt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void c_sqrt(complex *r, complex *z) { double mag; if( (mag = fcabs(z->real, z->imag)) == 0.) r->real = r->imag = 0.; else if(z->real > 0) { r->real = sqrt(0.5 * (mag + z->real) ); r->imag = z->imag / r->real / 2; } else { r->imag = sqrt(0.5 * (mag - z->real) ); if(z->imag < 0) r->imag = - r->imag; r->real = z->imag / r->imag /2; } } pcc-libs-20200614/libF77/cabs.c010064400017500000000000000043031076156276200145270ustar raggewheel/* $Id: cabs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double fcabs(double real, double imag) { double temp; if(real < 0) real = -real; if(imag < 0) imag = -imag; if(imag > real){ temp = real; real = imag; imag = temp; } if((real+imag) == real) return(real); temp = imag/real; temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ return(temp); } pcc-libs-20200614/libF77/complex010064400017500000000000000037031076106720100150340ustar raggewheel/* $Id: complex,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ typedef struct { float real, imag; } complex; typedef struct { double dreal, dimag; } dcomplex; pcc-libs-20200614/libF77/d_abs.c010064400017500000000000000036761076156276200147030ustar raggewheel/* $Id: d_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_abs(double *x) { if(*x >= 0) return(*x); return(- *x); } pcc-libs-20200614/libF77/d_acos.c010064400017500000000000000036771076156276200150640ustar raggewheel/* $Id: d_acos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_acos(double *x) { return( acos(*x) ); } pcc-libs-20200614/libF77/d_asin.c010064400017500000000000000036771076156276200150710ustar raggewheel/* $Id: d_asin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_asin(double *x) { return( asin(*x) ); } pcc-libs-20200614/libF77/d_atan.c010064400017500000000000000036771076156276200150620ustar raggewheel/* $Id: d_atan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_atan(double *x) { return( atan(*x) ); } pcc-libs-20200614/libF77/d_atn2.c010064400017500000000000000037151076156276200147740ustar raggewheel/* $Id: d_atn2.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_atn2(double *x,double *y) { return( atan2(*x,*y) ); } pcc-libs-20200614/libF77/d_cnjg.c010064400017500000000000000037211076156276200150460ustar raggewheel/* $Id: d_cnjg.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void d_cnjg(dcomplex *r, dcomplex *z) { r->dreal = z->dreal; r->dimag = - z->dimag; } pcc-libs-20200614/libF77/d_cos.c010064400017500000000000000036741076156276200147200ustar raggewheel/* $Id: d_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_cos(double *x) { return( cos(*x) ); } pcc-libs-20200614/libF77/d_cosh.c010064400017500000000000000036771076156276200150730ustar raggewheel/* $Id: d_cosh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_cosh(double *x) { return( cosh(*x) ); } pcc-libs-20200614/libF77/d_dim.c010064400017500000000000000036771076156276200147100ustar raggewheel/* $Id: d_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_dim(double *a,double *b) { return( *a > *b ? *a - *b : 0); } pcc-libs-20200614/libF77/d_erf.c010064400017500000000000000036741076156276200147100ustar raggewheel/* $Id: d_erf.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double derf_(double *x) { return( erf(*x) ); } pcc-libs-20200614/libF77/d_erfc.c010064400017500000000000000036771076156276200150560ustar raggewheel/* $Id: d_erfc.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double derfc_(double *x) { return( erfc(*x) ); } pcc-libs-20200614/libF77/d_exp.c010064400017500000000000000036741076156276200147300ustar raggewheel/* $Id: d_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_exp(double *x) { return( exp(*x) ); } pcc-libs-20200614/libF77/d_imag.c010064400017500000000000000036531076156276200150460ustar raggewheel/* $Id: d_imag.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_imag(dcomplex *z) { return(z->dimag); } pcc-libs-20200614/libF77/d_int.c010064400017500000000000000036601076156276200147210ustar raggewheel/* $Id: d_int.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_int(double *x) { return( (long int) (*x) ); } pcc-libs-20200614/libF77/d_lg10.c010064400017500000000000000037121076156276200146700ustar raggewheel/* $Id: d_lg10.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_lg10(double *x) { return( M_LOG10E * log(*x) ); } pcc-libs-20200614/libF77/d_log.c010064400017500000000000000036741076156276200147150ustar raggewheel/* $Id: d_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_log(double *x) { return( log(*x) ); } pcc-libs-20200614/libF77/d_mod.c010064400017500000000000000037151076156276200147070ustar raggewheel/* $Id: d_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_mod(double *x,double *y) { return(*x - (*y) * ( (long int) (*x / *y)) ); } pcc-libs-20200614/libF77/d_nint.c010064400017500000000000000037321076156276200150770ustar raggewheel/* $Id: d_nint.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_nint(double *x) { return( (*x)>=0 ? (long int) (*x + .5) : (long int) (*x - .5) ); } pcc-libs-20200614/libF77/d_prod.c010064400017500000000000000036661076156276200151010ustar raggewheel/* $Id: d_prod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_prod(float *x,float *y) { return( (*x) * (*y) ); } pcc-libs-20200614/libF77/d_sign.c010064400017500000000000000037441076156276200150720ustar raggewheel/* $Id: d_sign.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double d_sign(double *a,double *b) { double x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } pcc-libs-20200614/libF77/d_sin.c010064400017500000000000000036741076156276200147250ustar raggewheel/* $Id: d_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_sin(double *x) { return( sin(*x) ); } pcc-libs-20200614/libF77/d_sinh.c010064400017500000000000000036771076156276200151000ustar raggewheel/* $Id: d_sinh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_sinh(double *x) { return( sinh(*x) ); } pcc-libs-20200614/libF77/d_sqrt.c010064400017500000000000000036771076156276200151300ustar raggewheel/* $Id: d_sqrt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_sqrt(double *x) { return( sqrt(*x) ); } pcc-libs-20200614/libF77/d_tan.c010064400017500000000000000036741076156276200147160ustar raggewheel/* $Id: d_tan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_tan(double *x) { return( tan(*x) ); } pcc-libs-20200614/libF77/d_tanh.c010064400017500000000000000036771076156276200150710ustar raggewheel/* $Id: d_tanh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double d_tanh(double *x) { return( tanh(*x) ); } pcc-libs-20200614/libF77/erf.c010064400017500000000000000102571076106720100143640ustar raggewheel/* $Id: erf.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* C program for floating point error function erf(x) returns the error function of its argument erfc(x) returns 1.0-erf(x) erf(x) is defined by ${2 over sqrt(pi)} int from 0 to x e sup {-t sup 2} dt$ the entry for erfc is provided because of the extreme loss of relative accuracy if erf(x) is called for large x and the result subtracted from 1. (e.g. for x= 10, 12 places are lost). There are no error returns. Calls exp. Coefficients for large x are #5667 from Hart & Cheney (18.72D). */ #define M 7 #define N 9 int errno; static double torp = 1.1283791670955125738961589031; static double p1[] = { 0.804373630960840172832162e5, 0.740407142710151470082064e4, 0.301782788536507577809226e4, 0.380140318123903008244444e2, 0.143383842191748205576712e2, -.288805137207594084924010e0, 0.007547728033418631287834e0, }; static double q1[] = { 0.804373630960840172826266e5, 0.342165257924628539769006e5, 0.637960017324428279487120e4, 0.658070155459240506326937e3, 0.380190713951939403753468e2, 0.100000000000000000000000e1, 0.0, }; static double p2[] = { 0.18263348842295112592168999e4, 0.28980293292167655611275846e4, 0.2320439590251635247384768711e4, 0.1143262070703886173606073338e4, 0.3685196154710010637133875746e3, 0.7708161730368428609781633646e2, 0.9675807882987265400604202961e1, 0.5641877825507397413087057563e0, 0.0, }; static double q2[] = { 0.18263348842295112595576438e4, 0.495882756472114071495438422e4, 0.60895424232724435504633068e4, 0.4429612803883682726711528526e4, 0.2094384367789539593790281779e4, 0.6617361207107653469211984771e3, 0.1371255960500622202878443578e3, 0.1714980943627607849376131193e2, 1.0, }; double erf(arg) double arg;{ double erfc(); int sign; double argsq; double d, n; int i; errno = 0; sign = 1; if(arg < 0.){ arg = -arg; sign = -1; } if(arg < 0.5){ argsq = arg*arg; for(n=0,d=0,i=M-1; i>=0; i--){ n = n*argsq + p1[i]; d = d*argsq + q1[i]; } return(sign*torp*arg*n/d); } if(arg >= 10.) return(sign*1.); return(sign*(1. - erfc(arg))); } double erfc(arg) double arg;{ double erf(); double exp(); double n, d; int i; errno = 0; if(arg < 0.) return(2. - erfc(-arg)); /* if(arg < 0.5) return(1. - erf(arg)); */ if(arg >= 10.) return(0.); for(n=0,d=0,i=N-1; i>=0; i--){ n = n*arg + p2[i]; d = d*arg + q2[i]; } return(exp(-arg*arg)*n/d); } pcc-libs-20200614/libF77/f77lib.h010064400017500000000000000073771076156276200147340ustar raggewheel/* declarations */ typedef struct { float real, imag; } complex; typedef struct { double dreal, dimag; } dcomplex; /* prototypes */ void s_rnge(char *varn, long int offset, char *procn, int line); void abort_(void); void getarg_(long int *n, char *s, long int ls); long int iargc_(void); void (*signal_(int *sigp, void (**procp)(int)))(int); void s_stop(char *s, long int n); void f_exit(void); void s_paus(char *s, long int n); void pow_ci(complex *p, complex *a, long int *b); void pow_zi(dcomplex *p, dcomplex *a, long int *b); double pow_dd(double *ap, double *bp); double pow_di(double *ap, long int *bp); short pow_hh(short *ap, short *bp); long int pow_ii(long int *ap, long int *bp); float pow_ri(float *ap, long int *bp); void z_div(dcomplex *c, dcomplex *a, dcomplex *b); void pow_zz(dcomplex *r,dcomplex *a,dcomplex *b); float c_abs(complex *z); void c_cos(complex *r, complex *z); void c_div(complex *c, complex *a, complex *b); void c_exp(complex *r, complex *z); void c_log(complex *r, complex *z); void c_sin(complex *r, complex *z); void c_sqrt(complex *r, complex *z); double z_abs(dcomplex *z); void z_cos(dcomplex *r, dcomplex *z); void z_exp(dcomplex *r, dcomplex *z); void z_log(dcomplex *r, dcomplex *z); void z_sin(dcomplex *r, dcomplex *z); void z_sqrt(dcomplex *r, dcomplex *z); double r_abs(float *x); double r_acos(float *x); double r_asin(float *x); double r_atan(float *x); double r_atn2(float *x,float *y); void r_cnjg(complex *r, complex *z); double r_cos(float *x); double r_cosh(float *x); double r_dim(float *a,float *b); double r_exp(float *x); double r_imag(complex *z); double r_int(float *x); double r_lg10(float *x); double r_log(float *x); double r_mod(float *x,float *y); double r_nint(float *x); double r_sign(float *a,float *b); double r_sin(float *x); double r_sinh(float *x); double r_sqrt(float *x); double r_tan(float *x); double r_tanh(float *x); double d_abs(double *x); double d_acos(double *x); double d_asin(double *x); double d_atan(double *x); double d_atn2(double *x,double *y); void d_cnjg(dcomplex *r, dcomplex *z); double d_cos(double *x); double d_cosh(double *x); double d_dim(double *a,double *b); double derf_(double *x); double derfc_(double *x); double d_exp(double *x); double d_imag(dcomplex *z); double d_int(double *x); double d_lg10(double *x); double d_log(double *x); double d_mod(double *x,double *y); double d_nint(double *x); double d_prod(float *x,float *y); double d_sign(double *a,double *b); double d_sin(double *x); double d_sinh(double *x); double d_sqrt(double *x); double d_tan(double *x); double d_tanh(double *x); long int i_abs(long int *x); long int i_dim(long int *a,long int *b); long int i_dnnt(double *x); long int i_indx(char *a, char *b, long int la, long int lb); long int i_len(char *s, long int n); long int i_mod(long int *a,long int *b); long int i_nint(float *x); long int i_sign(long int *a,long int *b); short h_abs(short *x); short h_dim(short *a,short *b); short h_dnnt(double *x); short h_indx(char *a, char *b, long int la, long int lb); short h_len(char *s, long int n); short h_mod(short *a,short *b); short h_nint(float *x); short h_sign(short *a,short *b); long int l_ge(char *a,char *b,long int la,long int lb); long int l_gt(char *a,char *b,long int la,long int lb); long int l_le(char *a,char *b,long int la,long int lb); long int l_lt(char *a,char *b,long int la,long int lb); int s_cmp(char *a, char *b, long int la, long int lb); short hl_ge(char *a,char *b,long int la,long int lb); short hl_gt(char *a,char *b,long int la,long int lb); short hl_le(char *a,char *b,long int la,long int lb); short hl_lt(char *a,char *b,long int la,long int lb); void s_cat(char *lp, char *rpp[], long int rnp[], long int *np, long int ll); void s_copy(char *a, char *b, long int la, long int lb); double fcabs(double real, double imag); pcc-libs-20200614/libF77/getarg_.c010064400017500000000000000043541076156276200152350ustar raggewheel/* $Id: getarg_.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* * subroutine getarg(k, c) * returns the kth unix command argument in fortran character * variable argument c */ #include "f77lib.h" void getarg_(long int *n, char *s, long int ls) { extern int xargc; extern char **xargv; char *t; int i; if(*n>0 && *n= 0) return(*x); return(- *x); } pcc-libs-20200614/libF77/h_dim.c010064400017500000000000000036741076156276200147110ustar raggewheel/* $Id: h_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_dim(short *a,short *b) { return( *a > *b ? *a - *b : 0); } pcc-libs-20200614/libF77/h_dnnt.c010064400017500000000000000037231076156276200150760ustar raggewheel/* $Id: h_dnnt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_dnnt(double *x) { return( (*x)>=0 ? (short) (*x + .5) : (short) (*x - .5) ); } pcc-libs-20200614/libF77/h_indx.c010064400017500000000000000042051076156276200150710ustar raggewheel/* $Id: h_indx.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_indx(char *a, char *b, long int la, long int lb) { int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } pcc-libs-20200614/libF77/h_len.c010064400017500000000000000036511076156276200147110ustar raggewheel/* $Id: h_len.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_len(char *s, long int n) { return(n); } pcc-libs-20200614/libF77/h_mod.c010064400017500000000000000036561076156276200147170ustar raggewheel/* $Id: h_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_mod(short *a,short *b) { return( *a % *b); } pcc-libs-20200614/libF77/h_nint.c010064400017500000000000000037221076156276200151020ustar raggewheel/* $Id: h_nint.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_nint(float *x) { return( (*x)>=0 ? (short) (*x + .5) : (short) (*x - .5) ); } pcc-libs-20200614/libF77/h_sign.c010064400017500000000000000037401076156276200150720ustar raggewheel/* $Id: h_sign.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short h_sign(short *a,short *b) { short x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } pcc-libs-20200614/libF77/hl_ge.c010064400017500000000000000037211076156276200147000ustar raggewheel/* $Id: hl_ge.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short hl_ge(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) >= 0); } pcc-libs-20200614/libF77/hl_gt.c010064400017500000000000000037201076156276200147160ustar raggewheel/* $Id: hl_gt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short hl_gt(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) > 0); } pcc-libs-20200614/libF77/hl_le.c010064400017500000000000000037211076156276200147050ustar raggewheel/* $Id: hl_le.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short hl_le(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) <= 0); } pcc-libs-20200614/libF77/hl_lt.c010064400017500000000000000037201076156276200147230ustar raggewheel/* $Id: hl_lt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short hl_lt(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) < 0); } pcc-libs-20200614/libF77/i_abs.c010064400017500000000000000037021076156276200146760ustar raggewheel/* $Id: i_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_abs(long int *x) { if(*x >= 0) return(*x); return(- *x); } pcc-libs-20200614/libF77/i_dim.c010064400017500000000000000037051076156276200147050ustar raggewheel/* $Id: i_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_dim(long int *a,long int *b) { return( *a > *b ? *a - *b : 0); } pcc-libs-20200614/libF77/i_dnnt.c010064400017500000000000000037341076156276200151010ustar raggewheel/* $Id: i_dnnt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_dnnt(double *x) { return( (*x)>=0 ? (long int) (*x + .5) : (long int) (*x - .5) ); } pcc-libs-20200614/libF77/i_indx.c010064400017500000000000000042151076156276200150730ustar raggewheel/* $Id: i_indx.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_indx(char *a, char *b, long int la, long int lb) { long int i, n; char *s, *t, *bend; n = la - lb + 1; bend = b + lb; for(i = 0 ; i < n ; ++i) { s = a + i; t = b; while(t < bend) if(*s++ != *t++) goto no; return(i+1); no: ; } return(0); } pcc-libs-20200614/libF77/i_len.c010064400017500000000000000036541076156276200147150ustar raggewheel/* $Id: i_len.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_len(char *s, long int n) { return(n); } pcc-libs-20200614/libF77/i_mod.c010064400017500000000000000036671076156276200147220ustar raggewheel/* $Id: i_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_mod(long int *a,long int *b) { return( *a % *b); } pcc-libs-20200614/libF77/i_nint.c010064400017500000000000000037331076156276200151050ustar raggewheel/* $Id: i_nint.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_nint(float *x) { return( (*x)>=0 ? (long int) (*x + .5) : (long int) (*x - .5) ); } pcc-libs-20200614/libF77/i_sign.c010064400017500000000000000037541076156276200151000ustar raggewheel/* $Id: i_sign.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int i_sign(long int *a,long int *b) { long int x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } pcc-libs-20200614/libF77/iargc_.c010064400017500000000000000036711076156276200150520ustar raggewheel/* $Id: iargc_.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int iargc_() { extern int xargc; return ( xargc - 1 ); } pcc-libs-20200614/libF77/l_ge.c010064400017500000000000000037221076156276200145310ustar raggewheel/* $Id: l_ge.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int l_ge(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) >= 0); } pcc-libs-20200614/libF77/l_gt.c010064400017500000000000000037211076156276200145470ustar raggewheel/* $Id: l_gt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int l_gt(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) > 0); } pcc-libs-20200614/libF77/l_le.c010064400017500000000000000037221076156276200145360ustar raggewheel/* $Id: l_le.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int l_le(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) <= 0); } pcc-libs-20200614/libF77/l_lt.c010064400017500000000000000037211076156276200145540ustar raggewheel/* $Id: l_lt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int l_lt(char *a,char *b,long int la,long int lb) { return(s_cmp(a,b,la,lb) < 0); } pcc-libs-20200614/libF77/main.c010064400017500000000000000051471076156276200145520ustar raggewheel/* $Id: main.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */ #include #include #include static void sigfdie(int), sigidie(int); static void sigdie(char *s); void MAIN__(void); void f_exit(void); int xargc; char **xargv; int main(int argc, char **argv, char **arge) { xargc = argc; xargv = argv; signal(SIGFPE, sigfdie); /* ignore underflow, enable overflow */ signal(SIGIOT, sigidie); MAIN__(); f_exit(); return 0; } static void sigfdie(int a) { sigdie("Floating Exception"); } static void sigidie(int a) { sigdie("IOT Trap"); } static void sigdie(char *s) { /* print error message, then clear buffers */ fflush(stderr); fprintf(stderr, "%s\n", s); f_exit(); fflush(stderr); /* now get a core */ signal(SIGIOT, 0); abort(); } pcc-libs-20200614/libF77/pow_ci.c010064400017500000000000000040761076156276200151060ustar raggewheel/* $Id: pow_ci.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void pow_ci(complex *p, complex *a, long int *b) /* p = a**b */ { dcomplex p1, a1; a1.dreal = a->real; a1.dimag = a->imag; pow_zi(&p1, &a1, b); p->real = p1.dreal; p->imag = p1.dimag; } pcc-libs-20200614/libF77/pow_dd.c010064400017500000000000000037171076156276200151030ustar raggewheel/* $Id: pow_dd.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double pow_dd(double *ap, double *bp) { return(pow(*ap, *bp) ); } pcc-libs-20200614/libF77/pow_di.c010064400017500000000000000042551076156276200151060ustar raggewheel/* $Id: pow_di.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double pow_di(double *ap, long int *bp) { double pow, x; long int n; pow = 1; x = *ap; n = *bp; if(n != 0) { if(n < 0) { if(x == 0) { return(pow); } n = -n; x = 1/x; } for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } pcc-libs-20200614/libF77/pow_hh.c010064400017500000000000000041451076156276200151070ustar raggewheel/* $Id: pow_hh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" short pow_hh(short *ap, short *bp) { short pow, x, n; pow = 1; x = *ap; n = *bp; if(n < 0) { ; } else if(n > 0) { for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } pcc-libs-20200614/libF77/pow_ii.c010064400017500000000000000041611076156276200151070ustar raggewheel/* $Id: pow_ii.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" long int pow_ii(long int *ap, long int *bp) { long int pow, x, n; pow = 1; x = *ap; n = *bp; if(n < 0) { ; } else if(n > 0) { for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } pcc-libs-20200614/libF77/pow_ri.c010064400017500000000000000042551076156276200151240ustar raggewheel/* $Id: pow_ri.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" float pow_ri(float *ap, long int *bp) { double pow, x; long int n; pow = 1; x = *ap; n = *bp; if(n != 0) { if(n < 0) { if(x == 0) { return(pow); } n = -n; x = 1/x; } for( ; ; ) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return(pow); } pcc-libs-20200614/libF77/pow_zi.c010064400017500000000000000046521076131454200151240ustar raggewheel/* $Id: pow_zi.c,v 1.3 2008/02/27 17:09:54 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void pow_zi(dcomplex *p, dcomplex *a, long int *b) /* p = a**b */ { long int n; double t; dcomplex x; n = *b; p->dreal = 1; p->dimag = 0; if(n == 0) return; if(n < 0) { n = -n; z_div(&x, p, a); } else { x.dreal = a->dreal; x.dimag = a->dimag; } for( ; ; ) { if(n & 01) { t = p->dreal * x.dreal - p->dimag * x.dimag; p->dimag = p->dreal * x.dimag + p->dimag * x.dreal; p->dreal = t; } if(n >>= 1) { t = x.dreal * x.dreal - x.dimag * x.dimag; x.dimag = 2 * x.dreal * x.dimag; x.dreal = t; } else break; } } pcc-libs-20200614/libF77/pow_zz.c010064400017500000000000000042621076156276200151530ustar raggewheel/* $Id: pow_zz.c,v 1.4 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void pow_zz(dcomplex *r,dcomplex *a,dcomplex *b) { double logr, logi, x, y; logr = log( fcabs(a->dreal, a->dimag) ); logi = atan2(a->dimag, a->dreal); x = exp( logr * b->dreal - logi * b->dimag ); y = logr * b->dimag + logi * b->dreal; r->dreal = x * cos(y); r->dimag = x * sin(y); } pcc-libs-20200614/libF77/r_abs.c010064400017500000000000000036751076156276200147200ustar raggewheel/* $Id: r_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_abs(float *x) { if(*x >= 0) return(*x); return(- *x); } pcc-libs-20200614/libF77/r_acos.c010064400017500000000000000036761076156276200151010ustar raggewheel/* $Id: r_acos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_acos(float *x) { return( acos(*x) ); } pcc-libs-20200614/libF77/r_asin.c010064400017500000000000000036761076156276200151060ustar raggewheel/* $Id: r_asin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_asin(float *x) { return( asin(*x) ); } pcc-libs-20200614/libF77/r_atan.c010064400017500000000000000036761076156276200150770ustar raggewheel/* $Id: r_atan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_atan(float *x) { return( atan(*x) ); } pcc-libs-20200614/libF77/r_atn2.c010064400017500000000000000037131076156276200150100ustar raggewheel/* $Id: r_atn2.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_atn2(float *x,float *y) { return( atan2(*x,*y) ); } pcc-libs-20200614/libF77/r_cnjg.c010064400017500000000000000037131076156276200150650ustar raggewheel/* $Id: r_cnjg.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void r_cnjg(complex *r, complex *z) { r->real = z->real; r->imag = - z->imag; } pcc-libs-20200614/libF77/r_cos.c010064400017500000000000000036731076156276200147350ustar raggewheel/* $Id: r_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_cos(float *x) { return( cos(*x) ); } pcc-libs-20200614/libF77/r_cosh.c010064400017500000000000000036761076156276200151100ustar raggewheel/* $Id: r_cosh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_cosh(float *x) { return( cosh(*x) ); } pcc-libs-20200614/libF77/r_dim.c010064400017500000000000000036751076156276200147240ustar raggewheel/* $Id: r_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_dim(float *a,float *b) { return( *a > *b ? *a - *b : 0); } pcc-libs-20200614/libF77/r_erf.c010064400017500000000000000036401076106720100147030ustar raggewheel/* $Id: r_erf.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ float erf_(x) float *x; { double erf(); return( erf(*x) ); } pcc-libs-20200614/libF77/r_erfc.c010064400017500000000000000036441076106720100150520ustar raggewheel/* $Id: r_erfc.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ float erfc_(x) float *x; { double erfc(); return( erfc(*x) ); } pcc-libs-20200614/libF77/r_exp.c010064400017500000000000000036731076156276200147450ustar raggewheel/* $Id: r_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_exp(float *x) { return( exp(*x) ); } pcc-libs-20200614/libF77/r_imag.c010064400017500000000000000036511076156276200150620ustar raggewheel/* $Id: r_imag.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_imag(complex *z) { return(z->imag); } pcc-libs-20200614/libF77/r_int.c010064400017500000000000000036571076156276200147450ustar raggewheel/* $Id: r_int.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_int(float *x) { return( (long int) (*x) ); } pcc-libs-20200614/libF77/r_lg10.c010064400017500000000000000037111076156276200147050ustar raggewheel/* $Id: r_lg10.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_lg10(float *x) { return( M_LOG10E * log(*x) ); } pcc-libs-20200614/libF77/r_log.c010064400017500000000000000036731076156276200147320ustar raggewheel/* $Id: r_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_log(float *x) { return( log(*x) ); } pcc-libs-20200614/libF77/r_mod.c010064400017500000000000000037131076156276200147230ustar raggewheel/* $Id: r_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_mod(float *x,float *y) { return(*x - (*y) * ( (long int) (*x / *y)) ); } pcc-libs-20200614/libF77/r_nint.c010064400017500000000000000037311076156276200151140ustar raggewheel/* $Id: r_nint.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_nint(float *x) { return( (*x)>=0 ? (long int) (*x + .5) : (long int) (*x - .5) ); } pcc-libs-20200614/libF77/r_sign.c010064400017500000000000000037411076156276200151050ustar raggewheel/* $Id: r_sign.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" double r_sign(float *a,float *b) { float x; x = (*a >= 0 ? *a : - *a); return( *b >= 0 ? x : -x); } pcc-libs-20200614/libF77/r_sin.c010064400017500000000000000036731076156276200147420ustar raggewheel/* $Id: r_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_sin(float *x) { return( sin(*x) ); } pcc-libs-20200614/libF77/r_sinh.c010064400017500000000000000036761076156276200151150ustar raggewheel/* $Id: r_sinh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_sinh(float *x) { return( sinh(*x) ); } pcc-libs-20200614/libF77/r_sqrt.c010064400017500000000000000036761076156276200151450ustar raggewheel/* $Id: r_sqrt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_sqrt(float *x) { return( sqrt(*x) ); } pcc-libs-20200614/libF77/r_tan.c010064400017500000000000000036731076156276200147330ustar raggewheel/* $Id: r_tan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_tan(float *x) { return( tan(*x) ); } pcc-libs-20200614/libF77/r_tanh.c010064400017500000000000000036761076156276200151060ustar raggewheel/* $Id: r_tanh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double r_tanh(float *x) { return( tanh(*x) ); } pcc-libs-20200614/libF77/s_cat.c010064400017500000000000000042331076156276200147120ustar raggewheel/* $Id: s_cat.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void s_cat(char *lp, char *rpp[], long int rnp[], long int *np, long int ll) { int i, n, nc; char *rp; n = *np; for(i = 0 ; i < n ; ++i) { nc = ll; if(rnp[i] < nc) nc = rnp[i]; ll -= nc; rp = rpp[i]; while(--nc >= 0) *lp++ = *rp++; } while(--ll >= 0) *lp++ = ' '; } pcc-libs-20200614/libF77/s_cmp.c010064400017500000000000000044401076156276200147220ustar raggewheel/* $Id: s_cmp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" int s_cmp(char *a, char *b, long int la, long int lb) /* compare two strings */ { char *aend, *bend; aend = a + la; if(la <= lb) { while(a < aend) if(*a != *b) return( *a - *b ); else { ++a; ++b; } } else { bend = b + lb; while(b < bend) if(*a == *b) { ++a; ++b; } else return( *a - *b ); while(a < aend) if(*a != ' ') return(*a - ' '); else ++a; } return(0); } pcc-libs-20200614/libF77/s_copy.c010064400017500000000000000042141076156276200151140ustar raggewheel/* $Id: s_copy.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "f77lib.h" void s_copy(char *a, char *b, long int la, long int lb) /* assign strings: a = b */ { char *aend, *bend; aend = a + la; if(la <= lb) { while(a < aend) *a++ = *b++; } else { bend = b + lb; while(b < bend) *a++ = *b++; while(a < aend) *a++ = ' '; } } pcc-libs-20200614/libF77/s_paus.c010064400017500000000000000052531076156276200151160ustar raggewheel/* $Id: s_paus.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include #include #include "f77lib.h" #define PAUSESIG 15 static void waitpause(int); void s_paus(char *s, long int n) { int i; fprintf(stderr, "PAUSE "); if(n > 0) for(i = 0; i #include #include "f77lib.h" /* called when a subscript is out of range */ void s_rnge(char *varn, long int offset, char *procn, int line) { register int i; fprintf(stderr, "Subscript out of range on file line %d, procedure ", line); for(i = 0 ; i < 8 && *procn!='_' ; ++i) putc(*procn++, stderr); fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); for(i = 0 ; i < 6 && *varn!=' ' ; ++i) putc(*varn++, stderr); fprintf(stderr, ".\n"); abort(); } pcc-libs-20200614/libF77/s_stop.c010064400017500000000000000041531076156276200151310ustar raggewheel/* $Id: s_stop.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include "f77lib.h" void s_stop(char *s, long int n) { int i; if(n > 0) { fprintf(stderr, "STOP "); for(i = 0; i #include "f77lib.h" void (* signal_(int *sigp, void (**procp)(int)))(int) { void (*proc)(int); int sig; sig = *sigp; proc = *procp; return( signal(sig, proc) ); } pcc-libs-20200614/libF77/sinh.c010064400017500000000000000063661076106720100145570ustar raggewheel/* $Id: sinh.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* sinh(arg) returns the hyperbolic sign of its floating- point argument. The exponential function is called for arguments greater in magnitude than 0.5. The result overflows and 'huge' is returned for arguments greater than somewhat. A series is used for arguments smaller in magnitude than 0.5. The coeffieients are #2029 from Hart & Cheney. (20.36D) cosh(arg) is computed from the exponential function for all arguments. */ double exp(); static double p0 -0.6307673640497716991184787251e+6; static double p1 -0.8991272022039509355398013511e+5; static double p2 -0.2894211355989563807284660366e+4; static double p3 -0.2630563213397497062819489e+2; static double q0 -0.6307673640497716991212077277e+6; static double q1 0.1521517378790019070696485176e+5; static double q2 -0.173678953558233699533450911e+3; static double q3 1.0; double sinh(arg) double arg; { double sign, temp, argsq; sign = 1; if(arg < 0){ arg = - arg; sign = -1; } if(arg > 21.){ temp = exp(arg)/2; return(sign*temp); } if(arg > 0.5) { temp = (exp(arg) - exp(-arg))/2; return(sign*temp); } argsq = arg*arg; temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0)*arg; temp = temp/(((q3*argsq+q2)*argsq+q1)*argsq+q0); return(sign*temp); } double cosh(arg) double arg; { double temp; if(arg < 0) arg = - arg; if(arg > 21.){ temp = exp(arg)/2; return(temp); } temp = (exp(arg) + exp(-arg))/2; return(temp); } pcc-libs-20200614/libF77/tanh.c010064400017500000000000000043371076106720100145440ustar raggewheel/* $Id: tanh.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* tanh(arg) computes the hyperbolic tangent of its floating point argument. sinh and cosh are called except for large arguments, which would cause overflow improperly. */ double sinh(), cosh(); double tanh(arg) double arg; { double sign; sign = 1.; if(arg < 0.){ arg = -arg; sign = -1.; } if(arg > 21.){ return(sign); } return(sign*sinh(arg)/cosh(arg)); } pcc-libs-20200614/libF77/z_abs.c010064400017500000000000000037231076156276200147220ustar raggewheel/* $Id: z_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" double z_abs(dcomplex *z) { return( fcabs( z->dreal, z->dimag ) ); } pcc-libs-20200614/libF77/z_cos.c010064400017500000000000000040201076156276200147300ustar raggewheel/* $Id: z_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_cos(dcomplex *r, dcomplex *z) { r->dreal = cos(z->dreal) * cosh(z->dimag); r->dimag = - sin(z->dreal) * sinh(z->dimag); } pcc-libs-20200614/libF77/z_div.c010064400017500000000000000047441076156276200147430ustar raggewheel/* $Id: z_div.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_div(dcomplex *c, dcomplex *a, dcomplex *b) { double ratio, den; double abr, abi; if( (abr = b->dreal) < 0.) abr = - abr; if( (abi = b->dimag) < 0.) abi = - abi; if( abr <= abi ) { if(abi == 0) abort(); /* fatal("complex division by zero"); */ ratio = b->dreal / b->dimag ; den = b->dimag * (1 + ratio*ratio); c->dreal = (a->dreal*ratio + a->dimag) / den; c->dimag = (a->dimag*ratio - a->dreal) / den; } else { ratio = b->dimag / b->dreal ; den = b->dreal * (1 + ratio*ratio); c->dreal = (a->dreal + a->dimag*ratio) / den; c->dimag = (a->dimag - a->dreal*ratio) / den; } } pcc-libs-20200614/libF77/z_exp.c010064400017500000000000000040371076156276200147500ustar raggewheel/* $Id: z_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_exp(dcomplex *r, dcomplex *z) { double expx; expx = exp(z->dreal); r->dreal = expx * cos(z->dimag); r->dimag = expx * sin(z->dimag); } pcc-libs-20200614/libF77/z_log.c010064400017500000000000000040151076156276200147310ustar raggewheel/* $Id: z_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_log(dcomplex *r, dcomplex *z) { r->dimag = atan2(z->dimag, z->dreal); r->dreal = log( fcabs( z->dreal, z->dimag ) ); } pcc-libs-20200614/libF77/z_sin.c010064400017500000000000000040161076156276200147420ustar raggewheel/* $Id: z_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_sin(dcomplex *r, dcomplex *z) { r->dreal = sin(z->dreal) * cosh(z->dimag); r->dimag = cos(z->dreal) * sinh(z->dimag); } pcc-libs-20200614/libF77/z_sqrt.c010064400017500000000000000044061076156276200151450ustar raggewheel/* $Id: z_sqrt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "f77lib.h" void z_sqrt(dcomplex *r, dcomplex *z) { double mag; if( (mag = fcabs(z->dreal, z->dimag)) == 0.) r->dreal = r->dimag = 0.; else if(z->dreal > 0) { r->dreal = sqrt(0.5 * (mag + z->dreal) ); r->dimag = z->dimag / r->dreal / 2; } else { r->dimag = sqrt(0.5 * (mag - z->dreal) ); if(z->dimag < 0) z->dimag = - z->dimag; r->dreal = z->dimag / r->dimag / 2; } } pcc-libs-20200614/libI77004075500017500000000000000000001367127322400133755ustar raggewheelpcc-libs-20200614/libI77/CVS004075500017500000000000000000001367127322400140305ustar raggewheelpcc-libs-20200614/libI77/CVS/Root010064400017500000000000000000111367127322300147410ustar raggewheel/cvsroot pcc-libs-20200614/libI77/CVS/Repository010064400017500000000000000000201367127322300161750ustar raggewheelpcc-libs/libI77 pcc-libs-20200614/libI77/CVS/Entries010064400017500000000000000021161367127322400154400ustar raggewheel/Makefile/1.2/Wed Apr 27 09:12:55 2011// /backspace.c/1.3/Sat Mar 1 13:44:12 2008// /close.c/1.3/Sat Mar 1 13:44:12 2008// /dfe.c/1.3/Sat Mar 1 13:44:12 2008// /due.c/1.3/Sat Mar 1 13:44:12 2008// /endfile.c/1.4/Sun May 4 10:38:33 2008// /err.c/1.3/Sat Mar 1 13:44:12 2008// /fio.h/1.3/Sat Mar 1 13:44:12 2008// /fmt.c/1.3/Sat Mar 1 13:44:12 2008// /fmt.h/1.4/Sun May 4 10:38:33 2008// /fmtlib.c/1.3/Sat Mar 1 13:44:12 2008// /iio.c/1.3/Sat Mar 1 13:44:12 2008// /inquire.c/1.3/Sat Mar 1 13:44:12 2008// /lib.c/1.3/Sat Mar 1 13:44:12 2008// /lio.c/1.3/Sat Mar 1 13:44:12 2008// /lio.h/1.3/Sat Mar 1 13:44:12 2008// /lread.c/1.3/Sat Mar 1 13:44:12 2008// /open.c/1.5/Tue May 6 10:09:52 2008// /pwd.c/1.2/Tue Feb 26 19:54:44 2008// /rdfmt.c/1.3/Sat Mar 1 13:44:12 2008// /rewind.c/1.3/Sat Mar 1 13:44:12 2008// /rsfe.c/1.3/Sat Mar 1 13:44:12 2008// /sfe.c/1.3/Sat Mar 1 13:44:12 2008// /sue.c/1.3/Sat Mar 1 13:44:12 2008// /uio.c/1.3/Sat Mar 1 13:44:12 2008// /util.c/1.4/Sun May 4 10:38:33 2008// /wrtfmt.c/1.3/Sat Mar 1 13:42:02 2008// /wsfe.c/1.3/Sat Mar 1 13:44:12 2008// D pcc-libs-20200614/libI77/Makefile010075500017500000000000000006701155575702700151260ustar raggewheel# # Simple makefile for the F77 I/O library. # CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes .c.o : cc -O $(CFLAGS) -c $< -ld -r -x $*.o mv a.out $*.o OBJS= backspace.o dfe.o due.o iio.o inquire.o lib.o rewind.o rsfe.o rdfmt.o \ sue.o uio.o wsfe.o sfe.o fmt.o lio.o lread.o open.o close.o \ util.o endfile.o wrtfmt.o err.o fmtlib.o libI77.a: $(OBJS) ar r libI77.a $? clean distclean: /bin/rm -f $(OBJS) libI77.a pcc-libs-20200614/libI77/backspace.c010064400017500000000000000054741076225665400155510ustar raggewheel/* $Id: backspace.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" int f_back(alist *a) { unit *b; int n,i; long x; char buf[32]; if(a->aunit >= MXUNIT || a->aunit < 0) err(a->aerr,101,"backspace") b= &units[a->aunit]; if(b->useek==0) err(a->aerr,106,"backspace") if(b->ufd==NULL) err(a->aerr,114,"backspace") if(b->uend==1) { b->uend=0; return(0); } if(b->uwrt) { t_runc(b); nowreading(b); } if(b->url>0) { x=ftell(b->ufd); x /= b->url; x *= b->url; fseek(b->ufd,x,0); return(0); } if(b->ufmt==0) { fseek(b->ufd,-(long)sizeof(int),1); fread((char *)&n,sizeof(int),1,b->ufd); fseek(b->ufd,-(long)n-2*sizeof(int),1); return(0); } for(;;) { x=ftell(b->ufd); if(xufd,x,0); n=fread(buf,1,sizeof(buf),b->ufd); for(i=n-1;i>=0;i--) { if(buf[i]!='\n') continue; fseek(b->ufd,(long)(i-n),1); return(0); } if(x==0) return(0); else if(n==0) err(a->aerr,(EOF),"backspace") else err(a->aerr,errno,"backspace"); } } pcc-libs-20200614/libI77/close.c010064400017500000000000000052401076225665400147310ustar raggewheel/* $Id: close.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include "fio.h" int f_clos(cllist *a) { unit *b; if(a->cunit >= MXUNIT) return(0); b= &units[a->cunit]; if(b->ufd==NULL) return(0); b->uend=0; if(a->csta!=0) switch(*a->csta) { default: keep: case 'k': if(b->uwrt) t_runc(b); fclose(b->ufd); if(b->ufnm!=0) free(b->ufnm); b->ufnm=NULL; b->ufd=NULL; return(0); case 'd': delete: fclose(b->ufd); if(b->ufnm!=0) { unlink(b->ufnm); /*SYSDEP*/ free(b->ufnm); } b->ufnm=NULL; b->ufd=NULL; return(0); } else if(b->uscrtch==1) goto delete; else goto keep; } void f_exit() { int i; cllist xx; xx.cerr=1; xx.csta=NULL; for(i=0;iuwrt) nowreading(curunit); getn = y_getc; doed = rd_ed; doned = rd_ned; dorevert = donewrec = y_err; doend = y_rev; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); fmt_bg(); return(0); } int s_wdfe(cilist *a) { int n; if(!init) f_init(); if((n=c_dfe(a,WRITE))) return(n); reading=0; if(!curunit->uwrt) nowwriting(curunit); putn = y_putc; doed = w_ed; doned= w_ned; dorevert = donewrec = y_err; doend = y_rev; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startwrt"); fmt_bg(); return(0); } int e_rdfe() { en_fio(); return(0); } int e_wdfe() { en_fio(); return(0); } int c_dfe(cilist *a, int flag) { sequential=0; formatted=external=1; elist=a; cursor=scale=recpos=0; if(a->ciunit>MXUNIT || a->ciunit<0) err(a->cierr,101,"startchk"); curunit = &units[a->ciunit]; if(curunit->ufd==NULL && fk_open(flag,DIR,FMT,a->ciunit)) err(a->cierr,104,"dfe"); cf=curunit->ufd; if(!curunit->ufmt) err(a->cierr,102,"dfe") if(!curunit->useek) err(a->cierr,104,"dfe") fmtbuf=a->cifmt; fseek(cf,(long)curunit->url * (a->cirec-1),0); curunit->uend = 0; return(0); } int y_getc() { int ch; if(curunit->uend) return(-1); if((ch=getc(cf))!=EOF) { recpos++; if(curunit->url>=recpos || curunit->url==1) return(ch); else return(' '); } if(feof(cf)) { curunit->uend=1; errno=0; return(-1); } err(elist->cierr,errno,"readingd"); } int y_putc(int c) { recpos++; if(recpos <= curunit->url || curunit->url==1) putc(c,cf); else err(elist->cierr,110,"dout"); return(0); } int y_rev() { /*what about work done?*/ if(curunit->url==1 || recpos==curunit->url) return(0); while(recposurl) (*putn)(' '); recpos=0; return(0); } int y_err() { err(elist->cierr, 110, "dfe"); return 0; /* XXX */ } pcc-libs-20200614/libI77/due.c010064400017500000000000000055661076225665400144140ustar raggewheel/* $Id: due.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" int s_rdue(cilist *a) { int n; if((n=c_due(a,READ))) return(n); reading=1; if(curunit->uwrt) nowreading(curunit); return(0); } int s_wdue(cilist *a) { int n; if((n=c_due(a,WRITE))) return(n); reading=0; if(!curunit->uwrt) nowwriting(curunit); return(0); } int c_due(cilist *a, int flag) { if(!init) f_init(); if(a->ciunit>=MXUNIT || a->ciunit<0) err(a->cierr,101,"startio"); recpos=sequential=formatted=0; external=1; curunit = &units[a->ciunit]; elist=a; if(curunit->ufd==NULL && fk_open(flag,DIR,UNF,a->ciunit) ) err(a->cierr,104,"due"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,102,"cdue") if(!curunit->useek) err(a->cierr,104,"cdue") if(curunit->ufd==NULL) err(a->cierr,114,"cdue") fseek(cf,(long)(a->cirec-1)*curunit->url,0); curunit->uend = 0; return(0); } int e_rdue() { if(curunit->url==1 || recpos==curunit->url) return(0); fseek(cf,(long)(curunit->url-recpos),1); if(ftell(cf)%curunit->url) err(elist->cierr,200,"syserr"); return(0); } int e_wdue() { return(e_rdue()); } pcc-libs-20200614/libI77/endfile.c010064400017500000000000000060421100731105100152030ustar raggewheel/* $Id: endfile.c,v 1.4 2008/05/04 10:38:33 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include #include #include "fio.h" static alist *ax; int f_end(alist *a) { unit *b; if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"endfile"); b = &units[a->aunit]; if(b->ufd==NULL) return(0); b->uend=1; if( b->useek==0) return(0); ax=a; if(b->uwrt) nowreading(b); return(t_runc(b)); } int t_runc(unit *b) { char buf[128],nm[16]; FILE *tmp; int n,m, fd; long loc,len; if(b->url) return(0); /*don't truncate direct files*/ loc=ftell(b->ufd); fseek(b->ufd,0L,2); len=ftell(b->ufd); if(loc==len || b->useek==0 || b->ufnm==NULL) return(0); strcpy(nm,"tmp.FXXXXXX"); if(b->uwrt) nowreading(b); fd = mkstemp(nm); tmp=fdopen(fd,"w"); fseek(b->ufd,0L,0); for(;loc>0;) { n=fread(buf,1,loc>128?128:(int)loc,b->ufd); if(n>loc) n=loc; loc -= n; fwrite(buf,1,n,tmp); } fflush(tmp); for(n=0;n<10;n++) { if((m=fork())==-1) continue; else if(m==0) { execl("/bin/cp","cp",nm,b->ufnm,NULL); execl("/usr/bin/cp","cp",nm,b->ufnm,NULL); fprintf(stdout,"no cp\n"); exit(1); } wait(&m); if(m!=0) err(ax->aerr,111,"endfile"); fclose(tmp); unlink(nm); return(0); } err(ax->aerr,111,"endfile"); } pcc-libs-20200614/libI77/err.c010064400017500000000000000107561076225665400144240ustar raggewheel/* $Id: err.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include #include #include #include "fio.h" #define STR(x) (x==NULL?"":x) /*global definitions*/ unit units[MXUNIT]; /*unit table*/ flag init; /*0 on entry, 1 after initializations*/ cilist *elist; /*active external io list*/ flag reading; /*1 if reading, 0 if writing*/ flag cplus,cblank; char *fmtbuf; flag external; /*1 if external io, 0 if internal */ int (*doed)(struct syl *p, void *ptr, ftnlen len); int (*doend)(void),(*donewrec)(void),(*dorevert)(void); flag sequential; /*1 if sequential io, 0 if direct*/ flag formatted; /*1 if formatted io, 0 if unformatted*/ int (*getn)(void),(*putn)(int); /*for formatted io*/ FILE *cf; /*current file*/ unit *curunit; /*current unit*/ int recpos; /*place in current record*/ int cursor,scale; int canseek(FILE *f); /*error messages*/ char *F_err[] = { "error in format", "illegal unit number", "formatted io not allowed", "unformatted io not allowed", "direct io not allowed", "sequential io not allowed", "can't backspace file", "null file name", "can't stat file", "unit not connected", "off end of record", "truncation failed in endfile", "incomprehensible list input", "out of free space", "unit not connected", "read unexpected character", "blank logical input field", }; #define MAXERR (sizeof(F_err)/sizeof(char *)+100) void fatal(int n, char *s) { if(n<100 && n>=0) perror(s); /*SYSDEP*/ else if(n>=(int)MAXERR) { fprintf(stderr,"%s: illegal error number %d\n",s,n); } else if(n<0) fprintf(stderr,"%s: end of file %d\n",s,n); else fprintf(stderr,"%s: %s\n",s,F_err[n-100]); fprintf(stderr,"apparent state: unit %d named %s\n",curunit-units, STR(curunit->ufnm)); fprintf(stderr,"last format: %s\n",STR(fmtbuf)); fprintf(stderr,"lately %s %s %s %s IO\n",reading?"reading":"writing", sequential?"sequential":"direct",formatted?"formatted":"unformatted", external?"external":"internal"); abort(); } /*initialization routine*/ void f_init() { unit *p; init=1; p= &units[0]; p->ufd=stderr; p->useek=canseek(stderr); p->ufmt=1; p->uwrt=1; p = &units[5]; p->ufd=stdin; p->useek=canseek(stdin); p->ufmt=1; p->uwrt=0; p= &units[6]; p->ufd=stdout; p->useek=canseek(stdout); p->ufmt=1; p->uwrt=1; } int canseek(FILE *f) /*SYSDEP*/ { struct stat x; fstat(fileno(f),&x); if(x.st_nlink > 0 /*pipe*/ && !isatty(fileno(f))) { return(1); } return(0); } int nowreading(unit *x) { long loc; x->uwrt=0; loc=ftell(x->ufd); freopen(x->ufnm,"r",x->ufd); return fseek(x->ufd,loc,0); } int nowwriting(x) unit *x; { long loc; loc=ftell(x->ufd); x->uwrt=1; freopen(x->ufnm,"a",x->ufd); return fseek(x->ufd,loc,0); } pcc-libs-20200614/libI77/fio.h010064400017500000000000000131141076225665400144050ustar raggewheel/* $Id: fio.h,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 typedef long ftnint; typedef ftnint flag; typedef long ftnlen; /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /*units*/ typedef struct { FILE *ufd; /*0=unconnected*/ char *ufnm; long uinode; int url; /*0=sequential*/ flag useek; /*true=can backspace, use dir, ...*/ flag ufmt; flag uprnt; flag ublnk; flag uend; flag uwrt; /*last io was write*/ flag uscrtch; } unit; typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; extern int errno; extern flag init; extern cilist *elist; /*active external io list*/ extern flag reading,external,sequential,formatted; extern int (*getn)(void),(*putn)(int); /*for formatted io*/ extern FILE *cf; /*current file*/ extern unit *curunit; /*current unit*/ extern unit units[]; #define err(f,n,s) {if(f) errno= n; else fatal(n,s); return(n);} /*Table sizes*/ #define MXUNIT 10 extern int recpos; /*position in current record*/ #define WRITE 1 #define READ 2 #define SEQ 3 #define DIR 4 #define FMT 5 #define UNF 6 #define EXT 7 #define INT 8 /* forward decl's */ struct syl; /* function prototypes */ void fatal(int n, char *s); int t_runc(unit *b); int nowreading(unit *x); int f_back(alist *a); int rd_ed(struct syl *p, void *ptr, ftnlen len); int rd_ned(struct syl *p, char *ptr); int w_ed(struct syl *p, void *ptr, ftnlen len); int w_ned(struct syl *p, char *ptr); int s_rdfe(cilist *a); void f_init(void); int pars_f(char *); void fmt_bg(void); int s_wdfe(cilist *a); int e_rdfe(void); int e_wdfe(void); int nowwriting(unit *); int en_fio(void); int do_fio(ftnint *number, char *ptr, ftnlen len); int fk_open(int rd,int seq,int fmt, ftnint n); int s_rdue(cilist *a); int s_wdue(cilist *a); int c_due(cilist *a, int flag); int e_rdue(void); int e_wdue(void); int z_getc(void); int z_putc(int); int s_rsfi(icilist *a); int s_wsfi(icilist *a); int e_rsfi(void); int e_wsfi(void); int f_inqu(inlist *a); void g_char(char *a, ftnlen alen, char *b); void b_char(char *a, char *b, ftnlen blen); int inode(char *a); void setcilist(cilist *x, int u, char *fmt,int rec,int xerr,int end); void setolist(olist *, int, char *, char *, char *, int, char *, int); void stcllist(cllist *x, int xunit, char *stat, int cerr); void setalist(alist *x, int xunit, int aerr); int f_rew(alist *a); int s_rsfe(cilist *a); int c_sfe(cilist *a, int flag); int s_rsue(cilist *a); int s_wsue(cilist *a); int e_rsue(void); int e_wsue(void); int do_uio(ftnint *number, char *ptr, ftnlen len); int s_wsfe(cilist *a); void pr_put(int); int e_rsfe(void); int e_wsfe(void); int c_le(cilist *a, int flag); int e_wsle(void); int s_wsle(cilist *a); int wrt_L(ftnint *n, int len); int s_rsle(cilist *a); int e_rsle(void); int f_open(olist *a); int f_clos(cllist *a); void f_exit(void); void flush_(void); int fullpath(char *a,char *b, int errflag); int f_end(alist *); char *icvt(long value,int *ndigit,int *sign); pcc-libs-20200614/libI77/fmt.c010064400017500000000000000175451076225665400144250ustar raggewheel/* $Id: fmt.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "fio.h" #include "fmt.h" static int type_f(int); static int ne_d(char *s,char **p); static int e_d(char *s,char **p); static int op_gen(int a,int b,int c,int d); static char *ap_end(char *s); #define skip(s) while(*s==' ') s++ #define SYLMX 300 #define GLITCH '\2' /* special quote character for stu */ extern int cursor,scale; extern flag cblank,cplus; /*blanks in I and compulsory plus*/ struct syl syl[SYLMX]; int parenlvl,pc,revloc; static char *f_s(char *s, int curloc),*f_list(char *), *i_tem(char *),*gt_num(char *s, int *n); int pars_f(s) char *s; { parenlvl=revloc=pc=0; if((s=f_s(s,0))==NULL) { return(-1); } return(0); } char * f_s(char *s, int curloc) { skip(s); if(*s++!='(') { return(NULL); } if(parenlvl++ ==1) revloc=curloc; if(op_gen(RET,curloc,0,0)<0 || (s=f_list(s))==NULL) { return(NULL); } skip(s); return(s); } char * f_list(char *s) { for(;*s!=0;) { skip(s); if((s=i_tem(s))==NULL) return(NULL); skip(s); if(*s==',') s++; else if(*s==')') { if(--parenlvl==0) { op_gen(REVERT,revloc,0,0); return(++s); } op_gen(GOTO,0,0,0); return(++s); } } return(NULL); } char * i_tem(char *s) { char *t; int n,curloc; if(*s==')') return(s); if(ne_d(s,&t)) return(t); if(e_d(s,&t)) return(t); s=gt_num(s,&n); if((curloc=op_gen(STACK,n,0,0))<0) return(NULL); return(f_s(s,curloc)); } int ne_d(char *s,char **p) { int n,x,sign=0; switch(*s) { default: return(0); case ':': op_gen(COLON,0,0,0); break; case 'b': if(*++s=='z') op_gen(BZ,0,0,0); else op_gen(BN,0,0,0); break; case 's': if(*(s+1)=='s') { x=SS; s++; } else if(*(s+1)=='p') { x=SP; s++; } else x=S; op_gen(x,0,0,0); break; case '/': op_gen(SLASH,0,0,0); break; case '-': sign=1; s++; /*OUTRAGEOUS CODING TRICK*/ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': s=gt_num(s,&n); switch(*s) { default: return(0); case 'p': if(sign) n= -n; op_gen(P,n,0,0); break; case 'x': op_gen(X,n,0,0); break; case 'H': case 'h': op_gen(H,n,(int)(s+1),0); s+=n; break; } break; case GLITCH: case '"': case '\'': op_gen(APOS,(int)s,0,0); *p=ap_end(s); return(1); case 't': if(*(s+1)=='l') { x=TL; s++; } else if(*(s+1)=='r') { x=TR; s++; } else x=T; s=gt_num(s+1,&n); op_gen(x,n,0,0); break; case 'x': op_gen(X,1,0,0); break; case 'p': op_gen(P,1,0,0); break; } s++; *p=s; return(1); } int e_d(char *s,char **p) { int n,w,d,e,found=0,x=0; char *sv=s; s=gt_num(s,&n); op_gen(STACK,n,0,0); switch(*s++) { default: break; case 'e': x=1; case 'g': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; if(*s!='E') op_gen(x==1?E:G,w,d,0); else { s++; s=gt_num(s,&e); op_gen(x==1?EE:GE,w,d,e); } break; case 'l': found=1; s=gt_num(s,&w); if(w==0) break; op_gen(L,w,0,0); break; case 'a': found=1; skip(s); if(*s>='0' && *s<='9') { s=gt_num(s,&w); if(w==0) break; op_gen(AW,w,0,0); break; } op_gen(A,0,0,0); break; case 'f': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; op_gen(F,w,d,0); break; case 'd': found=1; s=gt_num(s,&w); if(w==0) break; if(*s=='.') { s++; s=gt_num(s,&d); } else d=0; op_gen(D,w,d,0); break; case 'i': found=1; s=gt_num(s,&w); if(w==0) break; if(*s!='.') { op_gen(I,w,0,0); break; } s++; s=gt_num(s,&d); op_gen(IM,w,d,0); break; } if(found==0) { pc--; /*unSTACK*/ *p=sv; return(0); } *p=s; return(1); } int op_gen(int a,int b,int c,int d) { struct syl *p= &syl[pc]; if(pc>=SYLMX) { fprintf(stderr,"format too complicated:\n%s\n", fmtbuf); abort(); } p->op=a; p->p1=b; p->p2=c; p->p3=d; return(pc++); } char * gt_num(char *s, int *n) { int m=0,cnt=0; char c; for(c= *s;;c = *s) { if(c==' ') { s++; continue; } if(c>'9' || c<'0') break; m=10*m+c-'0'; cnt++; s++; } if(cnt==0) *n=1; else *n=m; return(s); } #define STKSZ 10 int cnt[STKSZ],ret[STKSZ],cp,rp; flag workdone; int en_fio() { ftnint one=1; return(do_fio(&one,NULL,0l)); } int do_fio(ftnint *number, char *ptr, ftnlen len) { struct syl *p; int n,i; for(i=0;i<*number;i++,ptr+=len) { loop: switch(type_f((p= &syl[pc])->op)) { default: fprintf(stderr,"unknown code in do_fio: %d\n%s\n", p->op,fmtbuf); err(elist->cierr,100,"do_fio"); case NED: if((*doned)(p,ptr)) { pc++; goto loop; } pc++; continue; case ED: if(cnt[cp]<=0) { cp--; pc++; goto loop; } if(ptr==NULL) return((*doend)()); cnt[cp]--; workdone=1; if((n=(*doed)(p,ptr,len))>0) err(elist->cierr,errno,"fmt"); if(n<0) err(elist->ciend,(EOF),"fmt"); continue; case STACK: cnt[++cp]=p->p1; pc++; goto loop; case RET: ret[++rp]=p->p1; pc++; goto loop; case GOTO: if(--cnt[cp]<=0) { cp--; rp--; pc++; goto loop; } pc=1+ret[rp--]; goto loop; case REVERT: rp=cp=0; pc = p->p1; if(ptr==NULL) return((*doend)()); if(!workdone) return(0); if((n=(*dorevert)()) != 0) return(n); goto loop; case COLON: if(ptr==NULL) return((*doend)()); pc++; goto loop; case S: case SS: cplus=0; pc++; goto loop; case SP: cplus = 1; pc++; goto loop; case P: scale=p->p1; pc++; goto loop; case BN: cblank=0; pc++; goto loop; case BZ: cblank=1; pc++; goto loop; } } return(0); } void fmt_bg() { workdone=cp=rp=pc=cursor=0; cnt[0]=ret[0]=0; } int type_f(n) { switch(n) { default: return(n); case RET: return(RET); case REVERT: return(REVERT); case GOTO: return(GOTO); case STACK: return(STACK); case X: case SLASH: case APOS: case H: case T: case TL: case TR: return(NED); case F: case I: case IM: case A: case AW: case L: case E: case EE: case D: case G: case GE: return(ED); } } char * ap_end(char *s) { char quote; quote= *s++; for(;*s;s++) { if(*s!=quote) continue; if(*++s!=quote) return(s); } if(elist->cierr) errno= 100; else fatal(100,"bad string"); return s; } pcc-libs-20200614/libI77/fmt.h010064400017500000000000000056251100731105100143760ustar raggewheel/* $Id: fmt.h,v 1.4 2008/05/04 10:38:33 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ struct syl { int op,p1,p2,p3; }; #define RET 1 #define REVERT 2 #define GOTO 3 #define X 4 #define SLASH 5 #define STACK 6 #define I 7 #define ED 8 #define NED 9 #define IM 10 #define APOS 11 #define H 12 #define TL 13 #define TR 14 #define T 15 #define COLON 16 #define S 17 #define SP 18 #define SS 19 #define P 20 #define BN 21 #define BZ 22 #define F 23 #define E 24 #define EE 25 #define D 26 #define G 27 #define GE 28 #define L 29 #define A 30 #define AW 31 extern struct syl syl[]; extern int pc,parenlvl,revloc; int (*doed)(struct syl *p, void *ptr, ftnlen len); int (*doned)(struct syl *p, char *ptr); int (*dorevert)(void),(*donewrec)(void),(*doend)(void); extern flag cblank,cplus,workdone; extern char *fmtbuf; extern int scale; typedef union { float pf; double pd; } ufloat; typedef union { short is; char ic; long il; } unint; #define GET(x) if((x=(*getn)())<0) return(x) #define VAL(x) (x!='\n'?x:' ') #define PUT(x) (*putn)(x) extern int cursor; /* prototypes */ int wrt_E(ufloat *, int, int, int, ftnlen); int wrt_F(ufloat *p, int w,int d, ftnlen len); pcc-libs-20200614/libI77/fmtlib.c010064400017500000000000000044331076225665400151040ustar raggewheel/* $Id: fmtlib.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" #define MAXINTLENGTH 10 char * icvt(long value,int *ndigit,int *sign) { static char buf[MAXINTLENGTH+1]; register int i; if(value>0) *sign=0; else if(value<0) { value = -value; *sign= 1; } else { *sign=0; *ndigit=1; buf[MAXINTLENGTH]='0'; return(&buf[MAXINTLENGTH]); } for(i=MAXINTLENGTH-1;value>0;i--) { *(buf+i)=(int)(value%10)+'0'; value /= 10; } *ndigit=MAXINTLENGTH-1-i; return(&buf[i+1]); } pcc-libs-20200614/libI77/iio.c010064400017500000000000000065421076225665400144120ustar raggewheel/* $Id: iio.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" #include "fmt.h" char *icptr,*icend; icilist *svic; static int y_err(void), z_wnew(void), z_rnew(void), c_si(icilist *); int icnum,icpos; int z_getc() { if(icptr >= icend) err(svic->iciend,(EOF),"endfile"); if(icpos++ < svic->icirlen) return(*icptr++); else err(svic->icierr,110,"recend"); } int z_putc(int c) { if(icptr >= icend) err(svic->icierr,110,"inwrite"); if(icpos++ < svic->icirlen) *icptr++ = c; else err(svic->icierr,110,"recend"); return(0); } int z_rnew() { icptr = svic->iciunit + (++icnum)*svic->icirlen; icpos = 0; return 0; } int s_rsfi(icilist *a) { int n; if((n=c_si(a))) return(n); reading=1; doed=rd_ed; doned=rd_ned; getn=z_getc; dorevert = donewrec = y_err; doend = z_rnew; return(0); } int s_wsfi(icilist *a) { int n; if((n=c_si(a))) return(n); reading=0; doed=w_ed; doned=w_ned; putn=z_putc; dorevert = donewrec = y_err; doend = z_wnew; return(0); } int c_si(icilist *a) { fmtbuf=a->icifmt; if(pars_f(fmtbuf)<0) err(a->icierr,100,"startint"); fmt_bg(); sequential=formatted=1; external=0; cblank=cplus=scale=0; svic=a; icnum=icpos=0; icptr=svic->iciunit; icend=icptr+svic->icirlen*svic->icirnum; return(0); } int z_wnew() { while(icpos++ < svic->icirlen) *icptr++ = ' '; icpos = 0; icnum++; return 0; } int e_rsfi() { int n; n = en_fio(); fmtbuf = NULL; return(n); } int e_wsfi() { int n; n = en_fio(); fmtbuf = NULL; while(icpos++ < svic->icirlen) *icptr++ = ' '; return(n); } int y_err() { err(elist->cierr, 110, "iio"); } pcc-libs-20200614/libI77/inquire.c010064400017500000000000000076231076225665400153070ustar raggewheel/* $Id: inquire.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" int f_inqu(inlist *a) { flag byfile,legal; int i; unit *p; char buf[256]; long x; x = 0; /* XXX - check correctness */ if(a->infile!=NULL) { byfile=1; g_char(a->infile,a->infilen,buf); x=inode(buf); for(i=0,p=NULL;iinunitinunit>=0) { legal=1; p= &units[a->inunit]; } else { legal=0; p=NULL; } } if(a->inex!=NULL) { if((byfile && x>0) || (!byfile && p!=NULL)) *a->inex=1; else *a->inex=0; } if(a->inopen!=NULL) { if(byfile) *a->inopen=(p!=NULL); else *a->inopen=(p!=NULL && p->ufd!=NULL); } if(a->innum!=NULL) *a->innum= p-units; if(a->innamed!=NULL) { if(byfile || (p!=NULL && p->ufnm!=NULL)) *a->innamed=1; else *a->innamed=0; } if(a->inname!=NULL) { if(byfile) b_char(buf,a->inname,a->innamlen); else if(p!=NULL && p->ufnm!=NULL) b_char(p->ufnm,a->inname,a->innamlen); } if(a->inacc!=NULL && p!=NULL && p->ufd!=NULL) { if(p->url) b_char("direct",a->inacc,a->inacclen); else b_char("sequential",a->inacc,a->inacclen); } if(a->inseq!=NULL) { if(byfile || (p!=NULL && p->useek)) b_char("yes",a->inseq,a->inseqlen); else b_char("no",a->inseq,a->inseqlen); } if(a->indir!=NULL) { if(byfile || (p!=NULL && p->useek)) b_char("yes",a->indir,a->indirlen); else b_char("no",a->indir,a->indirlen); } if(a->infmt!=NULL) { if(p!=NULL && p->ufmt) b_char("formatted",a->infmt,a->infmtlen); else if(p!=NULL) b_char("unformatted",a->infmt,a->infmtlen); } if(a->inform!=NULL) b_char("yes",a->inform,a->informlen); if(a->inunf) { if(byfile || (p!=NULL && p->useek)) b_char("yes",a->inunf,a->inunflen); else b_char("unknown",a->inunf,a->inunflen); } if(a->inrecl!=NULL && p!=NULL) *a->inrecl=p->url; if(a->innrec!=NULL && p!=NULL && p->url>0) *a->innrec=ftell(p->ufd)/p->url+1; if(a->inblank && p!=NULL && p->ufmt) { if(p->ublnk) b_char("zero",a->inblank,a->inblanklen); else b_char("blank",a->inblank,a->inblanklen); } return(0); } pcc-libs-20200614/libI77/lib.c010064400017500000000000000047111076225665400143740ustar raggewheel/* $Id: lib.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "fio.h" void setcilist(cilist *x, int u, char *fmt,int rec,int xerr,int end) { x->ciunit=u; x->cifmt=fmt; x->cirec=rec; x->cierr=xerr; x->ciend=end; } void setolist(olist *x, int xunit, char *fname, char *sta, char *fm, int rl, char *blnk, int oerr) { x->oerr=oerr; x->ounit=xunit; x->ofnm=fname; x->ofnmlen=strlen(fname); x->osta=sta; x->ofm=fm; x->orl=rl; x->oblnk=blnk; } void stcllist(cllist *x, int xunit, char *stat, int cerr) { x->cerr=cerr; x->cunit=xunit; x->csta=stat; } void setalist(alist *x, int xunit, int aerr) { x->aunit=xunit; x->aerr=aerr; } pcc-libs-20200614/libI77/lio.c010064400017500000000000000101661076225665400144120ustar raggewheel/* $Id: lio.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "fio.h" #include "fmt.h" #include "lio.h" static int l_write(ftnint *number, flex *ptr,ftnlen len, ftnint type); static int t_putc(int); void lwrt_I(ftnint n); void lwrt_L(ftnint n); void lwrt_A(char *p, ftnlen len); void lwrt_F(double n); void lwrt_C(double a,double b); int s_wsle(cilist *a) { int n; if(!init) f_init(); if((n=c_le(a,WRITE))) return(n); reading=0; external=1; formatted=1; putn = t_putc; lioproc = l_write; if(!curunit->uwrt) return(nowwriting(curunit)); else return(0); } int e_wsle() { t_putc('\n'); recpos=0; return(0); } int t_putc(c) { recpos++; putc(c,cf); return 0; } void lwrt_I(ftnint n) { char buf[LINTW],*p; sprintf(buf," %ld",(long)n); if(recpos+strlen(buf)>=LINE) { t_putc('\n'); recpos=0; } for(p=buf;*p;t_putc(*p++)); } void lwrt_L(ftnint n) { if(recpos+LLOGW>=LINE) { t_putc('\n'); recpos=0; } wrt_L(&n,LLOGW); } void lwrt_A(char *p, ftnlen len) { int i; if(recpos+len>=LINE) { t_putc('\n'); recpos=0; } t_putc(' '); for(i=0;i=LINE) { t_putc('\n'); recpos=0; } scale=0; wrt_F(&uf,LFW,LFD,(ftnlen)sizeof(uf)); } else { if(recpos+LEW>=LINE) { t_putc('\n'); recpos=0; } wrt_E(&uf,LEW,LED,LEE,(ftnlen)sizeof(uf)); } } void lwrt_C(double a,double b) { if(recpos+2*LFW+3>=LINE) { t_putc('\n'); recpos=0; } t_putc(' '); t_putc('('); lwrt_F(a); lwrt_F(b); t_putc(')'); } int l_write(ftnint *number, flex *ptr,ftnlen len, ftnint type) { int i; ftnint x; double y,z; float *xx; double *yy; for(i=0;i< *number; i++) { switch((int)type) { default: fatal(204,"unknown type in lio"); case TYSHORT: x=ptr->flshort; goto xint; case TYLONG: x=ptr->flint; xint: lwrt_I(x); break; case TYREAL: y=ptr->flreal; goto xfloat; case TYDREAL: y=ptr->fldouble; xfloat: lwrt_F(y); break; case TYCOMPLEX: xx= &(ptr->flreal); y = *xx++; z = *xx; goto xcomplex; case TYDCOMPLEX: yy = &(ptr->fldouble); y= *yy++; z = *yy; xcomplex: lwrt_C(y,z); break; case TYLOGICAL: lwrt_L(ptr->flint); break; case TYCHAR: lwrt_A((char *)ptr,len); break; } ptr = (flex *)((char *)ptr + len); /* XXX ??? */ } return(0); } pcc-libs-20200614/libI77/lio.h010064400017500000000000000052051076225665400144150ustar raggewheel/* $Id: lio.h,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* copy of ftypes from the compiler */ /* variable types * numeric assumptions: * int < reals < complexes * TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX */ #define TYUNKNOWN 0 #define TYADDR 1 #define TYSHORT 2 #define TYLONG 3 #define TYREAL 4 #define TYDREAL 5 #define TYCOMPLEX 6 #define TYDCOMPLEX 7 #define TYLOGICAL 8 #define TYCHAR 9 #define TYSUBR 10 #define TYERROR 11 #define NTYPES (TYERROR+1) #define LINTW 12 #define LINE 80 #define LLOGW 2 #define LLOW 1.0 #define LHIGH 10.0 #define LFW 12 #define LFD 8 #define LEW 16 #define LED 9 #define LEE 2 typedef union { short flshort; ftnint flint; float flreal; double fldouble; } flex; extern int scale; extern int (*lioproc)(ftnint *number,flex *ptr,ftnlen len,ftnint type); int do_lio(ftnint *type,ftnint *number,flex *ptr,ftnlen len); pcc-libs-20200614/libI77/lread.c010064400017500000000000000215251076225665400147170ustar raggewheel/* $Id: lread.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "fio.h" #include "fmt.h" #include "lio.h" #include "ctype.h" extern char *fmtbuf; int (*lioproc)(ftnint *number,flex *ptr,ftnlen len,ftnint type); static int rd_int(double *x); int l_R(void); int l_C(void); int l_L(void); int l_CHAR(void); int t_getc(void); int t_sep(void); #define isblnk(x) (ltab[x+1]&B) #define issep(x) (ltab[x+1]&SX) #define isapos(x) (ltab[x+1]&AX) #define isexp(x) (ltab[x+1]&EX) #define SX 1 #define B 2 #define AX 4 #define EX 8 char ltab[128+1] = /* offset one for EOF */ { 0, 0,0,AX,0,0,0,0,0,0,0,B,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, SX|B,0,AX,0,0,0,0,0,0,0,0,0,SX,0,0,SX, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, AX,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; int l_first; int t_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF) return(ch); if(feof(cf)) curunit->uend = 1; return(EOF); } int e_rsle() { int ch; if(curunit->uend) return(0); while((ch=t_getc())!='\n' && ch!=EOF); return(0); } flag lquit; int lcount,ltype; char *lchar; double lx,ly; #define ERR(x) if((n=(x))) return(n) #define GETC(x) ((x=t_getc())) static int l_read(ftnint *number,flex *ptr,ftnlen len,ftnint type) { int i,n,ch; double *yy; float *xx; for(i=0;i<*number;i++) { if(curunit->uend) err(elist->ciend, EOF, "list in") if(l_first) { l_first=0; for(GETC(ch);isblnk(ch);GETC(ch)); ungetc(ch,cf); } else if(lcount==0) { ERR(t_sep()); if(lquit) return(0); } switch((int)type) { case TYSHORT: case TYLONG: case TYREAL: case TYDREAL: ERR(l_R()); break; case TYCOMPLEX: case TYDCOMPLEX: ERR(l_C()); break; case TYLOGICAL: ERR(l_L()); break; case TYCHAR: ERR(l_CHAR()); break; } if(lquit) return(0); if(feof(cf)) err(elist->ciend,(EOF),"list in") else if(ferror(cf)) { clearerr(cf); err(elist->cierr,errno,"list in") } if(ltype==0) goto bump; switch((int)type) { case TYSHORT: ptr->flshort=lx; break; case TYLOGICAL: case TYLONG: ptr->flint=lx; break; case TYREAL: ptr->flreal=lx; break; case TYDREAL: ptr->fldouble=lx; break; case TYCOMPLEX: xx=(float *)ptr; *xx++ = lx; *xx = ly; break; case TYDCOMPLEX: yy=(double *)ptr; *yy++ = lx; *yy = ly; break; case TYCHAR: b_char(lchar,(char *)ptr,len); break; } bump: if(lcount>0) lcount--; ptr = (flex *)((char *)ptr + len); } return(0); } int l_R() { double a,b,c,d; int i,ch,sign=0,da,db,dc; a=b=c=d=0; da=db=dc=0; if(lcount>0) return(0); ltype=0; for(GETC(ch);isblnk(ch);GETC(ch)); if(ch==',') { lcount=1; return(0); } if(ch=='/') { lquit=1; return(0); } ungetc(ch,cf); da=rd_int(&a); if(da== -1) sign=da; if(GETC(ch)!='*') { ungetc(ch,cf); db=1; b=a; a=1; } else db=rd_int(&b); if(GETC(ch)!='.') { dc=c=0; ungetc(ch,cf); } else dc=rd_int(&c); if(isexp(GETC(ch))) db=rd_int(&d); else { ungetc(ch,cf); d=0; } lcount=a; if(!db && !dc) return(0); if(db && b<0) { sign=1; b = -b; } for(i=0;i0) return(0); ltype=0; for(GETC(ch);isblnk(ch);GETC(ch)); if(ch==',') { lcount=1; return(0); } if(ch=='/') { lquit=1; return(0); } if(ch!='(') { if(fscanf(cf,"%d",&lcount)!=1) { if(!feof(cf)) err(elist->cierr,112,"no rep") else err(elist->cierr,(EOF),"lread"); } if(GETC(ch)!='*') { ungetc(ch,cf); if(!feof(cf)) err(elist->cierr,112,"no star") else err(elist->cierr,(EOF),"lread"); } if(GETC(ch)!='(') { ungetc(ch,cf); return(0); } } lcount = 1; ltype=TYLONG; fscanf(cf,"%lf",&lx); while(isblnk(GETC(ch))); if(ch!=',') { ungetc(ch,cf); err(elist->cierr,112,"no comma"); } while(isblnk(GETC(ch))); ungetc(ch,cf); fscanf(cf,"%lf",&ly); while(isblnk(GETC(ch))); if(ch!=')') err(elist->cierr,112,"no )"); while(isblnk(GETC(ch))); ungetc(ch,cf); return(0); } int l_L() { int ch; if(lcount>0) return(0); ltype=0; while(isblnk(GETC(ch))); if(ch==',') { lcount=1; return(0); } if(ch=='/') { lquit=1; return(0); } if(isdigit(ch)) { ungetc(ch,cf); fscanf(cf,"%d",&lcount); if(GETC(ch)!='*') { if(!feof(cf)) err(elist->cierr,112,"no star") else err(elist->cierr,(EOF),"lread"); } } else ungetc(ch,cf); if(GETC(ch)=='.') GETC(ch); switch(ch) { case 't': case 'T': lx=1; break; case 'f': case 'F': lx=0; break; default: if(isblnk(ch) || issep(ch) || ch==EOF) { ungetc(ch,cf); return(0); } else err(elist->cierr,112,"logical"); } ltype=TYLONG; while(!issep(GETC(ch)) && ch!='\n' && ch!=EOF); return(0); } #define BUFSIZE 128 int l_CHAR() { int ch,size,i; char quote,*p; if(lcount>0) return(0); ltype=0; while(isblnk(GETC(ch))); if(ch==',') { lcount=1; return(0); } if(ch=='/') { lquit=1; return(0); } if(isdigit(ch)) { ungetc(ch,cf); fscanf(cf,"%d",&lcount); if(GETC(ch)!='*') err(elist->cierr,112,"no star"); } else ungetc(ch,cf); if(GETC(ch)=='\'' || ch=='"') quote=ch; else if(isblnk(ch) || issep(ch) || ch==EOF) { ungetc(ch,cf); return(0); } else err(elist->cierr,112,"no quote"); ltype=TYCHAR; if(lchar!=NULL) free(lchar); size=BUFSIZE; p=lchar=(char *)malloc(size); if(lchar==NULL) err(elist->cierr,113,"no space"); for(i=0;;) { while(GETC(ch)!=quote && ch!='\n' && ch!=EOF && ++iuwrt) return(nowreading(curunit)); else return(0); } int t_sep() { int ch; for(GETC(ch);isblnk(ch);GETC(ch)); if(ch == EOF) { if(feof(cf)) return(EOF); else return(errno); } if(ch=='/') { lquit=1; return(0); } if(ch==',') for(GETC(ch);isblnk(ch);GETC(ch)); ungetc(ch,cf); return(0); } int c_le(cilist *a, int flag) { fmtbuf="list io"; if(a->ciunit>=MXUNIT || a->ciunit<0) err(a->cierr,101,"stler"); scale=recpos=0; elist=a; curunit = &units[a->ciunit]; if(curunit->ufd==NULL && fk_open(flag,SEQ,FMT,a->ciunit)) err(a->cierr,102,"lio"); cf=curunit->ufd; if(!curunit->ufmt) err(a->cierr,103,"lio") return(0); } int do_lio(ftnint *type,ftnint *number,flex *ptr,ftnlen len) { return((*lioproc)(number,ptr,len,*type)); } pcc-libs-20200614/libI77/open.c010064400017500000000000000103641101002716000145370ustar raggewheel/* $Id: open.c,v 1.5 2008/05/06 10:09:52 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include #include #include #include #include "fio.h" static int isdev(char *s); int canseek(FILE *f); int f_open(olist *a) { unit *b; int n; char buf[256]; cllist x; if(a->ounit>=MXUNIT || a->ounit<0) err(a->oerr,101,"open") b= &units[a->ounit]; if(b->ufd!=0) goto connected; unconnected: b->url=a->orl; if(a->oblnk && *a->oblnk=='b') b->ublnk=1; else b->ublnk=0; if(a->ofm==0) { if(b->url>0) b->ufmt=0; else b->ufmt=1; } else if(*a->ofm=='f') b->ufmt=1; else b->ufmt=0; if(a->osta==0) goto unknown; switch(*a->osta) { unknown: default: case 'o': if(a->ofnm==0) err(a->oerr,107,"open") g_char(a->ofnm,a->ofnmlen,buf); b->uscrtch=0; if(a->osta && *a->osta=='o' && access(buf,0)) err(a->oerr,errno,"open") done: b->ufnm=(char *) calloc(strlen(buf)+1,sizeof(char)); if(b->ufnm==NULL) err(a->oerr,113,"no space"); strcpy(b->ufnm,buf); b->uend=0; if(isdev(buf)) { b->ufd = fopen(buf,"r"); if(b->ufd==NULL) err(a->oerr,errno,buf) else b->uwrt = 0; } else { b->ufd = fopen(buf, "a"); if(b->ufd != NULL) b->uwrt = 1; else if((b->ufd = fopen(buf, "r")) != NULL) { fseek(b->ufd, 0L, 2); b->uwrt = 0; } else err(a->oerr, errno, buf) } b->useek=canseek(b->ufd); if((b->uinode=inode(buf))==-1) err(a->oerr,108,"open") if(a->orl && b->useek) rewind(b->ufd); return(0); case 's': b->uscrtch=1; strcpy(buf,"tmp.FXXXXXX"); close(mkstemp(buf)); goto done; case 'n': b->uscrtch=0; if(a->ofnm==0) err(a->oerr,107,"open") g_char(a->ofnm,a->ofnmlen,buf); /*SYSDEP access*/ if(access(buf, 0) == 0) creat(buf, 0666); goto done; } connected: if(a->ofnm==0) { same: if(a->oblnk!= 0) b->ublnk= *a->oblnk== 'b'?0:1; return(0); } g_char(a->ofnm,a->ofnmlen,buf); if(inode(buf)==b->uinode) goto same; x.cunit=a->ounit; x.csta=0; x.cerr=a->oerr; if((n=f_clos(&x))!=0) return(n); goto unconnected; } int fk_open(int rd,int seq,int fmt, ftnint n) { char nbuf[10]; olist a; sprintf(nbuf,"fort.%ld",n); a.oerr=1; a.ounit=n; a.ofnm=nbuf; a.ofnmlen=strlen(nbuf); a.osta=NULL; a.oacc= seq==SEQ?"s":"d"; a.ofm = fmt==FMT?"f":"u"; a.orl = seq==DIR?1:0; a.oblnk=NULL; return(f_open(&a)); } int isdev(char *s) { struct stat x; int j; if(stat(s, &x) == -1) return(0); if((j = (x.st_mode&S_IFMT)) == S_IFREG || j == S_IFDIR) return(0); else return(1); } pcc-libs-20200614/libI77/pwd.c010064400017500000000000000060551076106720400144110ustar raggewheel/* $Id: pwd.c,v 1.2 2008/02/26 19:54:44 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* * Print working (current) directory */ #include #include #include char dot[] "."; char dotdot[] ".."; char root[] "/"; char name[512]; int file; int off -1; struct stat x; struct direct y; main() { for (;;) { stat(dot, &x); if ((file = open(dotdot,0)) < 0) prname(); do { if (read(file, &y, sizeof(y)) < sizeof(y)) prname(); } while (y.d_ino != x.st_ino); close(file); if (y.d_ino == 2) ckroot(); cat(); chdir(dotdot); } } ckroot() { register i; if (stat(y.d_name,&x)<0 || chdir(root)<0 || (file=open(root,0))<0) prname(); i = x.st_dev; do { if (read(file,&y,sizeof(y)) < sizeof(y)) prname(); if (y.d_ino == 0) continue; if (stat(y.d_name,&x) < 0) prname(); } while (x.st_dev!=i || (x.st_mode&S_IFMT)!=S_IFDIR); if (strcmp(dot, y.d_name) || strcmp(dotdot, y.d_name)) cat(); write(1, root, 1); prname(); } prname() { if (off<0) off = 0; name[off] = '\n'; write(1, name, off+1); exit(0); } cat() { register i, j; i = -1; while (y.d_name[++i] != 0); if ((off+i+2) > 511) prname(); for(j=off+1; j>=0; --j) name[j+i+1] = name[j]; off=i+off+1; name[i] = root[0]; for(--i; i>=0; --i) name[i] = y.d_name[i]; } pcc-libs-20200614/libI77/rdfmt.c010064400017500000000000000143771076225665400147530ustar raggewheel/* $Id: rdfmt.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include "fio.h" #include "fmt.h" extern int cursor; int rd_I(unint *n, int w, ftnlen len); int rd_L(ftnint *n, int w); int rd_A(char *p, ftnlen len); int rd_AW(char *p, int w, ftnlen len); int rd_F(ufloat *p, int w, int d, ftnlen len); int rd_POS(char *s); int rd_H(int n, char *s); int rd_ed(struct syl *p, void *ptr, ftnlen len) { int ch; for(;cursor>0;cursor--) if((ch=(*getn)())<0) return(ch); if(cursor<0) { if(recpos+cursor < 0) err(elist->cierr,110,"fmt") if(curunit->useek) fseek(cf,(long) cursor,1); else err(elist->cierr,106,"fmt"); cursor=0; } switch(p->op) { default: fprintf(stderr,"rd_ed, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case I: ch = (rd_I(ptr,p->p1,len)); break; case IM: ch = (rd_I(ptr,p->p1,len)); break; case L: ch = (rd_L(ptr,p->p1)); break; case A: ch = (rd_A(ptr,len)); break; case AW: ch = (rd_AW(ptr,p->p1,len)); break; case E: case EE: case D: case G: case GE: case F: ch = (rd_F(ptr,p->p1,p->p2,len)); break; } if(ch == 0) return(ch); else if(feof(cf)) return(EOF); clearerr(cf); return(errno); } int rd_ned(struct syl *p, char *ptr) { switch(p->op) { default: fprintf(stderr,"rd_ned, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case APOS: return(rd_POS((char /* XXX */ *)p->p1)); case H: return(rd_H(p->p1,(char /* XXX */ *)p->p2)); case SLASH: return((*donewrec)()); case TR: case X: cursor += p->p1; return(1); case T: cursor=p->p1-recpos; return(1); case TL: cursor -= p->p1; return(1); } } int rd_I(unint *n, int w, ftnlen len) { long x=0; int i,sign=0,ch; for(i=0;iis=x; else n->il=x; return(0); } int rd_L(ftnint *n, int w) { int ch,i,v = -1; for(i=0;i='0') x=10*x+ch-'0'; else if(ch=='e' || ch=='d' || ch=='.') break; else if(cblank && ch==' ') x*=10; else if(ch==',') { i=w; break; } else if(ch!='\n') return(errno=115); } if(ch=='.') dot=1; while(i='0') y=10*y+ch-'0'; else if(cblank && ch==' ') y *= 10; else if(ch==',') {i=w; break;} else if(ch==' ') continue; else continue; ny++; } if(ch=='-') sz=1; while(i='0') z=10*z+ch-'0'; else if(cblank && ch==' ') z *= 10; else if(ch==',') break; else if(ch==' ') continue; else if(ch=='+') continue; else if(ch!='\n') return(errno=115); } if(!dot) for(i=0;i0;i--) x /= 10; for(i=scale;i<0;i++) x *= 10; } if(len==sizeof(float)) p->pf=x; else p->pd=x; return(0); } int rd_A(char *p, ftnlen len) { int i,ch; for(i=0;i=len) { for(i=0;iaunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"rewind"); b = &units[a->aunit]; if(b->ufd==NULL && fk_open(READ,SEQ,FMT,a->aunit)) err(a->aerr,114,"rewind") if(!b->useek) err(a->aerr,106,"rewind") if(b->uwrt) { nowreading(b); t_runc(b); } rewind(b->ufd); b->uend=0; return(0); } pcc-libs-20200614/libI77/rsfe.c010064400017500000000000000056551076225665400145750ustar raggewheel/* $Id: rsfe.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* read sequential formatted external */ #include "fio.h" #include "fmt.h" static int x_getc(void), x_endp(void), x_rev(void); static int xrd_SL(void); int s_rsfe(cilist *a) /* start */ { int n; if(!init) f_init(); if((n=c_sfe(a,READ))) return(n); reading=1; sequential=1; formatted=1; external=1; elist=a; cursor=recpos=0; scale=0; fmtbuf=a->cifmt; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); curunit= &units[a->ciunit]; cf=curunit->ufd; getn= x_getc; doed= rd_ed; doned= rd_ned; fmt_bg(); doend=x_endp; donewrec=xrd_SL; dorevert=x_rev; cblank=curunit->ublnk; cplus=0; if(curunit->uwrt) nowreading(curunit); return(0); } int xrd_SL() { int ch; if(!curunit->uend) while((ch=getc(cf))!='\n' && ch!=EOF); cursor=recpos=0; return(1); } int x_getc() { int ch; if(curunit->uend) return(EOF); if((ch=getc(cf))!=EOF && ch!='\n') { recpos++; return(ch); } if(ch=='\n') { ungetc(ch,cf); return(ch); } if(feof(cf)) { errno=0; curunit->uend=1; return(-1); } return(-1); } int x_endp() { xrd_SL(); return(0); } int x_rev() { xrd_SL(); return(0); } pcc-libs-20200614/libI77/sfe.c010064400017500000000000000044671076225665400144130ustar raggewheel/* $Id: sfe.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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. */ /* sequential formatted external common routines*/ #include "fio.h" extern char *fmtbuf; int e_rsfe() { int n; n=en_fio(); fmtbuf=NULL; return(n); } int c_sfe(cilist *a, int flag) /* check */ { unit *p; if(a->ciunit >= MXUNIT || a->ciunit<0) err(a->cierr,101,"startio"); p = &units[a->ciunit]; if(p->ufd==NULL && fk_open(flag,SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe") if(!p->ufmt) err(a->cierr,102,"sfe") return(0); } int e_wsfe() { return(e_rsfe()); } pcc-libs-20200614/libI77/sue.c010064400017500000000000000061361076225665400144250ustar raggewheel/* $Id: sue.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" extern int reclen; long recloc; static int c_sue(cilist *a, int flag); int s_rsue(cilist *a) { int n; if(!init) f_init(); if((n=c_sue(a,READ))) return(n); reading=1; recpos=0; if(curunit->uwrt) nowreading(curunit); if(fread(&reclen,sizeof(int),1,cf) != 1) { if(feof(cf)) { curunit->uend = 1; err(a->ciend, EOF, "start"); } clearerr(cf); err(a->cierr, errno, "start"); } return(0); } int s_wsue(cilist *a) { int n; if(!init) f_init(); if((n=c_sue(a,WRITE))) return(n); reading=0; reclen=0; if(!curunit->uwrt) nowwriting(curunit); recloc=ftell(cf); fseek(cf,(long)sizeof(int),1); return(0); } int c_sue(cilist *a, int flag) { if(a->ciunit >= MXUNIT || a->ciunit < 0) err(a->cierr,101,"startio"); external=sequential=1; formatted=0; curunit = &units[a->ciunit]; elist=a; if(curunit->ufd==NULL && fk_open(flag,SEQ,UNF,a->ciunit)) err(a->cierr,114,"sue"); cf=curunit->ufd; if(curunit->ufmt) err(a->cierr,103,"sue") if(!curunit->useek) err(a->cierr,103,"sue") return(0); } int e_wsue() { long loc; fwrite(&reclen,sizeof(int),1,cf); loc=ftell(cf); fseek(cf,recloc,0); fwrite(&reclen,sizeof(int),1,cf); fseek(cf,loc,0); return(0); } int e_rsue() { fseek(cf,(long)(reclen-recpos+sizeof(int)),1); return(0); } pcc-libs-20200614/libI77/uio.c010064400017500000000000000053361076225665400144260ustar raggewheel/* $Id: uio.c,v 1.3 2008/03/01 13:44:12 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 "fio.h" int reclen; static int do_ud(ftnint *number, char *ptr, ftnlen len); static int do_us(ftnint *number, char *ptr, ftnlen len) { if(reading) { recpos += *number * len; if(recpos>reclen) { err(elist->cierr,110,"eof/uio"); } fread(ptr,(int)len,(int)(*number),cf); return(0); } else { reclen += *number * len; fwrite(ptr,(int)len,(int)(*number),cf); return(0); } } int do_uio(ftnint *number, char *ptr, ftnlen len) { if(sequential) return(do_us(number,ptr,len)); else return(do_ud(number,ptr,len)); } int do_ud(ftnint *number, char *ptr, ftnlen len) { recpos += *number * len; if(recpos > curunit->url && curunit->url!=1) err(elist->cierr,110,"eof/uio"); if(reading) { if(fread(ptr,(int)len,(int)(*number),cf) != *number) err(elist->cierr,errno,"eof/uio") else return(0); } fwrite(ptr,(int)len,(int)(*number),cf); return(0); } pcc-libs-20200614/libI77/util.c010064400017500000000000000104561100731105100145560ustar raggewheel/* $Id: util.c,v 1.4 2008/05/04 10:38:33 ragge Exp $ */ /* * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code and documentation must retain the above * copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditionsand the following disclaimer in the * documentation and/or other materials provided with the distribution. * All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed or owned by Caldera * International, Inc. * Neither the name of Caldera International, Inc. nor the names of other * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA * INTERNATIONAL, 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 CALDERA INTERNATIONAL, INC. 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 OFLIABILITY, 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 #include #include #include #include #include #include #include "fio.h" static void dcat(char *a,char *b); #define DIRSIZE 14 void g_char(char *a, ftnlen alen, char *b) { char *x=a+alen-1,*y=b+alen-1; *(y+1)=0; for(;x>=a && *x==' ';x--) *y--=0; for(;x>=a;*y--= *x--); } void b_char(char *a, char *b, ftnlen blen) { int i; for(i=0;iy) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } else { register char *x=a,*y=b; if(x>y) for(;num>0;num--) *y++= *x++; else for(num--;num>=0;num--) *(y+num)= *(x+num); } } static char * curdir(void) { char name[256],*bufpos = name; struct stat x; struct dirent y; int file,i; *bufpos++ = 0; loop: stat(".",&x); if((file=open("..",0))<0) goto done; do { if(read(file,&y,sizeof(y)) #include #include "fio.h" #include "fmt.h" int wrt_I(unint *n,int w,ftnlen len); int wrt_IM(unint *n,int w,int m,ftnlen len); int wrt_AP(int n); int wrt_A(char *p,ftnlen len); int wrt_AW(char *p, int w,ftnlen len); int wrt_G(ufloat *p,int w,int d,int e,ftnlen len); int wrt_H(int a,int b); extern int cursor; static int mv_cur(void) { /*buggy, could move off front of record*/ for(;cursor>0;cursor--) (*putn)(' '); if(cursor<0) { if(cursor+recpos<0) err(elist->cierr,110,"left off"); if(curunit->useek) fseek(cf,(long)cursor,1); else err(elist->cierr,106,"fmt"); cursor=0; } return(0); } int w_ed(struct syl *p, void *ptr, ftnlen len) { if(mv_cur()) return(mv_cur()); switch(p->op) { default: fprintf(stderr,"w_ed, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case I: return(wrt_I(ptr,p->p1,len)); case IM: return(wrt_IM(ptr,p->p1,p->p2,len)); case L: return(wrt_L(ptr,p->p1)); case A: return(wrt_A(ptr,len)); case AW: return(wrt_AW(ptr,p->p1,len)); case D: case E: case EE: return(wrt_E(ptr,p->p1,p->p2,p->p3,len)); case G: case GE: return(wrt_G(ptr,p->p1,p->p2,p->p3,len)); case F: return(wrt_F(ptr,p->p1,p->p2,len)); } } int w_ned(struct syl *p, char *ptr) { switch(p->op) { default: fprintf(stderr,"w_ned, unexpected code: %d\n%s\n", p->op,fmtbuf); abort(); case SLASH: return((*donewrec)()); case T: cursor = p->p1-recpos; return(1); case TL: cursor -= p->p1; return(1); case TR: case X: cursor += p->p1; return(1); case APOS: return(wrt_AP(p->p1)); case H: return(wrt_H(p->p1,p->p2)); } } int wrt_I(unint *n,int w,ftnlen len) { int ndigit,sign,spare,i; long x; char *ans; if(len==sizeof(short)) x=n->is; else if(len == sizeof(char)) x = n->ic; else x=n->il; ans=icvt(x,&ndigit,&sign); spare=w-ndigit; if(sign || cplus) spare--; if(spare<0) for(i=0;iis; else if(len == sizeof(char)) x = n->ic; else x=n->il; ans=icvt(x,&ndigit,&sign); if(sign || cplus) xsign=1; else xsign=0; if(ndigit+xsign>w || m+xsign>w) { for(i=0;i=m) spare=w-ndigit-xsign; else spare=w-m-xsign; for(i=0;i 0) (*putn)(*p++); return(0); } int wrt_AW(char *p, int w,ftnlen len) { while(w>len) { w--; (*putn)(' '); } while(w-- > 0) (*putn)(*p++); return(0); } #define MXSTR 80 char nr[MXSTR]; /* * Trivial ecvt implementation. */ static char * Xecvt(double value, int ndigit, int *decpt, int *sign) { char fmt[10]; char *w = nr; if (ndigit > 70) ndigit = 70; snprintf(fmt, 10, "%%# .%de", ndigit-1); snprintf(nr, MXSTR, fmt, value); *sign = (*w == '-' ? 1 : 0); w[2] = w[1]; *decpt = atoi(&nr[ndigit+3]) + 1; nr[ndigit+2] = 0; return &nr[2]; } int wrt_E(ufloat *p,int w,int d,int e, ftnlen len) { char *s; int dp,sign,i,delta; if(scale>0) d++; s=Xecvt( (len==sizeof(float)?p->pf:p->pd) ,d,&dp,&sign); if(sign || cplus) delta=6; else delta=5; if(w -d) { (*putn)('.'); for(i=0;i<-scale;i++) (*putn)('0'); for(i=0;i0 && scalepf != 0) dp -= scale; else dp = 0; if(dp < 100 && dp > -100) (*putn)('e'); if(dp<0) { (*putn)('-'); dp = -dp; } else (*putn)('+'); if(e>=3 || dp >= 100) { (*putn)(dp/100 + '0'); dp = dp % 100; } if(e!=1) (*putn)(dp/10+'0'); (*putn)(dp%10+'0'); return(0); } int wrt_G(ufloat *p,int w,int d,int e,ftnlen len) { double up = 1,x; int i,oldscale=scale,n,j; x= len==sizeof(float)?p->pf:p->pd; if(x < 0 ) x = -x; if(x<.1) return(wrt_E(p,w,d,e,len)); for(i=0;i<=d;i++,up*=10) { if(x>up) continue; scale=0; if(e==0) n=4; else n=e+2; i=wrt_F(p,w-n,d-i,len); for(j=0;j 70) ndigit = 70; snprintf(fmt, 10, "%%# .%df", ndigit); snprintf(nr, MXSTR, fmt, value); *sign = (*w == '-' ? 1 : 0); if (w[1] == '0') { *decpt = 0; w+= 3; } else { for (w+= 1; *w && *w != '.'; w++) ; *decpt = w - nr - 1; while (*w) *w = w[1], w++; w = &nr[1]; } return w; } int wrt_F(ufloat *p, int w,int d, ftnlen len) { int i,delta,dp,sign,n; double x; char *s; x= (len==sizeof(float)?p->pf:p->pd); if(scale) { if(scale>0) for(i=0;i=d) sign=0; if(sign || cplus) delta=2; else delta=1; n= w - (d+delta+(dp>0?dp:0)); if(n<0) { for(i=0;icifmt; if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio"); curunit = &units[a->ciunit]; cf=curunit->ufd; putn= x_putc; doed= w_ed; doned= w_ned; doend=xw_end; dorevert=xw_rev; donewrec=x_wSL; fmt_bg(); cplus=0; cblank=curunit->ublnk; if(!curunit->uwrt) nowwriting(curunit); return(0); } int x_putc(c) { recpos++; putc(c,cf); return 0; } void pr_put(c) { static flag new = 1; recpos++; if(c=='\n') { new=1; putc(c,cf); } else if(new==1) { new=0; if(c=='0') putc('\n',cf); else if(c=='1') putc('\f',cf); } else putc(c,cf); } int x_wSL() { recpos=0; (*putn)('\n'); return(1); } int xw_end() { (*putn)('\n'); return(0); } int xw_rev() { if(workdone) (*putn)('\n'); return(workdone=0); } pcc-libs-20200614/libpcc004075500017500000000000000000001367127322400135745ustar raggewheelpcc-libs-20200614/libpcc/CVS004075500017500000000000000000001367127322400142275ustar raggewheelpcc-libs-20200614/libpcc/CVS/Root010064400017500000000000000000111367127322400151410ustar raggewheel/cvsroot pcc-libs-20200614/libpcc/CVS/Repository010064400017500000000000000000201367127322400163750ustar raggewheelpcc-libs/libpcc pcc-libs-20200614/libpcc/CVS/Entries010064400017500000000000000027161367127322400156450ustar raggewheel/Makefile.in/1.24/Fri Jul 27 16:30:00 2018// /_alloca.c/1.4/Sun Mar 15 00:20:41 2009// /_ftol.asm/1.1/Sun Mar 15 00:17:16 2009// /_ftol.c/1.2/Sat Mar 28 07:04:06 2009// /adddi3.c/1.3/Sun Mar 15 00:20:41 2009// /anddi3.c/1.3/Sun Mar 15 00:20:41 2009// /ashldi3.c/1.3/Sun Mar 15 00:20:41 2009// /ashrdi3.c/1.3/Sun Mar 15 00:20:41 2009// /cmpdi2.c/1.3/Sun Mar 15 00:20:41 2009// /cxmuldiv.c/1.4/Sat Jun 13 14:54:58 2020// /divdi3.c/1.3/Sun Mar 15 00:20:41 2009// /fixdfdi.c/1.3/Sun Mar 15 00:20:41 2009// /fixsfdi.c/1.3/Sun Mar 15 00:20:41 2009// /fixunsdfdi.c/1.3/Sun Mar 15 00:20:41 2009// /fixunssfdi.c/1.3/Sun Mar 15 00:20:41 2009// /floatdidf.c/1.3/Sun Mar 15 00:20:41 2009// /floatdisf.c/1.3/Sun Mar 15 00:20:41 2009// /floatunsdidf.c/1.3/Sun Mar 15 00:20:41 2009// /iordi3.c/1.3/Sun Mar 15 00:20:41 2009// /lshldi3.c/1.3/Sun Mar 15 00:20:41 2009// /lshrdi3.c/1.3/Sun Mar 15 00:20:42 2009// /moddi3.c/1.3/Sun Mar 15 00:20:42 2009// /muldi3.c/1.3/Sun Mar 15 00:20:42 2009// /negdi2.c/1.3/Sun Mar 15 00:20:42 2009// /notdi2.c/1.3/Sun Mar 15 00:20:42 2009// /qdivrem.c/1.3/Sun Mar 15 00:20:42 2009// /quad.h/1.10/Sun Mar 13 09:54:49 2016// /signbit.c/1.1/Fri Jul 27 16:30:00 2018// /ssp.c/1.11/Tue May 17 00:19:19 2011// /subdi3.c/1.3/Sun Mar 15 00:20:42 2009// /ucmpdi2.c/1.3/Sun Mar 15 00:20:42 2009// /udivdi3.c/1.3/Sun Mar 15 00:20:42 2009// /umoddi3.c/1.3/Sun Mar 15 00:20:42 2009// /unwind.c/1.3/Sun Sep 18 08:07:45 2011// /xordi3.c/1.3/Sun Mar 15 00:20:42 2009// D/include//// D pcc-libs-20200614/libpcc/Makefile.in010064400017500000000000000031611332664421000157100ustar raggewheel# $Id: Makefile.in,v 1.24 2018/07/27 16:30:00 ragge Exp $ # # Makefile.in for libpcc.a # VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ CC = @CC@ TARGMACH = @targmach@ TARGOS = @targos@ TARGET = @target@ VERSION = @version@ PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib PCCINCDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/include CPPFLAGS = @CPPFLAGS@ -I$(srcdir) @ENDIAN_FLAG@ -Dos_$(TARGOS) \ -Dmach_$(TARGMACH) -isystem $(top_srcdir)/libpcc/include LIBS = @LIBS@ AR = @AR@ RANLIB = @RANLIB@ INSTALL = @INSTALL@ HEADERS = float.h limits.h stdarg.h stdbool.h stddef.h \ iso646.h \ libpcc_float.h libpcc_limits.h libpcc_stdarg.h \ libpcc_stdbool.h libpcc_stddef.h OBJS = cmpdi2.o divdi3.o fixdfdi.o fixsfdi.o fixunsdfdi.o \ fixunssfdi.o floatdidf.o floatdisf.o floatunsdidf.o \ moddi3.o muldi3.o negdi2.o qdivrem.o \ ucmpdi2.o udivdi3.o umoddi3.o cxmuldiv.o \ ashldi3.o ashrdi3.o lshrdi3.o \ _alloca.o unwind.o \ ssp.o signbit.o DEST = libpcc.a all: $(DEST) $(DEST): $(OBJS) $(AR) r $@ $? $(RANLIB) $@ .c.o : $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< install: install-headers install-lib install-headers: test -z "${DESTDIR}$(PCCINCDIR)" || mkdir -p "${DESTDIR}$(PCCINCDIR)" headers='$(HEADERS)'; for i in $$headers; do \ $(INSTALL) -m 644 $(srcdir)/include/$$i \ ${DESTDIR}$(PCCINCDIR)/$$i; \ done install-lib: test -z "${DESTDIR}$(PCCLIBDIR)" || mkdir -p "${DESTDIR}$(PCCLIBDIR)" $(INSTALL) -m 644 $(DEST) ${DESTDIR}$(PCCLIBDIR) clean: /bin/rm -f $(OBJS) $(DEST) distclean: /bin/rm -f Makefile pcc-libs-20200614/libpcc/_alloca.c010064400017500000000000000022031115704473100153770ustar raggewheel/* $Id: _alloca.c,v 1.4 2009/03/15 00:20:41 gmcgarry Exp $ */ /* * This explanation of _alloca() comes from Chris Giese, posted to * alt.os.dev: * * By default, Windows reserves 1 meg of virtual memory for the stack. * No page of stack memory is actually allocated (commited) until the * page is accessed. This is demand-allocation. The page beyond the * top of the stack is the guard page. If this page is accessed, * memory will be allocated for it, and the guard page moved downward * by 4K (one page). Thus, the stack can grow beyond the initial 1 meg. * Windows will not, however, let you grow the stack by accessing * discontiguous pages of memory. Going beyond the guard page causes * an exception. Stack-probing code prevents this. */ #ifndef __MSC__ asm( " .text\n" " .globl __alloca\n" "__alloca:\n" #ifdef __i386__ " pop %edx\n" " pop %eax\n" " add $3,%eax\n" " and $-4,%eax\n" "1: cmp $4096,%eax\n" " jge 2f\n" " sub %eax,%esp\n" " test %eax,(%esp)\n" " mov %esp,%eax\n" " push %edx\n" " push %edx\n" " ret\n" "2: sub $4096,%esp\n" " sub $4096,%eax\n" " test %eax,(%esp)\n" " jmp 1b\n" #endif ); #endif pcc-libs-20200614/libpcc/_ftol.asm010064400017500000000000000014321115704441400154470ustar raggewheel; $Id: _ftol.asm,v 1.1 2009/03/15 00:17:16 gmcgarry Exp $ ; ; Implementation of _ftol(), _ftol2() for win32 and masm. ; .386 _TEXT segment use32 para public 'CODE' public __ftol2 __ftol2 proc near assume cs:_TEXT fnstcw word ptr [esp-2] mov ax, word ptr [esp-2] or ax, 0C00h mov word ptr [esp-4], ax fldcw word ptr [esp-4] fistp qword ptr [esp-12] fldcw word ptr [esp-2] mov eax, dword ptr [esp-12] mov edx, dword ptr [esp-8] ret __ftol2 endp _TEXT ends end alias __ftol = __ftol2 public __ftol pcc-libs-20200614/libpcc/_ftol.c010064400017500000000000000007471116334574600151320ustar raggewheel/* $Id: _ftol.c,v 1.2 2009/03/28 07:04:06 gmcgarry Exp $ */ /* * _ftol() and _ftol2() implementations used on win32 when linking against * other code built with Visual Studio. */ asm( " .text\n" " .globl __ftol\n" " .globl __ftol2\n" "__ftol:\n" "__ftol2:\n" " fnstcw -2(%esp)\n" " movw -2(%esp),%ax\n" " or %ax,0x0c00\n" " movw %ax,-4(%esp)\n" " fldcw -4(%esp)\n" " fistpl -12(%esp)\n" " fldcw -2(%esp)\n" " movl -12(%esp),%eax\n" " movl -8(%esp),%edx\n" " ret\n" ); pcc-libs-20200614/libpcc/adddi3.c010064400017500000000000000044251115704473100151450ustar raggewheel/* $Id: adddi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: adddi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Add two quads. This is trivial since a one-bit carry from a single * u_int addition x+y occurs if and only if the sum x+y is less than * either x or y (the choice to compare with x or y is arbitrary). */ quad_t __adddi3(quad_t a, quad_t b) { union uu aa, bb, sum; aa.q = a; bb.q = b; sum.ul[L] = aa.ul[L] + bb.ul[L]; sum.ul[H] = aa.ul[H] + bb.ul[H] + (sum.ul[L] < bb.ul[L]); return (sum.q); } pcc-libs-20200614/libpcc/anddi3.c010064400017500000000000000040531115704473100151540ustar raggewheel/* $Id: anddi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: anddi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return a & b, in quad. */ quad_t __anddi3(quad_t a, quad_t b) { union uu aa, bb; aa.q = a; bb.q = b; aa.ul[0] &= bb.ul[0]; aa.ul[1] &= bb.ul[1]; return (aa.q); } pcc-libs-20200614/libpcc/ashldi3.c010064400017500000000000000044501115704473100153420ustar raggewheel/* $Id: ashldi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: ashldi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Shift a (signed) quad value left (arithmetic shift left). * This is the same as logical shift left! */ quad_t __ashldi3(quad_t a, qshift_t shift) { union uu aa; if (shift == 0) return(a); aa.q = a; if (shift >= INT_BITS) { aa.ul[H] = aa.ul[L] << (shift - INT_BITS); aa.ul[L] = 0; } else { aa.ul[H] = (aa.ul[H] << shift) | (aa.ul[L] >> (INT_BITS - shift)); aa.ul[L] <<= shift; } return (aa.q); } pcc-libs-20200614/libpcc/ashrdi3.c010064400017500000000000000053021115704473100153450ustar raggewheel/* $Id: ashrdi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: ashrdi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Shift a (signed) quad value right (arithmetic shift right). */ quad_t __ashrdi3(quad_t a, qshift_t shift) { union uu aa; if (shift == 0) return(a); aa.q = a; if (shift >= INT_BITS) { int s; /* * Smear bits rightward using the machine's right-shift * method, whether that is sign extension or zero fill, * to get the `sign word' s. Note that shifting by * INT_BITS is undefined, so we shift (INT_BITS-1), * then 1 more, to get our answer. */ /* LINTED inherits machine dependency */ s = (aa.sl[H] >> (INT_BITS - 1)) >> 1; /* LINTED inherits machine dependency*/ aa.ul[L] = aa.sl[H] >> (shift - INT_BITS); aa.ul[H] = s; } else { aa.ul[L] = (aa.ul[L] >> shift) | (aa.ul[H] << (INT_BITS - shift)); /* LINTED inherits machine dependency */ aa.sl[H] >>= shift; } return (aa.q); } pcc-libs-20200614/libpcc/cmpdi2.c010064400017500000000000000043211115704473100151660ustar raggewheel/* $Id: cmpdi2.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: cmpdi2.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return 0, 1, or 2 as a <, =, > b respectively. * Both a and b are considered signed---which means only the high word is * signed. */ int __cmpdi2(quad_t a, quad_t b) { union uu aa, bb; aa.q = a; bb.q = b; return (aa.sl[H] < bb.sl[H] ? 0 : aa.sl[H] > bb.sl[H] ? 2 : aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1); } pcc-libs-20200614/libpcc/cxmuldiv.c010064400017500000000000000412541367116430200156510ustar raggewheel/* $Id: cxmuldiv.c,v 1.4 2020/06/13 14:54:58 ragge Exp $ */ /* * Copyright (c) 2014 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* * Complex div and mul, close to the C99 example but without * math routines. May need pcc to compile correctly. * Uses the same calling conventions and naming as the gcc counterparts. * * Could probably use the same function for all three sizes of floats. * Not heavily tested. */ #if __FLOAT_WORD_ORDER__ != __ORDER_PDP_ENDIAN__ /* not supported yet... */ /* * Float (single precision). */ union uf { float f; unsigned int i; }; #define FLOAT_SIGN 0x80000000U #define FLOAT_EXP 0x7f800000U #define FLOAT_MANT 0x007fffffU #define FLOAT_MANTEXP (FLOAT_EXP|FLOAT_MANT) #define FLOAT_INF 0x7f800000U #define FLOAT_ISFIN(x) ((x.i & FLOAT_MANTEXP) != FLOAT_INF) #define FLOAT_ISINF(x) ((x.i & FLOAT_MANTEXP) == FLOAT_INF) #define FLOAT_ISNAN(x) (((x.i & FLOAT_EXP) == FLOAT_INF) && \ (x.i & FLOAT_MANT) != 0) static float pcc_copysignf(float x, float y) { union uf ux, uy; ux.f = x; uy.f = y; ux.i = (ux.i & FLOAT_MANTEXP) | (uy.i & FLOAT_SIGN); return ux.f; } static float pcc_scalbnf(float x, int exp) { union uf x1, z1, z2; x1.f = x; if (FLOAT_ISINF(x1) || FLOAT_ISNAN(x1)) return x; exp += 127; if (exp <= 0) { z2.i = (127 - 50) << 23; x *= z2.f; exp += 50; if (exp < 0) exp = 0; } else if (exp > 254) { z2.i = (128 + 25) << 23; x *= z2.f; exp -= 25; if (exp > 254) exp = 254; } z1.i = exp << 23; x *= z1.f; return x; } float _Complex __divsc3(float ax, float bx, float cx, float dx) { float denom; union uf ua, ub, uc, ud, ur, ulogbw, ux, uy; int uci, udi, res, ilogbw = 0; ua.f = ax; ub.f = bx; uc.f = cx; ud.f = dx; /* fabsf; clear sign */ uci = uc.i & FLOAT_MANTEXP; udi = ud.i & FLOAT_MANTEXP; /* fmaxf; ordinary integer compare */ ur.i = (uci > udi ? uci : udi); /* logbf */ res = ur.i >> 23; if (ur.i == 0) ulogbw.f = (float)-1.0/ur.f; else if (res == 255) ulogbw.f = ur.f * ur.f; else if (res == 0) ulogbw.f = -126.0; else ulogbw.f = (res-127); /* isfinite */ if (FLOAT_ISFIN(ulogbw)) { ilogbw = (int)ulogbw.f; uc.f = pcc_scalbnf(uc.f, -ilogbw); ud.f = pcc_scalbnf(ud.f, -ilogbw); } denom = uc.f * uc.f + ud.f * ud.f; ux.f = pcc_scalbnf((ua.f * uc.f + ub.f * ud.f) / denom, -ilogbw); uy.f = pcc_scalbnf((ub.f * uc.f - ua.f * ud.f) / denom, -ilogbw); if (FLOAT_ISNAN(ux) && FLOAT_ISNAN(uy)) { if ((denom == 0.0) && (!FLOAT_ISNAN(ua) || !FLOAT_ISNAN(ub))) { ux.f = pcc_copysignf(__builtin_inff(), uc.f) * ua.f; uy.f = pcc_copysignf(__builtin_inff(), uc.f) * ub.f; } else if ((FLOAT_ISINF(ua) || FLOAT_ISINF(ub)) && FLOAT_ISFIN(uc) && FLOAT_ISFIN(ud)) { ua.f = pcc_copysignf(FLOAT_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysignf(FLOAT_ISINF(ub) ? 1.0 : 0.0, ub.f); ux.f = __builtin_inff() * ( ua.f * uc.f + ub.f * ud.f ); uy.f = __builtin_inff() * ( ub.f * uc.f - ua.f * ud.f ); } else if (FLOAT_ISINF(ulogbw) && FLOAT_ISFIN(ua) && FLOAT_ISFIN(ub)) { uc.f = pcc_copysignf(FLOAT_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysignf(FLOAT_ISINF(ud) ? 1.0 : 0.0, ud.f); ux.f = 0.0 * ( ua.f * uc.f + ub.f * ud.f ); uy.f = 0.0 * ( ub.f * uc.f - ua.f * ud.f ); } } return ux.f + 1.0iF * uy.f; } float _Complex __mulsc3(float fa, float fb, float fc, float fd) { union uf ua, ub, uc, ud, ux, uy, uac, ubd, uad, ubc; ua.f = fa; ub.f = fb; uc.f = fc; ud.f = fd; uac.f = ua.f * uc.f; ubd.f = ub.f * ud.f; uad.f = ua.f * ud.f; ubc.f = ub.f * uc.f; ux.f=uac.f-ubd.f; uy.f=uad.f+ubc.f; if (FLOAT_ISNAN(ux) && FLOAT_ISNAN(uy)) { /* Recover infinities that computed as NaN+iNaN ... */ int recalc = 0; if (FLOAT_ISINF(ua) || FLOAT_ISINF(ub) ) { // z is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ ua.f = pcc_copysignf(FLOAT_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysignf(FLOAT_ISINF(ub) ? 1.0 : 0.0, ub.f); if (FLOAT_ISNAN(uc)) uc.f = pcc_copysignf(0.0, uc.f); if (FLOAT_ISNAN(ud)) ud.f = pcc_copysignf(0.0, ud.f); recalc = 1; } if (FLOAT_ISINF(uc) || FLOAT_ISINF(ud) ) { // w is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ uc.f = pcc_copysignf(FLOAT_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysignf(FLOAT_ISINF(ud) ? 1.0 : 0.0, ud.f); if (FLOAT_ISNAN(ua)) ua.f = pcc_copysignf(0.0, ua.f); if (FLOAT_ISNAN(ub)) ub.f = pcc_copysignf(0.0, ub.f); recalc = 1; } if (!recalc && (FLOAT_ISINF(uac) || FLOAT_ISINF(ubd) || FLOAT_ISINF(uad) || FLOAT_ISINF(ubc))) { /* Recover infinities from overflow by changing NaNs to 0 ... */ if (FLOAT_ISNAN(ua)) ua.f = pcc_copysignf(0.0, ua.f); if (FLOAT_ISNAN(ub)) ub.f = pcc_copysignf(0.0, ub.f); if (FLOAT_ISNAN(uc)) uc.f = pcc_copysignf(0.0, uc.f); if (FLOAT_ISNAN(ud)) ud.f = pcc_copysignf(0.0, ud.f); recalc = 1; } if (recalc) { ux.f = __builtin_inff() * ( ua.f * uc.f - ub.f * ud.f ); uy.f = __builtin_inff() * ( ua.f * ud.f + ub.f * uc.f ); } } return ux.f + 1.0iF * uy.f; } /* * double precision functions. */ union ud { double f; unsigned int i[2]; }; #if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__ #define dih i[0] #define dil i[1] #else #define dil i[0] #define dih i[1] #endif #define DOUBLE_SIGN 0x80000000U #define DOUBLE_EXP 0x7ff00000U #define DOUBLE_MANT 0x000fffffU #define DOUBLE_MANTEXP (DOUBLE_EXP|DOUBLE_MANT) #define DOUBLE_INF 0x7ff00000U #define DOUBLE_ISFIN(x) ((x.dih & DOUBLE_MANTEXP) != DOUBLE_INF) #define DOUBLE_ISINF(x) ((x.dih & DOUBLE_MANTEXP) == DOUBLE_INF) #define DOUBLE_ISNAN(x) (((x.dih & DOUBLE_EXP) == DOUBLE_INF) && \ (((x.dih & DOUBLE_MANT) != 0) || ((x.dil) != 0))) static double pcc_copysign(double x, double y) { union ud ux, uy; ux.f = x; uy.f = y; ux.dih = (ux.dih & DOUBLE_MANTEXP) | (uy.dih & DOUBLE_SIGN); return ux.f; } static double pcc_scalbn(double x, int exp) { union ud x1, z1, z2; x1.f = x; if (DOUBLE_ISINF(x1) || DOUBLE_ISNAN(x1)) return x; exp += 1023; z1.dil = z2.dil = 0; if (exp <= 0) { z2.dih = (1023 - 110) << 20; x *= z2.f; exp += 110; if (exp < 0) exp = 0; } else if (exp > 2046) { z2.dih = (1024 + 55) << 20; x *= z2.f; exp -= 55; if (exp > 2046) exp = 2046; } z1.dih = exp << 20; x *= z1.f; return x; } double _Complex __divdc3(double ax, double bx, double cx, double dx) { double denom; union ud ua, ub, uc, ud, ur, ulogbw, ux, uy; int uci, udi, res, ilogbw = 0; ua.f = ax; ub.f = bx; uc.f = cx; ud.f = dx; /* fabsf; clear sign */ uci = uc.dih & DOUBLE_MANTEXP; udi = ud.dih & DOUBLE_MANTEXP; /* fmaxf; ordinary integer compare */ if ((uci > udi) || (uci == udi && uc.dil > ud.dil)) { ur.dih = uci; ur.dil = uc.dil; } else { ur.dih = udi; ur.dil = ud.dil; } /* logbf */ res = ur.dih >> 20; if (ur.dih == 0 && ur.dil == 0) ulogbw.f = (double)-1.0/ur.f; else if (res == 2047) ulogbw.f = ur.f * ur.f; else if (res == 0) ulogbw.f = -1022.0; else ulogbw.f = (res-1023); /* isfinite */ if (DOUBLE_ISFIN(ulogbw)) { ilogbw = (int)ulogbw.f; uc.f = pcc_scalbn(uc.f, -ilogbw); ud.f = pcc_scalbn(ud.f, -ilogbw); } denom = uc.f * uc.f + ud.f * ud.f; ux.f = pcc_scalbn((ua.f * uc.f + ub.f * ud.f) / denom, -ilogbw); uy.f = pcc_scalbn((ub.f * uc.f - ua.f * ud.f) / denom, -ilogbw); if (DOUBLE_ISNAN(ux) && DOUBLE_ISNAN(uy)) { if ((denom == 0.0) && (!DOUBLE_ISNAN(ua) || !DOUBLE_ISNAN(ub))) { ux.f = pcc_copysign(__builtin_inff(), uc.f) * ua.f; uy.f = pcc_copysign(__builtin_inff(), uc.f) * ub.f; } else if ((DOUBLE_ISINF(ua) || DOUBLE_ISINF(ub)) && DOUBLE_ISFIN(uc) && DOUBLE_ISFIN(ud)) { ua.f = pcc_copysign(DOUBLE_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysign(DOUBLE_ISINF(ub) ? 1.0 : 0.0, ub.f); ux.f = __builtin_inf() * ( ua.f * uc.f + ub.f * ud.f ); uy.f = __builtin_inf() * ( ub.f * uc.f - ua.f * ud.f ); } else if (DOUBLE_ISINF(ulogbw) && DOUBLE_ISFIN(ua) && DOUBLE_ISFIN(ub)) { uc.f = pcc_copysign(DOUBLE_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysign(DOUBLE_ISINF(ud) ? 1.0 : 0.0, ud.f); ux.f = 0.0 * ( ua.f * uc.f + ub.f * ud.f ); uy.f = 0.0 * ( ub.f * uc.f - ua.f * ud.f ); } } return ux.f + 1.0iF * uy.f; } double _Complex __muldc3(double fa, double fb, double fc, double fd) { union ud ua, ub, uc, ud, ux, uy, uac, ubd, uad, ubc; ua.f = fa; ub.f = fb; uc.f = fc; ud.f = fd; uac.f = ua.f * uc.f; ubd.f = ub.f * ud.f; uad.f = ua.f * ud.f; ubc.f = ub.f * uc.f; ux.f=uac.f-ubd.f; uy.f=uad.f+ubc.f; if (DOUBLE_ISNAN(ux) && DOUBLE_ISNAN(uy)) { /* Recover infinities that computed as NaN+iNaN ... */ int recalc = 0; if (DOUBLE_ISINF(ua) || DOUBLE_ISINF(ub) ) { // z is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ ua.f = pcc_copysign(DOUBLE_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysign(DOUBLE_ISINF(ub) ? 1.0 : 0.0, ub.f); if (DOUBLE_ISNAN(uc)) uc.f = pcc_copysign(0.0, uc.f); if (DOUBLE_ISNAN(ud)) ud.f = pcc_copysign(0.0, ud.f); recalc = 1; } if (DOUBLE_ISINF(uc) || DOUBLE_ISINF(ud) ) { // w is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ uc.f = pcc_copysign(DOUBLE_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysign(DOUBLE_ISINF(ud) ? 1.0 : 0.0, ud.f); if (DOUBLE_ISNAN(ua)) ua.f = pcc_copysign(0.0, ua.f); if (DOUBLE_ISNAN(ub)) ub.f = pcc_copysign(0.0, ub.f); recalc = 1; } if (!recalc && (DOUBLE_ISINF(uac) || DOUBLE_ISINF(ubd) || DOUBLE_ISINF(uad) || DOUBLE_ISINF(ubc))) { /* Recover infinities from overflow by changing NaNs to 0 ... */ if (DOUBLE_ISNAN(ua)) ua.f = pcc_copysign(0.0, ua.f); if (DOUBLE_ISNAN(ub)) ub.f = pcc_copysign(0.0, ub.f); if (DOUBLE_ISNAN(uc)) uc.f = pcc_copysign(0.0, uc.f); if (DOUBLE_ISNAN(ud)) ud.f = pcc_copysign(0.0, ud.f); recalc = 1; } if (recalc) { ux.f = __builtin_inf() * ( ua.f * uc.f - ub.f * ud.f ); uy.f = __builtin_inf() * ( ua.f * ud.f + ub.f * uc.f ); } } return ux.f + 1.0iF * uy.f; } /* * Long double functions. */ union ul { long double f; unsigned int i[4]; }; #if defined(mach_amd64) || defined(mach_i386) /* x87 */ #define dil3 i[0] #define dil2 i[0] #define dil1 i[1] #define dlh i[2] #elif __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__ #define dlh i[0] #define dil1 i[1] #define dil2 i[2] #define dil3 i[3] #else #define dil3 i[0] #define dil2 i[1] #define dil1 i[2] #define dlh i[3] #endif #if defined(mach_aarch64) || defined(mach_amd64) || defined(mach_i386) || defined(mach_mips) #define LDBL_SIGN 0x8000U #define LDBL_EXP 0x7fffU #define LDBL_MANT 0x0U #define LDBL_MANTEXP (LDBL_EXP|LDBL_MANT) #define LDBL_INF LDBL_EXP #define LDBL_HIDDEN 0x80000000U #else #error FIXME long double #endif #define LDBL_ISFIN(x) ((x.dlh & LDBL_MANTEXP) != LDBL_INF) #define LDBL_ISINF(x) (((x.dlh & LDBL_MANTEXP) == LDBL_INF) && \ (x.dil1 == 0 && x.dil2 == 0 && x.dil3 == 0)) #define LDBL_ISNAN(x) (((x.dlh & LDBL_MANTEXP) == LDBL_INF) && \ (x.dil1 != 0 || x.dil2 != 0 || x.dil3 != 0)) static long double pcc_copysignl(long double x, long double y) { union ul ux, uy; ux.f = x; uy.f = y; ux.dlh = (ux.dlh & LDBL_MANTEXP) | (uy.dlh & LDBL_SIGN); return ux.f; } static long double pcc_scalbnl(long double x, int exp) { union ul x1, z1, z2; x1.f = x; if (LDBL_ISINF(x1) || LDBL_ISNAN(x1)) return x; exp += 16383; z1.dil1 = z1.dil2 = z2.dil1 = z2.dil2 = 0; z1.dil3 = z2.dil3 = 0; if (exp <= 0) { z2.dlh = (16383 - 130); z2.dil1 = LDBL_HIDDEN; x *= z2.f; exp += 130; if (exp < 0) exp = 0; } else if (exp > 32766) { z2.dlh = (16384 + 65); z2.dil1 = LDBL_HIDDEN; x *= z2.f; exp -= 65; if (exp > 32766) exp = 32766; } z1.dlh = exp; z1.dil1 = LDBL_HIDDEN; x *= z1.f; return x; } long double _Complex __divxc3(long double ax, long double bx, long double cx, long double dx) { long double denom; union ul ua, ub, uc, ud, ur, ulogbw, ux, uy, *urp; int uci, udi, res, ilogbw = 0; ua.f = ax; ub.f = bx; uc.f = cx; ud.f = dx; /* fabsf; clear sign */ uci = uc.dlh & LDBL_MANTEXP; udi = ud.dlh & LDBL_MANTEXP; /* fmaxl; integer compare */ if ((uci > udi) || ((uci == udi) && (uc.dil1 > ud.dil1)) || ((uci == udi) && (uc.dil1 == ud.dil1) && (uc.dil2 > ud.dil2)) || ((uci == udi) && (uc.dil1 == ud.dil1) && (uc.dil2 == ud.dil2) && (uc.dil3 > ud.dil3))) urp = &uc; else urp = &ud; ur.dlh = urp->dlh; ur.dil1 = urp->dil1; ur.dil2 = urp->dil2; ur.dil3 = urp->dil3; /* logbf */ res = ur.dlh; if (res == 0 && ur.dil1 == 0 && ur.dil2 == 0 && ur.dil3 == 0) ulogbw.f = (long double)-1.0/ur.f; else if (res == 32767) ulogbw.f = ur.f * ur.f; else if (res == 0) ulogbw.f = -16382.0; else ulogbw.f = (res-16383); /* isfinite */ if (LDBL_ISFIN(ulogbw)) { ilogbw = (int)ulogbw.f; uc.f = pcc_scalbnl(uc.f, -ilogbw); ud.f = pcc_scalbnl(ud.f, -ilogbw); } denom = uc.f * uc.f + ud.f * ud.f; ux.f = pcc_scalbnl((ua.f * uc.f + ub.f * ud.f) / denom, -ilogbw); uy.f = pcc_scalbnl((ub.f * uc.f - ua.f * ud.f) / denom, -ilogbw); if (LDBL_ISNAN(ux) && LDBL_ISNAN(uy)) { if ((denom == 0.0) && (!LDBL_ISNAN(ua) || !LDBL_ISNAN(ub))) { ux.f = pcc_copysignl(__builtin_infl(), uc.f) * ua.f; uy.f = pcc_copysignl(__builtin_infl(), uc.f) * ub.f; } else if ((LDBL_ISINF(ua) || LDBL_ISINF(ub)) && LDBL_ISFIN(uc) && LDBL_ISFIN(ud)) { ua.f = pcc_copysignl(LDBL_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysignl(LDBL_ISINF(ub) ? 1.0 : 0.0, ub.f); ux.f = __builtin_infl() * ( ua.f * uc.f + ub.f * ud.f ); uy.f = __builtin_infl() * ( ub.f * uc.f - ua.f * ud.f ); } else if (LDBL_ISINF(ulogbw) && LDBL_ISFIN(ua) && LDBL_ISFIN(ub)) { uc.f = pcc_copysignl(LDBL_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysignl(LDBL_ISINF(ud) ? 1.0 : 0.0, ud.f); ux.f = 0.0 * ( ua.f * uc.f + ub.f * ud.f ); uy.f = 0.0 * ( ub.f * uc.f - ua.f * ud.f ); } } return ux.f + 1.0iF * uy.f; } long double _Complex __mulxc3(long double fa, long double fb, long double fc, long double fd) { union ul ua, ub, uc, ud, ux, uy, uac, ubd, uad, ubc; ua.f = fa; ub.f = fb; uc.f = fc; ud.f = fd; uac.f = ua.f * uc.f; ubd.f = ub.f * ud.f; uad.f = ua.f * ud.f; ubc.f = ub.f * uc.f; ux.f=uac.f-ubd.f; uy.f=uad.f+ubc.f; if (LDBL_ISNAN(ux) && LDBL_ISNAN(uy)) { /* Recover infinities that computed as NaN+iNaN ... */ int recalc = 0; if (LDBL_ISINF(ua) || LDBL_ISINF(ub) ) { // z is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ ua.f = pcc_copysignl(LDBL_ISINF(ua) ? 1.0 : 0.0, ua.f); ub.f = pcc_copysignl(LDBL_ISINF(ub) ? 1.0 : 0.0, ub.f); if (LDBL_ISNAN(uc)) uc.f = pcc_copysignl(0.0, uc.f); if (LDBL_ISNAN(ud)) ud.f = pcc_copysignl(0.0, ud.f); recalc = 1; } if (LDBL_ISINF(uc) || LDBL_ISINF(ud) ) { // w is infinite /* "Box" the infinity and change NaNs in the other factor to 0 */ uc.f = pcc_copysignl(LDBL_ISINF(uc) ? 1.0 : 0.0, uc.f); ud.f = pcc_copysignl(LDBL_ISINF(ud) ? 1.0 : 0.0, ud.f); if (LDBL_ISNAN(ua)) ua.f = pcc_copysignl(0.0, ua.f); if (LDBL_ISNAN(ub)) ub.f = pcc_copysignl(0.0, ub.f); recalc = 1; } if (!recalc && (LDBL_ISINF(uac) || LDBL_ISINF(ubd) || LDBL_ISINF(uad) || LDBL_ISINF(ubc))) { /* Recover infinities from overflow by changing NaNs to 0 ... */ if (LDBL_ISNAN(ua)) ua.f = pcc_copysignl(0.0, ua.f); if (LDBL_ISNAN(ub)) ub.f = pcc_copysignl(0.0, ub.f); if (LDBL_ISNAN(uc)) uc.f = pcc_copysignl(0.0, uc.f); if (LDBL_ISNAN(ud)) ud.f = pcc_copysignl(0.0, ud.f); recalc = 1; } if (recalc) { ux.f = __builtin_infl() * ( ua.f * uc.f - ub.f * ud.f ); uy.f = __builtin_infl() * ( ua.f * ud.f + ub.f * uc.f ); } } return ux.f + 1.0iF * uy.f; } #endif pcc-libs-20200614/libpcc/divdi3.c010064400017500000000000000043231115704473100151740ustar raggewheel/* $Id: divdi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: divdi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Divide two signed quads. * ??? if -1/2 should produce -1 on this machine, this code is wrong */ quad_t __divdi3(quad_t a, quad_t b) { u_quad_t ua, ub, uq; int neg = 0; ua = a; ub = b; if (a < 0) ua = -ua, neg ^= 1; if (b < 0) ub = -ub, neg ^= 1; uq = __qdivrem(ua, ub, (u_quad_t *)0); if (neg) uq = - uq; return uq; } pcc-libs-20200614/libpcc/fixdfdi.c010064400017500000000000000042471115704473100154340ustar raggewheel/* $Id: fixdfdi.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: fixdfdi.c,v 1.4 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Convert double to (signed) quad. * We clamp anything that is out of range. */ quad_t __fixdfdi(double x) { if (x < 0) if (x <= QUAD_MIN) return (QUAD_MIN); else return ((quad_t)-(u_quad_t)-x); else if (x >= QUAD_MAX) return (QUAD_MAX); else return ((quad_t)(u_quad_t)x); } pcc-libs-20200614/libpcc/fixsfdi.c010064400017500000000000000042361115704473100154510ustar raggewheel/* $Id: fixsfdi.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: fixsfdi.c,v 1.4 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992 The Regents of the University of California. * All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Convert float to (signed) quad. * We clamp anything that is out of range. */ quad_t __fixsfdi(float x) { if (x < 0) if (x <= QUAD_MIN) return (QUAD_MIN); else return ((quad_t)-(u_quad_t)-x); else if (x >= QUAD_MAX) return (QUAD_MAX); else return ((quad_t)(u_quad_t)x); } pcc-libs-20200614/libpcc/fixunsdfdi.c010064400017500000000000000056051115704473100161610ustar raggewheel/* $Id: fixunsdfdi.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: fixunsdfdi.c,v 1.7 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" #define ONE_FOURTH ((int)1 << (INT_BITS - 2)) #define ONE_HALF (ONE_FOURTH * 2.0) #define ONE (ONE_FOURTH * 4.0) /* * Convert double to (unsigned) quad. * Not sure what to do with negative numbers---for now, anything out * of range becomes UQUAD_MAX. */ u_quad_t __fixunsdfdi(double x) { union uu t; unsigned int tmp; if (x < 0) return (UQUAD_MAX); /* ??? should be 0? ERANGE??? */ #ifdef notdef /* this falls afoul of a GCC bug */ if (x >= UQUAD_MAX) return (UQUAD_MAX); #else /* so we wire in 2^64-1 instead */ if (x >= 18446744073709551615.0) /* XXX */ return (UQUAD_MAX); #endif /* * Now we know that 0 <= x <= 18446744073709549568. The upper * limit is one ulp less than 18446744073709551615 tested for above. * Dividing this by 2^32 will *not* round irrespective of any * rounding modes (except if the result is an IEEE denorm). * Furthermore, the quotient will fit into a 32-bit integer. */ tmp = x / ONE; t.ul[L] = (unsigned int) (x - tmp * ONE); t.ul[H] = tmp; return (t.uq); } pcc-libs-20200614/libpcc/fixunssfdi.c010064400017500000000000000064151115704473100162000ustar raggewheel/* $Id: fixunssfdi.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: fixunssfdi.c,v 1.6 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" #define ONE_FOURTH ((int)1 << (INT_BITS - 2)) #define ONE_HALF (ONE_FOURTH * 2.0) #define ONE (ONE_FOURTH * 4.0) /* * Convert float to (unsigned) quad. We do most of our work in double, * out of sheer paranoia. * * Not sure what to do with negative numbers---for now, anything out * of range becomes UQUAD_MAX. */ u_quad_t __fixunssfdi(float f) { double x, toppart; union uu t; if (f < 0) return (UQUAD_MAX); /* ??? should be 0? ERANGE??? */ #ifdef notdef /* this falls afoul of a GCC bug */ if (f >= UQUAD_MAX) return (UQUAD_MAX); #else /* so we wire in 2^64-1 instead */ if (f >= 18446744073709551615.0) /* XXX */ return (UQUAD_MAX); #endif x = f; /* * Get the upper part of the result. Note that the divide * may round up; we want to avoid this if possible, so we * subtract `1/2' first. */ toppart = (x - ONE_HALF) / ONE; /* * Now build a u_quad_t out of the top part. The difference * between x and this is the bottom part (this may introduce * a few fuzzy bits, but what the heck). With any luck this * difference will be nonnegative: x should wind up in the * range [0..UINT_MAX]. For paranoia, we assume [INT_MIN.. * 2*UINT_MAX] instead. */ t.ul[H] = (unsigned int)toppart; t.ul[L] = 0; x -= (double)t.uq; if (x < 0) { t.ul[H]--; x += UINT_MAX; } if (x > UINT_MAX) { t.ul[H]++; x -= UINT_MAX; } t.ul[L] = (unsigned int)x; return (t.uq); } pcc-libs-20200614/libpcc/floatdidf.c010064400017500000000000000050241115704473100157450ustar raggewheel/* $Id: floatdidf.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: floatdidf.c,v 1.6 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Convert (signed) quad to double. */ double __floatdidf(quad_t x) { double d; union uu u; int neg; /* * Get an unsigned number first, by negating if necessary. */ if (x < 0) u.q = -x, neg = 1; else u.q = x, neg = 0; /* * Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L] * has the units. Ideally we could just set d, add INT_BITS to * its exponent, and then add the units, but this is portable * code and does not know how to get at an exponent. Machine- * specific code may be able to do this more efficiently. */ d = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0); d += u.ul[L]; return (neg ? -d : d); } pcc-libs-20200614/libpcc/floatdisf.c010064400017500000000000000051061115704473100157650ustar raggewheel/* $Id: floatdisf.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: floatdisf.c,v 1.6 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Convert (signed) quad to float. */ float __floatdisf(quad_t x) { float f; union uu u; int neg; /* * Get an unsigned number first, by negating if necessary. */ if (x < 0) u.q = -x, neg = 1; else u.q = x, neg = 0; /* * Now u.ul[H] has the factor of 2^32 (or whatever) and u.ul[L] * has the units. Ideally we could just set f, add INT_BITS to * its exponent, and then add the units, but this is portable * code and does not know how to get at an exponent. Machine- * specific code may be able to do this more efficiently. * * Using double here may be excessive paranoia. */ f = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0); f += u.ul[L]; return (neg ? -f : f); } pcc-libs-20200614/libpcc/floatunsdidf.c010064400017500000000000000042271115704473100164770ustar raggewheel/* $Id: floatunsdidf.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: floatunsdidf.c,v 1.6 2003/08/07 16:43:16 agc Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Convert (unsigned) quad to double. * This is exactly like floatdidf.c except that negatives never occur. */ double __floatunsdidf(u_quad_t x) { double d; union uu u; u.uq = x; d = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0); d += u.ul[L]; return (d); } pcc-libs-20200614/libpcc/iordi3.c010064400017500000000000000040531115704473100152030ustar raggewheel/* $Id: iordi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: iordi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return a | b, in quad. */ quad_t __iordi3(quad_t a, quad_t b) { union uu aa, bb; aa.q = a; bb.q = b; aa.ul[0] |= bb.ul[0]; aa.ul[1] |= bb.ul[1]; return (aa.q); } pcc-libs-20200614/libpcc/lshldi3.c010064400017500000000000000044531115704473100153600ustar raggewheel/* $Id: lshldi3.c,v 1.3 2009/03/15 00:20:41 gmcgarry Exp $ */ /* $NetBSD: lshldi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Shift an (unsigned) quad value left (logical shift left). * This is the same as arithmetic shift left! */ quad_t __lshldi3(quad_t a, qshift_t shift) { union uu aa; if (shift == 0) return(a); aa.q = a; if (shift >= INT_BITS) { aa.ul[H] = aa.ul[L] << (shift - INT_BITS); aa.ul[L] = 0; } else { aa.ul[H] = (aa.ul[H] << shift) | (aa.ul[L] >> (INT_BITS - shift)); aa.ul[L] <<= shift; } return (aa.q); } pcc-libs-20200614/libpcc/lshrdi3.c010064400017500000000000000043771115704473200153740ustar raggewheel/* $Id: lshrdi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: lshrdi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Shift an (unsigned) quad value right (logical shift right). */ quad_t __lshrdi3(quad_t a, qshift_t shift) { union uu aa; if (shift == 0) return(a); aa.q = a; if (shift >= INT_BITS) { aa.ul[L] = aa.ul[H] >> (shift - INT_BITS); aa.ul[H] = 0; } else { aa.ul[L] = (aa.ul[L] >> shift) | (aa.ul[H] << (INT_BITS - shift)); aa.ul[H] >>= shift; } return (aa.q); } pcc-libs-20200614/libpcc/moddi3.c010064400017500000000000000043451115704473200151760ustar raggewheel/* $Id: moddi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: moddi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return remainder after dividing two signed quads. * * XXX we assume a % b < 0 iff a < 0, but this is actually machine-dependent. */ quad_t __moddi3(quad_t a, quad_t b) { u_quad_t ua, ub, ur; int neg = 0; ua = a; ub = b; if (a < 0) ua = -ua, neg ^= 1; if (b < 0) ub = -ub; (void)__qdivrem(ua, ub, &ur); if (neg) ur = -ur; return (ur); } pcc-libs-20200614/libpcc/muldi3.c010064400017500000000000000156061115704473200152160ustar raggewheel/* $Id: muldi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: muldi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Multiply two quads. * * Our algorithm is based on the following. Split incoming quad values * u and v (where u,v >= 0) into * * u = 2^n u1 * u0 (n = number of bits in `unsigned int', usu. 32) * * and * * v = 2^n v1 * v0 * * Then * * uv = 2^2n u1 v1 + 2^n u1 v0 + 2^n v1 u0 + u0 v0 * = 2^2n u1 v1 + 2^n (u1 v0 + v1 u0) + u0 v0 * * Now add 2^n u1 v1 to the first term and subtract it from the middle, * and add 2^n u0 v0 to the last term and subtract it from the middle. * This gives: * * uv = (2^2n + 2^n) (u1 v1) + * (2^n) (u1 v0 - u1 v1 + u0 v1 - u0 v0) + * (2^n + 1) (u0 v0) * * Factoring the middle a bit gives us: * * uv = (2^2n + 2^n) (u1 v1) + [u1v1 = high] * (2^n) (u1 - u0) (v0 - v1) + [(u1-u0)... = mid] * (2^n + 1) (u0 v0) [u0v0 = low] * * The terms (u1 v1), (u1 - u0) (v0 - v1), and (u0 v0) can all be done * in just half the precision of the original. (Note that either or both * of (u1 - u0) or (v0 - v1) may be negative.) * * This algorithm is from Knuth vol. 2 (2nd ed), section 4.3.3, p. 278. * * Since C does not give us a `int * int = quad' operator, we split * our input quads into two ints, then split the two ints into two * shorts. We can then calculate `short * short = int' in native * arithmetic. * * Our product should, strictly speaking, be a `long quad', with 128 * bits, but we are going to discard the upper 64. In other words, * we are not interested in uv, but rather in (uv mod 2^2n). This * makes some of the terms above vanish, and we get: * * (2^n)(high) + (2^n)(mid) + (2^n + 1)(low) * * or * * (2^n)(high + mid + low) + low * * Furthermore, `high' and `mid' can be computed mod 2^n, as any factor * of 2^n in either one will also vanish. Only `low' need be computed * mod 2^2n, and only because of the final term above. */ static quad_t __lmulq(unsigned int, unsigned int); quad_t __muldi3(quad_t a, quad_t b) { union uu u, v, low, prod; unsigned int high, mid, udiff, vdiff; int negall, negmid; #define u1 u.ul[H] #define u0 u.ul[L] #define v1 v.ul[H] #define v0 v.ul[L] /* * Get u and v such that u, v >= 0. When this is finished, * u1, u0, v1, and v0 will be directly accessible through the * int fields. */ if (a >= 0) u.q = a, negall = 0; else u.q = -a, negall = 1; if (b >= 0) v.q = b; else v.q = -b, negall ^= 1; if (u1 == 0 && v1 == 0) { /* * An (I hope) important optimization occurs when u1 and v1 * are both 0. This should be common since most numbers * are small. Here the product is just u0*v0. */ prod.q = __lmulq(u0, v0); } else { /* * Compute the three intermediate products, remembering * whether the middle term is negative. We can discard * any upper bits in high and mid, so we can use native * unsigned int * unsigned int => unsigned int arithmetic. */ low.q = __lmulq(u0, v0); if (u1 >= u0) negmid = 0, udiff = u1 - u0; else negmid = 1, udiff = u0 - u1; if (v0 >= v1) vdiff = v0 - v1; else vdiff = v1 - v0, negmid ^= 1; mid = udiff * vdiff; high = u1 * v1; /* * Assemble the final product. */ prod.ul[H] = high + (negmid ? -mid : mid) + low.ul[L] + low.ul[H]; prod.ul[L] = low.ul[L]; } return (negall ? -prod.q : prod.q); #undef u1 #undef u0 #undef v1 #undef v0 } /* * Multiply two 2N-bit ints to produce a 4N-bit quad, where N is half * the number of bits in an int (whatever that is---the code below * does not care as long as quad.h does its part of the bargain---but * typically N==16). * * We use the same algorithm from Knuth, but this time the modulo refinement * does not apply. On the other hand, since N is half the size of an int, * we can get away with native multiplication---none of our input terms * exceeds (UINT_MAX >> 1). * * Note that, for unsigned int l, the quad-precision result * * l << N * * splits into high and low ints as HHALF(l) and LHUP(l) respectively. */ static quad_t __lmulq(unsigned int u, unsigned int v) { unsigned int u1, u0, v1, v0, udiff, vdiff, high, mid, low; unsigned int prodh, prodl, was; union uu prod; int neg; u1 = HHALF(u); u0 = LHALF(u); v1 = HHALF(v); v0 = LHALF(v); low = u0 * v0; /* This is the same small-number optimization as before. */ if (u1 == 0 && v1 == 0) return (low); if (u1 >= u0) udiff = u1 - u0, neg = 0; else udiff = u0 - u1, neg = 1; if (v0 >= v1) vdiff = v0 - v1; else vdiff = v1 - v0, neg ^= 1; mid = udiff * vdiff; high = u1 * v1; /* prod = (high << 2N) + (high << N); */ prodh = high + HHALF(high); prodl = LHUP(high); /* if (neg) prod -= mid << N; else prod += mid << N; */ if (neg) { was = prodl; prodl -= LHUP(mid); prodh -= HHALF(mid) + (prodl > was); } else { was = prodl; prodl += LHUP(mid); prodh += HHALF(mid) + (prodl < was); } /* prod += low << N */ was = prodl; prodl += LHUP(low); prodh += HHALF(low) + (prodl < was); /* ... + low; */ if ((prodl += low) < low) prodh++; /* return 4N-bit product */ prod.ul[H] = prodh; prod.ul[L] = prodl; return (prod.q); } pcc-libs-20200614/libpcc/negdi2.c010064400017500000000000000041221115704473200151600ustar raggewheel/* $Id: negdi2.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: negdi2.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return -a (or, equivalently, 0 - a), in quad. See subdi3.c. */ quad_t __negdi2(quad_t a) { union uu aa, res; aa.q = a; res.ul[L] = -aa.ul[L]; res.ul[H] = -aa.ul[H] - (res.ul[L] > 0); return (res.q); } pcc-libs-20200614/libpcc/notdi2.c010064400017500000000000000041241115704473200152110ustar raggewheel/* $Id: notdi2.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: notdi2.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return ~a. For some reason gcc calls this `one's complement' rather * than `not'. */ quad_t __one_cmpldi2(quad_t a) { union uu aa; aa.q = a; aa.ul[0] = ~aa.ul[0]; aa.ul[1] = ~aa.ul[1]; return (aa.q); } pcc-libs-20200614/libpcc/qdivrem.c010064400017500000000000000174671115704473200154770ustar raggewheel/* $Id: qdivrem.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: qdivrem.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. */ /* * Multiprecision divide. This algorithm is from Knuth vol. 2 (2nd ed), * section 4.3.1, pp. 257--259. */ #include "quad.h" #define B ((int)1 << HALF_BITS) /* digit base */ /* Combine two `digits' to make a single two-digit number. */ #define COMBINE(a, b) (((unsigned int)(a) << HALF_BITS) | (b)) /* select a type for digits in base B: use unsigned short if they fit */ #if UINT_MAX == 0xffffffffU && USHRT_MAX >= 0xffff typedef unsigned short digit; #else typedef unsigned int digit; #endif static void shl(digit *p, int len, int sh); /* * __qdivrem(u, v, rem) returns u/v and, optionally, sets *rem to u%v. * * We do this in base 2-sup-HALF_BITS, so that all intermediate products * fit within unsigned int. As a consequence, the maximum length dividend and * divisor are 4 `digits' in this base (they are shorter if they have * leading zeros). */ u_quad_t __qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) { union uu tmp; digit *u, *v, *q; digit v1, v2; unsigned int qhat, rhat, t; int m, n, d, j, i; digit uspace[5], vspace[5], qspace[5]; /* * Take care of special cases: divide by zero, and u < v. */ if (vq == 0) { /* divide by zero. */ static volatile const unsigned int zero = 0; tmp.ul[H] = tmp.ul[L] = 1 / zero; if (arq) *arq = uq; return (tmp.q); } if (uq < vq) { if (arq) *arq = uq; return (0); } u = &uspace[0]; v = &vspace[0]; q = &qspace[0]; /* * Break dividend and divisor into digits in base B, then * count leading zeros to determine m and n. When done, we * will have: * u = (u[1]u[2]...u[m+n]) sub B * v = (v[1]v[2]...v[n]) sub B * v[1] != 0 * 1 < n <= 4 (if n = 1, we use a different division algorithm) * m >= 0 (otherwise u < v, which we already checked) * m + n = 4 * and thus * m = 4 - n <= 2 */ tmp.uq = uq; u[0] = 0; u[1] = (digit)HHALF(tmp.ul[H]); u[2] = (digit)LHALF(tmp.ul[H]); u[3] = (digit)HHALF(tmp.ul[L]); u[4] = (digit)LHALF(tmp.ul[L]); tmp.uq = vq; v[1] = (digit)HHALF(tmp.ul[H]); v[2] = (digit)LHALF(tmp.ul[H]); v[3] = (digit)HHALF(tmp.ul[L]); v[4] = (digit)LHALF(tmp.ul[L]); for (n = 4; v[1] == 0; v++) { if (--n == 1) { unsigned int rbj; /* r*B+u[j] (not root boy jim) */ digit q1, q2, q3, q4; /* * Change of plan, per exercise 16. * r = 0; * for j = 1..4: * q[j] = floor((r*B + u[j]) / v), * r = (r*B + u[j]) % v; * We unroll this completely here. */ t = v[2]; /* nonzero, by definition */ q1 = (digit)(u[1] / t); rbj = COMBINE(u[1] % t, u[2]); q2 = (digit)(rbj / t); rbj = COMBINE(rbj % t, u[3]); q3 = (digit)(rbj / t); rbj = COMBINE(rbj % t, u[4]); q4 = (digit)(rbj / t); if (arq) *arq = rbj % t; tmp.ul[H] = COMBINE(q1, q2); tmp.ul[L] = COMBINE(q3, q4); return (tmp.q); } } /* * By adjusting q once we determine m, we can guarantee that * there is a complete four-digit quotient at &qspace[1] when * we finally stop. */ for (m = 4 - n; u[1] == 0; u++) m--; for (i = 4 - m; --i >= 0;) q[i] = 0; q += 4 - m; /* * Here we run Program D, translated from MIX to C and acquiring * a few minor changes. * * D1: choose multiplier 1 << d to ensure v[1] >= B/2. */ d = 0; for (t = v[1]; t < B / 2; t <<= 1) d++; if (d > 0) { shl(&u[0], m + n, d); /* u <<= d */ shl(&v[1], n - 1, d); /* v <<= d */ } /* * D2: j = 0. */ j = 0; v1 = v[1]; /* for D3 -- note that v[1..n] are constant */ v2 = v[2]; /* for D3 */ do { digit uj0, uj1, uj2; /* * D3: Calculate qhat (\^q, in TeX notation). * Let qhat = min((u[j]*B + u[j+1])/v[1], B-1), and * let rhat = (u[j]*B + u[j+1]) mod v[1]. * While rhat < B and v[2]*qhat > rhat*B+u[j+2], * decrement qhat and increase rhat correspondingly. * Note that if rhat >= B, v[2]*qhat < rhat*B. */ uj0 = u[j + 0]; /* for D3 only -- note that u[j+...] change */ uj1 = u[j + 1]; /* for D3 only */ uj2 = u[j + 2]; /* for D3 only */ if (uj0 == v1) { qhat = B; rhat = uj1; goto qhat_too_big; } else { unsigned int nn = COMBINE(uj0, uj1); qhat = nn / v1; rhat = nn % v1; } while (v2 * qhat > COMBINE(rhat, uj2)) { qhat_too_big: qhat--; if ((rhat += v1) >= B) break; } /* * D4: Multiply and subtract. * The variable `t' holds any borrows across the loop. * We split this up so that we do not require v[0] = 0, * and to eliminate a final special case. */ for (t = 0, i = n; i > 0; i--) { t = u[i + j] - v[i] * qhat - t; u[i + j] = (digit)LHALF(t); t = (B - HHALF(t)) & (B - 1); } t = u[j] - t; u[j] = (digit)LHALF(t); /* * D5: test remainder. * There is a borrow if and only if HHALF(t) is nonzero; * in that (rare) case, qhat was too large (by exactly 1). * Fix it by adding v[1..n] to u[j..j+n]. */ if (HHALF(t)) { qhat--; for (t = 0, i = n; i > 0; i--) { /* D6: add back. */ t += u[i + j] + v[i]; u[i + j] = (digit)LHALF(t); t = HHALF(t); } u[j] = (digit)LHALF(u[j] + t); } q[j] = (digit)qhat; } while (++j <= m); /* D7: loop on j. */ /* * If caller wants the remainder, we have to calculate it as * u[m..m+n] >> d (this is at most n digits and thus fits in * u[m+1..m+n], but we may need more source digits). */ if (arq) { if (d) { for (i = m + n; i > m; --i) u[i] = (digit)(((unsigned int)u[i] >> d) | LHALF((unsigned int)u[i - 1] << (HALF_BITS - d))); u[i] = 0; } tmp.ul[H] = COMBINE(uspace[1], uspace[2]); tmp.ul[L] = COMBINE(uspace[3], uspace[4]); *arq = tmp.q; } tmp.ul[H] = COMBINE(qspace[1], qspace[2]); tmp.ul[L] = COMBINE(qspace[3], qspace[4]); return (tmp.q); } /* * Shift p[0]..p[len] left `sh' bits, ignoring any bits that * `fall out' the left (there never will be any such anyway). * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS. */ static void shl(digit *p, int len, int sh) { int i; for (i = 0; i < len; i++) p[i] = (digit)(LHALF((unsigned int)p[i] << sh) | ((unsigned int)p[i + 1] >> (HALF_BITS - sh))); p[i] = (digit)(LHALF((unsigned int)p[i] << sh)); } pcc-libs-20200614/libpcc/quad.h010064400017500000000000000120731267123435100147530ustar raggewheel/* $NetBSD: quad.h,v 1.1 2005/12/20 20:29:40 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)quad.h 8.1 (Berkeley) 6/4/93 */ /* * Quad arithmetic. * * This library makes the following assumptions: * * - The type long long (aka quad_t) exists. * * - A quad variable is exactly twice as long as `int'. * * - The machine's arithmetic is two's complement. * * This library can provide 128-bit arithmetic on a machine with 128-bit * quads and 64-bit ints, for instance, or 96-bit arithmetic on machines * with 48-bit ints. */ #ifndef __SunOS #include #endif #include #ifndef QUAD_MIN #define QUAD_MIN (-0x7fffffffffffffffLL-1) #endif #ifndef QUAD_MAX #define QUAD_MAX 0x7fffffffffffffffLL #endif #ifndef UQUAD_MAX #define UQUAD_MAX 0xffffffffffffffffULL #endif #ifdef WIN32 typedef long long quad_t; typedef unsigned long long u_quad_t; #endif #if defined(__SunOS) || defined(__svr4__) || defined(__minix) typedef long long quad_t; typedef unsigned long long u_quad_t; #endif /* * Depending on the desired operation, we view a `long long' (aka quad_t) in * one or more of the following formats. */ union uu { quad_t q; /* as a (signed) quad */ u_quad_t uq; /* as an unsigned quad */ int sl[2]; /* as two signed ints */ unsigned int ul[2]; /* as two unsigned ints */ }; /* * Define high and low parts of a quad_t. */ #ifdef TARGET_BIG_ENDIAN #define H 0 #define L 1 #else #define H 1 #define L 0 #endif /* * Total number of bits in a quad_t and in the pieces that make it up. * These are used for shifting, and also below for halfword extraction * and assembly. */ #define QUAD_BITS (sizeof(quad_t) * CHAR_BIT) #define INT_BITS (sizeof(int) * CHAR_BIT) #define HALF_BITS (sizeof(int) * CHAR_BIT / 2) /* * Extract high and low shortwords from longword, and move low shortword of * longword to upper half of long, i.e., produce the upper longword of * ((quad_t)(x) << (number_of_bits_in_int/2)). (`x' must actually be unsigned int.) * * These are used in the multiply code, to split a longword into upper * and lower halves, and to reassemble a product as a quad_t, shifted left * (sizeof(int)*CHAR_BIT/2). */ #define HHALF(x) ((unsigned int)(x) >> HALF_BITS) #define LHALF(x) ((unsigned int)(x) & (((int)1 << HALF_BITS) - 1)) #define LHUP(x) ((unsigned int)(x) << HALF_BITS) /* * XXX * Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument * as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use * both compilers. */ typedef unsigned int qshift_t; quad_t __adddi3(quad_t, quad_t); quad_t __anddi3(quad_t, quad_t); quad_t __ashldi3(quad_t, qshift_t); quad_t __ashrdi3(quad_t, qshift_t); int __cmpdi2(quad_t, quad_t); quad_t __divdi3(quad_t, quad_t); quad_t __fixdfdi(double); quad_t __fixsfdi(float); u_quad_t __fixunsdfdi(double); u_quad_t __fixunssfdi(float); double __floatdidf(quad_t); float __floatdisf(quad_t); double __floatunsdidf(u_quad_t); quad_t __iordi3(quad_t, quad_t); quad_t __lshldi3(quad_t, qshift_t); quad_t __lshrdi3(quad_t, qshift_t); quad_t __moddi3(quad_t, quad_t); quad_t __muldi3(quad_t, quad_t); quad_t __negdi2(quad_t); quad_t __one_cmpldi2(quad_t); u_quad_t __qdivrem(u_quad_t, u_quad_t, u_quad_t *); quad_t __subdi3(quad_t, quad_t); int __ucmpdi2(u_quad_t, u_quad_t); u_quad_t __udivdi3(u_quad_t, u_quad_t); u_quad_t __umoddi3(u_quad_t, u_quad_t); quad_t __xordi3(quad_t, quad_t); pcc-libs-20200614/libpcc/signbit.c010064400017500000000000000012741332664421000154510ustar raggewheel/* $Id: signbit.c,v 1.1 2018/07/27 16:30:00 ragge Exp $ */ /* * Simple signbit extraction code. * Written by Anders Magnusson. Public domain. */ union sbit { float f; double d; long double l; unsigned u[4]; }; int __signbitf(float x) { union sbit s; s.f = x; return s.u[0] >> 31; } int __signbitd(double x) { union sbit s; s.d = x; #if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__ return s.u[1] >> 31; #else return s.u[0] >> 31; #endif } int __signbitl(long double x) { union sbit s; s.l = x; #if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__ #if __i386__ || __amd64__ return (s.u[2] >> 15) & 1; #else return s.u[3] >> 31; #endif #else return s.u[0] >> 31; #endif } pcc-libs-20200614/libpcc/ssp.c010064400017500000000000000041571156433740700146330ustar raggewheel/* $Id: ssp.c,v 1.11 2011/05/17 00:19:19 gmcgarry Exp $ */ /*- * Copyright (c) 2008 Gregory McGarry * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #ifdef __MSC__ #include #define open(f,m) _open(f,m) #define read(h,b,n) _read(h,b,n) #define write(h,b,n) _write(h,b,n) #define close(h) _close(h) #else #include #endif #if defined(__lint__) #define __constructor /* define away */ #define __destructor /* define away */ #elif defined(__PCC__) #define __constructor _Pragma("init") #define __destructor _Pragma("fini") #elif defined(__GNUC__) #define __constructor __attribute__((constructor)) #define __destructor __attribute__((destructor)) #else #define __constructor #define __destructor #endif #ifdef os_win32 #define __progname "ERROR" #else extern char *__progname; #endif void __ssp_init(void); void __stack_chk_fail(void); int __stack_chk_guard; void __constructor __ssp_init(void) { int fd; size_t sz; if (__stack_chk_guard != 0) return; fd = open("/dev/urandom", 0); if (fd > 0) { sz = read(fd, (char *)&__stack_chk_guard, sizeof(__stack_chk_guard)); close(fd); if (sz == sizeof(__stack_chk_guard)) return; } __stack_chk_guard = 0x00000aff; } void __stack_chk_fail(void) { static const char msg[] = ": stack smashing attack detected\n"; write(2, __progname, strlen(__progname)); write(2, msg, sizeof(msg) - 1); abort(); } pcc-libs-20200614/libpcc/subdi3.c010064400017500000000000000043261115704473200152070ustar raggewheel/* $Id: subdi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: subdi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Subtract two quad values. This is trivial since a one-bit carry * from a single u_int difference x-y occurs if and only if (x-y) > x. */ quad_t __subdi3(quad_t a, quad_t b) { union uu aa, bb, diff; aa.q = a; bb.q = b; diff.ul[L] = aa.ul[L] - bb.ul[L]; diff.ul[H] = aa.ul[H] - bb.ul[H] - (diff.ul[L] > aa.ul[L]); return (diff.q); } pcc-libs-20200614/libpcc/ucmpdi2.c010064400017500000000000000042571115704473200153640ustar raggewheel/* $Id: ucmpdi2.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: ucmpdi2.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return 0, 1, or 2 as a <, =, > b respectively. * Neither a nor b are considered signed. */ int __ucmpdi2(u_quad_t a, u_quad_t b) { union uu aa, bb; aa.uq = a; bb.uq = b; return (aa.ul[H] < bb.ul[H] ? 0 : aa.ul[H] > bb.ul[H] ? 2 : aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1); } pcc-libs-20200614/libpcc/udivdi3.c010064400017500000000000000037741115704473200153730ustar raggewheel/* $Id: udivdi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: udivdi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Divide two unsigned quads. */ u_quad_t __udivdi3(u_quad_t a, u_quad_t b) { return (__qdivrem(a, b, (u_quad_t *)0)); } pcc-libs-20200614/libpcc/umoddi3.c010064400017500000000000000040411115704473200153540ustar raggewheel/* $Id: umoddi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: umoddi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return remainder after dividing two unsigned quads. */ u_quad_t __umoddi3(u_quad_t a, u_quad_t b) { u_quad_t r; (void)__qdivrem(a, b, &r); return (r); } pcc-libs-20200614/libpcc/unwind.c010064400017500000000000000041701163532332100153120ustar raggewheel#include #include struct _Unwind_Context; struct _Unwind_Exception; typedef unsigned int _Unwind_Ptr; typedef unsigned int _Unwind_Word; typedef enum { _URC_NO_REASON, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ERROR = 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, _URC_CONTINUE_UNWIND = 8 } _Unwind_Reason_Code; typedef enum { _UA_SEARCH_PHASE = 1, _UA_CLEANUP_PHASE = 2, _UA_HANDLER_FRAME = 4, _UA_FORCE_UNWIND = 8, _UA_END_OF_STACK = 16 } _Unwind_Action; typedef void (*_Unwind_Trace_Fn)(void); void _Unwind_Resume(struct _Unwind_Exception *object) { abort(); } _Unwind_Ptr _Unwind_GetIP(struct _Unwind_Context *context) { abort(); return 0; } _Unwind_Word _Unwind_GetGR(struct _Unwind_Context *context, int index) { abort(); return 0; } _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument) { abort(); return _URC_NO_REASON; } _Unwind_Word _Unwind_GetCFA(struct _Unwind_Context * context) { abort(); return 0; } _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *object) { abort(); return 0; } _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *object) { abort(); return 0; } void _Unwind_DeleteException (struct _Unwind_Exception *object) { abort(); } void _Unwind_SetIP(struct _Unwind_Context *context, _Unwind_Ptr val) { abort(); } void _Unwind_SetGR(struct _Unwind_Context *context, int index, _Unwind_Word val) { abort(); } void * _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { abort(); return 0; } _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Context *context) { abort(); return 0; } _Unwind_Ptr _Unwind_GetDataRelBase(struct _Unwind_Context *context) { abort(); return 0; } _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *context) { abort(); return 0; } _Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionClass, struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context) { abort(); return _URC_NO_REASON; } pcc-libs-20200614/libpcc/xordi3.c010064400017500000000000000040531115704473200152230ustar raggewheel/* $Id: xordi3.c,v 1.3 2009/03/15 00:20:42 gmcgarry Exp $ */ /* $NetBSD: xordi3.c,v 1.1 2005/12/20 19:28:51 christos Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * 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. Neither the name of the University 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 REGENTS 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 REGENTS 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 "quad.h" /* * Return a ^ b, in quad. */ quad_t __xordi3(quad_t a, quad_t b) { union uu aa, bb; aa.q = a; bb.q = b; aa.ul[0] ^= bb.ul[0]; aa.ul[1] ^= bb.ul[1]; return (aa.q); } pcc-libs-20200614/libpcc/include004075500017500000000000000000001367127322400152175ustar raggewheelpcc-libs-20200614/libpcc/include/CVS004075500017500000000000000000001367127322400156525ustar raggewheelpcc-libs-20200614/libpcc/include/CVS/Root010064400017500000000000000000111367127322400165640ustar raggewheel/cvsroot pcc-libs-20200614/libpcc/include/CVS/Repository010064400017500000000000000000301367127322400200210ustar raggewheelpcc-libs/libpcc/include pcc-libs-20200614/libpcc/include/CVS/Entries010064400017500000000000000007501367127322400172640ustar raggewheel/float.h/1.2/Fri Jul 18 03:11:27 2008// /iso646.h/1.1/Sat Feb 19 17:40:30 2011// /libpcc_float.h/1.7/Sat Aug 24 13:41:09 2019// /libpcc_limits.h/1.4/Sat Feb 19 08:47:13 2011// /libpcc_stdarg.h/1.7/Mon Nov 8 07:41:22 2010// /libpcc_stdbool.h/1.3/Sat May 16 03:56:18 2009// /libpcc_stddef.h/1.8/Sun Feb 8 08:30:42 2015// /limits.h/1.1/Sun Jun 13 07:30:33 2010// /stdarg.h/1.4/Fri Jul 18 03:11:27 2008// /stdbool.h/1.2/Fri Jul 18 03:11:27 2008// /stddef.h/1.4/Fri Jul 18 03:11:27 2008// D pcc-libs-20200614/libpcc/include/float.h010064400017500000000000000000321104000473700165310ustar raggewheel#include pcc-libs-20200614/libpcc/include/iso646.h010064400017500000000000000003631153000021600164550ustar raggewheel #ifndef _ISO646_H_ #define _ISO646_H_ #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif /* _ISO646_H_ */ pcc-libs-20200614/libpcc/include/libpcc_float.h010064400017500000000000000035501353023716500200660ustar raggewheel#ifndef _LIBPCC_FLOAT_H_ #define _LIBPCC_FLOAT_H_ /* * number of decimal digits needed to represent all the * significant digits for all internal floating-point formats */ #define DECIMAL_DIG 21 /* * the floating-point expression evaluation method: * -1 indeterminate * 0 evaluate to range and precision of type * 1 evaluate to range and precision of double type * 2 evaluate to range and precision of long double type */ #ifdef __FLT_EVAL_METHOD__ #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ #else #define FLT_EVAL_METHOD 0 #endif #define FLT_RADIX 2 #define FLT_HAS_SUBNORM __FLT_HAS_SUBNORM__ #define FLT_MANT_DIG __FLT_MANT_DIG__ #define FLT_DIG __FLT_DIG__ #define FLT_ROUNDS __FLT_ROUNDS__ #define FLT_EPSILON __FLT_EPSILON__ #define FLT_MIN_EXP __FLT_MIN_EXP__ #define FLT_MIN __FLT_MIN__ #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ #define FLT_MAX_EXP __FLT_MAX_EXP__ #define FLT_MAX __FLT_MAX__ #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ #define FLT_TRUE_MIN __FLT_TRUE_MIN__ #define DBL_HAS_SUBNORM __DBL_HAS_SUBNORM__ #define DBL_MANT_DIG __DBL_MANT_DIG__ #define DBL_DIG __DBL_DIG__ #define DBL_ROUNDS __DBL_ROUNDS__ #define DBL_EPSILON __DBL_EPSILON__ #define DBL_MIN_EXP __DBL_MIN_EXP__ #define DBL_MIN __DBL_MIN__ #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ #define DBL_MAX_EXP __DBL_MAX_EXP__ #define DBL_MAX __DBL_MAX__ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ #define DBL_TRUE_MIN __DBL_TRUE_MIN__ #define LDBL_HAS_SUBNORM __LDBL_HAS_SUBNORM__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ #define LDBL_DIG __LDBL_DIG__ #define LDBL_ROUNDS __LDBL_ROUNDS__ #define LDBL_EPSILON __LDBL_EPSILON__ #define LDBL_MIN_EXP __LDBL_MIN_EXP__ #define LDBL_MIN __LDBL_MIN__ #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ #define LDBL_MAX_EXP __LDBL_MAX_EXP__ #define LDBL_MAX __LDBL_MAX__ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ #define LDBL_TRUE_MIN __LDBL_TRUE_MIN__ #endif pcc-libs-20200614/libpcc/include/libpcc_limits.h010064400017500000000000000027031152770162100202560ustar raggewheel#ifndef _LIBPCC_LIMITS_H_ #define _LIBPCC_LIMITS_H_ #if defined __GNUC__ # if !defined _GCC_LIMITS_H_ /* this is needed to make limits.h from the glibc headers happy, which uses #include_next when __GNUC__ is defined and _GCC_LIMITS_H_ is not defined */ # define __GCC_LIMITS_H_ # endif #endif /* * The following limits are sometimes considered * a property of the compiler. Not complete. */ #undef CHAR_BIT #ifdef __pdp10__ #define CHAR_BIT 9 #else #define CHAR_BIT 8 #endif /* * Logic below assumes 2-complement. */ #undef CHAR_MIN #undef CHAR_MAX #ifdef __CHAR_UNSIGNED__ #define CHAR_MIN 0 #define CHAR_MAX UCHAR_MAX #else #define CHAR_MIN SCHAR_MIN #define CHAR_MAX SCHAR_MAX #endif #undef SCHAR_MAX #define SCHAR_MAX __SCHAR_MAX__ #undef SCHAR_MIN #define SCHAR_MIN (-SCHAR_MAX-1) #undef UCHAR_MAX #define UCHAR_MAX (2*SCHAR_MAX+1) #undef SHRT_MAX #define SHRT_MAX __SHRT_MAX__ #undef SHRT_MIN #define SHRT_MIN (-SHRT_MAX-1) #undef USHRT_MAX #define USHRT_MAX (2*SHRT_MAX+1) #undef INT_MAX #define INT_MAX __INT_MAX__ #undef INT_MIN #define INT_MIN (-INT_MAX-1) #undef UINT_MAX #define UINT_MAX (2U*INT_MAX+1U) #undef LONG_MAX #define LONG_MAX __LONG_MAX__ #undef LONG_MIN #define LONG_MIN (-LONG_MAX-1L) #undef ULONG_MAX #define ULONG_MAX (2UL*LONG_MAX+1UL) #undef LLONG_MAX #define LLONG_MAX __LONG_LONG_MAX__ #undef LLONG_MIN #define LLONG_MIN (-LLONG_MAX-1LL) #undef ULLONG_MAX #define ULLONG_MAX (2ULL*LLONG_MAX+1ULL) #endif pcc-libs-20200614/libpcc/include/libpcc_stdarg.h010064400017500000000000000013571146572464200202560ustar raggewheel#ifndef _LIBPCC_STDARG_H_ #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list #define _LIBPCC_STDARG_H_ #define _ANSI_STDARG_H_ #endif #if defined(_LIBPCC_STDARG_H_) || defined(__need___va_list) #ifndef _VA_LIST typedef __builtin_va_list va_list; #define _VA_LIST #define _VA_LIST_DEFINED #endif /* For broken glibc headers */ #ifndef __GNUC_VA_LIST #define __gnuc_va_list __builtin_va_list #define __GNUC_VA_LIST #endif #endif #ifdef _LIBPCC_STDARG_H_ #define va_start(ap, last) __builtin_stdarg_start((ap), last) #define va_arg(ap, type) __builtin_va_arg((ap), type) #define va_end(ap) __builtin_va_end((ap)) #define va_copy(dest, src) __builtin_va_copy((dest), (src)) #endif #undef __need___va_list #endif #endif pcc-libs-20200614/libpcc/include/libpcc_stdbool.h010064400017500000000000000002671120343454200204220ustar raggewheel#ifndef _LIBPCC_STDBOOL_H_ #define _LIBPCC_STDBOOL_H_ #define __bool_true_false_are_defined 1 #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 #endif #endif pcc-libs-20200614/libpcc/include/libpcc_stddef.h010064400017500000000000000031741246561726200202420ustar raggewheel#ifndef _LIBPCC_STDDEF_H_ #if !defined(__need_wchar_t) && !defined(__need_size_t) \ && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ && !defined(__need_wint_t) #define _LIBPCC_STDDEF_H_ #endif #if defined(_LIBPCC_STDDEF_H_) || defined(__need_ptrdiff_t) #if !defined(_PTRDIFF_T) && !defined(__ptrdiff_t_defined) #define _PTRDIFF_T #define __ptrdiff_t_defined #ifdef __PTRDIFF_TYPE__ typedef __PTRDIFF_TYPE__ ptrdiff_t; #else typedef int ptrdiff_t; #endif #endif #endif #if defined(_LIBPCC_STDDEF_H_) || defined(__need_size_t) #if !defined(_SIZE_T) && !defined(__size_t_defined) && !defined(_SIZE_T_) #define _SIZE_T #define _SIZE_T_ #define __size_t_defined #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ size_t; #else typedef unsigned long size_t; #endif #endif #endif #if defined(_LIBPCC_STDDEF_H_) || defined(__need_wchar_t) #ifndef __cplusplus #if !defined(_WCHAR_T) && !defined(__wchar_t_defined) #define _WCHAR_T #define __wchar_t_defined #ifdef __WCHAR_TYPE__ typedef __WCHAR_TYPE__ wchar_t; #else typedef unsigned short wchar_t; #endif #endif #endif #endif #if defined(_LIBPCC_STDDEF_H_) || defined(__need_wint_t) #if !defined(_WINT_T) && !defined(__wint_t_defined) #define _WINT_T #define __wint_t_defined #ifdef __WINT_TYPE__ typedef __WINT_TYPE__ wint_t; #else typedef unsigned int wint_t; #endif #endif #endif #if defined(_LIBPCC_STDDEF_H_) || defined(__need_NULL) #undef NULL #define NULL ((void *)(0)) #endif #if defined(_LIBPCC_STDDEF_H_) #define offsetof(type, member) ((size_t)&(((type *) 0)->member)) #endif #undef __need_ptrdiff_t #undef __need_size_t #undef __need_wchar_t #undef __need_wint_t #undef __need_NULL #endif pcc-libs-20200614/libpcc/include/limits.h010064400017500000000000000000331140510443100167230ustar raggewheel#include pcc-libs-20200614/libpcc/include/stdarg.h010064400017500000000000000000331104000473700167110ustar raggewheel#include pcc-libs-20200614/libpcc/include/stdbool.h010064400017500000000000000000341104000473700170740ustar raggewheel#include pcc-libs-20200614/libpcc/include/stddef.h010064400017500000000000000000331104000473700166760ustar raggewheel#include pcc-libs-20200614/libsoftfloat004075500017500000000000000000001367127322400150305ustar raggewheelpcc-libs-20200614/libsoftfloat/CVS004075500017500000000000000000001367127322400154635ustar raggewheelpcc-libs-20200614/libsoftfloat/CVS/Root010064400017500000000000000000111367127322400163750ustar raggewheel/cvsroot pcc-libs-20200614/libsoftfloat/CVS/Repository010064400017500000000000000000261367127322400176370ustar raggewheelpcc-libs/libsoftfloat pcc-libs-20200614/libsoftfloat/CVS/Entries010064400017500000000000000032031367127322400170710ustar raggewheel/Makefile.in/1.9/Sun Mar 13 09:54:49 2016// /README.NetBSD/1.1/Tue May 20 05:29:06 2008// /README.txt/1.1/Tue May 20 05:29:06 2008// /eqdf2.c/1.2/Fri Jul 4 02:48:05 2008// /eqsf2.c/1.2/Fri Jul 4 02:48:05 2008// /fpgetmask.c/1.3/Tue Aug 18 00:40:47 2009// /fpgetround.c/1.3/Tue Aug 18 00:40:47 2009// /fpgetsticky.c/1.3/Tue Aug 18 00:40:47 2009// /fpsetmask.c/1.3/Tue Aug 18 00:40:47 2009// /fpsetround.c/1.3/Tue Aug 18 00:40:47 2009// /fpsetsticky.c/1.3/Tue Aug 18 00:40:47 2009// /gedf2.c/1.2/Fri Jul 4 02:48:06 2008// /gesf2.c/1.2/Fri Jul 4 02:48:06 2008// /gexf2.c/1.2/Fri Jul 4 02:48:06 2008// /gtdf2.c/1.2/Fri Jul 4 02:48:06 2008// /gtsf2.c/1.2/Fri Jul 4 02:48:06 2008// /gtxf2.c/1.2/Fri Jul 4 02:48:06 2008// /ledf2.c/1.2/Fri Jul 4 02:48:06 2008// /lesf2.c/1.2/Fri Jul 4 02:48:06 2008// /ltdf2.c/1.2/Fri Jul 4 02:48:06 2008// /ltsf2.c/1.2/Fri Jul 4 02:48:06 2008// /namespace.h/1.1/Tue May 20 05:29:07 2008// /nedf2.c/1.2/Fri Jul 4 02:48:06 2008// /negdf2.c/1.2/Fri Jul 4 02:48:06 2008// /negsf2.c/1.2/Fri Jul 4 02:48:06 2008// /negxf2.c/1.2/Fri Jul 4 02:48:06 2008// /nesf2.c/1.2/Fri Jul 4 02:48:06 2008// /nexf2.c/1.2/Fri Jul 4 02:48:06 2008// /softfloat-for-gcc.h/1.1/Tue May 20 05:29:07 2008// /softfloat-history.txt/1.1/Tue May 20 05:29:07 2008// /softfloat-source.txt/1.1/Tue May 20 05:29:07 2008// /softfloat-specialize/1.3/Wed Oct 12 18:22:29 2016// /softfloat.txt/1.1/Tue May 20 05:29:07 2008// /timesoftfloat.c/1.2/Fri Jul 4 02:48:06 2008// /timesoftfloat.txt/1.1/Tue May 20 05:29:07 2008// /unorddf2.c/1.2/Fri Jul 4 02:48:06 2008// /unordsf2.c/1.2/Fri Jul 4 02:48:06 2008// D/arch//// D/bits32//// D/bits64//// D/templates//// D pcc-libs-20200614/libsoftfloat/Makefile.in010064400017500000000000000023531267123435100171510ustar raggewheel# $Id: Makefile.in,v 1.9 2016/03/13 09:54:49 ragge Exp $ # # Makefile.in for libpccsoftfloat.a # VPATH = @srcdir@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ prefix = @prefix@ exec_prefix = @exec_prefix@ libdir = @libdir@ CC = @CC@ TARGET = @target@ TARGMACH = @targmach@ VERSION = @version@ PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib CPPFLAGS = @CPPFLAGS@ -DSOFTFLOAT_FOR_GCC -I$(srcdir) \ -I$(srcdir)/arch/$(TARGMACH) \ -isystem $(top_srcdir)/libpcc/include LIBS = @LIBS@ AR = @AR@ RANLIB = @RANLIB@ INSTALL = @INSTALL@ OBJS = softfloat.o \ fpgetround.o fpsetround.o fpgetmask.o fpsetmask.o \ fpgetsticky.o fpsetsticky.o \ eqsf2.o nesf2.o gtsf2.o gesf2.o ltsf2.o lesf2.o negsf2.o \ eqdf2.o nedf2.o gtdf2.o gedf2.o ltdf2.o ledf2.o negdf2.o \ nexf2.o gtxf2.o gexf2.o negxf2.o unordsf2.o unorddf2.o DEST = libpccsoftfloat.a all: $(DEST) $(DEST): $(OBJS) $(AR) r $@ $? $(RANLIB) $@ softfloat.o : bits64/softfloat.c $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< .c.o : $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< install: test -z "${DESTDIR}$(PCCLIBDIR)" || mkdir -p "${DESTDIR}$(PCCLIBDIR)" $(INSTALL) -m 644 $(DEST) ${DESTDIR}$(PCCLIBDIR) clean: /bin/rm -f $(OBJS) $(DEST) distclean: /bin/rm -f Makefile pcc-libs-20200614/libsoftfloat/README.NetBSD010064400017500000000000000005571101446064200170400ustar raggewheel$NetBSD: README.NetBSD,v 1.2 2002/05/21 23:51:05 bjh21 Exp $ This is a modified version of part of John Hauser's SoftFloat 2a package. This version has been heavily modified to support its use with GCC to implement built-in floating-point operations, but compiling softfloat.c without SOFTFLOAT_FOR_GCC defined should get you the same results as from the original. pcc-libs-20200614/libsoftfloat/README.txt010064400017500000000000000031631101446064200165740ustar raggewheel$NetBSD: README.txt,v 1.1 2000/06/06 08:15:02 bjh21 Exp $ Package Overview for SoftFloat Release 2a John R. Hauser 1998 December 13 SoftFloat is a software implementation of floating-point that conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. SoftFloat is distributed in the form of C source code. Compiling the SoftFloat sources generates two things: -- A SoftFloat object file (typically `softfloat.o') containing the complete set of IEC/IEEE floating-point routines. -- A `timesoftfloat' program for evaluating the speed of the SoftFloat routines. (The SoftFloat module is linked into this program.) The SoftFloat package is documented in four text files: softfloat.txt Documentation for using the SoftFloat functions. softfloat-source.txt Documentation for compiling SoftFloat. softfloat-history.txt History of major changes to SoftFloat. timesoftfloat.txt Documentation for using `timesoftfloat'. Other files in the package comprise the source code for SoftFloat. Please be aware that some work is involved in porting this software to other targets. It is not just a matter of getting `make' to complete without error messages. I would have written the code that way if I could, but there are fundamental differences between systems that I can't make go away. You should not attempt to compile SoftFloat without first reading both `softfloat.txt' and `softfloat-source.txt'. At the time of this writing, the most up-to-date information about SoftFloat and the latest release can be found at the Web page `http:// HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'. pcc-libs-20200614/libsoftfloat/eqdf2.c010064400017500000000000000005311103330754500162420ustar raggewheel/* $NetBSD: eqdf2.c,v 1.1 2000/06/06 08:15:02 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __eqdf2(float64, float64); flag __eqdf2(float64 a, float64 b) { /* libgcc1.c says !(a == b) */ return !float64_eq(a, b); } pcc-libs-20200614/libsoftfloat/eqsf2.c010064400017500000000000000005311103330754500162610ustar raggewheel/* $NetBSD: eqsf2.c,v 1.1 2000/06/06 08:15:03 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __eqsf2(float32, float32); flag __eqsf2(float32 a, float32 b) { /* libgcc1.c says !(a == b) */ return !float32_eq(a, b); } pcc-libs-20200614/libsoftfloat/fpgetmask.c010064400017500000000000000034741124237421700172350ustar raggewheel/* $NetBSD: fpgetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpgetmask,_fpgetmask) #endif fp_except fpgetmask(void) { return float_exception_mask; } pcc-libs-20200614/libsoftfloat/fpgetround.c010064400017500000000000000034741124237421700174310ustar raggewheel/* $NetBSD: fpgetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpgetround,_fpgetround) #endif fp_rnd fpgetround(void) { return float_rounding_mode; } pcc-libs-20200614/libsoftfloat/fpgetsticky.c010064400017500000000000000035051124237421700176030ustar raggewheel/* $NetBSD: fpgetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpgetsticky,_fpgetsticky) #endif fp_except fpgetsticky(void) { return float_exception_flags; } pcc-libs-20200614/libsoftfloat/fpsetmask.c010064400017500000000000000036001124237421700172400ustar raggewheel/* $NetBSD: fpsetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpsetmask,_fpsetmask) #endif fp_except fpsetmask(fp_except mask) { fp_except old; old = float_exception_mask; float_exception_mask = mask; return old; } pcc-libs-20200614/libsoftfloat/fpsetround.c010064400017500000000000000035771124237421700174510ustar raggewheel/* $NetBSD: fpsetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpsetround,_fpsetround) #endif fp_rnd fpsetround(fp_rnd rnd_dir) { fp_rnd old; old = float_rounding_mode; float_rounding_mode = rnd_dir; return old; } pcc-libs-20200614/libsoftfloat/fpsetsticky.c010064400017500000000000000036161124237421700176220ustar raggewheel/* $NetBSD: fpsetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Neil A. Carson and Mark Brinicombe * * 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. * * 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 "namespace.h" #include #ifdef SOFTFLOAT_FOR_GCC #include "softfloat-for-gcc.h" #endif #include "milieu.h" #include "softfloat.h" #ifdef __weak_alias __weak_alias(fpsetsticky,_fpsetsticky) #endif fp_except fpsetsticky(fp_except except) { fp_except old; old = float_exception_flags; float_exception_flags = except; return old; } pcc-libs-20200614/libsoftfloat/gedf2.c010064400017500000000000000005371103330754600162370ustar raggewheel/* $NetBSD: gedf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __gedf2(float64, float64); flag __gedf2(float64 a, float64 b) { /* libgcc1.c says (a >= b) - 1 */ return float64_le(b, a) - 1; } pcc-libs-20200614/libsoftfloat/gesf2.c010064400017500000000000000005371103330754600162560ustar raggewheel/* $NetBSD: gesf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __gesf2(float32, float32); flag __gesf2(float32 a, float32 b) { /* libgcc1.c says (a >= b) - 1 */ return float32_le(b, a) - 1; } pcc-libs-20200614/libsoftfloat/gexf2.c010064400017500000000000000006101103330754600162530ustar raggewheel/* $NetBSD: gexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #ifdef FLOATX80 flag __gexf2(floatx80, floatx80); flag __gexf2(floatx80 a, floatx80 b) { /* libgcc1.c says (a >= b) - 1 */ return floatx80_le(b, a) - 1; } #endif /* FLOATX80 */ pcc-libs-20200614/libsoftfloat/gtdf2.c010064400017500000000000000005241103330754600162520ustar raggewheel/* $NetBSD: gtdf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __gtdf2(float64, float64); flag __gtdf2(float64 a, float64 b) { /* libgcc1.c says a > b */ return float64_lt(b, a); } pcc-libs-20200614/libsoftfloat/gtsf2.c010064400017500000000000000005241103330754600162710ustar raggewheel/* $NetBSD: gtsf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __gtsf2(float32, float32); flag __gtsf2(float32 a, float32 b) { /* libgcc1.c says a > b */ return float32_lt(b, a); } pcc-libs-20200614/libsoftfloat/gtxf2.c010064400017500000000000000005751103330754600163040ustar raggewheel/* $NetBSD: gtxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #ifdef FLOATX80 flag __gtxf2(floatx80, floatx80); flag __gtxf2(floatx80 a, floatx80 b) { /* libgcc1.c says a > b */ return floatx80_lt(b, a); } #endif /* FLOATX80 */ pcc-libs-20200614/libsoftfloat/ledf2.c010064400017500000000000000005371103330754600162440ustar raggewheel/* $NetBSD: ledf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __ledf2(float64, float64); flag __ledf2(float64 a, float64 b) { /* libgcc1.c says 1 - (a <= b) */ return 1 - float64_le(a, b); } pcc-libs-20200614/libsoftfloat/lesf2.c010064400017500000000000000005371103330754600162630ustar raggewheel/* $NetBSD: lesf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __lesf2(float32, float32); flag __lesf2(float32 a, float32 b) { /* libgcc1.c says 1 - (a <= b) */ return 1 - float32_le(a, b); } pcc-libs-20200614/libsoftfloat/ltdf2.c010064400017500000000000000005301103330754600162540ustar raggewheel/* $NetBSD: ltdf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __ltdf2(float64, float64); flag __ltdf2(float64 a, float64 b) { /* libgcc1.c says -(a < b) */ return -float64_lt(a, b); } pcc-libs-20200614/libsoftfloat/ltsf2.c010064400017500000000000000005301103330754600162730ustar raggewheel/* $NetBSD: ltsf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __ltsf2(float32, float32); flag __ltsf2(float32 a, float32 b) { /* libgcc1.c says -(a < b) */ return -float32_lt(a, b); } pcc-libs-20200614/libsoftfloat/namespace.h010064400017500000000000000003111101446064300171740ustar raggewheel#include "ieeefp.h" fp_rnd fpgetround(void); fp_rnd fpsetround(fp_rnd); fp_except fpgetmask(void); fp_except fpsetmask(fp_except); fp_except fpgetsticky(void); fp_except fpsetsticky(fp_except); pcc-libs-20200614/libsoftfloat/nedf2.c010064400017500000000000000005261103330754600162440ustar raggewheel/* $NetBSD: nedf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __nedf2(float64, float64); flag __nedf2(float64 a, float64 b) { /* libgcc1.c says a != b */ return !float64_eq(a, b); } pcc-libs-20200614/libsoftfloat/negdf2.c010064400017500000000000000005371103330754600164150ustar raggewheel/* $NetBSD: negdf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" float64 __negdf2(float64); float64 __negdf2(float64 a) { /* libgcc1.c says -a */ return a ^ FLOAT64_MANGLE(0x8000000000000000ULL); } pcc-libs-20200614/libsoftfloat/negsf2.c010064400017500000000000000005141103330754600164270ustar raggewheel/* $NetBSD: negsf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" float32 __negsf2(float32); float32 __negsf2(float32 a) { /* libgcc1.c says INTIFY(-a) */ return a ^ 0x80000000; } pcc-libs-20200614/libsoftfloat/negxf2.c010064400017500000000000000005711103330754600164370ustar raggewheel/* $NetBSD: negxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #ifdef FLOATX80 floatx80 __negxf2(floatx80); floatx80 __negxf2(floatx80 a) { /* libgcc1.c says -a */ return __mulxf3(a,__floatsixf(-1)); } #endif /* FLOATX80 */ pcc-libs-20200614/libsoftfloat/nesf2.c010064400017500000000000000005261103330754600162630ustar raggewheel/* $NetBSD: nesf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" flag __nesf2(float32, float32); flag __nesf2(float32 a, float32 b) { /* libgcc1.c says a != b */ return !float32_eq(a, b); } pcc-libs-20200614/libsoftfloat/nexf2.c010064400017500000000000000005771103330754600162760ustar raggewheel/* $NetBSD: nexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ /* * Written by Ben Harris, 2000. This file is in the Public Domain. */ #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" #ifdef FLOATX80 flag __nexf2(floatx80, floatx80); flag __nexf2(floatx80 a, floatx80 b) { /* libgcc1.c says a != b */ return !floatx80_eq(a, b); } #endif /* FLOATX80 */ pcc-libs-20200614/libsoftfloat/softfloat-for-gcc.h010064400017500000000000000041741101446064300205720ustar raggewheel/* $NetBSD: softfloat-for-gcc.h,v 1.7 2004/09/26 21:13:27 jmmv Exp $ */ /* * Move private identifiers with external linkage into implementation * namespace. -- Klaus Klein , May 5, 1999 */ #define float_exception_flags _softfloat_float_exception_flags #define float_exception_mask _softfloat_float_exception_mask #define float_rounding_mode _softfloat_float_rounding_mode #define float_raise _softfloat_float_raise /* The following batch are called by GCC through wrappers */ #define float32_eq _softfloat_float32_eq #define float32_le _softfloat_float32_le #define float32_lt _softfloat_float32_lt #define float64_eq _softfloat_float64_eq #define float64_le _softfloat_float64_le #define float64_lt _softfloat_float64_lt /* * Macros to define functions with the GCC expected names */ #define float32_add __addsf3 #define float64_add __adddf3 #define floatx80_add __addxf3 #define float32_sub __subsf3 #define float64_sub __subdf3 #define floatx80_sub __subxf3 #define float32_mul __mulsf3 #define float64_mul __muldf3 #define floatx80_mul __mulxf3 #define float32_div __divsf3 #define float64_div __divdf3 #define floatx80_div __divxf3 #define int32_to_float32 __floatsisf #define int32_to_float64 __floatsidf #define int32_to_floatx80 __floatsixf #define int64_to_float32 __floatdisf #define int64_to_float64 __floatdidf #define int64_to_floatx80 __floatdixf #define float32_to_int32_round_to_zero __fixsfsi #define float64_to_int32_round_to_zero __fixdfsi #define floatx80_to_int32_round_to_zero __fixxfsi #define float32_to_int64_round_to_zero __fixsfdi #define float64_to_int64_round_to_zero __fixdfdi #define floatx80_to_int64_round_to_zero __fixxfdi #define float32_to_uint32_round_to_zero __fixunssfsi #define float64_to_uint32_round_to_zero __fixunsdfsi #define float32_to_float64 __extendsfdf2 #define float64_to_floatx80 __extenddfxf2 #define float32_to_floatx80 __extendsfxf2 #define float64_to_float32 __truncdfsf2 #define floatx80_to_float64 __truncxfdf2 #define floatx80_to_float32 __truncxfsf2 #define floatx80_lt __ltxf2 #define floatx80_eq __eqxf2 #define floatx80_le __lexf2 pcc-libs-20200614/libsoftfloat/softfloat-history.txt010064400017500000000000000034111101446064300213340ustar raggewheel$NetBSD: softfloat-history.txt,v 1.1 2000/06/06 08:15:08 bjh21 Exp $ History of Major Changes to SoftFloat, up to Release 2a John R. Hauser 1998 December 16 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Release 2a (1998 December) -- Added functions to convert between 64-bit integers (int64) and all supported floating-point formats. -- Fixed a bug in all 64-bit-version square root functions except `float32_sqrt' that caused the result sometimes to be off by 1 unit in the last place (1 ulp) from what it should be. (Bug discovered by Paul Donahue.) -- Improved the makefiles. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Release 2 (1997 June) -- Created the 64-bit (bits64) version, adding the floatx80 and float128 formats. -- Changed the source directory structure, splitting the sources into a `bits32' and a `bits64' version. Renamed `environment.h' to `milieu.h' (to avoid confusion with environment variables). -- Fixed a small error that caused `float64_round_to_int' often to round the wrong way in nearest/even mode when the operand was between 2^20 and 2^21 and halfway between two integers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Release 1a (1996 July) -- Corrected a mistake that caused borderline underflow cases not to raise the underflow flag when they should have. (Problem reported by Doug Priest.) -- Added the `float_detect_tininess' variable to control whether tininess is detected before or after rounding. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Release 1 (1996 July) -- Original release. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pcc-libs-20200614/libsoftfloat/softfloat-source.txt010064400017500000000000000413631101446064300211430ustar raggewheel$NetBSD: softfloat-source.txt,v 1.2 2006/11/24 19:46:58 christos Exp $ SoftFloat Release 2a Source Documentation John R. Hauser 1998 December 14 ------------------------------------------------------------------------------- Introduction SoftFloat is a software implementation of floating-point that conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. SoftFloat can support four floating-point formats: single precision, double precision, extended double precision, and quadruple precision. All operations required by the IEEE Standard are implemented, except for conversions to and from decimal. SoftFloat is distributed in the form of C source code, so a C compiler is needed to compile the code. Support for the extended double- precision and quadruple-precision formats is dependent on the C compiler implementing a 64-bit integer type. This document gives information needed for compiling and/or porting SoftFloat. The source code for SoftFloat is intended to be relatively machine- independent and should be compilable using any ISO/ANSI C compiler. At the time of this writing, SoftFloat has been successfully compiled with the GNU C Compiler (`gcc') for several platforms. ------------------------------------------------------------------------------- Limitations SoftFloat as written requires an ISO/ANSI-style C compiler. No attempt has been made to accommodate compilers that are not ISO-conformant. Older ``K&R- style'' compilers are not adequate for compiling SoftFloat. All testing I have done so far has been with the GNU C Compiler. Compilation with other compilers should be possible but has not been tested. The SoftFloat sources assume that source code file names can be longer than 8 characters. In order to compile under an MS-DOS-type system, many of the source files will need to be renamed, and the source and makefiles edited appropriately. Once compiled, the SoftFloat binary does not depend on the existence of long file names. The underlying machine is assumed to be binary with a word size that is a power of 2. Bytes are 8 bits. Support for the extended double-precision and quadruple-precision formats depends on the C compiler implementing a 64-bit integer type. If the largest integer type supported by the C compiler is 32 bits, SoftFloat is limited to the single- and double- precision formats. ------------------------------------------------------------------------------- Contents Introduction Limitations Contents Legal Notice SoftFloat Source Directory Structure SoftFloat Source Files processors/*.h softfloat/bits*/*/softfloat.h softfloat/bits*/*/milieu.h softfloat/bits*/*/softfloat-specialize softfloat/bits*/softfloat-macros softfloat/bits*/softfloat.c Steps to Creating a `softfloat.o' Making `softfloat.o' a Library Testing SoftFloat Timing SoftFloat Compiler Options and Efficiency Processor-Specific Optimization of `softfloat.c' Using `softfloat-macros' Contact Information ------------------------------------------------------------------------------- Legal Notice SoftFloat was written by John R. Hauser. This work was made possible in part by the International Computer Science Institute, located at Suite 600, 1947 Center Street, Berkeley, California 94704. Funding was partially provided by the National Science Foundation under grant MIP-9311980. The original version of this code was written as part of a project to build a fixed-point vector processor in collaboration with the University of California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. ------------------------------------------------------------------------------- SoftFloat Source Directory Structure Because SoftFloat is targeted to multiple platforms, its source code is slightly scattered between target-specific and target-independent directories and files. The directory structure is as follows: processors softfloat bits64 templates 386-Win32-gcc SPARC-Solaris-gcc bits32 templates 386-Win32-gcc SPARC-Solaris-gcc The two topmost directories and their contents are: softfloat - Most of the source code needed for SoftFloat. processors - Target-specific header files that are not specific to SoftFloat. The `softfloat' directory is further split into two parts: bits64 - SoftFloat implementation using 64-bit integers. bits32 - SoftFloat implementation using only 32-bit integers. Within these directories are subdirectories for each of the targeted platforms. The SoftFloat source code is distributed with targets `386-Win32-gcc' and `SPARC-Solaris-gcc' (and perhaps others) already prepared for both the 32-bit and 64-bit implementations. Source files that are not within these target-specific subdirectories are intended to be target-independent. The naming convention used for the target-specific directories is `--'. The names of the supplied target directories should be interpreted as follows: : 386 - Intel 386-compatible processor. SPARC - SPARC processor (as used by Sun machines). : Win32 - Microsoft Win32 executable. Solaris - Sun Solaris executable. : gcc - GNU C Compiler. You do not need to maintain this convention if you do not want to. Alongside the supplied target-specific directories is a `templates' directory containing a set of ``generic'' target-specific source files. A new target directory can be created by copying the `templates' directory and editing the files inside. (Complete instructions for porting SoftFloat to a new target are in the section _Steps_to_Creating_a_`softfloat.o'_.) Note that the `templates' directory will not work as a target directory without some editing. To avoid confusion, it would be wise to refrain from editing the files inside `templates' directly. ------------------------------------------------------------------------------- SoftFloat Source Files The purpose of each source file is described below. In the following, the `*' symbol is used in place of the name of a specific target, such as `386-Win32-gcc' or `SPARC-Solaris-gcc', or in place of some other text, as in `bits*' for either `bits32' or `bits64'. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - processors/*.h The target-specific `processors' header file defines integer types of various sizes, and also defines certain C preprocessor macros that characterize the target. The two examples supplied are `386-gcc.h' and `SPARC-gcc.h'. The naming convention used for processor header files is `-.h'. If 64-bit integers are supported by the compiler, the macro name `BITS64' should be defined here along with the corresponding 64-bit integer types. In addition, the function-like macro `LIT64' must be defined for constructing 64-bit integer literals (constants). The `LIT64' macro is used consistently in the SoftFloat code to annotate 64-bit literals. If `BITS64' is not defined, only the 32-bit version of SoftFloat can be compiled. If `BITS64' _is_ defined, either can be compiled. If an inlining attribute (such as an `inline' keyword) is provided by the compiler, the macro `INLINE' should be defined to the appropriate keyword. If not, `INLINE' can be set to the keyword `static'. The `INLINE' macro appears in the SoftFloat source code before every function that should be inlined by the compiler. SoftFloat depends on inlining to obtain good speed. Even if inlining cannot be forced with a language keyword, the compiler may still be able to perform inlining on its own as an optimization. If a command-line option is needed to convince the compiler to perform this optimization, this should be assured in the makefile. (See the section _Compiler_Options_and_Efficiency_ below.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - softfloat/bits*/*/softfloat.h The target-specific `softfloat.h' header file defines the SoftFloat interface as seen by clients. Unlike the actual function definitions in `softfloat.c', the declarations in `softfloat.h' do not use any of the types defined by the `processors' header file. This is done so that clients will not have to include the `processors' header file in order to use SoftFloat. Nevertheless, the target-specific declarations in `softfloat.h' must match what `softfloat.c' expects. For example, if `int32' is defined as `int' in the `processors' header file, then in `softfloat.h' the output of `float32_to_int32' should be stated as `int', although in `softfloat.c' it is given in target- independent form as `int32'. For the `bits64' implementation of SoftFloat, the macro names `FLOATX80' and `FLOAT128' must be defined in order for the extended double-precision and quadruple-precision formats to be enabled in the code. Conversely, either or both of the extended formats can be disabled by simply removing the `#define' of the respective macro. When an extended format is not enabled, none of the functions that either input or output the format are defined, and no space is taken up in `softfloat.o' by such functions. There is no provision for disabling the usual single- and double-precision formats. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - softfloat/bits*/*/milieu.h The target-specific `milieu.h' header file provides declarations that are needed to compile SoftFloat. In addition, deviations from ISO/ANSI C by the compiler (such as names not properly declared in system header files) are corrected in this header if possible. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - softfloat/bits*/*/softfloat-specialize This target-specific C source fragment defines: -- whether tininess for underflow is detected before or after rounding by default; -- what (if anything) special happens when exceptions are raised; -- how signaling NaNs are distinguished from quiet NaNs; -- the default generated quiet NaNs; and -- how NaNs are propagated from function inputs to output. These details are not decided by the IEC/IEEE Standard. This fragment is included verbatim within `softfloat.c' when SoftFloat is compiled. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - softfloat/bits*/softfloat-macros This target-independent C source fragment defines a number of arithmetic functions used as primitives within the `softfloat.c' source. Most of the functions defined here are intended to be inlined for efficiency. This fragment is included verbatim within `softfloat.c' when SoftFloat is compiled. Target-specific variations on this file are possible. See the section _Processor-Specific_Optimization_of_`softfloat.c'_Using_`softfloat-macros'_ below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - softfloat/bits*/softfloat.c The target-independent `softfloat.c' source file contains the body of the SoftFloat implementation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The inclusion of the files above within each other (using `#include') can be shown graphically as follows: softfloat/bits*/softfloat.c softfloat/bits*/*/milieu.h processors/*.h softfloat/bits*/*/softfloat.h softfloat/bits*/*/softfloat-specialize softfloat/bits*/softfloat-macros Note in particular that `softfloat.c' does not include the `processors' header file directly. Rather, `softfloat.c' includes the target-specific `milieu.h' header file, which in turn includes the processor header file. ------------------------------------------------------------------------------- Steps to Creating a `softfloat.o' Porting and/or compiling SoftFloat involves the following steps: 1. If one does not already exist, create an appropriate `.h' file in the `processors' directory. 2. If `BITS64' is defined in the `processors' header file, choose whether to compile the 32-bit or 64-bit implementation of SoftFloat. If `BITS64' is not defined, your only choice is the 32-bit implementation. The remaining steps occur within either the `bits32' or `bits64' subdirectories. 3. If one does not already exist, create an appropriate target-specific subdirectory by copying the given `templates' directory. 4. In the target-specific subdirectory, edit the files `softfloat-specialize' and `softfloat.h' to define the desired exception handling functions and mode control values. In the `softfloat.h' header file, ensure also that all declarations give the proper target-specific type (such as `int' or `long') corresponding to the target-independent type used in `softfloat.c' (such as `int32'). None of the type names declared in the `processors' header file should appear in `softfloat.h'. 5. In the target-specific subdirectory, edit the files `milieu.h' and `Makefile' to reflect the current environment. 6. In the target-specific subdirectory, execute `make'. For the targets that are supplied, if the expected compiler is available (usually `gcc'), it should only be necessary to execute `make' in the target-specific subdirectory. ------------------------------------------------------------------------------- Making `softfloat.o' a Library SoftFloat is not made into a software library by the supplied makefile. If desired, `softfloat.o' can easily be put into its own library (in Unix, `softfloat.a') using the usual system tool (in Unix, `ar'). ------------------------------------------------------------------------------- Testing SoftFloat SoftFloat can be tested using the `testsoftfloat' program by the same author. The `testsoftfloat' program is part of the TestFloat package available at the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/ TestFloat.html'. ------------------------------------------------------------------------------- Timing SoftFloat A program called `timesoftfloat' for timing the SoftFloat functions is included with the SoftFloat source code. Compiling `timesoftfloat' should pose no difficulties once `softfloat.o' exists. The supplied makefile will create a `timesoftfloat' executable by default after generating `softfloat.o'. See `timesoftfloat.txt' for documentation about using `timesoftfloat'. ------------------------------------------------------------------------------- Compiler Options and Efficiency In order to get good speed with SoftFloat, it is important that the compiler inline the routines that have been marked `INLINE' in the code. Even if inlining cannot be forced by an appropriate definition of the `INLINE' macro, the compiler may still be able to perform inlining on its own as an optimization. In that case, the makefile should be edited to give the compiler whatever option is required to cause it to inline small functions. The ability of the processor to do fast shifts has been assumed. Efficiency will not be as good on processors for which this is not the case (such as the original Motorola 68000 or Intel 8086 processors). ------------------------------------------------------------------------------- Processor-Specific Optimization of `softfloat.c' Using `softfloat-macros' The `softfloat-macros' source fragment defines arithmetic functions used as primitives by `softfloat.c'. This file has been written in a target- independent form. For a given target, it may be possible to improve on these functions using target-specific and/or non-ISO-C features (such as `asm' statements). For example, one of the ``macro'' functions takes two word-size integers and returns their full product in two words. This operation can be done directly in hardware on many processors; but because it is not available through standard C, the function defined in `softfloat-macros' uses four multiplies to achieve the same result. To address these shortcomings, a customized version of `softfloat-macros' can be created in any of the target-specific subdirectories. A simple modification to the target's makefile should be sufficient to ensure that the custom version is used instead of the generic one. ------------------------------------------------------------------------------- Contact Information At the time of this writing, the most up-to-date information about SoftFloat and the latest release can be found at the Web page `http:// HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'. pcc-libs-20200614/libsoftfloat/softfloat-specialize010064400017500000000000000372021277747754500212040ustar raggewheel/* $NetBSD: softfloat-specialize,v 1.4 2004/09/26 21:13:27 jmmv Exp $ */ /* This is a derivative work. */ /* =============================================================================== This C source fragment is part of the SoftFloat IEC/IEEE Floating-point Arithmetic Package, Release 2a. Written by John R. Hauser. This work was made possible in part by the International Computer Science Institute, located at Suite 600, 1947 Center Street, Berkeley, California 94704. Funding was partially provided by the National Science Foundation under grant MIP-9311980. The original version of this code was written as part of a project to build a fixed-point vector processor in collaboration with the University of California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. More information is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ arithmetic/SoftFloat.html'. THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. Derivative works are acceptable, even for commercial purposes, so long as (1) they include prominent notice that the work is derivative, and (2) they include prominent notice akin to these four paragraphs for those parts of this code that are retained. =============================================================================== */ #include /* ------------------------------------------------------------------------------- Underflow tininess-detection mode, statically initialized to default value. (The declaration in `softfloat.h' must match the `int8' type here.) ------------------------------------------------------------------------------- */ #ifdef SOFTFLOAT_FOR_GCC static #endif int8 float_detect_tininess = float_tininess_after_rounding; /* ------------------------------------------------------------------------------- Raises the exceptions specified by `flags'. Floating-point traps can be defined here if desired. It is currently not possible for such a trap to substitute a result value. If traps are not implemented, this routine should be simply `float_exception_flags |= flags;'. ------------------------------------------------------------------------------- */ fp_except float_exception_mask = 0; void float_raise( fp_except flags ) { float_exception_flags |= flags; if ( flags & float_exception_mask ) { raise( SIGFPE ); } } /* ------------------------------------------------------------------------------- Internal canonical NaN format. ------------------------------------------------------------------------------- */ typedef struct { flag sign; bits64 high, low; } commonNaNT; /* ------------------------------------------------------------------------------- The pattern for a default generated single-precision NaN. ------------------------------------------------------------------------------- */ #define float32_default_nan 0xFFFFFFFF /* ------------------------------------------------------------------------------- Returns 1 if the single-precision floating-point value `a' is a NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ #ifdef SOFTFLOAT_FOR_GCC static #endif flag float32_is_nan( float32 a ) { return ( 0xFF000000 < (bits32) ( a<<1 ) ); } /* ------------------------------------------------------------------------------- Returns 1 if the single-precision floating-point value `a' is a signaling NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ #if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) && \ !defined(SOFTFLOAT_M68K_FOR_GCC) static #endif flag float32_is_signaling_nan( float32 a ) { return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF ); } /* ------------------------------------------------------------------------------- Returns the result of converting the single-precision floating-point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static commonNaNT float32ToCommonNaN( float32 a ) { commonNaNT z; if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); z.sign = a>>31; z.low = 0; z.high = ( (bits64) a )<<41; return z; } /* ------------------------------------------------------------------------------- Returns the result of converting the canonical NaN `a' to the single- precision floating-point format. ------------------------------------------------------------------------------- */ static float32 commonNaNToFloat32( commonNaNT a ) { return (float32) ((((bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 )); } /* ------------------------------------------------------------------------------- Takes two single-precision floating-point values `a' and `b', one of which is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static float32 propagateFloat32NaN( float32 a, float32 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; aIsNaN = float32_is_nan( a ); aIsSignalingNaN = float32_is_signaling_nan( a ); bIsNaN = float32_is_nan( b ); bIsSignalingNaN = float32_is_signaling_nan( b ); a |= 0x00400000; b |= 0x00400000; if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); if ( aIsNaN ) { return ( aIsSignalingNaN & bIsNaN ) ? b : a; } else { return b; } } /* ------------------------------------------------------------------------------- The pattern for a default generated double-precision NaN. ------------------------------------------------------------------------------- */ #define float64_default_nan LIT64( 0xFFFFFFFFFFFFFFFF ) /* ------------------------------------------------------------------------------- Returns 1 if the double-precision floating-point value `a' is a NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ #ifdef SOFTFLOAT_FOR_GCC static #endif flag float64_is_nan( float64 a ) { return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( FLOAT64_DEMANGLE(a)<<1 ) ); } /* ------------------------------------------------------------------------------- Returns 1 if the double-precision floating-point value `a' is a signaling NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ #if defined(SOFTFLOAT_FOR_GCC) && !defined(SOFTFLOATSPARC64_FOR_GCC) && \ !defined(SOFTFLOATM68K_FOR_GCC) static #endif flag float64_is_signaling_nan( float64 a ) { return ( ( ( FLOAT64_DEMANGLE(a)>>51 ) & 0xFFF ) == 0xFFE ) && ( FLOAT64_DEMANGLE(a) & LIT64( 0x0007FFFFFFFFFFFF ) ); } /* ------------------------------------------------------------------------------- Returns the result of converting the double-precision floating-point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static commonNaNT float64ToCommonNaN( float64 a ) { commonNaNT z; if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); z.sign = (flag) (FLOAT64_DEMANGLE(a)>>63); z.low = 0; z.high = FLOAT64_DEMANGLE(a)<<12; return z; } /* ------------------------------------------------------------------------------- Returns the result of converting the canonical NaN `a' to the double- precision floating-point format. ------------------------------------------------------------------------------- */ static float64 commonNaNToFloat64( commonNaNT a ) { return FLOAT64_MANGLE( ( ( (bits64) a.sign )<<63 ) | LIT64( 0x7FF8000000000000 ) | ( a.high>>12 ) ); } /* ------------------------------------------------------------------------------- Takes two double-precision floating-point values `a' and `b', one of which is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static float64 propagateFloat64NaN( float64 a, float64 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; aIsNaN = float64_is_nan( a ); aIsSignalingNaN = float64_is_signaling_nan( a ); bIsNaN = float64_is_nan( b ); bIsSignalingNaN = float64_is_signaling_nan( b ); a |= FLOAT64_MANGLE(LIT64( 0x0008000000000000 )); b |= FLOAT64_MANGLE(LIT64( 0x0008000000000000 )); if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); if ( aIsNaN ) { return ( aIsSignalingNaN & bIsNaN ) ? b : a; } else { return b; } } #ifdef FLOATX80 /* ------------------------------------------------------------------------------- The pattern for a default generated extended double-precision NaN. The `high' and `low' values hold the most- and least-significant bits, respectively. ------------------------------------------------------------------------------- */ #define floatx80_default_nan_high 0xFFFF #define floatx80_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) /* ------------------------------------------------------------------------------- Returns 1 if the extended double-precision floating-point value `a' is a NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ flag floatx80_is_nan( floatx80 a ) { return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( a.low<<1 ); } /* ------------------------------------------------------------------------------- Returns 1 if the extended double-precision floating-point value `a' is a signaling NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ flag floatx80_is_signaling_nan( floatx80 a ) { bits64 aLow; aLow = a.low & ~ LIT64( 0x4000000000000000 ); return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( aLow<<1 ) && ( a.low == aLow ); } /* ------------------------------------------------------------------------------- Returns the result of converting the extended double-precision floating- point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static commonNaNT floatx80ToCommonNaN( floatx80 a ) { commonNaNT z; if ( floatx80_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); z.sign = a.high>>15; z.low = 0; z.high = a.low<<1; return z; } /* ------------------------------------------------------------------------------- Returns the result of converting the canonical NaN `a' to the extended double-precision floating-point format. ------------------------------------------------------------------------------- */ static floatx80 commonNaNToFloatx80( commonNaNT a ) { floatx80 z; z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 ); z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF; return z; } /* ------------------------------------------------------------------------------- Takes two extended double-precision floating-point values `a' and `b', one of which is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; aIsNaN = floatx80_is_nan( a ); aIsSignalingNaN = floatx80_is_signaling_nan( a ); bIsNaN = floatx80_is_nan( b ); bIsSignalingNaN = floatx80_is_signaling_nan( b ); a.low |= LIT64( 0xC000000000000000 ); b.low |= LIT64( 0xC000000000000000 ); if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); if ( aIsNaN ) { return ( aIsSignalingNaN & bIsNaN ) ? b : a; } else { return b; } } #endif #ifdef FLOAT128 /* ------------------------------------------------------------------------------- The pattern for a default generated quadruple-precision NaN. The `high' and `low' values hold the most- and least-significant bits, respectively. ------------------------------------------------------------------------------- */ #define float128_default_nan_high LIT64( 0xFFFFFFFFFFFFFFFF ) #define float128_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF ) /* ------------------------------------------------------------------------------- Returns 1 if the quadruple-precision floating-point value `a' is a NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ flag float128_is_nan( float128 a ) { return ( LIT64( 0xFFFE000000000000 ) <= (bits64) ( a.high<<1 ) ) && ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) ); } /* ------------------------------------------------------------------------------- Returns 1 if the quadruple-precision floating-point value `a' is a signaling NaN; otherwise returns 0. ------------------------------------------------------------------------------- */ flag float128_is_signaling_nan( float128 a ) { return ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE ) && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) ); } /* ------------------------------------------------------------------------------- Returns the result of converting the quadruple-precision floating-point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static commonNaNT float128ToCommonNaN( float128 a ) { commonNaNT z; if ( float128_is_signaling_nan( a ) ) float_raise( float_flag_invalid ); z.sign = a.high>>63; shortShift128Left( a.high, a.low, 16, &z.high, &z.low ); return z; } /* ------------------------------------------------------------------------------- Returns the result of converting the canonical NaN `a' to the quadruple- precision floating-point format. ------------------------------------------------------------------------------- */ static float128 commonNaNToFloat128( commonNaNT a ) { float128 z; shift128Right( a.high, a.low, 16, &z.high, &z.low ); z.high |= ( ( (bits64) a.sign )<<63 ) | LIT64( 0x7FFF800000000000 ); return z; } /* ------------------------------------------------------------------------------- Takes two quadruple-precision floating-point values `a' and `b', one of which is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a signaling NaN, the invalid exception is raised. ------------------------------------------------------------------------------- */ static float128 propagateFloat128NaN( float128 a, float128 b ) { flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN; aIsNaN = float128_is_nan( a ); aIsSignalingNaN = float128_is_signaling_nan( a ); bIsNaN = float128_is_nan( b ); bIsSignalingNaN = float128_is_signaling_nan( b ); a.high |= LIT64( 0x0000800000000000 ); b.high |= LIT64( 0x0000800000000000 ); if ( aIsSignalingNaN | bIsSignalingNaN ) float_raise( float_flag_invalid ); if ( aIsNaN ) { return ( aIsSignalingNaN & bIsNaN ) ? b : a; } else { return b; } } #endif pcc-libs-20200614/libsoftfloat/softfloat.txt010064400017500000000000000403671101446064300176500ustar raggewheel$NetBSD: softfloat.txt,v 1.2 2006/11/24 19:46:58 christos Exp $ SoftFloat Release 2a General Documentation John R. Hauser 1998 December 13 ------------------------------------------------------------------------------- Introduction SoftFloat is a software implementation of floating-point that conforms to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. As many as four formats are supported: single precision, double precision, extended double precision, and quadruple precision. All operations required by the standard are implemented, except for conversions to and from decimal. This document gives information about the types defined and the routines implemented by SoftFloat. It does not attempt to define or explain the IEC/IEEE Floating-Point Standard. Details about the standard are available elsewhere. ------------------------------------------------------------------------------- Limitations SoftFloat is written in C and is designed to work with other C code. The SoftFloat header files assume an ISO/ANSI-style C compiler. No attempt has been made to accommodate compilers that are not ISO-conformant. In particular, the distributed header files will not be acceptable to any compiler that does not recognize function prototypes. Support for the extended double-precision and quadruple-precision formats depends on a C compiler that implements 64-bit integer arithmetic. If the largest integer format supported by the C compiler is 32 bits, SoftFloat is limited to only single and double precisions. When that is the case, all references in this document to the extended double precision, quadruple precision, and 64-bit integers should be ignored. ------------------------------------------------------------------------------- Contents Introduction Limitations Contents Legal Notice Types and Functions Rounding Modes Extended Double-Precision Rounding Precision Exceptions and Exception Flags Function Details Conversion Functions Standard Arithmetic Functions Remainder Functions Round-to-Integer Functions Comparison Functions Signaling NaN Test Functions Raise-Exception Function Contact Information ------------------------------------------------------------------------------- Legal Notice SoftFloat was written by John R. Hauser. This work was made possible in part by the International Computer Science Institute, located at Suite 600, 1947 Center Street, Berkeley, California 94704. Funding was partially provided by the National Science Foundation under grant MIP-9311980. The original version of this code was written as part of a project to build a fixed-point vector processor in collaboration with the University of California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. ------------------------------------------------------------------------------- Types and Functions When 64-bit integers are supported by the compiler, the `softfloat.h' header file defines four types: `float32' (single precision), `float64' (double precision), `floatx80' (extended double precision), and `float128' (quadruple precision). The `float32' and `float64' types are defined in terms of 32-bit and 64-bit integer types, respectively, while the `float128' type is defined as a structure of two 64-bit integers, taking into account the byte order of the particular machine being used. The `floatx80' type is defined as a structure containing one 16-bit and one 64-bit integer, with the machine's byte order again determining the order of the `high' and `low' fields. When 64-bit integers are _not_ supported by the compiler, the `softfloat.h' header file defines only two types: `float32' and `float64'. Because ISO/ANSI C guarantees at least one built-in integer type of 32 bits, the `float32' type is identified with an appropriate integer type. The `float64' type is defined as a structure of two 32-bit integers, with the machine's byte order determining the order of the fields. In either case, the types in `softfloat.h' are defined such that if a system implements the usual C `float' and `double' types according to the IEC/IEEE Standard, then the `float32' and `float64' types should be indistinguishable in memory from the native `float' and `double' types. (On the other hand, when `float32' or `float64' values are placed in processor registers by the compiler, the type of registers used may differ from those used for the native `float' and `double' types.) SoftFloat implements the following arithmetic operations: -- Conversions among all the floating-point formats, and also between integers (32-bit and 64-bit) and any of the floating-point formats. -- The usual add, subtract, multiply, divide, and square root operations for all floating-point formats. -- For each format, the floating-point remainder operation defined by the IEC/IEEE Standard. -- For each floating-point format, a ``round to integer'' operation that rounds to the nearest integer value in the same format. (The floating- point formats can hold integer values, of course.) -- Comparisons between two values in the same floating-point format. The only functions required by the IEC/IEEE Standard that are not provided are conversions to and from decimal. ------------------------------------------------------------------------------- Rounding Modes All four rounding modes prescribed by the IEC/IEEE Standard are implemented for all operations that require rounding. The rounding mode is selected by the global variable `float_rounding_mode'. This variable may be set to one of the values `float_round_nearest_even', `float_round_to_zero', `float_round_down', or `float_round_up'. The rounding mode is initialized to nearest/even. ------------------------------------------------------------------------------- Extended Double-Precision Rounding Precision For extended double precision (`floatx80') only, the rounding precision of the standard arithmetic operations is controlled by the global variable `floatx80_rounding_precision'. The operations affected are: floatx80_add floatx80_sub floatx80_mul floatx80_div floatx80_sqrt When `floatx80_rounding_precision' is set to its default value of 80, these operations are rounded (as usual) to the full precision of the extended double-precision format. Setting `floatx80_rounding_precision' to 32 or to 64 causes the operations listed to be rounded to reduced precision equivalent to single precision (`float32') or to double precision (`float64'), respectively. When rounding to reduced precision, additional bits in the result significand beyond the rounding point are set to zero. The consequences of setting `floatx80_rounding_precision' to a value other than 32, 64, or 80 is not specified. Operations other than the ones listed above are not affected by `floatx80_rounding_precision'. ------------------------------------------------------------------------------- Exceptions and Exception Flags All five exception flags required by the IEC/IEEE Standard are implemented. Each flag is stored as a unique bit in the global variable `float_exception_flags'. The positions of the exception flag bits within this variable are determined by the bit masks `float_flag_inexact', `float_flag_underflow', `float_flag_overflow', `float_flag_divbyzero', and `float_flag_invalid'. The exception flags variable is initialized to all 0, meaning no exceptions. An individual exception flag can be cleared with the statement float_exception_flags &= ~ float_flag_; where `' is the appropriate name. To raise a floating-point exception, the SoftFloat function `float_raise' should be used (see below). In the terminology of the IEC/IEEE Standard, SoftFloat can detect tininess for underflow either before or after rounding. The choice is made by the global variable `float_detect_tininess', which can be set to either `float_tininess_before_rounding' or `float_tininess_after_rounding'. Detecting tininess after rounding is better because it results in fewer spurious underflow signals. The other option is provided for compatibility with some systems. Like most systems, SoftFloat always detects loss of accuracy for underflow as an inexact result. ------------------------------------------------------------------------------- Function Details - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Conversion Functions All conversions among the floating-point formats are supported, as are all conversions between a floating-point format and 32-bit and 64-bit signed integers. The complete set of conversion functions is: int32_to_float32 int64_to_float32 int32_to_float64 int64_to_float32 int32_to_floatx80 int64_to_floatx80 int32_to_float128 int64_to_float128 float32_to_int32 float32_to_int64 float32_to_int32 float64_to_int64 floatx80_to_int32 floatx80_to_int64 float128_to_int32 float128_to_int64 float32_to_float64 float32_to_floatx80 float32_to_float128 float64_to_float32 float64_to_floatx80 float64_to_float128 floatx80_to_float32 floatx80_to_float64 floatx80_to_float128 float128_to_float32 float128_to_float64 float128_to_floatx80 Each conversion function takes one operand of the appropriate type and returns one result. Conversions from a smaller to a larger floating-point format are always exact and so require no rounding. Conversions from 32-bit integers to double precision and larger formats are also exact, and likewise for conversions from 64-bit integers to extended double and quadruple precisions. Conversions from floating-point to integer raise the invalid exception if the source value cannot be rounded to a representable integer of the desired size (32 or 64 bits). If the floating-point operand is a NaN, the largest positive integer is returned. Otherwise, if the conversion overflows, the largest integer with the same sign as the operand is returned. On conversions to integer, if the floating-point operand is not already an integer value, the operand is rounded according to the current rounding mode as specified by `float_rounding_mode'. Because C (and perhaps other languages) require that conversions to integers be rounded toward zero, the following functions are provided for improved speed and convenience: float32_to_int32_round_to_zero float32_to_int64_round_to_zero float64_to_int32_round_to_zero float64_to_int64_round_to_zero floatx80_to_int32_round_to_zero floatx80_to_int64_round_to_zero float128_to_int32_round_to_zero float128_to_int64_round_to_zero These variant functions ignore `float_rounding_mode' and always round toward zero. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Standard Arithmetic Functions The following standard arithmetic functions are provided: float32_add float32_sub float32_mul float32_div float32_sqrt float64_add float64_sub float64_mul float64_div float64_sqrt floatx80_add floatx80_sub floatx80_mul floatx80_div floatx80_sqrt float128_add float128_sub float128_mul float128_div float128_sqrt Each function takes two operands, except for `sqrt' which takes only one. The operands and result are all of the same type. Rounding of the extended double-precision (`floatx80') functions is affected by the `floatx80_rounding_precision' variable, as explained above in the section _Extended_Double-Precision_Rounding_Precision_. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Remainder Functions For each format, SoftFloat implements the remainder function according to the IEC/IEEE Standard. The remainder functions are: float32_rem float64_rem floatx80_rem float128_rem Each remainder function takes two operands. The operands and result are all of the same type. Given operands x and y, the remainder functions return the value x - n*y, where n is the integer closest to x/y. If x/y is exactly halfway between two integers, n is the even integer closest to x/y. The remainder functions are always exact and so require no rounding. Depending on the relative magnitudes of the operands, the remainder functions can take considerably longer to execute than the other SoftFloat functions. This is inherent in the remainder operation itself and is not a flaw in the SoftFloat implementation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Round-to-Integer Functions For each format, SoftFloat implements the round-to-integer function specified by the IEC/IEEE Standard. The functions are: float32_round_to_int float64_round_to_int floatx80_round_to_int float128_round_to_int Each function takes a single floating-point operand and returns a result of the same type. (Note that the result is not an integer type.) The operand is rounded to an exact integer according to the current rounding mode, and the resulting integer value is returned in the same floating-point format. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Comparison Functions The following floating-point comparison functions are provided: float32_eq float32_le float32_lt float64_eq float64_le float64_lt floatx80_eq floatx80_le floatx80_lt float128_eq float128_le float128_lt Each function takes two operands of the same type and returns a 1 or 0 representing either _true_ or _false_. The abbreviation `eq' stands for ``equal'' (=); `le' stands for ``less than or equal'' (<=); and `lt' stands for ``less than'' (<). The standard greater-than (>), greater-than-or-equal (>=), and not-equal (!=) functions are easily obtained using the functions provided. The not-equal function is just the logical complement of the equal function. The greater-than-or-equal function is identical to the less-than-or-equal function with the operands reversed; and the greater-than function can be obtained from the less-than function in the same way. The IEC/IEEE Standard specifies that the less-than-or-equal and less-than functions raise the invalid exception if either input is any kind of NaN. The equal functions, on the other hand, are defined not to raise the invalid exception on quiet NaNs. For completeness, SoftFloat provides the following additional functions: float32_eq_signaling float32_le_quiet float32_lt_quiet float64_eq_signaling float64_le_quiet float64_lt_quiet floatx80_eq_signaling floatx80_le_quiet floatx80_lt_quiet float128_eq_signaling float128_le_quiet float128_lt_quiet The `signaling' equal functions are identical to the standard functions except that the invalid exception is raised for any NaN input. Likewise, the `quiet' comparison functions are identical to their counterparts except that the invalid exception is not raised for quiet NaNs. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Signaling NaN Test Functions The following functions test whether a floating-point value is a signaling NaN: float32_is_signaling_nan float64_is_signaling_nan floatx80_is_signaling_nan float128_is_signaling_nan The functions take one operand and return 1 if the operand is a signaling NaN and 0 otherwise. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Raise-Exception Function SoftFloat provides a function for raising floating-point exceptions: float_raise The function takes a mask indicating the set of exceptions to raise. No result is returned. In addition to setting the specified exception flags, this function may cause a trap or abort appropriate for the current system. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ------------------------------------------------------------------------------- Contact Information At the time of this writing, the most up-to-date information about SoftFloat and the latest release can be found at the Web page `http:// HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'. pcc-libs-20200614/libsoftfloat/timesoftfloat.c010064400017500000000000002416001103330754600201260ustar raggewheel/* $NetBSD: timesoftfloat.c,v 1.1 2000/06/06 08:15:11 bjh21 Exp $ */ /* =============================================================================== This C source file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic Package, Release 2a. Written by John R. Hauser. This work was made possible in part by the International Computer Science Institute, located at Suite 600, 1947 Center Street, Berkeley, California 94704. Funding was partially provided by the National Science Foundation under grant MIP-9311980. The original version of this code was written as part of a project to build a fixed-point vector processor in collaboration with the University of California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. More information is available through the Web page `http://HTTP.CS.Berkeley.EDU/~jhauser/ arithmetic/SoftFloat.html'. THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ANY AND ALL LOSSES, COSTS, OR OTHER PROBLEMS ARISING FROM ITS USE. Derivative works are acceptable, even for commercial purposes, so long as (1) they include prominent notice that the work is derivative, and (2) they include prominent notice akin to these four paragraphs for those parts of this code that are retained. =============================================================================== */ #include #include #include #include #include #include "milieu.h" #include "softfloat.h" enum { minIterations = 1000 }; static void fail( const char *message, ... ) { va_list varArgs; fputs( "timesoftfloat: ", stderr ); va_start( varArgs, message ); vfprintf( stderr, message, varArgs ); va_end( varArgs ); fputs( ".\n", stderr ); exit( EXIT_FAILURE ); } static char *functionName; static char *roundingPrecisionName, *roundingModeName, *tininessModeName; static void reportTime( int32 count, long clocks ) { printf( "%8.1f kops/s: %s", ( count / ( ( (float) clocks ) / CLOCKS_PER_SEC ) ) / 1000, functionName ); if ( roundingModeName ) { if ( roundingPrecisionName ) { fputs( ", precision ", stdout ); fputs( roundingPrecisionName, stdout ); } fputs( ", rounding ", stdout ); fputs( roundingModeName, stdout ); if ( tininessModeName ) { fputs( ", tininess ", stdout ); fputs( tininessModeName, stdout ); fputs( " rounding", stdout ); } } fputc( '\n', stdout ); } enum { numInputs_int32 = 32 }; static const int32 inputs_int32[ numInputs_int32 ] = { 0xFFFFBB79, 0x405CF80F, 0x00000000, 0xFFFFFD04, 0xFFF20002, 0x0C8EF795, 0xF00011FF, 0x000006CA, 0x00009BFE, 0xFF4862E3, 0x9FFFEFFE, 0xFFFFFFB7, 0x0BFF7FFF, 0x0000F37A, 0x0011DFFE, 0x00000006, 0xFFF02006, 0xFFFFF7D1, 0x10200003, 0xDE8DF765, 0x00003E02, 0x000019E8, 0x0008FFFE, 0xFFFFFB5C, 0xFFDF7FFE, 0x07C42FBF, 0x0FFFE3FF, 0x040B9F13, 0xBFFFFFF8, 0x0001BF56, 0x000017F6, 0x000A908A }; static void time_a_int32_z_float32( float32 function( int32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_int32_z_float64( float64 function( int32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 static void time_a_int32_z_floatx80( floatx80 function( int32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif #ifdef FLOAT128 static void time_a_int32_z_float128( float128 function( int32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif enum { numInputs_int64 = 32 }; static const int64 inputs_int64[ numInputs_int64 ] = { LIT64( 0xFBFFC3FFFFFFFFFF ), LIT64( 0x0000000003C589BC ), LIT64( 0x00000000400013FE ), LIT64( 0x0000000000186171 ), LIT64( 0xFFFFFFFFFFFEFBFA ), LIT64( 0xFFFFFD79E6DFFC73 ), LIT64( 0x0000000010001DFF ), LIT64( 0xDD1A0F0C78513710 ), LIT64( 0xFFFF83FFFFFEFFFE ), LIT64( 0x00756EBD1AD0C1C7 ), LIT64( 0x0003FDFFFFFFFFBE ), LIT64( 0x0007D0FB2C2CA951 ), LIT64( 0x0007FC0007FFFFFE ), LIT64( 0x0000001F942B18BB ), LIT64( 0x0000080101FFFFFE ), LIT64( 0xFFFFFFFFFFFF0978 ), LIT64( 0x000000000008BFFF ), LIT64( 0x0000000006F5AF08 ), LIT64( 0xFFDEFF7FFFFFFFFE ), LIT64( 0x0000000000000003 ), LIT64( 0x3FFFFFFFFF80007D ), LIT64( 0x0000000000000078 ), LIT64( 0xFFF80000007FDFFD ), LIT64( 0x1BBC775B78016AB0 ), LIT64( 0xFFF9001FFFFFFFFE ), LIT64( 0xFFFD4767AB98E43F ), LIT64( 0xFFFFFEFFFE00001E ), LIT64( 0xFFFFFFFFFFF04EFD ), LIT64( 0x07FFFFFFFFFFF7FF ), LIT64( 0xFFFC9EAA38F89050 ), LIT64( 0x00000020FBFFFFFE ), LIT64( 0x0000099AE6455357 ) }; static void time_a_int64_z_float32( float32 function( int64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_int64_z_float64( float64 function( int64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 static void time_a_int64_z_floatx80( floatx80 function( int64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif #ifdef FLOAT128 static void time_a_int64_z_float128( float128 function( int64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_int64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_int64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif enum { numInputs_float32 = 32 }; static const float32 inputs_float32[ numInputs_float32 ] = { 0x4EFA0000, 0xC1D0B328, 0x80000000, 0x3E69A31E, 0xAF803EFF, 0x3F800000, 0x17BF8000, 0xE74A301A, 0x4E010003, 0x7EE3C75D, 0xBD803FE0, 0xBFFEFF00, 0x7981F800, 0x431FFFFC, 0xC100C000, 0x3D87EFFF, 0x4103FEFE, 0xBC000007, 0xBF01F7FF, 0x4E6C6B5C, 0xC187FFFE, 0xC58B9F13, 0x4F88007F, 0xDF004007, 0xB7FFD7FE, 0x7E8001FB, 0x46EFFBFF, 0x31C10000, 0xDB428661, 0x33F89B1F, 0xA3BFEFFF, 0x537BFFBE }; static void time_a_float32_z_int32( int32 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float32_z_int64( int64 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float32_z_float64( float64 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 static void time_a_float32_z_floatx80( floatx80 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif #ifdef FLOAT128 static void time_a_float32_z_float128( float128 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif static void time_az_float32( float32 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_ab_float32_z_flag( flag function( float32, float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNumA ], inputs_float32[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float32 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNumA ], inputs_float32[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float32 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_abz_float32( float32 function( float32, float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32[ inputNumA ], inputs_float32[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float32 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32[ inputNumA ], inputs_float32[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float32 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static const float32 inputs_float32_pos[ numInputs_float32 ] = { 0x4EFA0000, 0x41D0B328, 0x00000000, 0x3E69A31E, 0x2F803EFF, 0x3F800000, 0x17BF8000, 0x674A301A, 0x4E010003, 0x7EE3C75D, 0x3D803FE0, 0x3FFEFF00, 0x7981F800, 0x431FFFFC, 0x4100C000, 0x3D87EFFF, 0x4103FEFE, 0x3C000007, 0x3F01F7FF, 0x4E6C6B5C, 0x4187FFFE, 0x458B9F13, 0x4F88007F, 0x5F004007, 0x37FFD7FE, 0x7E8001FB, 0x46EFFBFF, 0x31C10000, 0x5B428661, 0x33F89B1F, 0x23BFEFFF, 0x537BFFBE }; static void time_az_float32_pos( float32 function( float32 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float32_pos[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float32_pos[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float32 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } enum { numInputs_float64 = 32 }; static const float64 inputs_float64[ numInputs_float64 ] = { LIT64( 0x422FFFC008000000 ), LIT64( 0xB7E0000480000000 ), LIT64( 0xF3FD2546120B7935 ), LIT64( 0x3FF0000000000000 ), LIT64( 0xCE07F766F09588D6 ), LIT64( 0x8000000000000000 ), LIT64( 0x3FCE000400000000 ), LIT64( 0x8313B60F0032BED8 ), LIT64( 0xC1EFFFFFC0002000 ), LIT64( 0x3FB3C75D224F2B0F ), LIT64( 0x7FD00000004000FF ), LIT64( 0xA12FFF8000001FFF ), LIT64( 0x3EE0000000FE0000 ), LIT64( 0x0010000080000004 ), LIT64( 0x41CFFFFE00000020 ), LIT64( 0x40303FFFFFFFFFFD ), LIT64( 0x3FD000003FEFFFFF ), LIT64( 0xBFD0000010000000 ), LIT64( 0xB7FC6B5C16CA55CF ), LIT64( 0x413EEB940B9D1301 ), LIT64( 0xC7E00200001FFFFF ), LIT64( 0x47F00021FFFFFFFE ), LIT64( 0xBFFFFFFFF80000FF ), LIT64( 0xC07FFFFFE00FFFFF ), LIT64( 0x001497A63740C5E8 ), LIT64( 0xC4BFFFE0001FFFFF ), LIT64( 0x96FFDFFEFFFFFFFF ), LIT64( 0x403FC000000001FE ), LIT64( 0xFFD00000000001F6 ), LIT64( 0x0640400002000000 ), LIT64( 0x479CEE1E4F789FE0 ), LIT64( 0xC237FFFFFFFFFDFE ) }; static void time_a_float64_z_int32( int32 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float64_z_int64( int64 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float64_z_float32( float32 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 static void time_a_float64_z_floatx80( floatx80 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif #ifdef FLOAT128 static void time_a_float64_z_float128( float128 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif static void time_az_float64( float64 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_ab_float64_z_flag( flag function( float64, float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNumA ], inputs_float64[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float64 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNumA ], inputs_float64[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float64 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_abz_float64( float64 function( float64, float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64[ inputNumA ], inputs_float64[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float64 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64[ inputNumA ], inputs_float64[ inputNumB ] ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float64 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static const float64 inputs_float64_pos[ numInputs_float64 ] = { LIT64( 0x422FFFC008000000 ), LIT64( 0x37E0000480000000 ), LIT64( 0x73FD2546120B7935 ), LIT64( 0x3FF0000000000000 ), LIT64( 0x4E07F766F09588D6 ), LIT64( 0x0000000000000000 ), LIT64( 0x3FCE000400000000 ), LIT64( 0x0313B60F0032BED8 ), LIT64( 0x41EFFFFFC0002000 ), LIT64( 0x3FB3C75D224F2B0F ), LIT64( 0x7FD00000004000FF ), LIT64( 0x212FFF8000001FFF ), LIT64( 0x3EE0000000FE0000 ), LIT64( 0x0010000080000004 ), LIT64( 0x41CFFFFE00000020 ), LIT64( 0x40303FFFFFFFFFFD ), LIT64( 0x3FD000003FEFFFFF ), LIT64( 0x3FD0000010000000 ), LIT64( 0x37FC6B5C16CA55CF ), LIT64( 0x413EEB940B9D1301 ), LIT64( 0x47E00200001FFFFF ), LIT64( 0x47F00021FFFFFFFE ), LIT64( 0x3FFFFFFFF80000FF ), LIT64( 0x407FFFFFE00FFFFF ), LIT64( 0x001497A63740C5E8 ), LIT64( 0x44BFFFE0001FFFFF ), LIT64( 0x16FFDFFEFFFFFFFF ), LIT64( 0x403FC000000001FE ), LIT64( 0x7FD00000000001F6 ), LIT64( 0x0640400002000000 ), LIT64( 0x479CEE1E4F789FE0 ), LIT64( 0x4237FFFFFFFFFDFE ) }; static void time_az_float64_pos( float64 function( float64 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { function( inputs_float64_pos[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { function( inputs_float64_pos[ inputNum ] ); inputNum = ( inputNum + 1 ) & ( numInputs_float64 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 enum { numInputs_floatx80 = 32 }; static const struct { bits16 high; bits64 low; } inputs_floatx80[ numInputs_floatx80 ] = { { 0xC03F, LIT64( 0xA9BE15A19C1E8B62 ) }, { 0x8000, LIT64( 0x0000000000000000 ) }, { 0x75A8, LIT64( 0xE59591E4788957A5 ) }, { 0xBFFF, LIT64( 0xFFF0000000000040 ) }, { 0x0CD8, LIT64( 0xFC000000000007FE ) }, { 0x43BA, LIT64( 0x99A4000000000000 ) }, { 0x3FFF, LIT64( 0x8000000000000000 ) }, { 0x4081, LIT64( 0x94FBF1BCEB5545F0 ) }, { 0x403E, LIT64( 0xFFF0000000002000 ) }, { 0x3FFE, LIT64( 0xC860E3C75D224F28 ) }, { 0x407E, LIT64( 0xFC00000FFFFFFFFE ) }, { 0x737A, LIT64( 0x800000007FFDFFFE ) }, { 0x4044, LIT64( 0xFFFFFF80000FFFFF ) }, { 0xBBFE, LIT64( 0x8000040000001FFE ) }, { 0xC002, LIT64( 0xFF80000000000020 ) }, { 0xDE8D, LIT64( 0xFFFFFFFFFFE00004 ) }, { 0xC004, LIT64( 0x8000000000003FFB ) }, { 0x407F, LIT64( 0x800000000003FFFE ) }, { 0xC000, LIT64( 0xA459EE6A5C16CA55 ) }, { 0x8003, LIT64( 0xC42CBF7399AEEB94 ) }, { 0xBF7F, LIT64( 0xF800000000000006 ) }, { 0xC07F, LIT64( 0xBF56BE8871F28FEA ) }, { 0xC07E, LIT64( 0xFFFF77FFFFFFFFFE ) }, { 0xADC9, LIT64( 0x8000000FFFFFFFDE ) }, { 0xC001, LIT64( 0xEFF7FFFFFFFFFFFF ) }, { 0x4001, LIT64( 0xBE84F30125C497A6 ) }, { 0xC06B, LIT64( 0xEFFFFFFFFFFFFFFF ) }, { 0x4080, LIT64( 0xFFFFFFFFBFFFFFFF ) }, { 0x87E9, LIT64( 0x81FFFFFFFFFFFBFF ) }, { 0xA63F, LIT64( 0x801FFFFFFEFFFFFE ) }, { 0x403C, LIT64( 0x801FFFFFFFF7FFFF ) }, { 0x4018, LIT64( 0x8000000000080003 ) } }; static void time_a_floatx80_z_int32( int32 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_floatx80_z_int64( int64 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_floatx80_z_float32( float32 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_floatx80_z_float64( float64 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOAT128 static void time_a_floatx80_z_float128( float128 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif static void time_az_floatx80( floatx80 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNum ].low; a.high = inputs_floatx80[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_ab_floatx80_z_flag( flag function( floatx80, floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; floatx80 a, b; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNumA ].low; a.high = inputs_floatx80[ inputNumA ].high; b.low = inputs_floatx80[ inputNumB ].low; b.high = inputs_floatx80[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_floatx80 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNumA ].low; a.high = inputs_floatx80[ inputNumA ].high; b.low = inputs_floatx80[ inputNumB ].low; b.high = inputs_floatx80[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_floatx80 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_abz_floatx80( floatx80 function( floatx80, floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; floatx80 a, b; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80[ inputNumA ].low; a.high = inputs_floatx80[ inputNumA ].high; b.low = inputs_floatx80[ inputNumB ].low; b.high = inputs_floatx80[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_floatx80 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80[ inputNumA ].low; a.high = inputs_floatx80[ inputNumA ].high; b.low = inputs_floatx80[ inputNumB ].low; b.high = inputs_floatx80[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_floatx80 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static const struct { bits16 high; bits64 low; } inputs_floatx80_pos[ numInputs_floatx80 ] = { { 0x403F, LIT64( 0xA9BE15A19C1E8B62 ) }, { 0x0000, LIT64( 0x0000000000000000 ) }, { 0x75A8, LIT64( 0xE59591E4788957A5 ) }, { 0x3FFF, LIT64( 0xFFF0000000000040 ) }, { 0x0CD8, LIT64( 0xFC000000000007FE ) }, { 0x43BA, LIT64( 0x99A4000000000000 ) }, { 0x3FFF, LIT64( 0x8000000000000000 ) }, { 0x4081, LIT64( 0x94FBF1BCEB5545F0 ) }, { 0x403E, LIT64( 0xFFF0000000002000 ) }, { 0x3FFE, LIT64( 0xC860E3C75D224F28 ) }, { 0x407E, LIT64( 0xFC00000FFFFFFFFE ) }, { 0x737A, LIT64( 0x800000007FFDFFFE ) }, { 0x4044, LIT64( 0xFFFFFF80000FFFFF ) }, { 0x3BFE, LIT64( 0x8000040000001FFE ) }, { 0x4002, LIT64( 0xFF80000000000020 ) }, { 0x5E8D, LIT64( 0xFFFFFFFFFFE00004 ) }, { 0x4004, LIT64( 0x8000000000003FFB ) }, { 0x407F, LIT64( 0x800000000003FFFE ) }, { 0x4000, LIT64( 0xA459EE6A5C16CA55 ) }, { 0x0003, LIT64( 0xC42CBF7399AEEB94 ) }, { 0x3F7F, LIT64( 0xF800000000000006 ) }, { 0x407F, LIT64( 0xBF56BE8871F28FEA ) }, { 0x407E, LIT64( 0xFFFF77FFFFFFFFFE ) }, { 0x2DC9, LIT64( 0x8000000FFFFFFFDE ) }, { 0x4001, LIT64( 0xEFF7FFFFFFFFFFFF ) }, { 0x4001, LIT64( 0xBE84F30125C497A6 ) }, { 0x406B, LIT64( 0xEFFFFFFFFFFFFFFF ) }, { 0x4080, LIT64( 0xFFFFFFFFBFFFFFFF ) }, { 0x07E9, LIT64( 0x81FFFFFFFFFFFBFF ) }, { 0x263F, LIT64( 0x801FFFFFFEFFFFFE ) }, { 0x403C, LIT64( 0x801FFFFFFFF7FFFF ) }, { 0x4018, LIT64( 0x8000000000080003 ) } }; static void time_az_floatx80_pos( floatx80 function( floatx80 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; floatx80 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_floatx80_pos[ inputNum ].low; a.high = inputs_floatx80_pos[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_floatx80_pos[ inputNum ].low; a.high = inputs_floatx80_pos[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_floatx80 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif #ifdef FLOAT128 enum { numInputs_float128 = 32 }; static const struct { bits64 high, low; } inputs_float128[ numInputs_float128 ] = { { LIT64( 0x3FDA200000100000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x3FFF000000000000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x85F14776190C8306 ), LIT64( 0xD8715F4E3D54BB92 ) }, { LIT64( 0xF2B00000007FFFFF ), LIT64( 0xFFFFFFFFFFF7FFFF ) }, { LIT64( 0x8000000000000000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0xBFFFFFFFFFE00000 ), LIT64( 0x0000008000000000 ) }, { LIT64( 0x407F1719CE722F3E ), LIT64( 0xDA6B3FE5FF29425B ) }, { LIT64( 0x43FFFF8000000000 ), LIT64( 0x0000000000400000 ) }, { LIT64( 0x401E000000000100 ), LIT64( 0x0000000000002000 ) }, { LIT64( 0x3FFED71DACDA8E47 ), LIT64( 0x4860E3C75D224F28 ) }, { LIT64( 0xBF7ECFC1E90647D1 ), LIT64( 0x7A124FE55623EE44 ) }, { LIT64( 0x0DF7007FFFFFFFFF ), LIT64( 0xFFFFFFFFEFFFFFFF ) }, { LIT64( 0x3FE5FFEFFFFFFFFF ), LIT64( 0xFFFFFFFFFFFFEFFF ) }, { LIT64( 0x403FFFFFFFFFFFFF ), LIT64( 0xFFFFFFFFFFFFFBFE ) }, { LIT64( 0xBFFB2FBF7399AFEB ), LIT64( 0xA459EE6A5C16CA55 ) }, { LIT64( 0xBDB8FFFFFFFFFFFC ), LIT64( 0x0000000000000400 ) }, { LIT64( 0x3FC8FFDFFFFFFFFF ), LIT64( 0xFFFFFFFFF0000000 ) }, { LIT64( 0x3FFBFFFFFFDFFFFF ), LIT64( 0xFFF8000000000000 ) }, { LIT64( 0x407043C11737BE84 ), LIT64( 0xDDD58212ADC937F4 ) }, { LIT64( 0x8001000000000000 ), LIT64( 0x0000001000000001 ) }, { LIT64( 0xC036FFFFFFFFFFFF ), LIT64( 0xFE40000000000000 ) }, { LIT64( 0x4002FFFFFE000002 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x4000C3FEDE897773 ), LIT64( 0x326AC4FD8EFBE6DC ) }, { LIT64( 0xBFFF0000000FFFFF ), LIT64( 0xFFFFFE0000000000 ) }, { LIT64( 0x62C3E502146E426D ), LIT64( 0x43F3CAA0DC7DF1A0 ) }, { LIT64( 0xB5CBD32E52BB570E ), LIT64( 0xBCC477CB11C6236C ) }, { LIT64( 0xE228FFFFFFC00000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x3F80000000000000 ), LIT64( 0x0000000080000008 ) }, { LIT64( 0xC1AFFFDFFFFFFFFF ), LIT64( 0xFFFC000000000000 ) }, { LIT64( 0xC96F000000000000 ), LIT64( 0x00000001FFFBFFFF ) }, { LIT64( 0x3DE09BFE7923A338 ), LIT64( 0xBCC8FBBD7CEC1F4F ) }, { LIT64( 0x401CFFFFFFFFFFFF ), LIT64( 0xFFFFFFFEFFFFFF80 ) } }; static void time_a_float128_z_int32( int32 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float128_z_int64( int64 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float128_z_float32( float32 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_a_float128_z_float64( float64 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #ifdef FLOATX80 static void time_a_float128_z_floatx80( floatx80 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif static void time_az_float128( float128 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNum ].low; a.high = inputs_float128[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_ab_float128_z_flag( flag function( float128, float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; float128 a, b; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNumA ].low; a.high = inputs_float128[ inputNumA ].high; b.low = inputs_float128[ inputNumB ].low; b.high = inputs_float128[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float128 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNumA ].low; a.high = inputs_float128[ inputNumA ].high; b.low = inputs_float128[ inputNumB ].low; b.high = inputs_float128[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float128 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static void time_abz_float128( float128 function( float128, float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNumA, inputNumB; float128 a, b; count = 0; inputNumA = 0; inputNumB = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128[ inputNumA ].low; a.high = inputs_float128[ inputNumA ].high; b.low = inputs_float128[ inputNumB ].low; b.high = inputs_float128[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float128 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNumA = 0; inputNumB = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128[ inputNumA ].low; a.high = inputs_float128[ inputNumA ].high; b.low = inputs_float128[ inputNumB ].low; b.high = inputs_float128[ inputNumB ].high; function( a, b ); inputNumA = ( inputNumA + 1 ) & ( numInputs_float128 - 1 ); if ( inputNumA == 0 ) ++inputNumB; inputNumB = ( inputNumB + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } static const struct { bits64 high, low; } inputs_float128_pos[ numInputs_float128 ] = { { LIT64( 0x3FDA200000100000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x3FFF000000000000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x05F14776190C8306 ), LIT64( 0xD8715F4E3D54BB92 ) }, { LIT64( 0x72B00000007FFFFF ), LIT64( 0xFFFFFFFFFFF7FFFF ) }, { LIT64( 0x0000000000000000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x3FFFFFFFFFE00000 ), LIT64( 0x0000008000000000 ) }, { LIT64( 0x407F1719CE722F3E ), LIT64( 0xDA6B3FE5FF29425B ) }, { LIT64( 0x43FFFF8000000000 ), LIT64( 0x0000000000400000 ) }, { LIT64( 0x401E000000000100 ), LIT64( 0x0000000000002000 ) }, { LIT64( 0x3FFED71DACDA8E47 ), LIT64( 0x4860E3C75D224F28 ) }, { LIT64( 0x3F7ECFC1E90647D1 ), LIT64( 0x7A124FE55623EE44 ) }, { LIT64( 0x0DF7007FFFFFFFFF ), LIT64( 0xFFFFFFFFEFFFFFFF ) }, { LIT64( 0x3FE5FFEFFFFFFFFF ), LIT64( 0xFFFFFFFFFFFFEFFF ) }, { LIT64( 0x403FFFFFFFFFFFFF ), LIT64( 0xFFFFFFFFFFFFFBFE ) }, { LIT64( 0x3FFB2FBF7399AFEB ), LIT64( 0xA459EE6A5C16CA55 ) }, { LIT64( 0x3DB8FFFFFFFFFFFC ), LIT64( 0x0000000000000400 ) }, { LIT64( 0x3FC8FFDFFFFFFFFF ), LIT64( 0xFFFFFFFFF0000000 ) }, { LIT64( 0x3FFBFFFFFFDFFFFF ), LIT64( 0xFFF8000000000000 ) }, { LIT64( 0x407043C11737BE84 ), LIT64( 0xDDD58212ADC937F4 ) }, { LIT64( 0x0001000000000000 ), LIT64( 0x0000001000000001 ) }, { LIT64( 0x4036FFFFFFFFFFFF ), LIT64( 0xFE40000000000000 ) }, { LIT64( 0x4002FFFFFE000002 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x4000C3FEDE897773 ), LIT64( 0x326AC4FD8EFBE6DC ) }, { LIT64( 0x3FFF0000000FFFFF ), LIT64( 0xFFFFFE0000000000 ) }, { LIT64( 0x62C3E502146E426D ), LIT64( 0x43F3CAA0DC7DF1A0 ) }, { LIT64( 0x35CBD32E52BB570E ), LIT64( 0xBCC477CB11C6236C ) }, { LIT64( 0x6228FFFFFFC00000 ), LIT64( 0x0000000000000000 ) }, { LIT64( 0x3F80000000000000 ), LIT64( 0x0000000080000008 ) }, { LIT64( 0x41AFFFDFFFFFFFFF ), LIT64( 0xFFFC000000000000 ) }, { LIT64( 0x496F000000000000 ), LIT64( 0x00000001FFFBFFFF ) }, { LIT64( 0x3DE09BFE7923A338 ), LIT64( 0xBCC8FBBD7CEC1F4F ) }, { LIT64( 0x401CFFFFFFFFFFFF ), LIT64( 0xFFFFFFFEFFFFFF80 ) } }; static void time_az_float128_pos( float128 function( float128 ) ) { clock_t startClock, endClock; int32 count, i; int8 inputNum; float128 a; count = 0; inputNum = 0; startClock = clock(); do { for ( i = minIterations; i; --i ) { a.low = inputs_float128_pos[ inputNum ].low; a.high = inputs_float128_pos[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } count += minIterations; } while ( clock() - startClock < CLOCKS_PER_SEC ); inputNum = 0; startClock = clock(); for ( i = count; i; --i ) { a.low = inputs_float128_pos[ inputNum ].low; a.high = inputs_float128_pos[ inputNum ].high; function( a ); inputNum = ( inputNum + 1 ) & ( numInputs_float128 - 1 ); } endClock = clock(); reportTime( count, endClock - startClock ); } #endif enum { INT32_TO_FLOAT32 = 1, INT32_TO_FLOAT64, #ifdef FLOATX80 INT32_TO_FLOATX80, #endif #ifdef FLOAT128 INT32_TO_FLOAT128, #endif INT64_TO_FLOAT32, INT64_TO_FLOAT64, #ifdef FLOATX80 INT64_TO_FLOATX80, #endif #ifdef FLOAT128 INT64_TO_FLOAT128, #endif FLOAT32_TO_INT32, FLOAT32_TO_INT32_ROUND_TO_ZERO, FLOAT32_TO_INT64, FLOAT32_TO_INT64_ROUND_TO_ZERO, FLOAT32_TO_FLOAT64, #ifdef FLOATX80 FLOAT32_TO_FLOATX80, #endif #ifdef FLOAT128 FLOAT32_TO_FLOAT128, #endif FLOAT32_ROUND_TO_INT, FLOAT32_ADD, FLOAT32_SUB, FLOAT32_MUL, FLOAT32_DIV, FLOAT32_REM, FLOAT32_SQRT, FLOAT32_EQ, FLOAT32_LE, FLOAT32_LT, FLOAT32_EQ_SIGNALING, FLOAT32_LE_QUIET, FLOAT32_LT_QUIET, FLOAT64_TO_INT32, FLOAT64_TO_INT32_ROUND_TO_ZERO, FLOAT64_TO_INT64, FLOAT64_TO_INT64_ROUND_TO_ZERO, FLOAT64_TO_FLOAT32, #ifdef FLOATX80 FLOAT64_TO_FLOATX80, #endif #ifdef FLOAT128 FLOAT64_TO_FLOAT128, #endif FLOAT64_ROUND_TO_INT, FLOAT64_ADD, FLOAT64_SUB, FLOAT64_MUL, FLOAT64_DIV, FLOAT64_REM, FLOAT64_SQRT, FLOAT64_EQ, FLOAT64_LE, FLOAT64_LT, FLOAT64_EQ_SIGNALING, FLOAT64_LE_QUIET, FLOAT64_LT_QUIET, #ifdef FLOATX80 FLOATX80_TO_INT32, FLOATX80_TO_INT32_ROUND_TO_ZERO, FLOATX80_TO_INT64, FLOATX80_TO_INT64_ROUND_TO_ZERO, FLOATX80_TO_FLOAT32, FLOATX80_TO_FLOAT64, #ifdef FLOAT128 FLOATX80_TO_FLOAT128, #endif FLOATX80_ROUND_TO_INT, FLOATX80_ADD, FLOATX80_SUB, FLOATX80_MUL, FLOATX80_DIV, FLOATX80_REM, FLOATX80_SQRT, FLOATX80_EQ, FLOATX80_LE, FLOATX80_LT, FLOATX80_EQ_SIGNALING, FLOATX80_LE_QUIET, FLOATX80_LT_QUIET, #endif #ifdef FLOAT128 FLOAT128_TO_INT32, FLOAT128_TO_INT32_ROUND_TO_ZERO, FLOAT128_TO_INT64, FLOAT128_TO_INT64_ROUND_TO_ZERO, FLOAT128_TO_FLOAT32, FLOAT128_TO_FLOAT64, #ifdef FLOATX80 FLOAT128_TO_FLOATX80, #endif FLOAT128_ROUND_TO_INT, FLOAT128_ADD, FLOAT128_SUB, FLOAT128_MUL, FLOAT128_DIV, FLOAT128_REM, FLOAT128_SQRT, FLOAT128_EQ, FLOAT128_LE, FLOAT128_LT, FLOAT128_EQ_SIGNALING, FLOAT128_LE_QUIET, FLOAT128_LT_QUIET, #endif NUM_FUNCTIONS }; static struct { char *name; int8 numInputs; flag roundingPrecision, roundingMode; flag tininessMode, tininessModeAtReducedPrecision; } functions[ NUM_FUNCTIONS ] = { { 0, 0, 0, 0, 0, 0 }, { "int32_to_float32", 1, FALSE, TRUE, FALSE, FALSE }, { "int32_to_float64", 1, FALSE, FALSE, FALSE, FALSE }, #ifdef FLOATX80 { "int32_to_floatx80", 1, FALSE, FALSE, FALSE, FALSE }, #endif #ifdef FLOAT128 { "int32_to_float128", 1, FALSE, FALSE, FALSE, FALSE }, #endif { "int64_to_float32", 1, FALSE, TRUE, FALSE, FALSE }, { "int64_to_float64", 1, FALSE, TRUE, FALSE, FALSE }, #ifdef FLOATX80 { "int64_to_floatx80", 1, FALSE, FALSE, FALSE, FALSE }, #endif #ifdef FLOAT128 { "int64_to_float128", 1, FALSE, FALSE, FALSE, FALSE }, #endif { "float32_to_int32", 1, FALSE, TRUE, FALSE, FALSE }, { "float32_to_int32_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float32_to_int64", 1, FALSE, TRUE, FALSE, FALSE }, { "float32_to_int64_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float32_to_float64", 1, FALSE, FALSE, FALSE, FALSE }, #ifdef FLOATX80 { "float32_to_floatx80", 1, FALSE, FALSE, FALSE, FALSE }, #endif #ifdef FLOAT128 { "float32_to_float128", 1, FALSE, FALSE, FALSE, FALSE }, #endif { "float32_round_to_int", 1, FALSE, TRUE, FALSE, FALSE }, { "float32_add", 2, FALSE, TRUE, FALSE, FALSE }, { "float32_sub", 2, FALSE, TRUE, FALSE, FALSE }, { "float32_mul", 2, FALSE, TRUE, TRUE, FALSE }, { "float32_div", 2, FALSE, TRUE, FALSE, FALSE }, { "float32_rem", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_sqrt", 1, FALSE, TRUE, FALSE, FALSE }, { "float32_eq", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_le", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_lt", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_eq_signaling", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_le_quiet", 2, FALSE, FALSE, FALSE, FALSE }, { "float32_lt_quiet", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_to_int32", 1, FALSE, TRUE, FALSE, FALSE }, { "float64_to_int32_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float64_to_int64", 1, FALSE, TRUE, FALSE, FALSE }, { "float64_to_int64_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float64_to_float32", 1, FALSE, TRUE, TRUE, FALSE }, #ifdef FLOATX80 { "float64_to_floatx80", 1, FALSE, FALSE, FALSE, FALSE }, #endif #ifdef FLOAT128 { "float64_to_float128", 1, FALSE, FALSE, FALSE, FALSE }, #endif { "float64_round_to_int", 1, FALSE, TRUE, FALSE, FALSE }, { "float64_add", 2, FALSE, TRUE, FALSE, FALSE }, { "float64_sub", 2, FALSE, TRUE, FALSE, FALSE }, { "float64_mul", 2, FALSE, TRUE, TRUE, FALSE }, { "float64_div", 2, FALSE, TRUE, FALSE, FALSE }, { "float64_rem", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_sqrt", 1, FALSE, TRUE, FALSE, FALSE }, { "float64_eq", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_le", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_lt", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_eq_signaling", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_le_quiet", 2, FALSE, FALSE, FALSE, FALSE }, { "float64_lt_quiet", 2, FALSE, FALSE, FALSE, FALSE }, #ifdef FLOATX80 { "floatx80_to_int32", 1, FALSE, TRUE, FALSE, FALSE }, { "floatx80_to_int32_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "floatx80_to_int64", 1, FALSE, TRUE, FALSE, FALSE }, { "floatx80_to_int64_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "floatx80_to_float32", 1, FALSE, TRUE, TRUE, FALSE }, { "floatx80_to_float64", 1, FALSE, TRUE, TRUE, FALSE }, #ifdef FLOAT128 { "floatx80_to_float128", 1, FALSE, FALSE, FALSE, FALSE }, #endif { "floatx80_round_to_int", 1, FALSE, TRUE, FALSE, FALSE }, { "floatx80_add", 2, TRUE, TRUE, FALSE, TRUE }, { "floatx80_sub", 2, TRUE, TRUE, FALSE, TRUE }, { "floatx80_mul", 2, TRUE, TRUE, TRUE, TRUE }, { "floatx80_div", 2, TRUE, TRUE, FALSE, TRUE }, { "floatx80_rem", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_sqrt", 1, TRUE, TRUE, FALSE, FALSE }, { "floatx80_eq", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_le", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_lt", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_eq_signaling", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_le_quiet", 2, FALSE, FALSE, FALSE, FALSE }, { "floatx80_lt_quiet", 2, FALSE, FALSE, FALSE, FALSE }, #endif #ifdef FLOAT128 { "float128_to_int32", 1, FALSE, TRUE, FALSE, FALSE }, { "float128_to_int32_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float128_to_int64", 1, FALSE, TRUE, FALSE, FALSE }, { "float128_to_int64_round_to_zero", 1, FALSE, FALSE, FALSE, FALSE }, { "float128_to_float32", 1, FALSE, TRUE, TRUE, FALSE }, { "float128_to_float64", 1, FALSE, TRUE, TRUE, FALSE }, #ifdef FLOATX80 { "float128_to_floatx80", 1, FALSE, TRUE, TRUE, FALSE }, #endif { "float128_round_to_int", 1, FALSE, TRUE, FALSE, FALSE }, { "float128_add", 2, FALSE, TRUE, FALSE, FALSE }, { "float128_sub", 2, FALSE, TRUE, FALSE, FALSE }, { "float128_mul", 2, FALSE, TRUE, TRUE, FALSE }, { "float128_div", 2, FALSE, TRUE, FALSE, FALSE }, { "float128_rem", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_sqrt", 1, FALSE, TRUE, FALSE, FALSE }, { "float128_eq", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_le", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_lt", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_eq_signaling", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_le_quiet", 2, FALSE, FALSE, FALSE, FALSE }, { "float128_lt_quiet", 2, FALSE, FALSE, FALSE, FALSE }, #endif }; enum { ROUND_NEAREST_EVEN = 1, ROUND_TO_ZERO, ROUND_DOWN, ROUND_UP, NUM_ROUNDINGMODES }; enum { TININESS_BEFORE_ROUNDING = 1, TININESS_AFTER_ROUNDING, NUM_TININESSMODES }; static void timeFunctionVariety( uint8 functionCode, int8 roundingPrecision, int8 roundingMode, int8 tininessMode ) { uint8 roundingCode; int8 tininessCode; functionName = functions[ functionCode ].name; if ( roundingPrecision == 32 ) { roundingPrecisionName = "32"; } else if ( roundingPrecision == 64 ) { roundingPrecisionName = "64"; } else if ( roundingPrecision == 80 ) { roundingPrecisionName = "80"; } else { roundingPrecisionName = 0; } #ifdef FLOATX80 floatx80_rounding_precision = roundingPrecision; #endif switch ( roundingMode ) { case 0: roundingModeName = 0; roundingCode = float_round_nearest_even; break; case ROUND_NEAREST_EVEN: roundingModeName = "nearest_even"; roundingCode = float_round_nearest_even; break; case ROUND_TO_ZERO: roundingModeName = "to_zero"; roundingCode = float_round_to_zero; break; case ROUND_DOWN: roundingModeName = "down"; roundingCode = float_round_down; break; case ROUND_UP: roundingModeName = "up"; roundingCode = float_round_up; break; } float_rounding_mode = roundingCode; switch ( tininessMode ) { case 0: tininessModeName = 0; tininessCode = float_tininess_after_rounding; break; case TININESS_BEFORE_ROUNDING: tininessModeName = "before"; tininessCode = float_tininess_before_rounding; break; case TININESS_AFTER_ROUNDING: tininessModeName = "after"; tininessCode = float_tininess_after_rounding; break; } float_detect_tininess = tininessCode; switch ( functionCode ) { case INT32_TO_FLOAT32: time_a_int32_z_float32( int32_to_float32 ); break; case INT32_TO_FLOAT64: time_a_int32_z_float64( int32_to_float64 ); break; #ifdef FLOATX80 case INT32_TO_FLOATX80: time_a_int32_z_floatx80( int32_to_floatx80 ); break; #endif #ifdef FLOAT128 case INT32_TO_FLOAT128: time_a_int32_z_float128( int32_to_float128 ); break; #endif case INT64_TO_FLOAT32: time_a_int64_z_float32( int64_to_float32 ); break; case INT64_TO_FLOAT64: time_a_int64_z_float64( int64_to_float64 ); break; #ifdef FLOATX80 case INT64_TO_FLOATX80: time_a_int64_z_floatx80( int64_to_floatx80 ); break; #endif #ifdef FLOAT128 case INT64_TO_FLOAT128: time_a_int64_z_float128( int64_to_float128 ); break; #endif case FLOAT32_TO_INT32: time_a_float32_z_int32( float32_to_int32 ); break; case FLOAT32_TO_INT32_ROUND_TO_ZERO: time_a_float32_z_int32( float32_to_int32_round_to_zero ); break; case FLOAT32_TO_INT64: time_a_float32_z_int64( float32_to_int64 ); break; case FLOAT32_TO_INT64_ROUND_TO_ZERO: time_a_float32_z_int64( float32_to_int64_round_to_zero ); break; case FLOAT32_TO_FLOAT64: time_a_float32_z_float64( float32_to_float64 ); break; #ifdef FLOATX80 case FLOAT32_TO_FLOATX80: time_a_float32_z_floatx80( float32_to_floatx80 ); break; #endif #ifdef FLOAT128 case FLOAT32_TO_FLOAT128: time_a_float32_z_float128( float32_to_float128 ); break; #endif case FLOAT32_ROUND_TO_INT: time_az_float32( float32_round_to_int ); break; case FLOAT32_ADD: time_abz_float32( float32_add ); break; case FLOAT32_SUB: time_abz_float32( float32_sub ); break; case FLOAT32_MUL: time_abz_float32( float32_mul ); break; case FLOAT32_DIV: time_abz_float32( float32_div ); break; case FLOAT32_REM: time_abz_float32( float32_rem ); break; case FLOAT32_SQRT: time_az_float32_pos( float32_sqrt ); break; case FLOAT32_EQ: time_ab_float32_z_flag( float32_eq ); break; case FLOAT32_LE: time_ab_float32_z_flag( float32_le ); break; case FLOAT32_LT: time_ab_float32_z_flag( float32_lt ); break; case FLOAT32_EQ_SIGNALING: time_ab_float32_z_flag( float32_eq_signaling ); break; case FLOAT32_LE_QUIET: time_ab_float32_z_flag( float32_le_quiet ); break; case FLOAT32_LT_QUIET: time_ab_float32_z_flag( float32_lt_quiet ); break; case FLOAT64_TO_INT32: time_a_float64_z_int32( float64_to_int32 ); break; case FLOAT64_TO_INT32_ROUND_TO_ZERO: time_a_float64_z_int32( float64_to_int32_round_to_zero ); break; case FLOAT64_TO_INT64: time_a_float64_z_int64( float64_to_int64 ); break; case FLOAT64_TO_INT64_ROUND_TO_ZERO: time_a_float64_z_int64( float64_to_int64_round_to_zero ); break; case FLOAT64_TO_FLOAT32: time_a_float64_z_float32( float64_to_float32 ); break; #ifdef FLOATX80 case FLOAT64_TO_FLOATX80: time_a_float64_z_floatx80( float64_to_floatx80 ); break; #endif #ifdef FLOAT128 case FLOAT64_TO_FLOAT128: time_a_float64_z_float128( float64_to_float128 ); break; #endif case FLOAT64_ROUND_TO_INT: time_az_float64( float64_round_to_int ); break; case FLOAT64_ADD: time_abz_float64( float64_add ); break; case FLOAT64_SUB: time_abz_float64( float64_sub ); break; case FLOAT64_MUL: time_abz_float64( float64_mul ); break; case FLOAT64_DIV: time_abz_float64( float64_div ); break; case FLOAT64_REM: time_abz_float64( float64_rem ); break; case FLOAT64_SQRT: time_az_float64_pos( float64_sqrt ); break; case FLOAT64_EQ: time_ab_float64_z_flag( float64_eq ); break; case FLOAT64_LE: time_ab_float64_z_flag( float64_le ); break; case FLOAT64_LT: time_ab_float64_z_flag( float64_lt ); break; case FLOAT64_EQ_SIGNALING: time_ab_float64_z_flag( float64_eq_signaling ); break; case FLOAT64_LE_QUIET: time_ab_float64_z_flag( float64_le_quiet ); break; case FLOAT64_LT_QUIET: time_ab_float64_z_flag( float64_lt_quiet ); break; #ifdef FLOATX80 case FLOATX80_TO_INT32: time_a_floatx80_z_int32( floatx80_to_int32 ); break; case FLOATX80_TO_INT32_ROUND_TO_ZERO: time_a_floatx80_z_int32( floatx80_to_int32_round_to_zero ); break; case FLOATX80_TO_INT64: time_a_floatx80_z_int64( floatx80_to_int64 ); break; case FLOATX80_TO_INT64_ROUND_TO_ZERO: time_a_floatx80_z_int64( floatx80_to_int64_round_to_zero ); break; case FLOATX80_TO_FLOAT32: time_a_floatx80_z_float32( floatx80_to_float32 ); break; case FLOATX80_TO_FLOAT64: time_a_floatx80_z_float64( floatx80_to_float64 ); break; #ifdef FLOAT128 case FLOATX80_TO_FLOAT128: time_a_floatx80_z_float128( floatx80_to_float128 ); break; #endif case FLOATX80_ROUND_TO_INT: time_az_floatx80( floatx80_round_to_int ); break; case FLOATX80_ADD: time_abz_floatx80( floatx80_add ); break; case FLOATX80_SUB: time_abz_floatx80( floatx80_sub ); break; case FLOATX80_MUL: time_abz_floatx80( floatx80_mul ); break; case FLOATX80_DIV: time_abz_floatx80( floatx80_div ); break; case FLOATX80_REM: time_abz_floatx80( floatx80_rem ); break; case FLOATX80_SQRT: time_az_floatx80_pos( floatx80_sqrt ); break; case FLOATX80_EQ: time_ab_floatx80_z_flag( floatx80_eq ); break; case FLOATX80_LE: time_ab_floatx80_z_flag( floatx80_le ); break; case FLOATX80_LT: time_ab_floatx80_z_flag( floatx80_lt ); break; case FLOATX80_EQ_SIGNALING: time_ab_floatx80_z_flag( floatx80_eq_signaling ); break; case FLOATX80_LE_QUIET: time_ab_floatx80_z_flag( floatx80_le_quiet ); break; case FLOATX80_LT_QUIET: time_ab_floatx80_z_flag( floatx80_lt_quiet ); break; #endif #ifdef FLOAT128 case FLOAT128_TO_INT32: time_a_float128_z_int32( float128_to_int32 ); break; case FLOAT128_TO_INT32_ROUND_TO_ZERO: time_a_float128_z_int32( float128_to_int32_round_to_zero ); break; case FLOAT128_TO_INT64: time_a_float128_z_int64( float128_to_int64 ); break; case FLOAT128_TO_INT64_ROUND_TO_ZERO: time_a_float128_z_int64( float128_to_int64_round_to_zero ); break; case FLOAT128_TO_FLOAT32: time_a_float128_z_float32( float128_to_float32 ); break; case FLOAT128_TO_FLOAT64: time_a_float128_z_float64( float128_to_float64 ); break; #ifdef FLOATX80 case FLOAT128_TO_FLOATX80: time_a_float128_z_floatx80( float128_to_floatx80 ); break; #endif case FLOAT128_ROUND_TO_INT: time_az_float128( float128_round_to_int ); break; case FLOAT128_ADD: time_abz_float128( float128_add ); break; case FLOAT128_SUB: time_abz_float128( float128_sub ); break; case FLOAT128_MUL: time_abz_float128( float128_mul ); break; case FLOAT128_DIV: time_abz_float128( float128_div ); break; case FLOAT128_REM: time_abz_float128( float128_rem ); break; case FLOAT128_SQRT: time_az_float128_pos( float128_sqrt ); break; case FLOAT128_EQ: time_ab_float128_z_flag( float128_eq ); break; case FLOAT128_LE: time_ab_float128_z_flag( float128_le ); break; case FLOAT128_LT: time_ab_float128_z_flag( float128_lt ); break; case FLOAT128_EQ_SIGNALING: time_ab_float128_z_flag( float128_eq_signaling ); break; case FLOAT128_LE_QUIET: time_ab_float128_z_flag( float128_le_quiet ); break; case FLOAT128_LT_QUIET: time_ab_float128_z_flag( float128_lt_quiet ); break; #endif } } static void timeFunction( uint8 functionCode, int8 roundingPrecisionIn, int8 roundingModeIn, int8 tininessModeIn ) { int8 roundingPrecision, roundingMode, tininessMode; roundingPrecision = 32; for (;;) { if ( ! functions[ functionCode ].roundingPrecision ) { roundingPrecision = 0; } else if ( roundingPrecisionIn ) { roundingPrecision = roundingPrecisionIn; } for ( roundingMode = 1; roundingMode < NUM_ROUNDINGMODES; ++roundingMode ) { if ( ! functions[ functionCode ].roundingMode ) { roundingMode = 0; } else if ( roundingModeIn ) { roundingMode = roundingModeIn; } for ( tininessMode = 1; tininessMode < NUM_TININESSMODES; ++tininessMode ) { if ( ( roundingPrecision == 32 ) || ( roundingPrecision == 64 ) ) { if ( ! functions[ functionCode ] .tininessModeAtReducedPrecision ) { tininessMode = 0; } else if ( tininessModeIn ) { tininessMode = tininessModeIn; } } else { if ( ! functions[ functionCode ].tininessMode ) { tininessMode = 0; } else if ( tininessModeIn ) { tininessMode = tininessModeIn; } } timeFunctionVariety( functionCode, roundingPrecision, roundingMode, tininessMode ); if ( tininessModeIn || ! tininessMode ) break; } if ( roundingModeIn || ! roundingMode ) break; } if ( roundingPrecisionIn || ! roundingPrecision ) break; if ( roundingPrecision == 80 ) { break; } else if ( roundingPrecision == 64 ) { roundingPrecision = 80; } else if ( roundingPrecision == 32 ) { roundingPrecision = 64; } } } main( int argc, char **argv ) { char *argPtr; flag functionArgument; uint8 functionCode; int8 operands, roundingPrecision, roundingMode, tininessMode; if ( argc <= 1 ) goto writeHelpMessage; functionArgument = FALSE; functionCode = 0; operands = 0; roundingPrecision = 0; roundingMode = 0; tininessMode = 0; --argc; ++argv; while ( argc && ( argPtr = argv[ 0 ] ) ) { if ( argPtr[ 0 ] == '-' ) ++argPtr; if ( strcmp( argPtr, "help" ) == 0 ) { writeHelpMessage: fputs( "timesoftfloat [