├── .gitignore ├── NOTES ├── README ├── make-all.sh ├── make-distclean.sh ├── make-install.sh ├── make-tmp.sh ├── pcc-libs ├── Makefile.in ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── csu │ ├── Makefile.in │ ├── README │ ├── darwin │ │ ├── Makefile │ │ ├── common.c │ │ ├── common.h │ │ ├── i386 │ │ │ ├── crt0.c │ │ │ └── dylib1.c │ │ ├── macho.h │ │ └── powerpc │ │ │ ├── crt0.c │ │ │ └── dylib1.c │ ├── linux │ │ ├── Makefile │ │ ├── amd64 │ │ │ ├── crt0.c │ │ │ ├── crti.c │ │ │ └── crtn.c │ │ ├── common.c │ │ ├── common.h │ │ ├── crtbegin.c │ │ ├── crtend.c │ │ └── i386 │ │ │ ├── crt0.c │ │ │ ├── crti.c │ │ │ └── crtn.c │ ├── netbsd │ │ ├── Makefile │ │ ├── common.h │ │ ├── crtbegin.c │ │ └── crtend.c │ └── none │ │ ├── common.h │ │ ├── crtbegin.c │ │ ├── crtend.c │ │ └── m68k │ │ ├── crt0.s │ │ ├── crti.s │ │ ├── crtn.s │ │ └── ram.ld ├── install-sh ├── libF77 │ ├── Makefile │ ├── abort_.c │ ├── c_abs.c │ ├── c_cos.c │ ├── c_div.c │ ├── c_exp.c │ ├── c_log.c │ ├── c_sin.c │ ├── c_sqrt.c │ ├── cabs.c │ ├── complex │ ├── d_abs.c │ ├── d_acos.c │ ├── d_asin.c │ ├── d_atan.c │ ├── d_atn2.c │ ├── d_cnjg.c │ ├── d_cos.c │ ├── d_cosh.c │ ├── d_dim.c │ ├── d_erf.c │ ├── d_erfc.c │ ├── d_exp.c │ ├── d_imag.c │ ├── d_int.c │ ├── d_lg10.c │ ├── d_log.c │ ├── d_mod.c │ ├── d_nint.c │ ├── d_prod.c │ ├── d_sign.c │ ├── d_sin.c │ ├── d_sinh.c │ ├── d_sqrt.c │ ├── d_tan.c │ ├── d_tanh.c │ ├── erf.c │ ├── f77lib.h │ ├── getarg_.c │ ├── h_abs.c │ ├── h_dim.c │ ├── h_dnnt.c │ ├── h_indx.c │ ├── h_len.c │ ├── h_mod.c │ ├── h_nint.c │ ├── h_sign.c │ ├── hl_ge.c │ ├── hl_gt.c │ ├── hl_le.c │ ├── hl_lt.c │ ├── i_abs.c │ ├── i_dim.c │ ├── i_dnnt.c │ ├── i_indx.c │ ├── i_len.c │ ├── i_mod.c │ ├── i_nint.c │ ├── i_sign.c │ ├── iargc_.c │ ├── l_ge.c │ ├── l_gt.c │ ├── l_le.c │ ├── l_lt.c │ ├── main.c │ ├── pow_ci.c │ ├── pow_dd.c │ ├── pow_di.c │ ├── pow_hh.c │ ├── pow_ii.c │ ├── pow_ri.c │ ├── pow_zi.c │ ├── pow_zz.c │ ├── r_abs.c │ ├── r_acos.c │ ├── r_asin.c │ ├── r_atan.c │ ├── r_atn2.c │ ├── r_cnjg.c │ ├── r_cos.c │ ├── r_cosh.c │ ├── r_dim.c │ ├── r_erf.c │ ├── r_erfc.c │ ├── r_exp.c │ ├── r_imag.c │ ├── r_int.c │ ├── r_lg10.c │ ├── r_log.c │ ├── r_mod.c │ ├── r_nint.c │ ├── r_sign.c │ ├── r_sin.c │ ├── r_sinh.c │ ├── r_sqrt.c │ ├── r_tan.c │ ├── r_tanh.c │ ├── s_cat.c │ ├── s_cmp.c │ ├── s_copy.c │ ├── s_paus.c │ ├── s_rnge.c │ ├── s_stop.c │ ├── signal_.c │ ├── sinh.c │ ├── tanh.c │ ├── z_abs.c │ ├── z_cos.c │ ├── z_div.c │ ├── z_exp.c │ ├── z_log.c │ ├── z_sin.c │ └── z_sqrt.c ├── libI77 │ ├── Makefile │ ├── backspace.c │ ├── close.c │ ├── dfe.c │ ├── due.c │ ├── endfile.c │ ├── err.c │ ├── fio.h │ ├── fmt.c │ ├── fmt.h │ ├── fmtlib.c │ ├── iio.c │ ├── inquire.c │ ├── lib.c │ ├── lio.c │ ├── lio.h │ ├── lread.c │ ├── open.c │ ├── pwd.c │ ├── rdfmt.c │ ├── rewind.c │ ├── rsfe.c │ ├── sfe.c │ ├── sue.c │ ├── uio.c │ ├── util.c │ ├── wrtfmt.c │ └── wsfe.c ├── libpcc │ ├── Makefile.in │ ├── _alloca.c │ ├── _ftol.asm │ ├── _ftol.c │ ├── adddi3.c │ ├── anddi3.c │ ├── arch │ │ └── m68k │ │ │ ├── Makefile.sub │ │ │ ├── divsi3.s │ │ │ ├── modsi3.s │ │ │ ├── mulsi3.s │ │ │ ├── udivsi3.s │ │ │ └── umodsi3.s │ ├── ashldi3.c │ ├── ashrdi3.c │ ├── cmpdi2.c │ ├── cxmuldiv.c │ ├── divdi3.c │ ├── fixdfdi.c │ ├── fixsfdi.c │ ├── fixunsdfdi.c │ ├── fixunssfdi.c │ ├── floatdidf.c │ ├── floatdisf.c │ ├── floatunsdidf.c │ ├── include │ │ ├── float.h │ │ ├── iso646.h │ │ ├── libpcc_float.h │ │ ├── libpcc_limits.h │ │ ├── libpcc_stdarg.h │ │ ├── libpcc_stdbool.h │ │ ├── libpcc_stddef.h │ │ ├── limits.h │ │ ├── stdarg.h │ │ ├── stdbool.h │ │ └── stddef.h │ ├── iordi3.c │ ├── lshldi3.c │ ├── lshrdi3.c │ ├── moddi3.c │ ├── muldi3.c │ ├── negdi2.c │ ├── notdi2.c │ ├── qdivrem.c │ ├── quad.h │ ├── signbit.c │ ├── ssp.c │ ├── subdi3.c │ ├── ucmpdi2.c │ ├── udivdi3.c │ ├── umoddi3.c │ ├── unwind.c │ └── xordi3.c └── libsoftfloat │ ├── Makefile.in │ ├── README.NetBSD │ ├── README.txt │ ├── arch │ ├── aarch64 │ │ ├── aarch64-gcc.h │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ └── softfloat.h │ ├── amd64 │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ ├── softfloat.h │ │ └── x86_64-gcc.h │ ├── arm │ │ ├── arm-gcc.h │ │ ├── milieu.h │ │ └── softfloat.h │ ├── i386 │ │ ├── i386-gcc.h │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ └── softfloat.h │ ├── m68k │ │ ├── m68k-gcc.h │ │ ├── milieu.h │ │ └── softfloat.h │ ├── mips │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ ├── mips-gcc.h │ │ └── softfloat.h │ ├── powerpc │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ ├── powerpc-gcc.h │ │ └── softfloat.h │ ├── sh3 │ │ ├── milieu.h │ │ ├── sh3-gcc.h │ │ └── softfloat.h │ └── sparc64 │ │ ├── ieeefp.h │ │ ├── milieu.h │ │ ├── softfloat-qp.h │ │ ├── softfloat.h │ │ └── sparc64-gcc.h │ ├── bits32 │ ├── softfloat-macros │ └── softfloat.c │ ├── bits64 │ ├── softfloat-macros │ └── softfloat.c │ ├── eqdf2.c │ ├── eqsf2.c │ ├── fpgetmask.c │ ├── fpgetround.c │ ├── fpgetsticky.c │ ├── fpsetmask.c │ ├── fpsetround.c │ ├── fpsetsticky.c │ ├── gedf2.c │ ├── gesf2.c │ ├── gexf2.c │ ├── gtdf2.c │ ├── gtsf2.c │ ├── gtxf2.c │ ├── ledf2.c │ ├── lesf2.c │ ├── ltdf2.c │ ├── ltsf2.c │ ├── namespace.h │ ├── nedf2.c │ ├── negdf2.c │ ├── negsf2.c │ ├── negxf2.c │ ├── nesf2.c │ ├── nexf2.c │ ├── softfloat-for-gcc.h │ ├── softfloat-history.txt │ ├── softfloat-source.txt │ ├── softfloat-specialize │ ├── softfloat.txt │ ├── templates │ ├── milieu.h │ ├── softfloat-specialize │ └── softfloat.h │ ├── timesoftfloat.c │ ├── timesoftfloat.txt │ ├── unorddf2.c │ └── unordsf2.c ├── pcc ├── DATESTAMP ├── Makefile.in ├── arch │ ├── aarch64 │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── amd64 │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── arm │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── hppa │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── i386 │ │ ├── code.c │ │ ├── flocal.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── i86 │ │ ├── TODO │ │ ├── code.c │ │ ├── flocal.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── m16c │ │ ├── TODO │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── m68k │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── mips │ │ ├── TODO │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── mips64 │ │ ├── TODO │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── nova │ │ ├── README │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── pdp10 │ │ ├── README │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── pdp11 │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── pdp7 │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── powerpc │ │ ├── README │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── riscv │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ ├── sparc64 │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c │ └── vax │ │ ├── code.c │ │ ├── local.c │ │ ├── local2.c │ │ ├── macdefs.h │ │ ├── order.c │ │ └── table.c ├── cc │ ├── Makefile.in │ ├── cc │ │ ├── Makefile.in │ │ ├── cc.1 │ │ └── cc.c │ ├── ccom │ │ ├── Makefile.in │ │ ├── builtins.c │ │ ├── ccom.1 │ │ ├── cgram.y │ │ ├── complex.c │ │ ├── dwarf.c │ │ ├── dwarf.h │ │ ├── gcc_compat.c │ │ ├── init.c │ │ ├── inline.c │ │ ├── main.c │ │ ├── optim.c │ │ ├── params.c │ │ ├── pass1.h │ │ ├── pftn.c │ │ ├── scan.l │ │ ├── softfloat.c │ │ ├── stabs.c │ │ ├── symtabs.c │ │ └── trees.c │ ├── cpp │ │ ├── Makefile.in │ │ ├── cpc.c │ │ ├── cpp.1 │ │ ├── cpp.c │ │ ├── cpp.h │ │ ├── cpy.y │ │ ├── tests │ │ │ ├── res1 │ │ │ ├── res10 │ │ │ ├── res11 │ │ │ ├── res12 │ │ │ ├── res13 │ │ │ ├── res14 │ │ │ ├── res15 │ │ │ ├── res15C │ │ │ ├── res16 │ │ │ ├── res16C │ │ │ ├── res17 │ │ │ ├── res18 │ │ │ ├── res2 │ │ │ ├── res20 │ │ │ ├── res21 │ │ │ ├── res22 │ │ │ ├── res3 │ │ │ ├── res4 │ │ │ ├── res5 │ │ │ ├── res6 │ │ │ ├── res7 │ │ │ ├── res8 │ │ │ ├── res9 │ │ │ ├── test1 │ │ │ ├── test10 │ │ │ ├── test11 │ │ │ ├── test12 │ │ │ ├── test13 │ │ │ ├── test14 │ │ │ ├── test15 │ │ │ ├── test16 │ │ │ ├── test17 │ │ │ ├── test18 │ │ │ ├── test19 │ │ │ ├── test2 │ │ │ ├── test20 │ │ │ ├── test21 │ │ │ ├── test3 │ │ │ ├── test4 │ │ │ ├── test5 │ │ │ ├── test6 │ │ │ ├── test7 │ │ │ ├── test8 │ │ │ └── test9 │ │ └── token.c │ ├── cxxcom │ │ ├── Makefile.in │ │ ├── builtins.c │ │ ├── cgram.y │ │ ├── cxxcode.c │ │ ├── cxxdefs.h │ │ ├── gcc_compat.c │ │ ├── init.c │ │ ├── inline.c │ │ ├── main.c │ │ ├── optim.c │ │ ├── pass1.h │ │ ├── pftn.c │ │ ├── scan.l │ │ ├── softfloat.c │ │ ├── stabs.c │ │ ├── symtabs.c │ │ └── trees.c │ └── driver │ │ ├── Makefile.in │ │ ├── driver.c │ │ ├── driver.h │ │ ├── platform.c │ │ ├── strlist.c │ │ ├── strlist.h │ │ ├── xalloc.c │ │ └── xalloc.h ├── cc2 │ └── cc2.nova.c ├── common │ ├── compat.c │ ├── compat.h │ ├── softfloat.c │ ├── softfloat.h │ ├── strtodg.c │ ├── unicode.c │ └── unicode.h ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── f77 │ ├── Makefile.in │ ├── f77 │ │ ├── Makefile.in │ │ ├── f77.1 │ │ └── f77.c │ └── fcom │ │ ├── Makefile.in │ │ ├── data.c │ │ ├── defines.h │ │ ├── defs.h │ │ ├── equiv.c │ │ ├── error.c │ │ ├── exec.c │ │ ├── expr.c │ │ ├── ftypes.h │ │ ├── gram.dcl │ │ ├── gram.exec │ │ ├── gram.expr │ │ ├── gram.head │ │ ├── gram.io │ │ ├── init.c │ │ ├── intr.c │ │ ├── io.c │ │ ├── lex.c │ │ ├── main.c │ │ ├── misc.c │ │ ├── proc.c │ │ ├── put.c │ │ ├── putscj.c │ │ ├── scjdefs.h │ │ └── tokens ├── install-sh ├── mip │ ├── common.c │ ├── manifest.h │ ├── match.c │ ├── mkext.c │ ├── node.h │ ├── optim2.c │ ├── pass2.h │ ├── reader.c │ └── regs.c └── os │ ├── android │ └── ccconfig.h │ ├── bsd │ └── ccconfig.h │ ├── darwin │ └── ccconfig.h │ ├── dragonfly │ └── ccconfig.h │ ├── freebsd │ └── ccconfig.h │ ├── inc │ └── amd64.h │ ├── linux │ └── ccconfig.h │ ├── litebsd │ └── ccconfig.h │ ├── midnightbsd │ └── ccconfig.h │ ├── minix │ └── ccconfig.h │ ├── mirbsd │ └── ccconfig.h │ ├── netbsd │ └── ccconfig.h │ ├── nextstep │ └── ccconfig.h │ ├── none │ └── ccconfig.h │ ├── openbsd │ ├── ccconfig.h │ └── f77config.h │ ├── sunos │ └── ccconfig.h │ ├── sysv4 │ └── ccconfig.h │ └── win32 │ ├── build.bat │ ├── build_installer.bat │ ├── ccconfig.h │ ├── config.h │ └── pcc.iss └── update.sh /.gitignore: -------------------------------------------------------------------------------- 1 | CVS 2 | *.o 3 | *.lo 4 | Makefile 5 | config.* 6 | *.a 7 | -------------------------------------------------------------------------------- /NOTES: -------------------------------------------------------------------------------- 1 | Wed Dec 24 08:39:39 IST 2014 2 | ============================ 3 | 4 | CVS checkout commands (from http://pcc.ludd.ltu.se/supported-platforms/): 5 | 6 | cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc-libs 7 | cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc 8 | 9 | I have noticed at least once that 'cvs update' didn't get everything new 10 | and that after moving the old copies out of the way and doing a fresh 11 | checkout I got more stuff. That's weird, but maybe it's a factoid about 12 | CVS that I've just forgotten. 13 | 14 | In any case, it's probably a good idea to go through that exercise 15 | every once in a while. 16 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Fri Jul 19 02:18:35 PM IDT 2024 2 | =============================== 3 | 4 | The last time I was able to update this repo was October 30, 2023. Since 5 | then, the original CVS repo has been unavailable. In theory, one day 6 | PCC will return. We can only keep hoping. 7 | 8 | Thu Sep 1 20:49:54 IDT 2016 9 | ============================ 10 | 11 | This Git repo is a simple mirror of the CVS repositories for the PCC 12 | Revived project (but without the 'CVS' directories). 13 | 14 | This project is a revival of the venerable Unix Portable C Compiler. It 15 | adds C 99 and general GCC compatbility with code generators for i386 16 | and x86_64 among others. The home page is: 17 | 18 | http://pcc.ludd.ltu.se/ 19 | 20 | For installing, you have to first build and install the pcc-libs, 21 | and then build and install pcc. The usual configure && make incantation 22 | is used. For instructions using CVS, see: 23 | 24 | http://pcc.ludd.ltu.se/supported-platforms/ 25 | 26 | The mailing list for reporting errors is: pcc@lists.ludd.ltu.se. 27 | 28 | The JIRA is 29 | 30 | http://pcc.ludd.ltu.se/jira/secure/Dashboard.jspa 31 | 32 | I am creating this Git repo so that I can access the code via HTTP(S) 33 | from behind the corporate firewall at my work. There are no other 34 | motives. 35 | 36 | Arnold Robbins 37 | arnold@skeeve.com 38 | -------------------------------------------------------------------------------- /make-all.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for i in pcc-libs pcc 4 | do 5 | cd $i 6 | ./configure 7 | make -j && make install 8 | cd .. 9 | done 10 | -------------------------------------------------------------------------------- /make-distclean.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for i in pcc-libs pcc 4 | do 5 | cd $i 6 | make distclean 7 | cd .. 8 | done 9 | -------------------------------------------------------------------------------- /make-install.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for i in pcc-libs pcc 4 | do 5 | cd $i 6 | ./configure && make -j && sudo make install 7 | cd .. 8 | done 9 | -------------------------------------------------------------------------------- /make-tmp.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for i in pcc-libs pcc 4 | do 5 | cd $i 6 | ./configure --prefix=/tmp/pcc 7 | make -j && make install 8 | cd .. 9 | done 10 | -------------------------------------------------------------------------------- /pcc-libs/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.5 2011/08/21 09:00:54 plunky Exp $ 2 | # 3 | # top-level Makefile 4 | # 5 | 6 | @SET_MAKE@ 7 | 8 | ALL_SUBDIRS= libsoftfloat libpcc csu 9 | DIST_SUBDIRS= $(ALL_SUBDIRS) libF77 libI77 10 | 11 | all install clean: 12 | @for subdir in $(ALL_SUBDIRS); do \ 13 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 14 | echo "===> $$_nextdir_"; \ 15 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 16 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 17 | echo "<=== $$_nextdir_"; \ 18 | done 19 | 20 | distclean: clean 21 | @for subdir in $(DIST_SUBDIRS); do \ 22 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 23 | echo "===> $$_nextdir_"; \ 24 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 25 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 26 | echo "<=== $$_nextdir_"; \ 27 | done 28 | /bin/rm -rf Makefile config.log config.status \ 29 | configure.lineno config.h autom4te.cache 30 | -------------------------------------------------------------------------------- /pcc-libs/csu/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.16 2023/07/27 17:03:32 ragge Exp $ 2 | # 3 | # Makefile.in for pcc-libs/csu 4 | # 5 | 6 | @SET_MAKE@ 7 | 8 | prefix = @prefix@ 9 | exec_prefix = @exec_prefix@ 10 | libdir = @libdir@ 11 | srcdir = @srcdir@ 12 | 13 | TARGOS = @targos@ 14 | TARGMACH = @targmach@ 15 | TARGET = @target@ 16 | VERSION = @version@ 17 | PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib 18 | 19 | CC = @CC@ 20 | AS = @AS@ 21 | CFLAGS += @CFLAGS@ 22 | 23 | MFLAGS = AS="$(AS)" CC="$(CC)" MACH="$(TARGMACH)" CFLAGS="$(CFLAGS)" PCCLIBDIR="$(PCCLIBDIR)" 24 | 25 | all clean install: 26 | if test -f $(srcdir)/$(TARGOS)/Makefile; then \ 27 | (cd $(srcdir)/$(TARGOS) && exec $(MAKE) $(MFLAGS) $@) \ 28 | || exit $$?; \ 29 | fi 30 | 31 | distclean: clean 32 | /bin/rm -f Makefile 33 | -------------------------------------------------------------------------------- /pcc-libs/csu/README: -------------------------------------------------------------------------------- 1 | $Id: README,v 1.5 2014/08/28 20:29:04 ragge Exp $ 2 | 3 | OS-dependent and target-dependent: 4 | 5 | To be provided by the target's libc: 6 | (the corresponding code included in this archive is mere incomplete 7 | examples, can be possibly useful to replace the platform-provided ones, 8 | but only on exceptionally broken platforms) 9 | 10 | crt0.o startup code for programs (maybe compiled -static) 11 | crt1.o a different flavour of startup code (iff the platform needs 12 | this in certain platform-specific situations) 13 | gcrt[01].o the corresponding profiling startup code for programs 14 | crti.o beginning of _init() and _fini() functions (inside .init section) 15 | crtn.o end of _init() and _fini() functions (inside .fini section) 16 | 17 | To be provided by the compiler, needed if constructors/destructors are 18 | desired, p++ is generated or library calls expects their existence. 19 | 20 | crtbegin.o support for calling global ctors/dtors 21 | crtend.o end of the ctor/dtor lists 22 | if a difference from crtbegin.o/crtend.o is enforced by the platform: 23 | crtbeginT.o + for static binary 24 | crtendT.o + for static binary 25 | crtbeginS.o + for shared library 26 | crtendS.o + for shared library 27 | -------------------------------------------------------------------------------- /pcc-libs/csu/darwin/Makefile: -------------------------------------------------------------------------------- 1 | MACH ?= powerpc 2 | TARGET ?= $(MACH)-darwin 3 | VERSION ?= 1.1.0 4 | PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib 5 | SRCDIR ?= . 6 | 7 | CFLAGS = -I$(SRCDIR)$(MACH) -I$(SRCDIR) -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes 8 | 9 | OBJS = crt0.o crt1.o gcrt1.o dylib1.o 10 | 11 | all: $(OBJS) 12 | 13 | crt0.o: $(MACH)/crt0.c 14 | $(CC) -r -static -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -O $(CFLAGS) -o $@ $< 15 | 16 | crt1.o: $(MACH)/crt0.c 17 | $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -DDYNAMIC -O $(CFLAGS) -o $@ $< /usr/lib/dyld 18 | 19 | gcrt1.o: $(MACH)/crt0.c 20 | $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DCRT -DDYNAMIC -DPROFILE -O $(CFLAGS) -o $@ $< /usr/lib/dyld 21 | 22 | dylib1.o: $(MACH)/dylib1.c 23 | $(CC) -r -nostdlib -Wl,-keep_private_externs -Wl,-weak_reference_mismatches,non-weak -DDYNAMIC -O $(CFLAGS) -o $@ $< 24 | 25 | install: 26 | mkdir -p ${DESTDIR}$(PCCLIBDIR) 27 | cp $(OBJS) ${DESTDIR}$(PCCLIBDIR) 28 | 29 | clean: 30 | rm -f $(OBJS) 31 | -------------------------------------------------------------------------------- /pcc-libs/csu/darwin/common.h: -------------------------------------------------------------------------------- 1 | /* $Id: common.h,v 1.5 2011/05/27 07:23:49 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #if defined(__ppc__) 19 | #define IDENT(x) asm(".cstring\n\t.ascii \"" x "\\0\"") 20 | #elif defined(__i386__) || defined(__x86_64__) 21 | #define IDENT(x) asm(".cstring\n\t.ascii \"" x "\\0\"") 22 | #endif 23 | 24 | #define NULL (void *)0 25 | 26 | extern int main(int argc, char *argv[], char *envp[]); 27 | extern void exit(int); 28 | extern int atexit(void (*fcn)(void)); 29 | 30 | #ifdef CRT 31 | static char *_strrchr(char *, int); 32 | static int _strcmp(char *, char *); 33 | #endif 34 | 35 | #if PROFILE 36 | extern void moninit(void); 37 | static void _mcleanup(void); 38 | extern void monitor(char *, char *, char *, int, int); 39 | #endif 40 | 41 | #ifdef DYNAMIC 42 | extern void _dyld_init(void); 43 | extern void _dyld_fini(void); 44 | extern int _dyld_func_lookup(const char *, void **); 45 | #endif 46 | 47 | extern int (*mach_init_routine)(void); 48 | extern int (*_cthread_init_routine)(void); 49 | 50 | extern void _init(void); 51 | extern void _fini(void); 52 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/Makefile: -------------------------------------------------------------------------------- 1 | MACH ?= i386 2 | TARGET ?= $(MACH)-linux 3 | VERSION ?= 1.1.0 4 | PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib 5 | SRCDIR ?= . 6 | 7 | CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes 8 | 9 | #OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o \ 10 | # crtbeginS.o crtendS.o crtbeginT.o crtendT.o 11 | OBJS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o 12 | 13 | 14 | all: $(OBJS) 15 | 16 | crt0.o: $(MACH)/crt0.c 17 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 18 | 19 | crt1.o: $(MACH)/crt0.c 20 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 21 | 22 | gcrt1.o: $(MACH)/crt0.c 23 | $(CC) -O2 -DPROFILE $(CFLAGS) -c -o $@ $< 24 | 25 | crti.o: $(MACH)/crti.c 26 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 27 | 28 | crtn.o: $(MACH)/crtn.c 29 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 30 | 31 | crtbegin.o: crtbegin.c 32 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 33 | 34 | crtend.o: crtend.c 35 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 36 | 37 | crtbeginS.o: crtbegin.c 38 | $(CC) -O2 $(CFLAGS) -fpic -c -o $@ $< 39 | 40 | crtendS.o: crtend.c 41 | $(CC) -O2 $(CFLAGS) -fpic -c -o $@ $< 42 | 43 | crtbeginT.o: crtbegin.c 44 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 45 | 46 | crtendT.o: crtend.c 47 | $(CC) -O2 $(CFLAGS) -c -o $@ $< 48 | 49 | install: 50 | mkdir -p ${DESTDIR}$(PCCLIBDIR) 51 | cp $(OBJS) ${DESTDIR}$(PCCLIBDIR) 52 | 53 | clean: 54 | rm -f $(OBJS) 55 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/amd64/crt0.c: -------------------------------------------------------------------------------- 1 | /* $Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | void __start(int, char **, char **); 21 | 22 | asm(" .text \n" 23 | " .align 4 \n" 24 | " .globl _start \n" 25 | "_start: \n" 26 | " movq %rbx,%r9 \n" 27 | " movq %rcx,%r8 \n" 28 | " movq %rdx,%rcx \n" 29 | " movq (%rsp),%rdi \n" 30 | " leaq 16(%rsp,%rdi,8),%rdx \n" 31 | " leaq 8(%rsp),%rsi \n" 32 | " andq $-16,%rsp \n" 33 | " callq __start \n"); 34 | /* cannot return */ 35 | 36 | void 37 | __start(int argc, char *argv[], char *envp[]) 38 | { 39 | 40 | #ifdef PROFILE 41 | atexit(_mcleanup); 42 | monstartup((unsigned long)&_eprol, (unsigned long)&_etext); 43 | #endif 44 | 45 | _init(); 46 | atexit(_fini); 47 | 48 | exit(main(argc, argv, envp)); 49 | } 50 | 51 | #include "common.c" 52 | 53 | IDENT("$Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $"); 54 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/amd64/crti.c: -------------------------------------------------------------------------------- 1 | /* $Id: crti.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .init \n" 21 | " .globl _init \n" 22 | " .align 16 \n" 23 | "_init: \n" 24 | " subq $8,%rsp \n" 25 | " .previous \n"); 26 | 27 | asm( " .section .fini \n" 28 | " .globl _fini \n" 29 | " .align 16 \n" 30 | "_fini: \n" 31 | " subq $8,%rsp \n" 32 | " .previous \n"); 33 | 34 | IDENT("$Id: crti.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $"); 35 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/amd64/crtn.c: -------------------------------------------------------------------------------- 1 | /* $Id: crtn.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2009 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .init \n" 21 | " addq $8,%rsp \n" 22 | " ret \n" 23 | " .previous \n"); 24 | 25 | asm( " .section .fini \n" 26 | " addq $8,%rsp \n" 27 | " ret \n" 28 | " .previous \n"); 29 | 30 | IDENT("$Id: crtn.c,v 1.1 2009/08/14 02:24:36 gmcgarry Exp $"); 31 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/common.c: -------------------------------------------------------------------------------- 1 | /* $Id: common.c,v 1.4 2009/01/23 07:10:09 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | #ifdef PROFILE 21 | asm(" .text\n_eprol:"); 22 | #endif 23 | 24 | IDENT("$Id: common.c,v 1.4 2009/01/23 07:10:09 gmcgarry Exp $"); 25 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/common.h: -------------------------------------------------------------------------------- 1 | /* $Id: common.h,v 1.5 2009/02/14 23:49:40 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #define IDENT(x) asm(".ident\t\"" x "\"") 19 | 20 | #define NULL (void *)0 21 | 22 | extern int main(int argc, char *argv[], char *envp[]); 23 | extern void exit(int); 24 | extern int atexit(void (*fcn)(void)); 25 | 26 | #if PROFILE 27 | extern void monstartup(unsigned long, unsigned long); 28 | extern void _mcleanup(void); 29 | extern unsigned char _etext, _eprol; 30 | #endif 31 | 32 | extern void _init(void); 33 | extern void _fini(void); 34 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/crtend.c: -------------------------------------------------------------------------------- 1 | /* $Id: crtend.c,v 1.5 2021/09/16 21:39:34 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .ctors,\"aw\",@progbits\n" 21 | #ifdef __x86_64__ 22 | " .quad 0\n" 23 | #else 24 | " .long 0\n" 25 | #endif 26 | " .previous\n" 27 | ); 28 | 29 | asm( " .section .dtors,\"aw\",@progbits\n" 30 | #ifdef __x86_64__ 31 | " .quad 0\n" 32 | #else 33 | " .long 0\n" 34 | #endif 35 | " .previous\n" 36 | ); 37 | 38 | IDENT("$Id: crtend.c,v 1.5 2021/09/16 21:39:34 gmcgarry Exp $"); 39 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/i386/crt0.c: -------------------------------------------------------------------------------- 1 | /* $Id: crt0.c,v 1.4 2009/02/14 23:49:40 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | void __start(int, char **, char **); 21 | 22 | asm(" .text \n" 23 | " .align 4 \n" 24 | " .globl _start \n" 25 | "_start: \n" 26 | " xorl %ebp,%ebp \n" 27 | " popl %ebx \n" 28 | " movl %esp,%ecx \n" 29 | " subl $16,%esp \n" 30 | " andl $-16,%esp \n" 31 | " movl %ebx,(%esp) \n" 32 | " movl %ecx,4(%esp) \n" 33 | " addl $1,%ebx \n" 34 | " shll $2,%ebx \n" 35 | " addl %ebx,%ecx \n" 36 | " movl %ecx,8(%esp) \n" 37 | " call __start \n" 38 | " hlt \n"); 39 | 40 | void 41 | __start(int argc, char *argv[], char *envp[]) 42 | { 43 | 44 | #ifdef PROFILE 45 | atexit(_mcleanup); 46 | monstartup((unsigned long)&_eprol, (unsigned long)&_etext); 47 | #endif 48 | 49 | _init(); 50 | atexit(_fini); 51 | 52 | exit(main(argc, argv, envp)); 53 | } 54 | 55 | #include "common.c" 56 | 57 | IDENT("$Id: crt0.c,v 1.4 2009/02/14 23:49:40 gmcgarry Exp $"); 58 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/i386/crti.c: -------------------------------------------------------------------------------- 1 | /* $Id: crti.c,v 1.3 2022/10/29 08:19:54 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .init \n" 21 | " .globl _init \n" 22 | " .align 16 \n" 23 | "_init: \n" 24 | " push %ebp \n" 25 | " mov %esp,%ebp \n" 26 | " .previous \n"); 27 | 28 | asm( " .section .fini \n" 29 | " .globl _fini \n" 30 | " .align 16 \n" 31 | "_fini: \n" 32 | " push %ebp \n" 33 | " mov %esp,%ebp \n" 34 | " .previous \n"); 35 | 36 | IDENT("$Id: crti.c,v 1.3 2022/10/29 08:19:54 gmcgarry Exp $"); 37 | -------------------------------------------------------------------------------- /pcc-libs/csu/linux/i386/crtn.c: -------------------------------------------------------------------------------- 1 | /* $Id: crtn.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .init \n" 21 | " leave \n" 22 | " ret \n" 23 | " .previous \n"); 24 | 25 | asm( " .section .fini \n" 26 | " leave \n" 27 | " ret \n" 28 | " .previous \n"); 29 | 30 | IDENT("$Id: crtn.c,v 1.2 2008/07/02 00:19:20 gmcgarry Exp $"); 31 | -------------------------------------------------------------------------------- /pcc-libs/csu/netbsd/Makefile: -------------------------------------------------------------------------------- 1 | MACH ?= i386 2 | TARGET ?= $(MACH)-netbsd 3 | VERSION ?= 1.1.0 4 | PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib 5 | SRCDIR ?= . 6 | 7 | CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes 8 | 9 | OBJS = crtbegin.o crtend.o 10 | 11 | all: $(OBJS) 12 | 13 | crtbegin.o: crtbegin.c 14 | $(CC) -O $(CFLAGS) -c -o $@ $< 15 | 16 | crtend.o: crtend.c 17 | $(CC) -O $(CFLAGS) -c -o $@ $< 18 | 19 | install: 20 | mkdir -p $(DESTDIR)$(PCCLIBDIR) 21 | cp $(OBJS) $(DESTDIR)$(PCCLIBDIR) 22 | 23 | clean: 24 | rm -f $(OBJS) 25 | -------------------------------------------------------------------------------- /pcc-libs/csu/netbsd/common.h: -------------------------------------------------------------------------------- 1 | /* $Id: common.h,v 1.1 2008/08/24 05:19:10 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #define IDENT(x) asm(".ident\t\"" x "\"") 19 | 20 | #define NULL (void *)0 21 | 22 | extern void _init(void); 23 | extern void _fini(void); 24 | -------------------------------------------------------------------------------- /pcc-libs/csu/netbsd/crtend.c: -------------------------------------------------------------------------------- 1 | /* $Id: crtend.c,v 1.4 2021/10/14 20:08:26 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2008 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .ctors,\"aw\",@progbits\n" 21 | #if defined(__x86_64__) || defined(__sparc64__) 22 | " .quad 0\n" 23 | #else 24 | " .long 0\n" 25 | #endif 26 | " .previous\n" 27 | ); 28 | 29 | asm( " .section .dtors,\"aw\",@progbits\n" 30 | #if defined(__x86_64__) || defined(__sparc64__) 31 | " .quad 0\n" 32 | #else 33 | " .long 0\n" 34 | #endif 35 | " .previous\n" 36 | ); 37 | 38 | IDENT("$Id: crtend.c,v 1.4 2021/10/14 20:08:26 gmcgarry Exp $"); 39 | -------------------------------------------------------------------------------- /pcc-libs/csu/none/common.h: -------------------------------------------------------------------------------- 1 | /* $Id: common.h,v 1.1 2022/10/29 08:19:54 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2022 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #define IDENT(x) asm(".ident\t\"" x "\"") 19 | 20 | #define NULL (void *)0 21 | 22 | extern void _init(void); 23 | extern void _fini(void); 24 | -------------------------------------------------------------------------------- /pcc-libs/csu/none/crtend.c: -------------------------------------------------------------------------------- 1 | /* $Id: crtend.c,v 1.1 2022/10/29 08:19:54 gmcgarry Exp $ */ 2 | /*- 3 | * Copyright (c) 2022 Gregory McGarry 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #include "common.h" 19 | 20 | asm( " .section .ctors,\"aw\",@progbits\n" 21 | " .long 0\n" 22 | " .previous\n" 23 | ); 24 | 25 | asm( " .section .dtors,\"aw\",@progbits\n" 26 | " .long 0\n" 27 | " .previous\n" 28 | ); 29 | 30 | IDENT("$Id: crtend.c,v 1.1 2022/10/29 08:19:54 gmcgarry Exp $"); 31 | -------------------------------------------------------------------------------- /pcc-libs/csu/none/m68k/crti.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | .globl _init 3 | .p2align 2 4 | _init: 5 | link.w %fp,#0 6 | .previous 7 | 8 | .section .fini 9 | .globl _fini 10 | .p2align 2 11 | _fini: 12 | link.w %fp,#0 13 | .previous 14 | -------------------------------------------------------------------------------- /pcc-libs/csu/none/m68k/crtn.s: -------------------------------------------------------------------------------- 1 | .section .init 2 | unlk %fp 3 | rts 4 | .previous 5 | 6 | .section .fini 7 | unlk %fp 8 | rts 9 | .previous 10 | -------------------------------------------------------------------------------- /pcc-libs/csu/none/m68k/ram.ld: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | RAM (xrw) : ORIGIN = 0x00000000, LENGTH = 512K 4 | } 5 | 6 | STACK_SIZE = 0x1000; 7 | 8 | OUTPUT_FORMAT(srec) 9 | ENTRY(_start) 10 | 11 | INPUT( -lio ) 12 | 13 | PROVIDE(__stack_top = _estack); 14 | PROVIDE(__bss_start = _sbss); 15 | PROVIDE(__bss_end = _ebss); 16 | PROVIDE(__bss_size = _ebss - _sbss); 17 | PROVIDE(__heap_start = _sheap); 18 | PROVIDE(__heap_end = _eheap); 19 | 20 | SECTIONS 21 | { 22 | _estack = ORIGIN(RAM) + LENGTH(RAM); 23 | 24 | . = 0x00000000; 25 | .text : 26 | { 27 | . = ALIGN(4); 28 | KEEP(*(.vtable)) 29 | *(.text) /* remaining code */ 30 | *(.text.*) 31 | *(.init) 32 | *(.init.*) 33 | *(.fini) 34 | *(.fini.*) 35 | *(.rodata) /* read-only data (constants) */ 36 | *(.rodata.*) 37 | *(.ctors) 38 | *(.dtors) 39 | . = ALIGN(4); 40 | _etext = .; 41 | . = ALIGN(4); 42 | *(.data) 43 | *(.data.*) 44 | } >RAM 45 | 46 | .bss (NOLOAD): 47 | { 48 | . = ALIGN(4); 49 | _sbss = .; /* start of .bss label (for startup) */ 50 | *(.bss) 51 | *(.bss.*) 52 | *(COMMON) 53 | . = ALIGN(4); 54 | _ebss = .; /* end of .bss label (for startup) */ 55 | } >RAM 56 | 57 | _sheap = _ebss; 58 | _eheap = _estack - STACK_SIZE; 59 | 60 | DISCARD : /* remove the debugging information from the standard libraries */ 61 | { 62 | libc.a ( * ) 63 | libpcc.a ( * ) 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /pcc-libs/libF77/Makefile: -------------------------------------------------------------------------------- 1 | # compile, then strip unnecessary symbols 2 | 3 | CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes 4 | 5 | .c.o : 6 | cc -O $(CFLAGS) -c $< 7 | -ld -r -x $*.o 8 | mv a.out $*.o 9 | 10 | MISC = main.o s_rnge.o abort_.o getarg_.o iargc_.o signal_.o s_stop.o s_paus.o 11 | 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 12 | CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o 13 | DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o 14 | REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ 15 | r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ 16 | r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ 17 | r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o 18 | DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\ 19 | d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\ 20 | d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\ 21 | d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\ 22 | d_sqrt.o d_tan.o d_tanh.o 23 | 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 24 | 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 25 | 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 26 | CHAR = s_cat.o s_cmp.o s_copy.o 27 | 28 | libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(CHAR) cabs.o 29 | ar r libF77.a $? 30 | 31 | clean distclean: 32 | rm -f $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) \ 33 | $(CMP) $(CHAR) cabs.o libF77.a 34 | -------------------------------------------------------------------------------- /pcc-libs/libF77/complex: -------------------------------------------------------------------------------- 1 | /* $Id: complex,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | typedef struct { float real, imag; } complex; 36 | typedef struct { double dreal, dimag; } dcomplex; 37 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_abs.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | d_abs(double *x) 39 | { 40 | if(*x >= 0) 41 | return(*x); 42 | return(- *x); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_acos.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_acos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_acos(double *x) 41 | { 42 | return( acos(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_asin.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_asin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_asin(double *x) 41 | { 42 | return( asin(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_atan.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_atan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_atan(double *x) 41 | { 42 | return( atan(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_cos.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_cos(double *x) 41 | { 42 | return( cos(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_cosh.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_cosh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_cosh(double *x) 41 | { 42 | return( cosh(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_dim.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | d_dim(double *a,double *b) 39 | { 40 | return( *a > *b ? *a - *b : 0); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_erf.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_erf.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | derf_(double *x) 41 | { 42 | return( erf(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_erfc.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_erfc.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | derfc_(double *x) 41 | { 42 | return( erfc(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_exp.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_exp(double *x) 41 | { 42 | return( exp(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_imag.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_imag.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | d_imag(dcomplex *z) 39 | { 40 | return(z->dimag); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_int.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_int.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | d_int(double *x) 39 | { 40 | return( (long int) (*x) ); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_log.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_log(double *x) 41 | { 42 | return( log(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_prod.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_prod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | d_prod(float *x,float *y) 39 | { 40 | return( (*x) * (*y) ); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_sin.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_sin(double *x) 41 | { 42 | return( sin(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_sinh.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_sinh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_sinh(double *x) 41 | { 42 | return( sinh(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_sqrt.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_sqrt.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_sqrt(double *x) 41 | { 42 | return( sqrt(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_tan.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_tan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | d_tan(double *x) 41 | { 42 | return( tan(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/d_tanh.c: -------------------------------------------------------------------------------- 1 | /* $Id: d_tanh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double d_tanh(double *x) 40 | { 41 | return( tanh(*x) ); 42 | } 43 | -------------------------------------------------------------------------------- /pcc-libs/libF77/h_abs.c: -------------------------------------------------------------------------------- 1 | /* $Id: h_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | short 38 | h_abs(short *x) 39 | { 40 | if(*x >= 0) 41 | return(*x); 42 | return(- *x); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/h_dim.c: -------------------------------------------------------------------------------- 1 | /* $Id: h_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | short 38 | h_dim(short *a,short *b) 39 | { 40 | return( *a > *b ? *a - *b : 0); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/h_len.c: -------------------------------------------------------------------------------- 1 | /* $Id: h_len.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | short 38 | h_len(char *s, long int n) 39 | { 40 | return(n); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/h_mod.c: -------------------------------------------------------------------------------- 1 | /* $Id: h_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | short 38 | h_mod(short *a,short *b) 39 | { 40 | return( *a % *b); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/i_dim.c: -------------------------------------------------------------------------------- 1 | /* $Id: i_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | long int 38 | i_dim(long int *a,long int *b) 39 | { 40 | return( *a > *b ? *a - *b : 0); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/i_len.c: -------------------------------------------------------------------------------- 1 | /* $Id: i_len.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | long int 38 | i_len(char *s, long int n) 39 | { 40 | return(n); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/i_mod.c: -------------------------------------------------------------------------------- 1 | /* $Id: i_mod.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | long int 38 | i_mod(long int *a,long int *b) 39 | { 40 | return( *a % *b); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/iargc_.c: -------------------------------------------------------------------------------- 1 | /* $Id: iargc_.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | long int 38 | iargc_() 39 | { 40 | extern int xargc; 41 | return ( xargc - 1 ); 42 | } 43 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_abs.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_abs.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | r_abs(float *x) 39 | { 40 | if(*x >= 0) 41 | return(*x); 42 | return(- *x); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_acos.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_acos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_acos(float *x) 41 | { 42 | return( acos(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_asin.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_asin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_asin(float *x) 41 | { 42 | return( asin(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_atan.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_atan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_atan(float *x) 41 | { 42 | return( atan(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_cos.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_cos.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_cos(float *x) 41 | { 42 | return( cos(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_cosh.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_cosh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_cosh(float *x) 41 | { 42 | return( cosh(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_dim.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_dim.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | r_dim(float *a,float *b) 39 | { 40 | return( *a > *b ? *a - *b : 0); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_erf.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_erf.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | float erf_(x) 36 | float *x; 37 | { 38 | double erf(); 39 | return( erf(*x) ); 40 | } 41 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_erfc.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_erfc.c,v 1.2 2008/02/26 19:54:41 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | float erfc_(x) 36 | float *x; 37 | { 38 | double erfc(); 39 | return( erfc(*x) ); 40 | } 41 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_exp.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_exp.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_exp(float *x) 41 | { 42 | return( exp(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_imag.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_imag.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | r_imag(complex *z) 39 | { 40 | return(z->imag); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_int.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_int.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include "f77lib.h" 36 | 37 | double 38 | r_int(float *x) 39 | { 40 | return( (long int) (*x) ); 41 | } 42 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_log.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_log.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_log(float *x) 41 | { 42 | return( log(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_sin.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_sin.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_sin(float *x) 41 | { 42 | return( sin(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_sinh.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_sinh.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_sinh(float *x) 41 | { 42 | return( sinh(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libF77/r_tan.c: -------------------------------------------------------------------------------- 1 | /* $Id: r_tan.c,v 1.3 2008/02/28 16:48:50 ragge Exp $ */ 2 | /* 3 | * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code and documentation must retain the above 10 | * copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditionsand the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * All advertising materials mentioning features or use of this software 15 | * must display the following acknowledgement: 16 | * This product includes software developed or owned by Caldera 17 | * International, Inc. 18 | * Neither the name of Caldera International, Inc. nor the names of other 19 | * contributors may be used to endorse or promote products derived from 20 | * this software without specific prior written permission. 21 | * 22 | * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 23 | * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | * POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #include 36 | 37 | #include "f77lib.h" 38 | 39 | double 40 | r_tan(float *x) 41 | { 42 | return( tan(*x) ); 43 | } 44 | -------------------------------------------------------------------------------- /pcc-libs/libI77/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Simple makefile for the F77 I/O library. 3 | # 4 | 5 | CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes 6 | 7 | .c.o : 8 | cc -O $(CFLAGS) -c $< 9 | -ld -r -x $*.o 10 | mv a.out $*.o 11 | 12 | OBJS= backspace.o dfe.o due.o iio.o inquire.o lib.o rewind.o rsfe.o rdfmt.o \ 13 | sue.o uio.o wsfe.o sfe.o fmt.o lio.o lread.o open.o close.o \ 14 | util.o endfile.o wrtfmt.o err.o fmtlib.o 15 | 16 | libI77.a: $(OBJS) 17 | ar r libI77.a $? 18 | 19 | clean distclean: 20 | /bin/rm -f $(OBJS) libI77.a 21 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.26 2022/11/05 02:06:09 gmcgarry Exp $ 2 | # 3 | # Makefile.in for libpcc.a 4 | # 5 | 6 | VPATH = @srcdir@ 7 | srcdir = @srcdir@ 8 | top_srcdir = @top_srcdir@ 9 | top_builddir = @top_builddir@ 10 | prefix = @prefix@ 11 | exec_prefix = @exec_prefix@ 12 | libdir = @libdir@ 13 | 14 | CC = @CC@ 15 | AS = @AS@ 16 | AR = @AR@ 17 | RANLIB = @RANLIB@ 18 | INSTALL = @INSTALL@ 19 | 20 | TARGMACH = @targmach@ 21 | TARGOS = @targos@ 22 | TARGET = @target@ 23 | VERSION = @version@ 24 | PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib 25 | PCCINCDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/include 26 | 27 | CFLAGS += @CFLAGS@ 28 | CPPFLAGS += @CPPFLAGS@ -I$(srcdir) @ENDIAN_FLAG@ -Dos_$(TARGOS) \ 29 | -Dmach_$(TARGMACH) -isystem $(top_srcdir)/libpcc/include 30 | 31 | LIBS = @LIBS@ 32 | 33 | HEADERS = float.h limits.h stdarg.h stdbool.h stddef.h \ 34 | iso646.h \ 35 | libpcc_float.h libpcc_limits.h libpcc_stdarg.h \ 36 | libpcc_stdbool.h libpcc_stddef.h 37 | 38 | OBJS = cmpdi2.o divdi3.o fixdfdi.o fixsfdi.o fixunsdfdi.o \ 39 | fixunssfdi.o floatdidf.o floatdisf.o floatunsdidf.o \ 40 | moddi3.o muldi3.o negdi2.o qdivrem.o \ 41 | ucmpdi2.o udivdi3.o umoddi3.o cxmuldiv.o \ 42 | ashldi3.o ashrdi3.o lshrdi3.o \ 43 | _alloca.o unwind.o \ 44 | ssp.o signbit.o 45 | 46 | -include arch/$(TARGMACH)/Makefile.sub 47 | 48 | DEST = libpcc.a 49 | 50 | all: $(DEST) 51 | 52 | $(DEST): $(OBJS) 53 | $(AR) r $@ $? 54 | $(RANLIB) $@ 55 | 56 | .c.o : 57 | $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< 58 | 59 | install: install-headers install-lib 60 | 61 | install-headers: 62 | test -z "${DESTDIR}$(PCCINCDIR)" || mkdir -p "${DESTDIR}$(PCCINCDIR)" 63 | headers='$(HEADERS)'; for i in $$headers; do \ 64 | $(INSTALL) -m 644 $(srcdir)/include/$$i \ 65 | ${DESTDIR}$(PCCINCDIR)/$$i; \ 66 | done 67 | 68 | install-lib: 69 | test -z "${DESTDIR}$(PCCLIBDIR)" || mkdir -p "${DESTDIR}$(PCCLIBDIR)" 70 | $(INSTALL) -m 644 $(DEST) ${DESTDIR}$(PCCLIBDIR) 71 | 72 | clean: 73 | /bin/rm -f $(OBJS) $(DEST) 74 | 75 | distclean: 76 | /bin/rm -f Makefile 77 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/_alloca.c: -------------------------------------------------------------------------------- 1 | /* $Id: _alloca.c,v 1.4 2009/03/15 00:20:41 gmcgarry Exp $ */ 2 | /* 3 | * This explanation of _alloca() comes from Chris Giese, posted to 4 | * alt.os.dev: 5 | * 6 | * By default, Windows reserves 1 meg of virtual memory for the stack. 7 | * No page of stack memory is actually allocated (commited) until the 8 | * page is accessed. This is demand-allocation. The page beyond the 9 | * top of the stack is the guard page. If this page is accessed, 10 | * memory will be allocated for it, and the guard page moved downward 11 | * by 4K (one page). Thus, the stack can grow beyond the initial 1 meg. 12 | * Windows will not, however, let you grow the stack by accessing 13 | * discontiguous pages of memory. Going beyond the guard page causes 14 | * an exception. Stack-probing code prevents this. 15 | */ 16 | 17 | #ifndef __MSC__ 18 | 19 | asm( " .text\n" 20 | " .globl __alloca\n" 21 | "__alloca:\n" 22 | #ifdef __i386__ 23 | " pop %edx\n" 24 | " pop %eax\n" 25 | " add $3,%eax\n" 26 | " and $-4,%eax\n" 27 | "1: cmp $4096,%eax\n" 28 | " jge 2f\n" 29 | " sub %eax,%esp\n" 30 | " test %eax,(%esp)\n" 31 | " mov %esp,%eax\n" 32 | " push %edx\n" 33 | " push %edx\n" 34 | " ret\n" 35 | "2: sub $4096,%esp\n" 36 | " sub $4096,%eax\n" 37 | " test %eax,(%esp)\n" 38 | " jmp 1b\n" 39 | #endif 40 | ); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/_ftol.asm: -------------------------------------------------------------------------------- 1 | ; $Id: _ftol.asm,v 1.1 2009/03/15 00:17:16 gmcgarry Exp $ 2 | ; 3 | ; Implementation of _ftol(), _ftol2() for win32 and masm. 4 | ; 5 | .386 6 | _TEXT segment use32 para public 'CODE' 7 | public __ftol2 8 | __ftol2 proc near 9 | assume cs:_TEXT 10 | fnstcw word ptr [esp-2] 11 | mov ax, word ptr [esp-2] 12 | or ax, 0C00h 13 | mov word ptr [esp-4], ax 14 | fldcw word ptr [esp-4] 15 | fistp qword ptr [esp-12] 16 | fldcw word ptr [esp-2] 17 | mov eax, dword ptr [esp-12] 18 | mov edx, dword ptr [esp-8] 19 | ret 20 | __ftol2 endp 21 | 22 | _TEXT ends 23 | end 24 | 25 | alias __ftol = __ftol2 26 | public __ftol 27 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/_ftol.c: -------------------------------------------------------------------------------- 1 | /* $Id: _ftol.c,v 1.2 2009/03/28 07:04:06 gmcgarry Exp $ */ 2 | 3 | /* 4 | * _ftol() and _ftol2() implementations used on win32 when linking against 5 | * other code built with Visual Studio. 6 | */ 7 | 8 | asm( " .text\n" 9 | " .globl __ftol\n" 10 | " .globl __ftol2\n" 11 | "__ftol:\n" 12 | "__ftol2:\n" 13 | " fnstcw -2(%esp)\n" 14 | " movw -2(%esp),%ax\n" 15 | " or %ax,0x0c00\n" 16 | " movw %ax,-4(%esp)\n" 17 | " fldcw -4(%esp)\n" 18 | " fistpl -12(%esp)\n" 19 | " fldcw -2(%esp)\n" 20 | " movl -12(%esp),%eax\n" 21 | " movl -8(%esp),%edx\n" 22 | " ret\n" 23 | ); 24 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/Makefile.sub: -------------------------------------------------------------------------------- 1 | MACH_OBJS = divsi3.o mulsi3.o udivsi3.o umodsi3.o modsi3.o 2 | 3 | OBJS += $(addprefix $(srcdir)/arch/$(TARGMACH)/, $(MACH_OBJS)) 4 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/divsi3.s: -------------------------------------------------------------------------------- 1 | .extern __udivsi3 2 | 3 | | int __divsi3(int a, int b) 4 | .p2align 2 5 | .globl __divsi3 6 | __divsi3: 7 | move.l %d2,-(%sp) 8 | move.l #1,%d2 | sign of result stored in d2 (=1 or =-1) 9 | move.l 12(%sp),%d1 | d1 = divisor 10 | bpl 1f 11 | neg.l %d1 12 | neg.l %d2 | change sign because divisor <0 13 | 1: move.l 8(%sp),%d0 | d0 = dividend 14 | bpl 2f 15 | neg.l %d0 16 | neg.l %d2 17 | 2: move.l %d1,-(%sp) 18 | move.l %d0,-(%sp) 19 | bsr __udivsi3 | divide abs(dividend) by abs(divisor) 20 | add.l #8,%sp 21 | tst.b %d2 22 | bpl 3f 23 | neg.l %d0 24 | 3: move.l (%sp)+,%d2 25 | rts 26 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/modsi3.s: -------------------------------------------------------------------------------- 1 | .extern __udivsi3 2 | .extern __mulsi3 3 | 4 | | unsigned int __modsi3(int a, int b) 5 | .p2align 2 6 | .globl __modsi3 7 | __modsi3: 8 | move.l 8(%sp),%d1 | d1 = divisor 9 | move.l 4(%sp),%d0 | d0 = dividend 10 | move.l %d1,-(%sp) 11 | move.l %d0,-(%sp) 12 | bsr __divsi3 13 | add.l #8,%sp 14 | move.l 8(%sp),%d1 | d1 = divisor 15 | move.l %d1,-(%sp) 16 | move.l %d0,-(%sp) 17 | bsr __mulsi3 | d0 = (a/b)*b 18 | add.l #8,%sp 19 | move.l 4(%sp),%d1 | d1 = dividend 20 | sub.l %d0,%d1 | d1 = a - (a/b)*b 21 | move.l %d1,%d0 22 | rts 23 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/mulsi3.s: -------------------------------------------------------------------------------- 1 | | int __mulsi3(int a, int b) 2 | .p2align 2 3 | .globl __mulsi3 4 | __mulsi3: 5 | move.w 4(%sp),%d0 6 | move.w 6(%sp),%d1 7 | mulu.w 10(%sp),%d0 | x0*y1 8 | mulu.w 8(%sp),%d1 | x1*y0 9 | add.l %d1,%d0 10 | swap %d0 11 | clr.w %d0 12 | move.w 6(%sp),%d1 13 | mulu.w 10(%sp),%d1 | x1*y1 14 | add.l %d1,%d0 15 | rts 16 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/udivsi3.s: -------------------------------------------------------------------------------- 1 | | unsigned int __udivdi3(unsigned int a, unsigned int b) 2 | .p2align 2 3 | .globl __udivsi3 4 | __udivsi3: 5 | move.l %d2,-(%sp) 6 | move.l 12(%sp),%d1 | d1 = divisor 7 | move.l 8(%sp),%d0 | d0 = dividend 8 | cmp.l #0x10000,%d1 | divisor >= 2 ^ 16 ? 9 | bcc 3f | then try next algorithm 10 | move.l %d0,%d2 11 | clr.w %d2 12 | swap %d2 13 | divu %d1,%d2 | high quotient in lower word 14 | move.w %d2,%d0 | save high quotient 15 | swap %d0 16 | move.w 10(%sp),%d2 | get low dividend + high rest 17 | divu %d1,%d2 | low quotient 18 | move.w %d2,%d0 19 | bra 6f 20 | 3: move.l %d1,%d2 | use d2 as divisor backup 21 | 4: lsr.l #1,%d1 | shift divisor 22 | lsr.l #1,%d0 | shift dividend 23 | cmp.l #0x10000,%d1 | still divisor >= 2 ^ 16 ? 24 | bcc 4b 25 | divu %d1,%d0 | now we have 16 bit divisor 26 | and.l #0xffff,%d0 | mask out divisor, ignore remainder 27 | move.l %d2,%d1 28 | mulu %d0,%d1 | low part, 32 bits 29 | swap %d2 30 | mulu %d0,%d2 | high part, at most 17 bits 31 | swap %d2 | align high part with low part 32 | tst.w %d2 | high part 17 bits? 33 | bne 5f | if 17 bits, quotient was too large 34 | add.l %d2,%d1 | add parts 35 | bcs 5f | if sum is 33 bits, quotient was too large 36 | cmp.l 8(%sp),%d1 | compare the sum with the dividend 37 | bls 6f | if sum > dividend, quotient was too large 38 | 5: sub.l #1,%d0 | adjust quotient 39 | 6: move.l (%sp)+,%d2 40 | rts 41 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/arch/m68k/umodsi3.s: -------------------------------------------------------------------------------- 1 | .extern __udivsi3 2 | .extern __mulsi3 3 | 4 | | unsigned int __umodsi3(unsigned int a, unsigned int b) 5 | .p2align 2 6 | .globl __umodsi3 7 | __umodsi3: 8 | move.l 8(%sp),%d1 | d1 = divisor 9 | move.l 4(%sp),%d0 | d0 = dividend 10 | move.l %d1,-(%sp) 11 | move.l %d0,-(%sp) 12 | bsr __udivsi3 13 | add.l #8,%sp 14 | move.l 8(%sp),%d1 | d1 = divisor 15 | move.l %d1,-(%sp) 16 | move.l %d0,-(%sp) 17 | bsr __mulsi3 | d0 = (a/b)*b 18 | add.l #8,%sp 19 | move.l 4(%sp),%d1 | d1 = dividend 20 | sub.l %d0,%d1 | d1 = a - (a/b)*b 21 | move.l %d1,%d0 22 | rts 23 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/float.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/iso646.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ISO646_H_ 3 | #define _ISO646_H_ 4 | 5 | #define and && 6 | #define and_eq &= 7 | #define bitand & 8 | #define bitor | 9 | #define compl ~ 10 | #define not ! 11 | #define not_eq != 12 | #define or || 13 | #define or_eq |= 14 | #define xor ^ 15 | #define xor_eq ^= 16 | 17 | #endif /* _ISO646_H_ */ 18 | 19 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/libpcc_limits.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPCC_LIMITS_H_ 2 | #define _LIBPCC_LIMITS_H_ 3 | 4 | #if defined __GNUC__ 5 | # if !defined _GCC_LIMITS_H_ 6 | /* this is needed to make limits.h from the glibc headers happy, which uses 7 | #include_next 8 | when __GNUC__ is defined and _GCC_LIMITS_H_ is not defined 9 | */ 10 | # define __GCC_LIMITS_H_ 11 | # endif 12 | 13 | #endif 14 | 15 | /* 16 | * The following limits are sometimes considered 17 | * a property of the compiler. Not complete. 18 | */ 19 | 20 | #undef CHAR_BIT 21 | #ifdef __pdp10__ 22 | #define CHAR_BIT 9 23 | #else 24 | #define CHAR_BIT 8 25 | #endif 26 | 27 | /* 28 | * Logic below assumes 2-complement. 29 | */ 30 | #undef CHAR_MIN 31 | #undef CHAR_MAX 32 | #ifdef __CHAR_UNSIGNED__ 33 | #define CHAR_MIN 0 34 | #define CHAR_MAX UCHAR_MAX 35 | #else 36 | #define CHAR_MIN SCHAR_MIN 37 | #define CHAR_MAX SCHAR_MAX 38 | #endif 39 | 40 | #undef SCHAR_MAX 41 | #define SCHAR_MAX __SCHAR_MAX__ 42 | #undef SCHAR_MIN 43 | #define SCHAR_MIN (-SCHAR_MAX-1) 44 | #undef UCHAR_MAX 45 | #define UCHAR_MAX (2*SCHAR_MAX+1) 46 | 47 | #undef SHRT_MAX 48 | #define SHRT_MAX __SHRT_MAX__ 49 | #undef SHRT_MIN 50 | #define SHRT_MIN (-SHRT_MAX-1) 51 | #undef USHRT_MAX 52 | #define USHRT_MAX (2*SHRT_MAX+1) 53 | 54 | #undef INT_MAX 55 | #define INT_MAX __INT_MAX__ 56 | #undef INT_MIN 57 | #define INT_MIN (-INT_MAX-1) 58 | #undef UINT_MAX 59 | #define UINT_MAX (2U*INT_MAX+1U) 60 | 61 | #undef LONG_MAX 62 | #define LONG_MAX __LONG_MAX__ 63 | #undef LONG_MIN 64 | #define LONG_MIN (-LONG_MAX-1L) 65 | #undef ULONG_MAX 66 | #define ULONG_MAX (2UL*LONG_MAX+1UL) 67 | 68 | #undef LLONG_MAX 69 | #define LLONG_MAX __LONG_LONG_MAX__ 70 | #undef LLONG_MIN 71 | #define LLONG_MIN (-LLONG_MAX-1LL) 72 | #undef ULLONG_MAX 73 | #define ULLONG_MAX (2ULL*LLONG_MAX+1ULL) 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/libpcc_stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPCC_STDARG_H_ 2 | #ifndef _ANSI_STDARG_H_ 3 | 4 | #ifndef __need___va_list 5 | #define _LIBPCC_STDARG_H_ 6 | #define _ANSI_STDARG_H_ 7 | #endif 8 | 9 | #if defined(_LIBPCC_STDARG_H_) || defined(__need___va_list) 10 | #ifndef _VA_LIST 11 | typedef __builtin_va_list va_list; 12 | #define _VA_LIST 13 | #define _VA_LIST_DEFINED 14 | #endif 15 | /* For broken glibc headers */ 16 | #ifndef __GNUC_VA_LIST 17 | #define __gnuc_va_list __builtin_va_list 18 | #define __GNUC_VA_LIST 19 | #endif 20 | 21 | #endif 22 | 23 | #ifdef _LIBPCC_STDARG_H_ 24 | 25 | #define va_start(ap, last) __builtin_stdarg_start((ap), last) 26 | #define va_arg(ap, type) __builtin_va_arg((ap), type) 27 | #define va_end(ap) __builtin_va_end((ap)) 28 | #define va_copy(dest, src) __builtin_va_copy((dest), (src)) 29 | 30 | #endif 31 | 32 | #undef __need___va_list 33 | 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/libpcc_stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPCC_STDBOOL_H_ 2 | #define _LIBPCC_STDBOOL_H_ 3 | 4 | #define __bool_true_false_are_defined 1 5 | 6 | #ifndef __cplusplus 7 | 8 | #define bool _Bool 9 | #define true 1 10 | #define false 0 11 | 12 | #endif 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/libpcc_stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBPCC_STDDEF_H_ 2 | 3 | #if !defined(__need_wchar_t) && !defined(__need_size_t) \ 4 | && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ 5 | && !defined(__need_wint_t) 6 | #define _LIBPCC_STDDEF_H_ 7 | #endif 8 | 9 | #if defined(_LIBPCC_STDDEF_H_) || defined(__need_ptrdiff_t) 10 | #if !defined(_PTRDIFF_T) && !defined(__ptrdiff_t_defined) 11 | #define _PTRDIFF_T 12 | #define __ptrdiff_t_defined 13 | #ifdef __PTRDIFF_TYPE__ 14 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 15 | #else 16 | typedef int ptrdiff_t; 17 | #endif 18 | #endif 19 | #endif 20 | 21 | #if defined(_LIBPCC_STDDEF_H_) || defined(__need_size_t) 22 | #if !defined(_SIZE_T) && !defined(__size_t_defined) && !defined(_SIZE_T_) 23 | #define _SIZE_T 24 | #define _SIZE_T_ 25 | #define __size_t_defined 26 | #ifdef __SIZE_TYPE__ 27 | typedef __SIZE_TYPE__ size_t; 28 | #else 29 | typedef unsigned long size_t; 30 | #endif 31 | #endif 32 | #endif 33 | 34 | #if defined(_LIBPCC_STDDEF_H_) || defined(__need_wchar_t) 35 | #ifndef __cplusplus 36 | #if !defined(_WCHAR_T) && !defined(__wchar_t_defined) 37 | #define _WCHAR_T 38 | #define __wchar_t_defined 39 | #ifdef __WCHAR_TYPE__ 40 | typedef __WCHAR_TYPE__ wchar_t; 41 | #else 42 | typedef unsigned short wchar_t; 43 | #endif 44 | #endif 45 | #endif 46 | #endif 47 | 48 | #if defined(_LIBPCC_STDDEF_H_) || defined(__need_wint_t) 49 | #if !defined(_WINT_T) && !defined(__wint_t_defined) 50 | #define _WINT_T 51 | #define __wint_t_defined 52 | #ifdef __WINT_TYPE__ 53 | typedef __WINT_TYPE__ wint_t; 54 | #else 55 | typedef unsigned int wint_t; 56 | #endif 57 | #endif 58 | #endif 59 | 60 | #if defined(_LIBPCC_STDDEF_H_) || defined(__need_NULL) 61 | #undef NULL 62 | #define NULL ((void *)(0)) 63 | #endif 64 | 65 | #if defined(_LIBPCC_STDDEF_H_) 66 | #define offsetof(type, member) ((size_t)&(((type *) 0)->member)) 67 | #endif 68 | 69 | #undef __need_ptrdiff_t 70 | #undef __need_size_t 71 | #undef __need_wchar_t 72 | #undef __need_wint_t 73 | #undef __need_NULL 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/limits.h: -------------------------------------------------------------------------------- 1 | #include_next 2 | #include 3 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/include/stddef.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /pcc-libs/libpcc/signbit.c: -------------------------------------------------------------------------------- 1 | /* $Id: signbit.c,v 1.1 2018/07/27 16:30:00 ragge Exp $ */ 2 | /* 3 | * Simple signbit extraction code. 4 | * Written by Anders Magnusson. Public domain. 5 | */ 6 | 7 | union sbit { 8 | float f; 9 | double d; 10 | long double l; 11 | unsigned u[4]; 12 | }; 13 | 14 | int 15 | __signbitf(float x) 16 | { 17 | union sbit s; 18 | 19 | s.f = x; 20 | return s.u[0] >> 31; 21 | } 22 | 23 | int 24 | __signbitd(double x) 25 | { 26 | union sbit s; 27 | 28 | s.d = x; 29 | #if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__ 30 | return s.u[1] >> 31; 31 | #else 32 | return s.u[0] >> 31; 33 | #endif 34 | } 35 | 36 | int 37 | __signbitl(long double x) 38 | { 39 | union sbit s; 40 | 41 | s.l = x; 42 | #if __FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__ 43 | #if __i386__ || __amd64__ 44 | return (s.u[2] >> 15) & 1; 45 | #else 46 | return s.u[3] >> 31; 47 | #endif 48 | #else 49 | return s.u[0] >> 31; 50 | #endif 51 | } 52 | 53 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.10 2022/11/05 02:06:09 gmcgarry Exp $ 2 | # 3 | # Makefile.in for libpccsoftfloat.a 4 | # 5 | 6 | VPATH = @srcdir@ 7 | srcdir = @srcdir@ 8 | top_srcdir = @top_srcdir@ 9 | top_builddir = @top_builddir@ 10 | prefix = @prefix@ 11 | exec_prefix = @exec_prefix@ 12 | libdir = @libdir@ 13 | 14 | CC = @CC@ 15 | TARGET = @target@ 16 | TARGMACH = @targmach@ 17 | VERSION = @version@ 18 | PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib 19 | 20 | CFLAGS += @CFLAGS@ 21 | CPPFLAGS += @CPPFLAGS@ -DSOFTFLOAT_FOR_GCC -I$(srcdir) \ 22 | -I$(srcdir)/arch/$(TARGMACH) \ 23 | -isystem $(top_srcdir)/libpcc/include 24 | 25 | LIBS = @LIBS@ 26 | AR = @AR@ 27 | RANLIB = @RANLIB@ 28 | INSTALL = @INSTALL@ 29 | 30 | OBJS = softfloat.o \ 31 | fpgetround.o fpsetround.o fpgetmask.o fpsetmask.o \ 32 | fpgetsticky.o fpsetsticky.o \ 33 | eqsf2.o nesf2.o gtsf2.o gesf2.o ltsf2.o lesf2.o negsf2.o \ 34 | eqdf2.o nedf2.o gtdf2.o gedf2.o ltdf2.o ledf2.o negdf2.o \ 35 | nexf2.o gtxf2.o gexf2.o negxf2.o unordsf2.o unorddf2.o 36 | 37 | DEST = libpccsoftfloat.a 38 | 39 | all: $(DEST) 40 | 41 | $(DEST): $(OBJS) 42 | $(AR) r $@ $? 43 | $(RANLIB) $@ 44 | 45 | softfloat.o : bits64/softfloat.c 46 | $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< 47 | 48 | .c.o : 49 | $(CC) -O $(CPPFLAGS) $(CFLAGS) -c $< 50 | 51 | install: 52 | test -z "${DESTDIR}$(PCCLIBDIR)" || mkdir -p "${DESTDIR}$(PCCLIBDIR)" 53 | $(INSTALL) -m 644 $(DEST) ${DESTDIR}$(PCCLIBDIR) 54 | 55 | clean: 56 | /bin/rm -f $(OBJS) $(DEST) 57 | 58 | distclean: 59 | /bin/rm -f Makefile 60 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/README.NetBSD: -------------------------------------------------------------------------------- 1 | $NetBSD: README.NetBSD,v 1.2 2002/05/21 23:51:05 bjh21 Exp $ 2 | 3 | This is a modified version of part of John Hauser's SoftFloat 2a package. 4 | This version has been heavily modified to support its use with GCC to 5 | implement built-in floating-point operations, but compiling 6 | softfloat.c without SOFTFLOAT_FOR_GCC defined should get you the same 7 | results as from the original. 8 | 9 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/README.txt: -------------------------------------------------------------------------------- 1 | $NetBSD: README.txt,v 1.1 2000/06/06 08:15:02 bjh21 Exp $ 2 | 3 | Package Overview for SoftFloat Release 2a 4 | 5 | John R. Hauser 6 | 1998 December 13 7 | 8 | 9 | SoftFloat is a software implementation of floating-point that conforms to 10 | the IEC/IEEE Standard for Binary Floating-Point Arithmetic. SoftFloat is 11 | distributed in the form of C source code. Compiling the SoftFloat sources 12 | generates two things: 13 | 14 | -- A SoftFloat object file (typically `softfloat.o') containing the complete 15 | set of IEC/IEEE floating-point routines. 16 | 17 | -- A `timesoftfloat' program for evaluating the speed of the SoftFloat 18 | routines. (The SoftFloat module is linked into this program.) 19 | 20 | The SoftFloat package is documented in four text files: 21 | 22 | softfloat.txt Documentation for using the SoftFloat functions. 23 | softfloat-source.txt Documentation for compiling SoftFloat. 24 | softfloat-history.txt History of major changes to SoftFloat. 25 | timesoftfloat.txt Documentation for using `timesoftfloat'. 26 | 27 | Other files in the package comprise the source code for SoftFloat. 28 | 29 | Please be aware that some work is involved in porting this software to other 30 | targets. It is not just a matter of getting `make' to complete without 31 | error messages. I would have written the code that way if I could, but 32 | there are fundamental differences between systems that I can't make go away. 33 | You should not attempt to compile SoftFloat without first reading both 34 | `softfloat.txt' and `softfloat-source.txt'. 35 | 36 | At the time of this writing, the most up-to-date information about 37 | SoftFloat and the latest release can be found at the Web page `http:// 38 | HTTP.CS.Berkeley.EDU/~jhauser/arithmetic/SoftFloat.html'. 39 | 40 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/aarch64/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* $ ieeefp.h,v 1.0 2020/06/03 09:26:10 $ */ 2 | /* 3 | * Copyright (c) 2020 Puresoftware Ltd. 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | #ifndef _AARCH64_IEEEFP_H_ 19 | #define _AARCH64_IEEEFP_H_ 20 | 21 | typedef int fp_except; 22 | #define FP_X_INV 8 /* invalid operation exception */ 23 | #define FP_X_DNML 15 /* denormalization exception */ 24 | #define FP_X_DZ 9 /* divide-by-zero exception */ 25 | #define FP_X_OFL 10 /* overflow exception */ 26 | #define FP_X_UFL 11 /* underflow exception */ 27 | #define FP_X_IMP 12 /* imprecise (loss of precision) */ 28 | 29 | typedef enum { 30 | FP_RN=(0 << 22), /* round to nearest representable number */ 31 | FP_RM=(1 << 22), /* round toward negative infinity */ 32 | FP_RP=(2 << 22), /* round toward positive infinity */ 33 | FP_RZ=(3 << 22) /* round to zero (truncate) */ 34 | } fp_rnd; 35 | 36 | #endif /* _AARCH64_IEEEFP_H_ */ 37 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/aarch64/milieu.h: -------------------------------------------------------------------------------- 1 | /* $ milieu.h,v 1.0 2020/06/03 09:13:54 $ */ 2 | /* 3 | * Copyright (c) 2020 Puresoftware Ltd. 4 | * 5 | * Permission to use, copy, modify, and distribute this software for any 6 | * purpose with or without fee is hereby granted, provided that the above 7 | * copyright notice and this permission notice appear in all copies. 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | */ 17 | 18 | /* 19 | ------------------------------------------------------------------------------- 20 | Include common integer types and flags. 21 | ------------------------------------------------------------------------------- 22 | */ 23 | #include "aarch64-gcc.h" 24 | 25 | /* 26 | ------------------------------------------------------------------------------- 27 | Symbolic Boolean literals. 28 | ------------------------------------------------------------------------------- 29 | */ 30 | enum { 31 | FALSE = 0, 32 | TRUE = 1 33 | }; 34 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/amd64/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ieeefp.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ 2 | 3 | /* 4 | * Written by J.T. Conklin, Apr 6, 1995 5 | * Public domain. 6 | */ 7 | 8 | #ifndef _X86_IEEEFP_H_ 9 | #define _X86_IEEEFP_H_ 10 | 11 | typedef int fp_except; 12 | #define FP_X_INV 0x01 /* invalid operation exception */ 13 | #define FP_X_DNML 0x02 /* denormalization exception */ 14 | #define FP_X_DZ 0x04 /* divide-by-zero exception */ 15 | #define FP_X_OFL 0x08 /* overflow exception */ 16 | #define FP_X_UFL 0x10 /* underflow exception */ 17 | #define FP_X_IMP 0x20 /* imprecise (loss of precision) */ 18 | 19 | typedef enum { 20 | FP_RN=0, /* round to nearest representable number */ 21 | FP_RM=1, /* round toward negative infinity */ 22 | FP_RP=2, /* round toward positive infinity */ 23 | FP_RZ=3 /* round to zero (truncate) */ 24 | } fp_rnd; 25 | 26 | #endif /* _X86_IEEEFP_H_ */ 27 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/i386/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ieeefp.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ 2 | 3 | /* 4 | * Written by J.T. Conklin, Apr 6, 1995 5 | * Public domain. 6 | */ 7 | 8 | #ifndef _X86_IEEEFP_H_ 9 | #define _X86_IEEEFP_H_ 10 | 11 | typedef int fp_except; 12 | #define FP_X_INV 0x01 /* invalid operation exception */ 13 | #define FP_X_DNML 0x02 /* denormalization exception */ 14 | #define FP_X_DZ 0x04 /* divide-by-zero exception */ 15 | #define FP_X_OFL 0x08 /* overflow exception */ 16 | #define FP_X_UFL 0x10 /* underflow exception */ 17 | #define FP_X_IMP 0x20 /* imprecise (loss of precision) */ 18 | 19 | typedef enum { 20 | FP_RN=0, /* round to nearest representable number */ 21 | FP_RM=1, /* round toward negative infinity */ 22 | FP_RP=2, /* round toward positive infinity */ 23 | FP_RZ=3 /* round to zero (truncate) */ 24 | } fp_rnd; 25 | 26 | #endif /* _X86_IEEEFP_H_ */ 27 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/mips/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ieeefp.h,v 1.7 2012/03/19 22:24:07 matt Exp $ */ 2 | 3 | /* 4 | * Written by J.T. Conklin, Apr 11, 1995 5 | * Public domain. 6 | */ 7 | 8 | #ifndef _MIPS_IEEEFP_H_ 9 | #define _MIPS_IEEEFP_H_ 10 | 11 | typedef unsigned int fp_except; 12 | #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ 13 | #define FP_X_UFL 0x02 /* underflow exception */ 14 | #define FP_X_OFL 0x04 /* overflow exception */ 15 | #define FP_X_DZ 0x08 /* divide-by-zero exception */ 16 | #define FP_X_INV 0x10 /* invalid operation exception */ 17 | 18 | typedef enum { 19 | FP_RN=0, /* round to nearest representable number */ 20 | FP_RZ=1, /* round to zero (truncate) */ 21 | FP_RP=2, /* round toward positive infinity */ 22 | FP_RM=3 /* round toward negative infinity */ 23 | } fp_rnd; 24 | 25 | #endif /* _MIPS_IEEEFP_H_ */ 26 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/powerpc/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin, Apr 6, 1995 3 | * Public domain. 4 | */ 5 | 6 | #ifndef _POWERPC_IEEEFP_H_ 7 | #define _POWERPC_IEEEFP_H_ 8 | 9 | typedef int fp_except; 10 | #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ 11 | #define FP_X_DZ 0x02 /* divide-by-zero exception */ 12 | #define FP_X_UFL 0x04 /* underflow exception */ 13 | #define FP_X_OFL 0x08 /* overflow exception */ 14 | #define FP_X_INV 0x10 /* invalid operation exception */ 15 | 16 | typedef enum { 17 | FP_RN=0, /* round to nearest representable number */ 18 | FP_RZ=1, /* round to zero (truncate) */ 19 | FP_RP=2, /* round toward positive infinity */ 20 | FP_RM=3 /* round toward negative infinity */ 21 | } fp_rnd; 22 | 23 | #endif /* _POWERPC_IEEEFP_H_ */ 24 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/arch/sparc64/ieeefp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by J.T. Conklin, Apr 6, 1995 3 | * Public domain. 4 | */ 5 | 6 | #ifndef _SPARC_IEEEFP_H_ 7 | #define _SPARC_IEEEFP_H_ 8 | 9 | typedef int fp_except; 10 | #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ 11 | #define FP_X_DZ 0x02 /* divide-by-zero exception */ 12 | #define FP_X_UFL 0x04 /* underflow exception */ 13 | #define FP_X_OFL 0x08 /* overflow exception */ 14 | #define FP_X_INV 0x10 /* invalid operation exception */ 15 | 16 | typedef enum { 17 | FP_RN=0, /* round to nearest representable number */ 18 | FP_RZ=1, /* round to zero (truncate) */ 19 | FP_RP=2, /* round toward positive infinity */ 20 | FP_RM=3 /* round toward negative infinity */ 21 | } fp_rnd; 22 | 23 | #endif /* _SPARC_IEEEFP_H_ */ 24 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/eqdf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: eqdf2.c,v 1.1 2000/06/06 08:15:02 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __eqdf2(float64, float64); 12 | 13 | flag 14 | __eqdf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says !(a == b) */ 18 | return !float64_eq(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/eqsf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: eqsf2.c,v 1.1 2000/06/06 08:15:03 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __eqsf2(float32, float32); 12 | 13 | flag 14 | __eqsf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says !(a == b) */ 18 | return !float32_eq(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/fpgetmask.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: fpgetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Neil A. Carson and Mark Brinicombe 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include "namespace.h" 33 | 34 | #include 35 | #ifdef SOFTFLOAT_FOR_GCC 36 | #include "softfloat-for-gcc.h" 37 | #endif 38 | #include "milieu.h" 39 | #include "softfloat.h" 40 | 41 | #ifdef __weak_alias 42 | __weak_alias(fpgetmask,_fpgetmask) 43 | #endif 44 | 45 | fp_except 46 | fpgetmask(void) 47 | { 48 | 49 | return float_exception_mask; 50 | } 51 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/fpgetround.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: fpgetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Neil A. Carson and Mark Brinicombe 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include "namespace.h" 33 | 34 | #include 35 | #ifdef SOFTFLOAT_FOR_GCC 36 | #include "softfloat-for-gcc.h" 37 | #endif 38 | #include "milieu.h" 39 | #include "softfloat.h" 40 | 41 | #ifdef __weak_alias 42 | __weak_alias(fpgetround,_fpgetround) 43 | #endif 44 | 45 | fp_rnd 46 | fpgetround(void) 47 | { 48 | 49 | return float_rounding_mode; 50 | } 51 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/fpgetsticky.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: fpgetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. 5 | * All rights reserved. 6 | * 7 | * This code is derived from software contributed to The NetBSD Foundation 8 | * by Neil A. Carson and Mark Brinicombe 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include "namespace.h" 33 | 34 | #include 35 | #ifdef SOFTFLOAT_FOR_GCC 36 | #include "softfloat-for-gcc.h" 37 | #endif 38 | #include "milieu.h" 39 | #include "softfloat.h" 40 | 41 | #ifdef __weak_alias 42 | __weak_alias(fpgetsticky,_fpgetsticky) 43 | #endif 44 | 45 | fp_except 46 | fpgetsticky(void) 47 | { 48 | 49 | return float_exception_flags; 50 | } 51 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gedf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gedf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __gedf2(float64, float64); 12 | 13 | flag 14 | __gedf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says (a >= b) - 1 */ 18 | return float64_le(b, a) - 1; 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gesf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gesf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __gesf2(float32, float32); 12 | 13 | flag 14 | __gesf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says (a >= b) - 1 */ 18 | return float32_le(b, a) - 1; 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gexf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | #ifdef FLOATX80 12 | 13 | flag __gexf2(floatx80, floatx80); 14 | 15 | flag 16 | __gexf2(floatx80 a, floatx80 b) 17 | { 18 | 19 | /* libgcc1.c says (a >= b) - 1 */ 20 | return floatx80_le(b, a) - 1; 21 | } 22 | #endif /* FLOATX80 */ 23 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gtdf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gtdf2.c,v 1.1 2000/06/06 08:15:05 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __gtdf2(float64, float64); 12 | 13 | flag 14 | __gtdf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says a > b */ 18 | return float64_lt(b, a); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gtsf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gtsf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __gtsf2(float32, float32); 12 | 13 | flag 14 | __gtsf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says a > b */ 18 | return float32_lt(b, a); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/gtxf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: gtxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | #ifdef FLOATX80 12 | 13 | flag __gtxf2(floatx80, floatx80); 14 | 15 | flag 16 | __gtxf2(floatx80 a, floatx80 b) 17 | { 18 | 19 | /* libgcc1.c says a > b */ 20 | return floatx80_lt(b, a); 21 | } 22 | #endif /* FLOATX80 */ 23 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/ledf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ledf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __ledf2(float64, float64); 12 | 13 | flag 14 | __ledf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says 1 - (a <= b) */ 18 | return 1 - float64_le(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/lesf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: lesf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __lesf2(float32, float32); 12 | 13 | flag 14 | __lesf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says 1 - (a <= b) */ 18 | return 1 - float32_le(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/ltdf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ltdf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __ltdf2(float64, float64); 12 | 13 | flag 14 | __ltdf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says -(a < b) */ 18 | return -float64_lt(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/ltsf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: ltsf2.c,v 1.1 2000/06/06 08:15:06 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __ltsf2(float32, float32); 12 | 13 | flag 14 | __ltsf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says -(a < b) */ 18 | return -float32_lt(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/namespace.h: -------------------------------------------------------------------------------- 1 | #include "ieeefp.h" 2 | 3 | fp_rnd fpgetround(void); 4 | fp_rnd fpsetround(fp_rnd); 5 | fp_except fpgetmask(void); 6 | fp_except fpsetmask(fp_except); 7 | fp_except fpgetsticky(void); 8 | fp_except fpsetsticky(fp_except); 9 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/nedf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nedf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __nedf2(float64, float64); 12 | 13 | flag 14 | __nedf2(float64 a, float64 b) 15 | { 16 | 17 | /* libgcc1.c says a != b */ 18 | return !float64_eq(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/negdf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: negdf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | float64 __negdf2(float64); 12 | 13 | float64 14 | __negdf2(float64 a) 15 | { 16 | 17 | /* libgcc1.c says -a */ 18 | return a ^ FLOAT64_MANGLE(0x8000000000000000ULL); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/negsf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: negsf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | float32 __negsf2(float32); 12 | 13 | float32 14 | __negsf2(float32 a) 15 | { 16 | 17 | /* libgcc1.c says INTIFY(-a) */ 18 | return a ^ 0x80000000; 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/negxf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: negxf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | #ifdef FLOATX80 12 | 13 | floatx80 __negxf2(floatx80); 14 | 15 | floatx80 16 | __negxf2(floatx80 a) 17 | { 18 | 19 | /* libgcc1.c says -a */ 20 | return __mulxf3(a,__floatsixf(-1)); 21 | } 22 | #endif /* FLOATX80 */ 23 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/nesf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nesf2.c,v 1.1 2000/06/06 08:15:07 bjh21 Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __nesf2(float32, float32); 12 | 13 | flag 14 | __nesf2(float32 a, float32 b) 15 | { 16 | 17 | /* libgcc1.c says a != b */ 18 | return !float32_eq(a, b); 19 | } 20 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/nexf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: nexf2.c,v 1.2 2004/09/27 10:16:24 he Exp $ */ 2 | 3 | /* 4 | * Written by Ben Harris, 2000. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | #ifdef FLOATX80 12 | 13 | flag __nexf2(floatx80, floatx80); 14 | 15 | flag 16 | __nexf2(floatx80 a, floatx80 b) 17 | { 18 | 19 | /* libgcc1.c says a != b */ 20 | return !floatx80_eq(a, b); 21 | } 22 | #endif /* FLOATX80 */ 23 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/softfloat-history.txt: -------------------------------------------------------------------------------- 1 | $NetBSD: softfloat-history.txt,v 1.1 2000/06/06 08:15:08 bjh21 Exp $ 2 | 3 | History of Major Changes to SoftFloat, up to Release 2a 4 | 5 | John R. Hauser 6 | 1998 December 16 7 | 8 | 9 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 | Release 2a (1998 December) 11 | 12 | -- Added functions to convert between 64-bit integers (int64) and all 13 | supported floating-point formats. 14 | 15 | -- Fixed a bug in all 64-bit-version square root functions except 16 | `float32_sqrt' that caused the result sometimes to be off by 1 unit in 17 | the last place (1 ulp) from what it should be. (Bug discovered by Paul 18 | Donahue.) 19 | 20 | -- Improved the makefiles. 21 | 22 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 23 | Release 2 (1997 June) 24 | 25 | -- Created the 64-bit (bits64) version, adding the floatx80 and float128 26 | formats. 27 | 28 | -- Changed the source directory structure, splitting the sources into a 29 | `bits32' and a `bits64' version. Renamed `environment.h' to `milieu.h' 30 | (to avoid confusion with environment variables). 31 | 32 | -- Fixed a small error that caused `float64_round_to_int' often to round the 33 | wrong way in nearest/even mode when the operand was between 2^20 and 2^21 34 | and halfway between two integers. 35 | 36 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 37 | Release 1a (1996 July) 38 | 39 | -- Corrected a mistake that caused borderline underflow cases not to raise 40 | the underflow flag when they should have. (Problem reported by Doug 41 | Priest.) 42 | 43 | -- Added the `float_detect_tininess' variable to control whether tininess is 44 | detected before or after rounding. 45 | 46 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 47 | Release 1 (1996 July) 48 | 49 | -- Original release. 50 | 51 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 52 | 53 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/unorddf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: unorddf2.c,v 1.1 2003/05/06 08:58:19 rearnsha Exp $ */ 2 | 3 | /* 4 | * Written by Richard Earnshaw, 2003. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __unorddf2(float64, float64); 12 | 13 | flag 14 | __unorddf2(float64 a, float64 b) 15 | { 16 | /* 17 | * The comparison is unordered if either input is a NaN. 18 | * Test for this by comparing each operand with itself. 19 | * We must perform both comparisons to correctly check for 20 | * signalling NaNs. 21 | */ 22 | return 1 ^ (float64_eq(a, a) & float64_eq(b, b)); 23 | } 24 | -------------------------------------------------------------------------------- /pcc-libs/libsoftfloat/unordsf2.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: unordsf2.c,v 1.1 2003/05/06 08:58:20 rearnsha Exp $ */ 2 | 3 | /* 4 | * Written by Richard Earnshaw, 2003. This file is in the Public Domain. 5 | */ 6 | 7 | #include "softfloat-for-gcc.h" 8 | #include "milieu.h" 9 | #include "softfloat.h" 10 | 11 | flag __unordsf2(float32, float32); 12 | 13 | flag 14 | __unordsf2(float32 a, float32 b) 15 | { 16 | /* 17 | * The comparison is unordered if either input is a NaN. 18 | * Test for this by comparing each operand with itself. 19 | * We must perform both comparisons to correctly check for 20 | * signalling NaNs. 21 | */ 22 | return 1 ^ (float32_eq(a, a) & float32_eq(b, b)); 23 | } 24 | -------------------------------------------------------------------------------- /pcc/DATESTAMP: -------------------------------------------------------------------------------- 1 | 20231021 2 | -------------------------------------------------------------------------------- /pcc/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.9 2011/06/07 13:56:05 plunky Exp $ 2 | # 3 | # Makefile.in for top-level of pcc. 4 | # 5 | 6 | @SET_MAKE@ 7 | 8 | ALL_SUBDIRS= cc 9 | DIST_SUBDIRS= $(ALL_SUBDIRS) f77 10 | 11 | all install clean: 12 | @for subdir in $(ALL_SUBDIRS); do \ 13 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 14 | echo "===> $$_nextdir_"; \ 15 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 16 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 17 | echo "<=== $$_nextdir_"; \ 18 | done 19 | 20 | distclean: 21 | @for subdir in $(DIST_SUBDIRS); do \ 22 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 23 | echo "===> $$_nextdir_"; \ 24 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 25 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 26 | echo "<=== $$_nextdir_"; \ 27 | done 28 | rm -rf Makefile config.log stamp-h1 config.status \ 29 | configure.lineno config.h autom4te.cache 30 | -------------------------------------------------------------------------------- /pcc/arch/m16c/TODO: -------------------------------------------------------------------------------- 1 | * Mul/Div does not work. -------------------------------------------------------------------------------- /pcc/arch/mips/TODO: -------------------------------------------------------------------------------- 1 | * Fix floating-point arguments in registers 2 | * Fix structure arguments in registers 3 | -------------------------------------------------------------------------------- /pcc/arch/mips64/TODO: -------------------------------------------------------------------------------- 1 | * Fix floating-point arguments in registers 2 | * Fix structure arguments in registers 3 | -------------------------------------------------------------------------------- /pcc/arch/pdp10/README: -------------------------------------------------------------------------------- 1 | 2 | 3 | PDP10 C calling convention 4 | -------------------------- 5 | Register 1-7 are argument registers. Types of sizes up to 36 bits are 6 | given in one register, two otherwise. CHAR and SHORT are given as INTs. 7 | 8 | If the argument that would end up in register 7 requires two registers, 9 | it is saved on the stack instead and no more registers would end up 10 | on the stack. 11 | 12 | struct return: a hidden argument containing the address of the struct 13 | is stored as the first argument _on_the_stack_, never in register. 14 | 15 | struct argument: always saved on stack, and terminates the list 16 | of arguments that are kept in registers. 17 | 18 | In case of debugging all arguments are saved on stack in the function. 19 | 20 | All variadic arguments are always saved on the stack. 21 | -------------------------------------------------------------------------------- /pcc/cc/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.9 2012/01/01 16:27:25 ragge Exp $ 2 | # 3 | # Makefile.in for top-level of pcc. 4 | # 5 | 6 | @SET_MAKE@ 7 | 8 | ALL_SUBDIRS= cc cpp ccom cxxcom 9 | DIST_SUBDIRS= $(ALL_SUBDIRS) driver 10 | 11 | all install clean: 12 | @for subdir in $(ALL_SUBDIRS); do \ 13 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 14 | echo "===> $$_nextdir_"; \ 15 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 16 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 17 | echo "<=== $$_nextdir_"; \ 18 | done 19 | 20 | distclean: 21 | @for subdir in $(DIST_SUBDIRS); do \ 22 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 23 | echo "===> $$_nextdir_"; \ 24 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 25 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 26 | echo "<=== $$_nextdir_"; \ 27 | done 28 | rm -f Makefile 29 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res1: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | char p[] = "x ## y"; 8 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res10: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | 8 | int midiopen(int); 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | foo_optarg 17 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res11: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | 8 | a 9 | a b 10 | a b c 11 | a b c d 12 | 13 | 14 | 15 | 16 | 17 | 18 | __attribute__((__noreturn__)) 19 | 20 | 21 | 1 2 22 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res13: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | long 8 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res14: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | AB 7 | 8 | 9 | 10 | i1(c) q p 11 | 12 | 13 | 14 | 15 | B(22,(foof bar kaka)); 16 | 17 | 18 | 19 | notable; 20 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res15: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | do { _foo_X (); } while ( 0); 5 | 6 | 7 | do { _foo_Y (); } while ( 0); 8 | 9 | 10 | do { _foo_(); } while ( 0); 11 | 12 | 13 | 14 | 15 | (111 FIRST 111); 16 | (222 SECOND 222); 17 | (111 (222 THIRD 222) 111); 18 | (222 (111 FOURTH 111) 222); 19 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res15C: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | do { _foo_X (); } while (/* CONSTCOND */0); 5 | 6 | 7 | do { _foo_Y (); } while (/* CONSTCOND */0); 8 | 9 | 10 | do { _foo_(); } while (/* CONSTCOND */0); 11 | 12 | 13 | 14 | 15 | (111 /*LINTED*/ FIRST 111); 16 | (222 SECOND /*LINTED*/ 222); 17 | (111 /*LINTED*/ (222 THIRD /*LINTED*/ 222) 111); 18 | (222 (111 /*LINTED*/ FOURTH 111) /*LINTED*/ 222); 19 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res16: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | This file is testing line counting in various scenarios involving 4 | escaped newlines, including using the trigraph escape sequence 5 | 6 | --> 4 4 7 | "multi-line string" 8 | 9 | 10 | --> 8 8 11 | 'multi-line character constant' 12 | 13 | 14 | --> 12 12 15 | multi-line 012345678 integer constant 16 | 17 | 18 | 19 | --> 17 17 20 | multi-line list of tokens 21 | 22 | 23 | 24 | 25 | 26 | --> 24 24 27 | 28 | 29 | 30 | --> 28 28 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | --> 36 36 39 | 40 | 41 | 42 | --> 40 40 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | --> 48 48 51 | 52 | #pragma multi-line #pragma directive 53 | # 49 "" 54 | 55 | 56 | 57 | --> 52 52 58 | 59 | 60 | 61 | 62 | --> 57 57 63 | multi-line macro embedded 64 | --> 59 59 65 | 66 | 67 | 68 | 69 | --> 64 64 70 | macro with a leading comment 71 | --> 66 66 72 | 73 | 74 | 75 | --> 70 70 76 | macro with leading whitespace and escaped newlines 77 | --> 72 72 78 | 79 | a token split by escaped newlines 80 | 81 | 82 | --> 77 77 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | #pragma multi-line #pragma inside if-true block 91 | # 84 "" 92 | 93 | 94 | 95 | --> 87 87 96 | 97 | --> 89 89 98 | 99 | #pragma with a preceding comment 100 | # 90 "" 101 | 102 | --> 91 91 103 | 104 | 105 | 106 | 107 | 108 | --> 97 97 109 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res16C: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | This file is testing line counting in various scenarios involving 4 | escaped newlines, including using the trigraph escape sequence 5 | 6 | --> 4 4 7 | "multi-line string" 8 | 9 | 10 | --> 8 8 11 | 'multi-line character constant' 12 | 13 | 14 | --> 12 12 15 | multi-line 012345678 integer constant 16 | 17 | 18 | 19 | --> 17 17 20 | multi-line list of tokens 21 | 22 | 23 | 24 | 25 | 26 | --> 24 24 27 | /* multi-line comment */ 28 | 29 | 30 | --> 28 28 31 | /*/ comment with escaped newlines /* 32 | 33 | 34 | in the markers 35 | */ 36 | 37 | 38 | --> 36 36 39 | // multi-line C++ comment 40 | 41 | 42 | --> 40 40 43 | // C++ comment with leading whitespace and escaped newlines 44 | 45 | 46 | 47 | 48 | 49 | 50 | --> 48 48 51 | 52 | #pragma multi-line #pragma directive 53 | # 49 "" 54 | 55 | 56 | 57 | --> 52 52 58 | 59 | 60 | 61 | 62 | --> 57 57 63 | multi-line macro /* with a comment */ embedded 64 | --> 59 59 65 | /* comment before directive */ #define BAR macro with a leading comment 66 | 67 | 68 | 69 | --> 64 64 70 | BAR 71 | --> 66 66 72 | 73 | 74 | 75 | --> 70 70 76 | macro with leading whitespace and escaped newlines 77 | --> 72 72 78 | 79 | a token split by escaped newlines 80 | 81 | 82 | --> 77 77 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | #pragma multi-line #pragma inside if-true block 91 | # 84 "" 92 | 93 | 94 | 95 | --> 87 87 96 | 97 | --> 89 89 98 | /* comment */ # pragma with a preceding comment 99 | --> 91 91 100 | 101 | 102 | 103 | 104 | 105 | --> 97 97 106 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res17: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | testing that pp-numbers are parsed correctly 4 | 5 | 6 | 7 | 8 | 9 | 123.4e+foo 10 | 123.4f+FOO 11 | 123.4e+foo 12 | 13 | 14 | 15 | 16 | 123.4e+foo 17 | 18 | 19 | 20 | 21 | FOO.123.foo.456+FOO+789.foo 22 | 23 | 24 | 0xfaff 25 | 26 | 27 | 28 | 0xfe00 29 | 30 | 31 | 32 | 0xfeff 33 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res18: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | "foo" 6 | "\"foo\"" 7 | "\"foo\\n\"" 8 | "\"\\\"foo\\\"\"" 9 | "\"foo\\\\\"" 10 | "\"\\\\\\\"foo\"" 11 | "\"foo\\\\\\\\\"" 12 | "foo\n" 13 | "foo\\n" 14 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res2: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | # 15 "" 5 | f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 6 | f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1)) 7 | ^m(0,1); 8 | int i[] = { 1, 23, 4, 5, }; 9 | char c[2][6] = { "hello", "" }; 10 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res20: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | # 167 "" 5 | int squares[] = (1 * 1), (2 * 2), (3 * 3), (4 * 4), (5 * 5), (6 * 6), (7 * 7), (8 * 8); 6 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res21: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | _PROTOTYPE( void __bad_assertion, (const char *_mess) ); 8 | 9 | 10 | 11 | 12 | 13 | 14 | ((sizeof(lists) / sizeof(lists[0]) == sizeof(sysroots) / sizeof(sysroots[0]))? (void)0 : __bad_assertion("Assertion \"" "sizeof(lists) / sizeof(lists[0]) == sizeof(sysroots) / sizeof(sysroots[0])" "\" failed, file " "\"\"" ", line " "12" "\n")); 15 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res22: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | char cbuf[sizeof "'\\U12340'"]; 4 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res3: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | printf("x" "1" "= %d, x" "2" "= %s", x1, x2); 13 | fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); 14 | 15 | \#include "vers2.h" 16 | "hello"; 17 | "hello" ", world" 18 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res4: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | (1) 7 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res5: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | int j[] = { 123, 45, 67, 89, 5 | 10, 11, 12, }; 6 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res6: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | foo 8 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res7: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | a 6 | YES 7 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res8: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | 7 | 8 | (hej.s_s.s_pos) 9 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/res9: -------------------------------------------------------------------------------- 1 | 2 | # 1 "" 3 | 4 | 5 | 6 | ao 7 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test1: -------------------------------------------------------------------------------- 1 | #define hash_hash # ## # 2 | #define mkstr(a) # a 3 | #define in_between(a) mkstr(a) 4 | #define join(c, d) in_between(c hash_hash d) 5 | char p[] = join(x, y); // equivalent to 6 | // char p[] = "x ## y"; 7 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test10: -------------------------------------------------------------------------------- 1 | #define __CONCAT(x,y) x ## y 2 | #define dev_type_open(n) int n(int) 3 | #define dev_decl(n,t) __CONCAT(dev_type_,t)(__CONCAT(n,t)) 4 | #define cdev_decl(n) dev_decl(n,open) 5 | 6 | cdev_decl(midi); 7 | 8 | # define __GETOPT_PREFIX foo_ 9 | # define __GETOPT_CONCAT(x, y) x ## y 10 | # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) 11 | # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) 12 | # define optarg __GETOPT_ID (optarg) 13 | 14 | optarg 15 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test11: -------------------------------------------------------------------------------- 1 | #define D1(s, ...) s 2 | #define D2(s, ...) s D1(__VA_ARGS__) 3 | #define D3(s, ...) s D2(__VA_ARGS__) 4 | #define D4(s, ...) s D3(__VA_ARGS__) 5 | 6 | D1(a) 7 | D2(a, b) 8 | D3(a, b, c) 9 | D4(a, b, c, d) 10 | 11 | 12 | #define __sun_attr___noreturn__ __attribute__((__noreturn__)) 13 | #define ___sun_attr_inner(__a) __sun_attr_##__a 14 | #define __sun_attr__(__a) ___sun_attr_inner __a 15 | #define __NORETURN __sun_attr__((__noreturn__)) 16 | __NORETURN 17 | #define X(...) 18 | #define Y(...) 1 __VA_ARGS__ 2 19 | Y(X X() ()) 20 | 21 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test12: -------------------------------------------------------------------------------- 1 | #define y 2 2 | #define fe(p) sfe(p) p 3 | #define sfe(p) p 4 | #define Y fe(y) y fe(y) 5 | 6 | Y; 7 | 8 | # define S2B_QMIN 0 9 | # define S2B_CMIN (S2B_QMIN + 8) 10 | #define S2B_1(i) i, 11 | #define S2B_2(i) S2B_1(i) S2B_1(i) 12 | #define S2B_4(i) S2B_2(i) S2B_2(i) 13 | #define S2B_8(i) S2B_4(i) S2B_4(i) 14 | #define S2B_16(i) S2B_8(i) S2B_8(i) 15 | #define S2B_32(i) S2B_16(i) S2B_16(i) 16 | #define S2B_64(i) S2B_32(i) S2B_32(i) 17 | #define S2B_128(i) S2B_64(i) S2B_64(i) 18 | #define S2B_256(i) S2B_128(i) S2B_128(i) 19 | S2B_256(S2B_CMIN + 0) 20 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test13: -------------------------------------------------------------------------------- 1 | 2 | #define UL long, foo 3 | #define D(I,F) I 4 | #define E(I) D(I) 5 | E(UL) 6 | 7 | #define FOO 1 8 | 9 | #if (FOO == 1) 10 | 11 | #endif /* FOO */ 12 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test14: -------------------------------------------------------------------------------- 1 | #define A(x) A ## x 2 | #define AB A(B) 3 | 4 | AB 5 | 6 | #define i1(w) i2(w) p 7 | #define i2(x) i1(x) q 8 | i1(c) 9 | 10 | #undef A 11 | #define A(x,y) B(x,y) 12 | 13 | A(22,(foof 14 | bar kaka)); 15 | 16 | #define CONCAT(a, b) a ## b 17 | CONCAT(not, 18 | able); 19 | 20 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test15: -------------------------------------------------------------------------------- 1 | #define FOO(x) do { _foo_ ## x (); } while (/* CONSTCOND */0) 2 | FOO(X); 3 | 4 | #define BAR FOO(Y) 5 | BAR; 6 | 7 | #define BAZ do { _foo_(); } while (/* CONSTCOND */0) 8 | BAZ; 9 | 10 | #define foo(a) (111 /*LINTED*/ a 111) 11 | #define bar(a) (222 a /*LINTED*/ 222) 12 | 13 | foo(FIRST); 14 | bar(SECOND); 15 | foo(bar(THIRD)); 16 | bar(foo(FOURTH)); 17 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test16: -------------------------------------------------------------------------------- 1 | This file is testing line counting in various scenarios involving 2 | escaped newlines, including using the trigraph escape sequence 3 | 4 | --> __LINE__ 4 5 | "multi-\ 6 | line ??/ 7 | string" 8 | --> __LINE__ 8 9 | 'multi-\ 10 | line ??/ 11 | character constant' 12 | --> __LINE__ 12 13 | multi-\ 14 | line 012\ 15 | 345??/ 16 | 678 integer constant 17 | --> __LINE__ 17 18 | multi-\ 19 | line\ 20 | li??/ 21 | st ??/ 22 | of \ 23 | tokens 24 | --> __LINE__ 24 25 | /* multi-\ 26 | line ??/ 27 | comment */ 28 | --> __LINE__ 28 29 | /\ 30 | ??/ 31 | */ comment with escaped newlines /* 32 | in the markers 33 | ??/ 34 | *\ 35 | / 36 | --> __LINE__ 36 37 | // multi-\ 38 | line ??/ 39 | C++ comment 40 | --> __LINE__ 40 41 | \ 42 | \ 43 | /\ 44 | ??/ 45 | \ 46 | / ??/ 47 | C++ comment with leading whitespace and escaped newlines 48 | --> __LINE__ 48 49 | #pragma multi-\ 50 | line ??/ 51 | #pragma directive 52 | --> __LINE__ 52 53 | #define FOO multi-\ 54 | line macro /* with\ 55 | a comment *??/ 56 | / embedded 57 | --> __LINE__ 57 58 | FOO 59 | --> __LINE__ 59 60 | /??/ 61 | * comment \ 62 | before ??/ 63 | directive */ #define BAR macro with a leading comment 64 | --> __LINE__ 64 65 | BAR 66 | --> __LINE__ 66 67 | \ 68 | ??/ 69 | #define BAZ macro with leading whitespace and escaped newlines 70 | --> __LINE__ 70 71 | BAZ 72 | --> __LINE__ 72 73 | #define POTATO a token split by escaped newlines 74 | PO\ 75 | TA??/ 76 | TO 77 | --> __LINE__ 77 78 | #if 0 79 | #pragma multi-??/ 80 | line \ 81 | #pragma inside if-false block 82 | --> __LINE__ 82 83 | #else 84 | #pragma multi-??/ 85 | line \ 86 | #pragma inside if-true block 87 | --> __LINE__ 87 88 | #endif 89 | --> __LINE__ 89 90 | /* comment */ # pragma with a preceding comment 91 | --> __LINE__ 91 92 | #if 0 93 | /* multi-\ 94 | * line comment at flslvl=1 95 | */ 96 | #endif 97 | --> __LINE__ 97 98 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test17: -------------------------------------------------------------------------------- 1 | testing that pp-numbers are parsed correctly 2 | 3 | #define e E 4 | #define f F 5 | #define foo FOO 6 | 7 | 123.4e+foo 8 | 123.4f+foo 9 | 12\ 10 | 3.4\ 11 | e\ 12 | +\ 13 | foo 14 | 123??/ 15 | .4??/ 16 | e??/ 17 | +??/ 18 | foo 19 | foo.123.foo.456+foo+789.foo 20 | 21 | #if 0xfaff 22 | 0xfaff 23 | #endif 24 | 25 | #if 0xfe00 26 | 0xfe00 27 | #endif 28 | 29 | #if 0xfeff 30 | 0xfeff 31 | #endif 32 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test18: -------------------------------------------------------------------------------- 1 | #define str(a) #a 2 | 3 | str(foo) 4 | str("foo") 5 | str("foo\n") 6 | str("\"foo\"") 7 | str("foo\\") 8 | str("\\\"foo") 9 | str("foo\\\\") 10 | str(foo\n) 11 | str(foo\\n) 12 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test19: -------------------------------------------------------------------------------- 1 | #define S(x) S0(x) 2 | #define S0(x) #x 3 | #define T(x,y)\ 4 | S(x)\ 5 | S(y) 6 | #define T0(x,y)\ 7 | S0(x)\ 8 | S0(y) 9 | #define U(x)\ 10 | S(x)\ 11 | S(x) 12 | #define U0(x)\ 13 | S0(x)\ 14 | S0(x) 15 | #define V(x)\ 16 | V_(x)\ 17 | V_(x) 18 | #define V_(x)\ 19 | S(x) 20 | #define V0(x)\ 21 | V0_(x)\ 22 | V0_(x) 23 | #define V0_(x)\ 24 | S0(x) 25 | __COUNTER__ 26 | S(__COUNTER__) 27 | S0(__COUNTER__) 28 | T(__COUNTER__,__COUNTER__) 29 | T0(__COUNTER__,__COUNTER__) 30 | U(__COUNTER__) 31 | U0(__COUNTER__) 32 | V(__COUNTER__) 33 | V0(__COUNTER__) 34 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test2: -------------------------------------------------------------------------------- 1 | #define x 3 2 | #define f(a) f(x * (a)) 3 | #undef x 4 | #define x 2 5 | #define g f 6 | #define z z[0] 7 | #define h g(~ 8 | #define m(a) a(w) 9 | #define w 0,1 10 | #define t(a) a 11 | #define p() int 12 | #define q(x) x 13 | #define r(x,y) x ## y 14 | #define str(x) # x 15 | f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); 16 | g(x+(3,4)-w) | h 5) & m 17 | (f)^m(m); 18 | p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) }; 19 | char c[2][6] = { str(hello), str() }; 20 | /* 21 | * f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); 22 | * f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); 23 | * int i[] = { 1, 23, 4, 5, }; 24 | * char c[2][6] = { "hello", "" }; 25 | */ 26 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test21: -------------------------------------------------------------------------------- 1 | 2 | #define __makestr(x) # x 3 | #define __xstr(x) __makestr(x) 4 | 5 | _PROTOTYPE( void __bad_assertion, (const char *_mess) ); 6 | #define assert(expr) ((expr)? (void)0 : \ 7 | __bad_assertion("Assertion \"" #expr \ 8 | "\" failed, file " __xstr(__FILE__) \ 9 | ", line " __xstr(__LINE__) "\n")) 10 | 11 | 12 | assert(sizeof(lists) / sizeof(lists[0]) == 13 | sizeof(sysroots) / sizeof(sysroots[0])); 14 | 15 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test3: -------------------------------------------------------------------------------- 1 | #define str(s) # s 2 | #define xstr(s) str(s) 3 | #define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ 4 | x ## s, x ## t) 5 | #define INCFILE(n) vers ## n 6 | #define glue(a, b) a ## b 7 | #define xglue(a, b) glue(a, b) 8 | #define HIGHLOW "hello" 9 | #define LOW LOW ", world" 10 | debug(1, 2); 11 | fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away 12 | == 0) str(: @\n), s); 13 | \#include xstr(INCFILE(2).h) 14 | glue(HIGH, LOW); 15 | xglue(HIGH, LOW) 16 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test4: -------------------------------------------------------------------------------- 1 | #define foobar 1 2 | #define C(x,y) x##y 3 | #define D(x) (C(x,bar)) 4 | D(foo) 5 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test5: -------------------------------------------------------------------------------- 1 | #define t(x,y,z) x ## y ## z 2 | int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), 3 | t(10,,), t(,11,), t(,,12), t(,,) }; 4 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test6: -------------------------------------------------------------------------------- 1 | #define X(a,b, \ 2 | c,d) \ 3 | foo 4 | 5 | X(1,2,3,4) 6 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test7: -------------------------------------------------------------------------------- 1 | #define a() YES 2 | #define b() a 3 | b() 4 | b()() 5 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test8: -------------------------------------------------------------------------------- 1 | // test macro expansion in arguments 2 | #define s_pos s_s.s_pos 3 | #define foo(x) (x) 4 | 5 | //hej.s_pos 6 | foo(hej.s_pos) 7 | 8 | -------------------------------------------------------------------------------- /pcc/cc/cpp/tests/test9: -------------------------------------------------------------------------------- 1 | #define C(a,b,c) a##b##c 2 | #define N(x,y) C(x,_,y) 3 | #define A_O ao 4 | N(A,O) 5 | -------------------------------------------------------------------------------- /pcc/cc/cxxcom/cxxdefs.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | enum { NM_NEW, NM_NWA, NM_DEL, NM_DLA, NM_NORMAL, }; 4 | 5 | enum { LINK_DEF, LINK_C }; /* linkage definitions */ 6 | extern int elnk; 7 | #define SCLINK 00020 /* for symtab */ 8 | 9 | extern int cppdebug; 10 | 11 | /* spole is symbol at base, nscur is where we are in the stack. */ 12 | extern struct symtab *spole, *nscur; 13 | 14 | /* insert a symbol into this something */ 15 | #define INSSYM(sp) (sp->snext = nscur->sup, nscur->sup = sp, sp->sdown = nscur) 16 | #define POPSYM() (nscur = nscur->sdown) 17 | 18 | /* C++-specific node types */ 19 | #define CONST_CAST (MAXOP+35) 20 | #define DYN_CAST (MAXOP+36) 21 | #define REINT_CAST (MAXOP+37) 22 | #define STATIC_CAST (MAXOP+38) 23 | #define NEWKW (MAXOP+39) 24 | #define DELETE (MAXOP+40) 25 | #define NMLIST (MAXOP+41) 26 | 27 | /* C++-specific symtab types */ 28 | #define CLNAME (MAXSTCL+1) /* symtab entry is class */ 29 | #define NSPACE (MAXSTCL+2) /* symtab entry is namespace */ 30 | 31 | char *decoratename(struct symtab *sp, int type); 32 | NODE *cxx_new(NODE *p); 33 | NODE *cxx_delete(NODE *p, int del); 34 | void dclns(NODE *attr, char *n); 35 | struct symtab *cxxlookup(NODE *p, int declare); 36 | void cxxsetname(struct symtab *sp); 37 | void cxxmember(struct symtab *sp); 38 | struct symtab *cxxstrvar(struct symtab *so); 39 | struct symtab *cxxdclstr(char *n); 40 | struct symtab *cxxftnfind(NODE *p, int flags); 41 | struct symtab *cxxdeclvar(NODE *p); 42 | void symtree(void); 43 | NODE *cxxrstruct(int soru, NODE *attr, NODE *t, char *tag); 44 | NODE *cxxmatchftn(NODE *, NODE *); 45 | NODE *cxxaddhidden(NODE *, NODE *); 46 | NODE *cxxstructref(NODE *p, int f, char *name); 47 | -------------------------------------------------------------------------------- /pcc/cc/driver/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.9 2012/09/25 11:17:17 plunky Exp $ 2 | # 3 | # Makefile.in for the cc driver part of pcc. 4 | # 5 | VPATH=@srcdir@ 6 | srcdir=@srcdir@ 7 | top_srcdir=@top_srcdir@ 8 | top_builddir=@top_builddir@ 9 | prefix = @prefix@ 10 | exec_prefix = @exec_prefix@ 11 | bindir = @bindir@ 12 | libdir = @libdir@ 13 | libexecdir = @libexecdir@ 14 | includedir = @includedir@ 15 | datarootdir = @datarootdir@ 16 | mandir = @mandir@ 17 | CC = @CC@ 18 | EXEEXT = @EXEEXT@ 19 | TARGOS = @targos@ 20 | TARGOSVER = @targosver@ 21 | TARGMACH = @targmach@ 22 | TARGET = @target@ 23 | VERSION = @PACKAGE_VERSION@ 24 | PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib 25 | PCCINCDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/include 26 | CFLAGS = @CFLAGS@ @ADD_CFLAGS@ 27 | CPPFLAGS = @CPPFLAGS@ -DLIBEXECDIR=\"$(libexecdir)/\" \ 28 | @ADD_CPPFLAGS@ -DINCLUDEDIR=\"$(includedir)/\" \ 29 | -DPCCINCDIR=\"$(PCCINCDIR)/\" -DPCCLIBDIR=\"$(PCCLIBDIR)/\" \ 30 | -DTARGOS=\"$(TARGOS)\" -DTARGOSVER=$(TARGOSVER) -Dos_$(TARGOS) \ 31 | -DTARGMACH=\"$(TARGMACH)\" -Dmach_$(TARGMACH) \ 32 | -I$(top_builddir) -I$(top_srcdir)/os/$(TARGOS) -I$(MIPDIR) -I$(MDIR) 33 | LIBS = @LIBS@ 34 | LDFLAGS = @LDFLAGS@ 35 | INSTALL = @INSTALL@ 36 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 37 | INSTALL_DATA = @INSTALL_DATA@ 38 | 39 | OBJS=driver.o platform.o strlist.o xalloc.o 40 | DEST=@BINPREFIX@pcc$(EXEEXT) 41 | 42 | MIPDIR=$(top_srcdir)/mip 43 | MDIR=$(top_srcdir)/arch/$(TARGMACH) 44 | 45 | all: $(DEST) 46 | 47 | $(DEST): $(OBJS) 48 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) 49 | 50 | .c.o: 51 | $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< 52 | 53 | install: 54 | test -z "$(DESTDIR)$(bindir)" || mkdir -p "$(DESTDIR)$(bindir)" 55 | $(INSTALL_PROGRAM) $(DEST) $(DESTDIR)$(bindir) 56 | 57 | clean: 58 | rm -f $(OBJS) $(DEST) 59 | 60 | distclean: clean 61 | rm -f Makefile 62 | -------------------------------------------------------------------------------- /pcc/cc/driver/xalloc.h: -------------------------------------------------------------------------------- 1 | /* $Id: xalloc.h,v 1.2 2011/05/26 16:48:40 plunky Exp $ */ 2 | 3 | /*- 4 | * Copyright (c) 2011 Joerg Sonnenberger . 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 28 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef XALLOC_H 33 | #define XALLOC_H 34 | 35 | #include 36 | 37 | void *xcalloc(size_t, size_t); 38 | void *xmalloc(size_t); 39 | void *xrealloc(void *, size_t); 40 | char *xstrdup(const char *); 41 | 42 | #endif /* XALLOC_H */ 43 | -------------------------------------------------------------------------------- /pcc/common/compat.h: -------------------------------------------------------------------------------- 1 | /* $Id: compat.h,v 1.6 2015/07/24 08:26:05 ragge Exp $ */ 2 | 3 | /* 4 | * Just compatibility function prototypes. 5 | * Public domain. 6 | */ 7 | 8 | #ifndef COMPAT_H 9 | #define COMPAT_H 10 | 11 | #ifndef HAVE_STRLCPY 12 | #include /* size_t */ 13 | size_t strlcpy(char *dst, const char *src, size_t siz); 14 | #endif 15 | 16 | #ifndef HAVE_STRLCAT 17 | #include /* size_t */ 18 | size_t strlcat(char *dst, const char *src, size_t siz); 19 | #endif 20 | 21 | #ifndef HAVE_GETOPT 22 | extern char *optarg; 23 | extern int optind; 24 | int getopt(int, char * const [], const char *); 25 | #endif 26 | 27 | #ifndef HAVE_MKSTEMP 28 | int mkstemp(char *); 29 | #endif 30 | 31 | #ifndef HAVE_FFS 32 | int ffs(int); 33 | #endif 34 | 35 | #ifndef HAVE_SNPRINTF 36 | #include /* size_t */ 37 | int snprintf(char *str, size_t count, const char *fmt, ...); 38 | #endif 39 | 40 | #ifndef HAVE_VSNPRINTF 41 | #include /* size_t */ 42 | #include /* va_list */ 43 | int vsnprintf(char *str, size_t count, const char *fmt, va_list args); 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /pcc/common/unicode.h: -------------------------------------------------------------------------------- 1 | /* $Id: unicode.h,v 1.5 2015/07/19 13:20:37 ragge Exp $ */ 2 | 3 | #ifndef _UNICODE_H 4 | #define _UNICODE_H 5 | 6 | extern long u82cp(char **q); 7 | extern void u8error(const char *fmt, ...); 8 | extern void cp2u16(long num, unsigned short *s); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /pcc/f77/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.7 2011/06/07 13:56:05 plunky Exp $ 2 | # 3 | # Makefile.in for top-level of pcc. 4 | # 5 | 6 | @SET_MAKE@ 7 | 8 | ALL_SUBDIRS= f77 fcom 9 | DIST_SUBDIRS= $(ALL_SUBDIRS) 10 | 11 | all install clean: 12 | @for subdir in $(ALL_SUBDIRS); do \ 13 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 14 | echo "===> $$_nextdir_"; \ 15 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 16 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 17 | echo "<=== $$_nextdir_"; \ 18 | done 19 | 20 | distclean: 21 | @for subdir in $(DIST_SUBDIRS); do \ 22 | _nextdir_=$${_thisdir_+$$_thisdir_/}$$subdir; \ 23 | echo "===> $$_nextdir_"; \ 24 | (_thisdir_=$$_nextdir_; export _thisdir_; cd $$subdir && \ 25 | exec $(MAKE) $(MFLAGS) $@) || exit $$?; \ 26 | echo "<=== $$_nextdir_"; \ 27 | done 28 | rm -f Makefile 29 | -------------------------------------------------------------------------------- /pcc/f77/f77/Makefile.in: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.in,v 1.23 2022/12/10 09:19:58 ragge Exp $ 2 | # 3 | # Makefile.in for the f77 frontend of pcc. 4 | # 5 | VPATH=@srcdir@ 6 | top_srcdir=@top_srcdir@ 7 | top_builddir=@top_builddir@ 8 | prefix = @prefix@ 9 | exec_prefix = @exec_prefix@ 10 | bindir = @bindir@ 11 | libdir = @libdir@ 12 | libexecdir = @libexecdir@ 13 | includedir = @includedir@ 14 | CC = @CC@ 15 | TARGOS = @targos@ 16 | TARGOSVER = @targosver@ 17 | TARGMACH = @targmach@ 18 | TARGET = @target@ 19 | VERSION = @PACKAGE_VERSION@ 20 | PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib 21 | PCCINCDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/include 22 | F77LIBDIR=-L$(prefix)/lib 23 | CFLAGS = @CFLAGS@ @ADD_CFLAGS@ 24 | CPPFLAGS = @CPPFLAGS@ @ADD_CPPFLAGS@ -DLANG_F77 \ 25 | -DLIBEXECDIR=\"$(libexecdir)\" -DINCLUDEDIR=\"$(includedir)\" \ 26 | -DPCCINCDIR=\"$(PCCINCDIR)/\" -DPCCLIBDIR=\"$(PCCLIBDIR)/\" \ 27 | -Dmach_$(TARGMACH) -Dos_$(TARGOS) \ 28 | -I$(top_srcdir)/cc/driver -I$(MIPDIR) -I$(COMMONDIR)\ 29 | -I$(FCOMDIR) -I$(top_builddir) -I$(top_srcdir)/os/$(TARGOS) -I$(MDIR) 30 | LIBS = @LIBS@ 31 | LDFLAGS = @LDFLAGS@ 32 | INSTALL = @INSTALL@ 33 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 34 | INSTALL_DATA = @INSTALL_DATA@ 35 | OBJS=f77.o strlist.o xalloc.o 36 | DEST=@BINPREFIX@f77 37 | 38 | MIPDIR=$(top_srcdir)/mip 39 | MDIR=$(top_srcdir)/arch/$(TARGMACH) 40 | FCOMDIR=$(top_srcdir)/f77/fcom 41 | COMMONDIR=$(top_srcdir)/common 42 | 43 | all: $(DEST) 44 | 45 | $(DEST): $(OBJS) 46 | $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) 47 | 48 | strlist.o: $(top_srcdir)/cc/driver/strlist.c 49 | $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(top_srcdir)/cc/driver/strlist.c 50 | 51 | xalloc.o: $(top_srcdir)/cc/driver/xalloc.c 52 | $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(top_srcdir)/cc/driver/xalloc.c 53 | 54 | .c.o: 55 | $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< 56 | 57 | install: 58 | $(INSTALL_PROGRAM) $(DEST) $(bindir) 59 | 60 | clean: 61 | rm -f $(OBJS) $(DEST) 62 | 63 | distclean: clean 64 | rm -f Makefile 65 | -------------------------------------------------------------------------------- /pcc/f77/fcom/scjdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Map pass2 nodes to pass1 dito. 3 | */ 4 | #include "node.h" 5 | 6 | 7 | #define P2BAD -1 8 | #define P2PLUS PLUS 9 | #define P2MINUS MINUS 10 | #define P2NEG UMINUS 11 | #define P2STAR MUL 12 | #define P2BITAND AND 13 | #define P2BITOR OR 14 | #define P2BITXOR ER 15 | #define P2GOTO GOTO 16 | #define P2ASSIGN ASSIGN 17 | #define P2SLASH DIV 18 | #define P2MOD MOD 19 | #define P2LSHIFT LS 20 | #define P2RSHIFT RS 21 | #define P2CALL CALL 22 | #define P2CALL0 UCALL 23 | 24 | #define P2BITNOT -1 25 | #define P2EQ EQ 26 | #define P2NE NE 27 | #define P2LE LE 28 | #define P2LT LT 29 | #define P2GE GE 30 | #define P2GT GT 31 | #define P2CONV SCONV 32 | 33 | /* special operators included only for fortran's use */ 34 | 35 | #define P2INT INT 36 | 37 | #define P2PTR PTR 38 | -------------------------------------------------------------------------------- /pcc/f77/fcom/tokens: -------------------------------------------------------------------------------- 1 | SEOS 2 | SCOMMENT 3 | SLABEL 4 | SUNKNOWN 5 | SHOLLERITH 6 | SICON 7 | SRCON 8 | SDCON 9 | SBITCON 10 | SOCTCON 11 | SHEXCON 12 | STRUE 13 | SFALSE 14 | SFNAME 15 | SNAMEEQ 16 | SFIELD 17 | SSCALE 18 | SINCLUDE 19 | SLET 20 | SASSIGN 21 | SAUTOMATIC 22 | SBACKSPACE 23 | SBLOCK 24 | SCALL 25 | SCHARACTER 26 | SCLOSE 27 | SCOMMON 28 | SCOMPLEX 29 | SCONTINUE 30 | SDATA 31 | SDCOMPLEX 32 | SDIMENSION 33 | SDO 34 | SDOUBLE 35 | SELSE 36 | SELSEIF 37 | SEND 38 | SENDFILE 39 | SENDIF 40 | SENTRY 41 | SEQUIV 42 | SEXTERNAL 43 | SFORMAT 44 | SFUNCTION 45 | SGOTO 46 | SASGOTO 47 | SCOMPGOTO 48 | SARITHIF 49 | SLOGIF 50 | SIMPLICIT 51 | SINQUIRE 52 | SINTEGER 53 | SINTRINSIC 54 | SLOGICAL 55 | SOPEN 56 | SPARAM 57 | SPAUSE 58 | SPRINT 59 | SPROGRAM 60 | SPUNCH 61 | SREAD 62 | SREAL 63 | SRETURN 64 | SREWIND 65 | SSAVE 66 | SSTATIC 67 | SSTOP 68 | SSUBROUTINE 69 | STHEN 70 | STO 71 | SUNDEFINED 72 | SWRITE 73 | SLPAR 74 | SRPAR 75 | SEQUALS 76 | SCOLON 77 | SCOMMA 78 | SCURRENCY 79 | SPLUS 80 | SMINUS 81 | SSTAR 82 | SSLASH 83 | SPOWER 84 | SCONCAT 85 | SAND 86 | SOR 87 | SNEQV 88 | SEQV 89 | SNOT 90 | SEQ 91 | SLT 92 | SGT 93 | SLE 94 | SGE 95 | SNE 96 | -------------------------------------------------------------------------------- /pcc/os/mirbsd/ccconfig.h: -------------------------------------------------------------------------------- 1 | /* $Id: ccconfig.h,v 1.10 2014/12/24 08:43:28 plunky Exp $ */ 2 | /*- 3 | * Copyright (c) 2007, 2008 4 | * Thorsten Glaser 5 | * 6 | * Provided that these terms and disclaimer and all copyright notices 7 | * are retained or reproduced in an accompanying document, permission 8 | * is granted to deal in this work without restriction, including un- 9 | * limited rights to use, publicly perform, distribute, sell, modify, 10 | * merge, give away, or sublicence. 11 | * 12 | * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to 13 | * the utmost extent permitted by applicable law, neither express nor 14 | * implied; without malicious intent or gross negligence. In no event 15 | * may a licensor, author or contributor be held liable for indirect, 16 | * direct, other damage, loss, or other issues arising in any way out 17 | * of dealing in the work, even if advised of the possibility of such 18 | * damage or existence of a defect, except proven that it results out 19 | * of said person's immediate fault when using the work as intended. 20 | */ 21 | 22 | /** 23 | * Configuration for pcc on a MirOS BSD (i386 or sparc) target 24 | */ 25 | 26 | /* === mi part === */ 27 | 28 | /* cpp MI defines */ 29 | #define CPPADD { \ 30 | "-D__MirBSD__", \ 31 | "-D__OpenBSD__", \ 32 | "-D__unix__", \ 33 | "-D__ELF__", \ 34 | NULL \ 35 | } 36 | 37 | /* for dynamically linked binaries */ 38 | #define DYNLINKLIB "/usr/libexec/ld.so" 39 | 40 | #define CRTEND_T "crtend.o" 41 | #define DEFLIBS { "-lc", NULL } 42 | 43 | /* === md part === */ 44 | 45 | #if defined(mach_i386) 46 | #define CPPMDADD { \ 47 | "-D__i386__", \ 48 | "-D__i386", \ 49 | "-Di386", \ 50 | NULL, \ 51 | } 52 | #elif defined(mach_sparc) 53 | #error pcc does not support sparc yet 54 | #else 55 | #error this architecture is not supported by MirOS BSD 56 | #endif 57 | -------------------------------------------------------------------------------- /pcc/os/win32/build_installer.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files\Inno Setup 5\ISCC.exe" /DAppName="PCC" /DAppVersion="1.1.x" /DAppNameLower="pcc" pcc.iss 2 | -------------------------------------------------------------------------------- /pcc/os/win32/ccconfig.h: -------------------------------------------------------------------------------- 1 | /* $Id: ccconfig.h,v 1.19 2014/12/24 12:35:38 plunky Exp $ */ 2 | 3 | /* 4 | * Currently only supports console applications. 5 | */ 6 | 7 | #if defined(MSLINKER) 8 | /* requires microsoft toolkit headers and linker, and pcc-libs */ 9 | #define CPPADD { "-DWIN32", "-D_WIN32", NULL } 10 | #define DEFLIBS { "/subsystem:console", "msvcrt.lib", "libpcc.a", NULL } 11 | #else 12 | /* common cpp predefines */ 13 | #define CPPADD { "-DWIN32", "-D_WIN32", "-D__MSVCRT__", "-D__MINGW32__", NULL } 14 | 15 | /* host-dependent */ 16 | /* requires w32api-3.2.tar.gz and mingw-runtime-3.14.tar.gz */ 17 | #define CRT0 "crt2.o" 18 | #define STARTLABEL "_mainCRTStartup" 19 | #define CRT0_S "dllcrt2.o" 20 | #define STARTLABEL_S "_DllMainCRTStartup@12" 21 | #define GCRT0 "gcrt2.o" /* in _addition_ to either crt2.o or dllcrt2.o */ 22 | 23 | #define CRTBEGIN 0 /* No constructor/destructor support for now */ 24 | #define CRTEND 0 25 | #define CRTBEGIN_S 0 26 | #define CRTEND_S 0 27 | #define CRTBEGIN_T 0 /* Note: MingW cannot do -static linking */ 28 | #define CRTEND_T 0 29 | #define CRTI 0 30 | #define CRTN 0 31 | 32 | #define WIN32_LIBC "-lmsvcrt" 33 | #define MINGW_RTLIBS "-lmoldname", "-lmingwex", "-lmingw32" 34 | #define MINGW_SYSLIBS "-luser32", "-lkernel32" /* ,"-ladvapi32", "-lshell32" */ 35 | #define DEFLIBS { MINGW_RTLIBS, "-lpcc", WIN32_LIBC, MINGW_SYSLIBS, MINGW_RTLIBS, WIN32_LIBC, 0 } 36 | #define DEFPROFLIBS { MINGW_RTLIBS, "-lpcc", WIN32_LIBC, "-lgmon", MINGW_SYSLIBS, MINGW_RTLIBS, WIN32_LIBC, 0 } 37 | #define DEFCXXLIBS { "-lp++", MINGW_RTLIBS, "-lpcc", WIN32_LIBC, MINGW_SYSLIBS, MINGW_RTLIBS, WIN32_LIBC, 0 } 38 | 39 | #endif 40 | 41 | #define CPPMDADD { "-D__i386__", NULL } 42 | -------------------------------------------------------------------------------- /pcc/os/win32/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Config file for visual studio build 3 | */ 4 | #define PREPROCESSOR "%PCCDIR%\\libexec\\cpp.exe" 5 | #define COMPILER "%PCCDIR%\\libexec\\ccom.exe" 6 | 7 | #define USE_YASM 8 | 9 | #ifdef USE_YASM 10 | #define ASSEMBLER "yasm.exe" 11 | #else 12 | #define ASSEMBLER "gas.exe" 13 | #endif 14 | 15 | #ifdef USE_MSLINKER 16 | #define LINKER "link.exe /nologo" 17 | #define MSLINKER 18 | #else 19 | #define LINKER "ld.exe" 20 | #endif 21 | 22 | 23 | #define PECOFFABI 24 | 25 | #define STDINC "%PCCDIR%\\include\\" 26 | #define LIBDIR "%PCCDIR%\\lib\\" 27 | #define INCLUDEDIR STDINC 28 | #define PCCLIBDIR "%PCCDIR%\\lib\\i386-win32\\1.1.0\\lib\\" 29 | #define PCCINCDIR "%PCCDIR%\\lib\\i386-win32\\1.1.0\\include\\" 30 | 31 | #if !defined(vsnprintf) 32 | #define vsnprintf _vsnprintf 33 | #endif 34 | /* windows defines (u)uintptr_t in stddef.h, not inttypes.h */ 35 | #include 36 | #if !defined(snprintf) 37 | #define snprintf _snprintf 38 | #endif 39 | 40 | #ifndef STDERR_FILENO 41 | #define STDERR_FILENO 2 42 | #endif 43 | 44 | #define inline __inline 45 | 46 | /* #define HAVE_INTTYPES_H 1 */ 47 | #define HAVE_MEMORY_H 1 48 | /* #define HAVE_MKSTEMP 1 */ 49 | 50 | #ifndef __MSC__ 51 | #define HAVE_STDINT_H 1 52 | #endif 53 | 54 | #define HAVE_STDLIB_H 1 55 | /* #define HAVE_STRINGS_H 1 */ 56 | #define HAVE_STRING_H 1 57 | /* #define HAVE_STRLCAT 1 */ 58 | /* #define HAVE_STRLCPY 1 */ 59 | #define HAVE_SYS_STAT_H 1 60 | #define HAVE_SYS_TYPES_H 1 61 | #define HAVE_SNPRINTF 1 62 | #define HAVE_VSNPRINTF 1 63 | /* #define HAVE_UNISTD_H 1 */ 64 | /* #define HOST_BIG_ENDIAN */ 65 | #define HOST_LITTLE_ENDIAN 66 | 67 | #define PACKAGE_NAME "pcc" 68 | #define PACKAGE_STRING "pcc 1.1.0" 69 | #define PACKAGE_TARNAME "pcc" 70 | #define PACKAGE_VERSION "1.1.0" 71 | #define PCC_MAJOR 1 72 | #define PCC_MINOR 1 73 | #define PCC_MINORMINOR 0 74 | #define STDC_HEADERS 1 75 | #define TARGET_LITTLE_ENDIAN 1 76 | #define VERSSTR "pcc 1.1.0 for win32, gmcgarry@pcc.ludd.ltu.se" 77 | #define WCHAR_SIZE 2 78 | #define WCHAR_TYPE USHORT 79 | #define YYTEXT_POINTER 1 80 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | for i in pcc pcc-libs 4 | do 5 | rm -fr $i 6 | cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co $i 7 | done 8 | 9 | git status 10 | --------------------------------------------------------------------------------