diff options
Diffstat (limited to 'test')
235 files changed, 50 insertions, 15573 deletions
diff --git a/test/c/Makefile b/test/c/Makefile index 060c8fcd..1284d98f 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -10,13 +10,11 @@ LIBS=$(LIBMATH) TIME=xtime -o /dev/null -mintime 1.0 # Xavier's hack #TIME=time >/dev/null # Otherwise -BENCHS=fib integr qsort fft sha1 aes almabench lists \ +PROGS=fib integr qsort fft sha1 aes almabench lists \ binarytrees fannkuch knucleotide mandelbrot nbody \ nsieve nsievebits spectral vmach \ bisect chomp perlin -PROGS=$(BENCHS) initializers - all_s: $(PROGS:%=%.s) all: $(PROGS:%=%.compcert) @@ -26,7 +24,7 @@ all_gcc: $(PROGS:%=%.gcc) %.compcert: %.c $(CCOMP) $(CCOMP) $(CCOMPFLAGS) -o $*.compcert $*.c $(LIBS) -%.s: %.c ../../ccomp +%.s: %.c $(CCOMP) $(CCOMP) $(CCOMPFLAGS) -S $*.c %.gcc: %.c diff --git a/test/ccured_olden/COPYRIGHT b/test/ccured_olden/COPYRIGHT deleted file mode 100644 index 3a53304a..00000000 --- a/test/ccured_olden/COPYRIGHT +++ /dev/null @@ -1,23 +0,0 @@ -/* OLDEN parallel C for dynamic structures: compiler, runtime system - and benchmarks - - Copyright (C) 1994-1996 by Anne Rogers (amr@cs.princeton.edu) and - Martin Carlisle (mcc@cs.princeton.edu) - ALL RIGHTS RESERVED. - - OLDEN is distributed under the following conditions: - - You may make copies of OLDEN for your own use and modify those copies. - - All copies of OLDEN must retain our names and copyright notice. - - You may not sell OLDEN or distribute OLDEN in conjunction with a - commercial product or service without the expressed written consent of - Anne Rogers and Martin Carlisle. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. -*/ - diff --git a/test/ccured_olden/CVS/Entries b/test/ccured_olden/CVS/Entries deleted file mode 100644 index a8e10c79..00000000 --- a/test/ccured_olden/CVS/Entries +++ /dev/null @@ -1,13 +0,0 @@ -/COPYRIGHT/1.1/Mon Jun 11 21:20:00 2001// -/README/1.1/Mon Jun 11 21:20:00 2001// -D/bh//// -D/bisort//// -D/em3d//// -D/health//// -D/mst//// -D/perimeter//// -D/power//// -D/treeadd//// -D/tsp//// -D/voronoi//// -D/newbisort//// diff --git a/test/ccured_olden/CVS/Repository b/test/ccured_olden/CVS/Repository deleted file mode 100644 index d65135b7..00000000 --- a/test/ccured_olden/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden diff --git a/test/ccured_olden/CVS/Root b/test/ccured_olden/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/README b/test/ccured_olden/README deleted file mode 100644 index 48157ffa..00000000 --- a/test/ccured_olden/README +++ /dev/null @@ -1,19 +0,0 @@ -Olden v1.0 benchmark suite -January 3, 1995 - -Martin C. Carlisle - -see COPYRIGHT for copyright information - -Contains plain versions of the 10 benchmarks used in the PPoPP paper. - -KNOWN BUGS: (updated June 10, 1996) - -line 66 of health/health.c should read: - new->hosp.personnel = (int)pow(2.0, (double) (level - 1)); -instead of: - new->hosp.personnel = (int)pow(2, level - 1); - -This patch has not been applied and is not reflected in the data in the -PPoPP submission. - diff --git a/test/ccured_olden/bh/.cvsignore b/test/ccured_olden/bh/.cvsignore deleted file mode 100644 index 94c933eb..00000000 --- a/test/ccured_olden/bh/.cvsignore +++ /dev/null @@ -1,39 +0,0 @@ -*.i -*_all.c -*cil.c -*box.c -code -data.in -data.out -*.origi -*_allinfer.c -*_ppp.c -code.cil -code.box -code.wildbox - -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -changes.out -*_comb.c -*cured.c -*.optim.c -ope.m -dat.out -changes -*.browser -*optimcured*
\ No newline at end of file diff --git a/test/ccured_olden/bh/.gdbinit b/test/ccured_olden/bh/.gdbinit deleted file mode 100644 index 123e0ab7..00000000 --- a/test/ccured_olden/bh/.gdbinit +++ /dev/null @@ -1,3 +0,0 @@ -file code.exe -b main -r diff --git a/test/ccured_olden/bh/CVS/Entries b/test/ccured_olden/bh/CVS/Entries deleted file mode 100644 index acce0666..00000000 --- a/test/ccured_olden/bh/CVS/Entries +++ /dev/null @@ -1,23 +0,0 @@ -/Readme/1.1/Thu Apr 26 07:13:27 2001// -/allcfiles/1.1/Thu Oct 18 05:30:18 2001// -/code.h/1.1/Thu Apr 26 07:13:27 2001// -/data.cil.out/1.1/Wed Jun 13 16:19:10 2001// -/grav.c/1.2/Sun Apr 29 05:21:42 2001// -/input/1.1/Thu Apr 26 07:13:27 2001// -/io.c/1.4/Tue Oct 9 00:17:00 2001// -/load.c/1.3/Thu Jul 12 19:57:18 2001// -/real.h/1.1/Thu Apr 26 07:13:27 2001// -/stdinc.h/1.6/Tue Oct 9 00:17:00 2001// -/vectmath.h/1.4/Mon Jul 23 19:46:26 2001// -/data.in/1.1/Fri Nov 9 00:51:18 2001// -/data.orig.out/1.1/Mon Nov 12 08:08:28 2001// -/normalize.pl/1.2/Mon Nov 12 15:44:12 2001// -/.cvsignore/1.14/Sat Jul 27 06:13:42 2002// -/testit/1.1/Wed Dec 25 17:27:31 2002// -/defs.h/1.12/Mon Jan 6 22:43:21 2003// -/code.c/1.5/Wed Jan 8 06:10:33 2003// -/Makefile/1.11/Sat Jan 11 05:01:09 2003// -/getparam.c/1.5/Sat Jan 11 04:58:14 2003// -/trusted_bh.c/1.2/Sat Jan 11 05:01:58 2003// -/util.c/1.11/Sat Jan 11 04:59:49 2003// -D diff --git a/test/ccured_olden/bh/CVS/Repository b/test/ccured_olden/bh/CVS/Repository deleted file mode 100644 index ebfd8c04..00000000 --- a/test/ccured_olden/bh/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/bh diff --git a/test/ccured_olden/bh/CVS/Root b/test/ccured_olden/bh/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/bh/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/bh/Makefile b/test/ccured_olden/bh/Makefile deleted file mode 100644 index d7ee3f83..00000000 --- a/test/ccured_olden/bh/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -############################################################################## -# MAKEFILE: compile tree-code program. # -# # -# Copyright (c) 1993, Joshua E. Barnes, Honolulu, HI. # -# It's free because it's yours. # -############################################################################## - -# Compiler flags for development on SGI; not used on other systems. -# single version: CFLAGS = -fullwarn -woff 269,302 -prototypes -O -float -# double version: CFLAGS = -DDOUBLEPREC -fullwarn -woff 269,302 -prototypes -O - -# Standard compiler flags. Double precision is the default because not -# all available systems seem to have single-precision square root. -#sm: orig: CFLAGS = -DDOUBLEPREC -O -CFLAGS = -DDOUBLEPREC -O3 -LDFLAGS = -O3 - -# CompCert -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -CC=gcc -arch ppc # MacOS X -#CC=gcc # other systems - -CFLAGS=-O1 -Wall - -LIBS= # MacOS X - -# Build a treecode. -code.exe.compcert: code.compcert io.compcert load.compcert grav.compcert util.compcert getparam.compcert trusted_bh.compcert - $(CCOMP) $(LDFLAGS) -o code.exe.compcert code.compcert io.compcert load.compcert grav.compcert\ - util.o getparam.compcert trusted_bh.compcert $(EXTRA_LIBS) - -code.compcert: code.c defs.h code.h stdinc.h - $(CCOMP) $(CCOMPFLAGS) code.c - -io.compcert: io.c defs.h stdinc.h - $(CCOMP) $(CCOMPFLAGS) io.c - -load.compcert: load.c defs.h stdinc.h - $(CCOMP) $(CCOMPFLAGS) load.c - -grav.compcert: grav.c defs.h stdinc.h - $(CCOMP) $(CCOMPFLAGS) -grav.c - -code.exe: code.o io.o load.o grav.o util.o getparam.o trusted_bh.o - $(CC) $(LDFLAGS) -o code.exe code.o io.o load.o grav.o\ - util.o getparam.o trusted_bh.o -lm $(EXTRA_LIBS) - -code.o: code.c defs.h code.h stdinc.h - $(CC) $(CFLAGS) -c code.c - -io.o: io.c defs.h stdinc.h - $(CC) $(CFLAGS) -c io.c - -load.o: load.c defs.h stdinc.h - $(CC) $(CFLAGS) -c load.c - -grav.o: grav.c defs.h stdinc.h - $(CC) $(CFLAGS) -c grav.c - -# Utility routines etc. - -util.o: util.c stdinc.h - $(CC) $(CFLAGS) util.c - -util.compcert: util.c stdinc.h - $(CCOMP) $(CCOMPFLAGS) util.c - -# Added to help boxing -trusted_bh.o: trusted_bh.c stdinc.h - $(CC) $(CFLAGS) -c trusted_bh.c - -getparam.o: getparam.c stdinc.h - $(CC) $(CFLAGS) -c getparam.c - -trusted_bh.compcert: trusted_bh.c stdinc.h - $(CCOMP) $(CCOMPFLAGS) trusted_bh.c - -getparam.compcert: getparam.c stdinc.h - $(CCOMP) $(CCOMPFLAGS) getparam.c - -clean: - rm -f *.o *.lib *.exe *.obj *~ *cil.c *_comb.c *infer.c *cured.c *.i *cured*optim.c diff --git a/test/ccured_olden/bh/Readme b/test/ccured_olden/bh/Readme deleted file mode 100644 index 5034f519..00000000 --- a/test/ccured_olden/bh/Readme +++ /dev/null @@ -1,62 +0,0 @@ -README README README README README README README README README README - - 22 June 1993 - - This is the fourth release of the hierarchical N-body program. The -algorithm used to compute gravitational forces has asymptotic complexity of -O(N log N). This is achieved by building a tree structure to represent the -mass distribution and estimating forces by a partial recursive descent of this -tree. See "A Hierarchical O(N log N) Force Calculation Algorithm", by Joshua -Barnes and Piet Hut, Nature, 324, 446, and "Error Analysis of a Tree Code", by -Joshua Barnes and Piet Hut, Astrophysical Journal Supplement, 70, 389, for -more information. - - The code has been rewritten in ANSI C for greater portability. Prototypes -have been provided for all functions. Several functions associated with tree -construction have been simplified; the resulting code should be easier to -mantain. Force calculation has been made more accurate by incorporating a new -opening-angle criterion, and faster by adding additional pointers to the tree -structure. Quadrupole corrections for body-cell interactions are now included -as a run-time option; see "Performance Characteristics of Tree Codes", by Lars -Hernquist, Astrophysical Journal Supplement, 64, 715. - - The source files for the tree code have been bundled together for ease of -distribution. On a UNIX system, you can split this file simply by invoking -the Bourne shell on it (use the sh command). On other systems, you may have -to edit this file and split it up by hand; note that file X is delimited by -lines containing the message End of X. Once you have split this file, you can -compile it by running make on a UNIX system. On other systems, you are on -your own; take a look at the Makefile for hints. Running the program with the -default input parameters (type a <CR> to all prompts) will start a short -calculation with a few particles to test things out. - - These sources include a few files which you may find generally useful: -"stdinc.h", a standard include file with common definitions, "vectmath.h", a -set of macros for elementary vector and matrix operations, "real.h", a set of -definitions for floating-point code, "getparam.c", a simple, standardized user -interface, and "util.c", some miscellaneous utilities. These are part of a -larger collection of software for numerical experiments with gravitating -systems. - - NO WARRANTY is offered on the software supplied here -- use it at your own -risk. NO RESTRICTIONS are imposed on use and distribution of the code -- you -are free to use this software for any application, modify it in any way, use -pieces in other programs, and give it away to anyone else. You are encouraged -to extend these rights to others who receive this software from you, following -the philosophy and intentions of the Free Software Foundation. - - You are asked to include a brief acknowledgement in any scientific papers -you write using this code; I would appreciate receiving preprints or reprints -of such papers. I would also appreciate receiving reports of bugs and/or -problems encountered in porting this code to other machines. - - Have fun and stay in touch. - - Joshua E. Barnes barnes@zeno.ifa.hawaii.edu - - Institute for Astronomy (808) 956-8138 - University of Hawaii - 2680 Woodlawn Drive - Honolulu, Hawaii 96822 - -README README README README README README README README README README diff --git a/test/ccured_olden/bh/allcfiles b/test/ccured_olden/bh/allcfiles deleted file mode 100644 index 6a04d2ac..00000000 --- a/test/ccured_olden/bh/allcfiles +++ /dev/null @@ -1,7 +0,0 @@ -bhbox.c -code.c -getparam.c -grav.c -io.c -load.c -util.c diff --git a/test/ccured_olden/bh/code.c b/test/ccured_olden/bh/code.c deleted file mode 100644 index ee3c0894..00000000 --- a/test/ccured_olden/bh/code.c +++ /dev/null @@ -1,200 +0,0 @@ -/****************************************************************************/ -/* CODE.C: hierarchical N-body code. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#define global /* nada */ - -#include <stdlib.h> -#include "code.h" - -/* - * Default values for input parameters. - */ - -string defv[] = { - - /* file names for input/output */ - "in=", /* Input file with initial conditions */ - "out=", /* Output file of N-body frames */ - - /* params to control N-body integration */ - "dtime=0.03125", /* Integration time-step */ - "eps=0.025", /* Potential softening parameter */ - "theta=1.0", /* Cell subdivision tolerence */ - "usequad=false", /* If true, use quad moments */ - "rsize=4.0", /* Size of initial root cell */ - "options=", /* Various control options */ - "tstop=2.0", /* Time to stop integration */ - "dtout=0.25", /* Data output interval */ - - /* params used if no input specified to make a Plummer model */ - "nbody=1024", /* Number of particles for test run */ - "seed=123", /* Random number seed for test run */ - - NULL, -}; - -string headline = "Hierarchical N-body Code"; /* default id for run */ - -local void startrun(void); /* initialize system state */ -local void stepsystem(void); /* advance by one time-step */ -local void testdata(void); /* generate test data */ -local void pickshell(vector, real); /* pick point on shell */ - -/* - * MAIN: toplevel routine for hierarchical N-body code. - */ - -int main(int argc, string argv[]) -{ - initparam(argv, defv); /* setup parameter access */ - startrun(); /* set params, input data */ - initoutput(); /* begin system output */ - while (tnow < tstop - 1.0/(1024*freq)) /* while not past tstop */ - stepsystem(); /* advance N-body system */ - stopoutput(); /* finish up output */ - return 0; // Change this to zero when the running time is 3.8s again -} - -/* - * STARTRUN: startup hierarchical N-body code. - */ - -local void startrun(void) -{ - infile = getparam("in"); /* set I/O file names */ - outfile = getparam("out"); - freq = 1.0 / getrparam("dtime"); /* inverse timestep */ - eps = getrparam("eps"); /* softening length */ - theta = getrparam("theta"); /* force accuracy parameter */ - usequad = getbparam("usequad"); /* flag for quad moments */ - rsize = getrparam("rsize"); /* initial size of root */ - options = getparam("options"); /* and control options */ - tstop = getrparam("tstop"); /* time to stop integration */ - freqout = 1.0 / getrparam("dtout"); /* inverse output interval */ - if (! streq(infile, "")) { /* was data file given? */ - - inputdata(); /* read inital data */ - } else { /* make initial conds? */ - nbody = getiparam("nbody"); /* get nbody parameter */ - if (nbody < 1) /* check input value */ - error("startrun: nbody = %d is absurd\n", nbody); - srand((long) getiparam("seed")); /* set random generator */ - testdata(); /* make test model */ - } - nstep = 0; /* start counting steps */ - tout = tnow; /* schedule first output */ -} - -/* - * TESTDATA: generate Plummer model initial conditions for test runs, - * scaled to units such that M = -4E = G = 1 (Henon, Hegge, etc). - * See Aarseth, SJ, Henon, M, & Wielen, R (1974) Astr & Ap, 37, 183. - */ - -#define MFRAC 0.999 /* cut off 1-MFRAC of mass */ - -local void testdata(void) -{ - real rsc, vsc, r, v, x, y; - vector cmr, cmv; - bodyptr p; - - headline = "Hierarchical code: Plummer model"; - /* supply default headline */ - tnow = 0.0; /* reset elapsed model time */ - bodytab = (bodyptr) allocate(nbody * sizeof(body)); - /* alloc space for bodies */ - rsc = 3 * PI / 16; /* set length scale factor */ - vsc = rsqrt(1.0 / rsc); /* and recip. speed scale */ - CLRV(cmr); /* init cm pos, vel */ - CLRV(cmv); - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over particles */ - Type(p) = BODY; /* tag as a body */ - Mass(p) = 1.0 / nbody; /* set masses equal */ - r = 1 / rsqrt(rpow(xrandom(0.0, MFRAC), /* pick r in struct units */ - -2.0/3.0) - 1); - pickshell(Pos(p), rsc * r); /* pick scaled position */ - ADDV(cmr, cmr, Pos(p)); /* add to running sum */ - do { /* select from fn g(x) */ - x = xrandom(0.0, 1.0); /* for x in range 0:1 */ - y = xrandom(0.0, 0.1); /* max of g(x) is 0.092 */ - } while (y > x*x * rpow(1 - x*x, 3.5)); /* using von Neumann tech */ - v = rsqrt(2.0) * x/rpow(1 + r*r, 0.25); /* find v in struct units */ - pickshell(Vel(p), vsc * v); /* pick scaled velocity */ - ADDV(cmv, cmv, Vel(p)); /* add to running sum */ - } - DIVVS(cmr, cmr, (real) nbody); /* normalize cm coords */ - DIVVS(cmv, cmv, (real) nbody); - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over particles */ - SUBV(Pos(p), Pos(p), cmr); /* offset by cm coords */ - SUBV(Vel(p), Vel(p), cmv); - } -} - -/* - * PICKSHELL: pick a random point on a sphere of specified radius. - */ - -local void pickshell(vector vec, real rad) -{ - int k; - real rsq, rsc; - - do { /* pick point in NDIM-space */ - for (k = 0; k < NDIM; k++) /* loop over dimensions */ - vec[k] = xrandom(-1.0, 1.0); /* pick from unit cube */ - DOTVP(rsq, vec, vec); /* compute radius squared */ - } while (rsq > 1.0); /* reject if outside sphere */ - rsc = rad / rsqrt(rsq); /* compute scaling factor */ - MULVS(vec, vec, rsc); /* rescale to radius given */ -} - -/* - * STEPSYSTEM: advance N-body system one time-step. - */ - -local void stepsystem(void) -{ - bodyptr p; - real dt; - vector dvel, dpos; - - if (nstep == 0) { /* about to take 1st step? */ - maketree(bodytab, nbody); /* build tree structure */ - nfcalc = n2bcalc = nbccalc = 0; /* zero counters */ - for (p = bodytab; p < bodytab+nbody; p++) { - /* loop over all bodies */ - hackgrav(p, Mass(p) > 0.0); /* get force on each */ - nfcalc++; /* count force calcs */ - n2bcalc += n2bterm; /* and 2-body terms */ - nbccalc += nbcterm; /* and body-cell terms */ - } - output(); /* do initial output */ - } - dt = 1.0 / freq; /* set basic time-step */ - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all bodies */ - MULVS(dvel, Acc(p), 0.5 * dt); /* get velocity increment */ - ADDV(Vel(p), Vel(p), dvel); /* advance v by 1/2 step */ - MULVS(dpos, Vel(p), dt); /* get positon increment */ - ADDV(Pos(p), Pos(p), dpos); /* advance r by 1 step */ - } - maketree(bodytab, nbody); /* build tree structure */ - nfcalc = n2bcalc = nbccalc = 0; /* zero counters */ - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over bodies */ - hackgrav(p, Mass(p) > 0.0); /* get force on each */ - nfcalc++; /* count force calcs */ - n2bcalc += n2bterm; /* and 2-body terms */ - nbccalc += nbcterm; /* and body-cell terms */ - } - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all bodies */ - MULVS(dvel, Acc(p), 0.5 * dt); /* get velocity increment */ - ADDV(Vel(p), Vel(p), dvel); /* advance v by 1/2 step */ - } - nstep++; /* count another time step */ - tnow = tnow + dt; /* finally, advance time */ - output(); /* do major or minor output */ -} diff --git a/test/ccured_olden/bh/code.h b/test/ccured_olden/bh/code.h deleted file mode 100644 index 89b8a098..00000000 --- a/test/ccured_olden/bh/code.h +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************/ -/* CODE.H: define various global things for code.c and io.c. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "defs.h" - -global string infile; /* file name for snapshot input */ - -global string outfile; /* file name for snapshot output */ - -global real freq; /* inverse of integration timestep */ - -global real freqout; /* output frequency */ - -global real tstop; /* time to stop calculation */ - -extern string headline; /* message describing calculation */ - -global real tnow; /* current value of time */ - -global real tout; /* time of next output */ - -global int nstep; /* number of time-steps */ - -global int nfcalc; /* count force calculations */ - -global int n2bcalc; /* count body-body interactions */ - -global int nbccalc; /* count body-cell interactions */ - -global int nbody; /* number of bodies in system */ - -global bodyptr bodytab; /* points to array of bodies */ - -/* - * Global function prototypes. - */ - -void initoutput(void); /* open files for output */ -void stopoutput(void); /* close output files */ -void inputdata(void); /* read initial data file */ -void maketree(bodyptr, int); /* construct tree structure */ -void hackgrav(bodyptr, bool); /* compute force on body */ -void output(void); /* perform output operation */ - -/* - * Utility routines used in code.c and io.c. These are defined in util.c - * and getparam.c, which must be compiled with same choice of precision. - */ - -bool streq(string, string); /* test string equality */ -real xrandom(real, real); /* generate a random number */ -void initparam(string *, string *); /* initialize parameter pkg */ -string getparam(string); /* get parameter as string */ -int getiparam(string); /* get parameter as integer */ -bool getbparam(string); /* get parameter as bool */ -real getrparam(string); /* get parameter as real */ diff --git a/test/ccured_olden/bh/data.in b/test/ccured_olden/bh/data.in deleted file mode 100644 index 1901ba93..00000000 --- a/test/ccured_olden/bh/data.in +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/test/ccured_olden/bh/data.orig.out b/test/ccured_olden/bh/data.orig.out deleted file mode 100644 index 895eecb6..00000000 --- a/test/ccured_olden/bh/data.orig.out +++ /dev/null @@ -1,462 +0,0 @@ - -Hierarchical code: Plummer model - - nbody dtime eps theta usequad dtout - 1024 0.03125 0.0250 1.00 false 0.2500 - - - tnow T+U T/U nttot nbavg ncavg - 0.000 -0.2605 -0.4941 208234 85 118 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 0.0000 0.0000 - am vec 0.0040 0.0111 0.0039 - - tnow T+U T/U nttot nbavg ncavg - 0.031 -0.2605 -0.4945 211569 89 116 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 0.0000 0.0000 - am vec 0.0040 0.0111 0.0039 - - tnow T+U T/U nttot nbavg ncavg - 0.062 -0.2606 -0.4949 213299 90 117 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0111 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.094 -0.2606 -0.4954 213209 91 116 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0111 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.125 -0.2606 -0.4957 214475 90 118 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.156 -0.2606 -0.4959 212360 87 119 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.188 -0.2606 -0.4961 215638 90 120 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.219 -0.2607 -0.4962 213907 90 118 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.250 -0.2606 -0.4966 211413 88 118 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.281 -0.2607 -0.4968 212516 90 116 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.312 -0.2606 -0.4971 212043 91 115 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.344 -0.2606 -0.4974 210500 90 115 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.375 -0.2605 -0.4976 210875 90 115 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.406 -0.2605 -0.4976 211891 91 115 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.438 -0.2606 -0.4975 212886 92 115 - - cm pos 0.0000 -0.0001 0.0000 - cm vel 0.0000 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.469 -0.2606 -0.4975 214848 93 115 - - cm pos 0.0000 -0.0001 0.0000 - cm vel 0.0000 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.500 -0.2604 -0.4976 212165 90 116 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.531 -0.2605 -0.4974 212366 90 117 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg - 0.562 -0.2606 -0.4971 212423 92 115 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.594 -0.2606 -0.4969 212283 93 113 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.625 -0.2604 -0.4969 211770 93 113 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.656 -0.2604 -0.4966 213017 94 113 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.688 -0.2605 -0.4964 211250 93 113 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.719 -0.2604 -0.4964 211170 92 113 - - cm pos 0.0000 -0.0001 0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.750 -0.2604 -0.4962 210947 92 113 - - cm pos 0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.781 -0.2604 -0.4959 210270 92 112 - - cm pos 0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.812 -0.2604 -0.4957 210869 92 112 - - cm pos 0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.844 -0.2603 -0.4954 210822 93 112 - - cm pos 0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.875 -0.2602 -0.4951 212697 95 112 - - cm pos 0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.906 -0.2602 -0.4948 210581 93 112 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.938 -0.2603 -0.4943 209929 93 111 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 0.969 -0.2603 -0.4939 212661 95 112 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.000 -0.2603 -0.4935 212223 94 112 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.031 -0.2602 -0.4932 211476 92 113 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.062 -0.2601 -0.4930 212513 95 112 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.094 -0.2602 -0.4926 212473 96 111 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0002 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.125 -0.2601 -0.4924 212418 94 112 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0002 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.156 -0.2601 -0.4921 211307 94 111 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.188 -0.2601 -0.4919 212029 96 110 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.219 -0.2600 -0.4916 211871 95 111 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.250 -0.2602 -0.4912 212729 93 113 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.281 -0.2603 -0.4908 211198 91 115 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.312 -0.2603 -0.4906 213544 93 115 - - cm pos -0.0002 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.344 -0.2602 -0.4906 212351 92 114 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.375 -0.2603 -0.4903 211854 91 115 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.406 -0.2603 -0.4902 211998 91 115 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.438 -0.2604 -0.4900 210887 89 116 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.469 -0.2604 -0.4899 210486 88 117 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0001 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.500 -0.2604 -0.4897 210373 87 117 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0004 -0.0001 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.531 -0.2604 -0.4896 210691 88 117 - - cm pos -0.0002 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.562 -0.2603 -0.4895 211982 89 117 - - cm pos -0.0002 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 0.0000 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.594 -0.2602 -0.4894 213499 93 115 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 0.0000 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg - 1.625 -0.2602 -0.4892 214135 93 115 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 0.0000 - am vec 0.0040 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.656 -0.2600 -0.4891 212530 93 113 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 0.0000 - am vec 0.0040 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.688 -0.2601 -0.4889 212150 93 113 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.719 -0.2600 -0.4886 212527 94 113 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.750 -0.2599 -0.4882 214475 95 113 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.781 -0.2600 -0.4877 211398 91 114 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.812 -0.2601 -0.4874 212928 92 115 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.844 -0.2600 -0.4872 209464 86 117 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.875 -0.2600 -0.4871 207897 83 119 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.906 -0.2599 -0.4871 209291 84 119 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.938 -0.2599 -0.4870 208078 85 118 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 1.969 -0.2599 -0.4866 209032 86 117 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg - 2.000 -0.2600 -0.4864 208927 85 118 - - cm pos -0.0005 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - diff --git a/test/ccured_olden/bh/data.out b/test/ccured_olden/bh/data.out deleted file mode 100644 index 501f205e..00000000 --- a/test/ccured_olden/bh/data.out +++ /dev/null @@ -1,462 +0,0 @@ - -Hierarchical code: Plummer model - - nbody dtime eps theta usequad dtout tstop - 1024 0.03125 0.0250 1.00 false 0.2500 2.0000 - - - tnow T+U T/U nttot nbavg ncavg cputime - 0.000 -0.2605 -0.4941 208234 85 118 0.00 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0000 0.0000 - am vec 0.0040 0.0111 0.0039 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.031 -0.2605 -0.4945 211569 89 116 0.00 - - cm pos 0.0000 -0.0000 0.0000 - cm vel 0.0000 -0.0000 -0.0000 - am vec 0.0040 0.0111 0.0039 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.062 -0.2606 -0.4949 213299 90 117 0.00 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel 0.0000 -0.0001 0.0000 - am vec 0.0040 0.0111 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.094 -0.2606 -0.4954 213209 91 116 0.00 - - cm pos 0.0000 -0.0000 0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0040 0.0111 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.125 -0.2606 -0.4957 214475 90 118 0.00 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.156 -0.2606 -0.4959 212360 87 119 0.00 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.188 -0.2606 -0.4961 215638 90 120 0.00 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.219 -0.2607 -0.4962 213907 90 118 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.250 -0.2606 -0.4966 211413 88 118 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.281 -0.2607 -0.4968 212516 90 116 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0000 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.312 -0.2606 -0.4971 212043 91 115 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.344 -0.2606 -0.4974 210500 90 115 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.375 -0.2605 -0.4976 210875 90 115 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.406 -0.2605 -0.4976 211891 91 115 0.01 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel -0.0000 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.438 -0.2606 -0.4975 212886 92 115 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0000 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.469 -0.2606 -0.4975 214848 93 115 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0000 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.500 -0.2604 -0.4976 212165 90 116 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.531 -0.2605 -0.4974 212366 90 117 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0040 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.562 -0.2606 -0.4971 212423 92 115 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.594 -0.2606 -0.4969 212283 93 113 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.625 -0.2604 -0.4969 211770 93 113 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.656 -0.2604 -0.4966 213017 94 113 0.01 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.688 -0.2605 -0.4964 211250 93 113 0.02 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.719 -0.2604 -0.4964 211170 92 113 0.02 - - cm pos -0.0000 -0.0001 -0.0000 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.750 -0.2604 -0.4962 210947 92 113 0.02 - - cm pos -0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.781 -0.2604 -0.4959 210270 92 112 0.02 - - cm pos -0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.812 -0.2604 -0.4957 210869 92 112 0.02 - - cm pos -0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.844 -0.2603 -0.4954 210822 93 112 0.02 - - cm pos -0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.875 -0.2602 -0.4951 212697 95 112 0.02 - - cm pos -0.0000 -0.0002 -0.0001 - cm vel -0.0001 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.906 -0.2602 -0.4948 210581 93 112 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.938 -0.2603 -0.4943 209929 93 111 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 0.969 -0.2603 -0.4939 212661 95 112 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.000 -0.2603 -0.4935 212223 94 112 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.031 -0.2602 -0.4932 211476 92 113 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.062 -0.2601 -0.4930 212513 95 112 0.02 - - cm pos -0.0001 -0.0002 -0.0001 - cm vel -0.0002 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.094 -0.2602 -0.4926 212473 96 111 0.02 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0002 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.125 -0.2601 -0.4924 212418 94 112 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0002 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.156 -0.2601 -0.4921 211307 94 111 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0001 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.188 -0.2601 -0.4919 212029 96 110 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.219 -0.2600 -0.4916 211871 95 111 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0003 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.250 -0.2602 -0.4912 212729 93 113 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.281 -0.2603 -0.4908 211198 91 115 0.03 - - cm pos -0.0001 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.312 -0.2603 -0.4906 213544 93 115 0.03 - - cm pos -0.0002 -0.0003 -0.0001 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0039 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.344 -0.2602 -0.4906 212351 92 114 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0002 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.375 -0.2603 -0.4903 211854 91 115 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.406 -0.2603 -0.4902 211998 91 115 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.438 -0.2604 -0.4900 210887 89 116 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.469 -0.2604 -0.4899 210486 88 117 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0003 -0.0001 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.500 -0.2604 -0.4897 210373 87 117 0.03 - - cm pos -0.0002 -0.0003 -0.0002 - cm vel -0.0004 -0.0001 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.531 -0.2604 -0.4896 210691 88 117 0.03 - - cm pos -0.0002 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0001 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.562 -0.2603 -0.4895 211982 89 117 0.03 - - cm pos -0.0002 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0000 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.594 -0.2602 -0.4894 213499 93 115 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0000 - am vec 0.0040 0.0110 0.0041 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.625 -0.2602 -0.4892 214135 93 115 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0000 - am vec 0.0040 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.656 -0.2600 -0.4891 212530 93 113 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0004 -0.0002 -0.0000 - am vec 0.0040 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.688 -0.2601 -0.4889 212150 93 113 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.719 -0.2600 -0.4886 212527 94 113 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.750 -0.2599 -0.4882 214475 95 113 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.781 -0.2600 -0.4877 211398 91 114 0.04 - - cm pos -0.0003 -0.0004 -0.0002 - cm vel -0.0005 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.812 -0.2601 -0.4874 212928 92 115 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.844 -0.2600 -0.4872 209464 86 117 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.875 -0.2600 -0.4871 207897 83 119 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0002 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.906 -0.2599 -0.4871 209291 84 119 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0005 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.938 -0.2599 -0.4870 208078 85 118 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 1.969 -0.2599 -0.4866 209032 86 117 0.04 - - cm pos -0.0004 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - - tnow T+U T/U nttot nbavg ncavg cputime - 2.000 -0.2600 -0.4864 208927 85 118 0.04 - - cm pos -0.0005 -0.0004 -0.0002 - cm vel -0.0006 -0.0001 -0.0001 - am vec 0.0039 0.0110 0.0042 - diff --git a/test/ccured_olden/bh/defs.h b/test/ccured_olden/bh/defs.h deleted file mode 100644 index d8b46432..00000000 --- a/test/ccured_olden/bh/defs.h +++ /dev/null @@ -1,196 +0,0 @@ -/****************************************************************************/ -/* DEFS.H: include file for hierarchical force calculation routines. The */ -/* definitions in this file are needed for load.c and grav.c; this file */ -/* does not provide definitions for other parts of the N-body code. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "stdinc.h" -#include "real.h" -#include "vectmath.h" - -/* - * Body and cell data structures are used to represent the tree. During - * tree construction, descendent pointers are stored in the subp arrays: - * - * +-------------------------------------------------------------+ - * root --> | CELL: mass, pos, next, rcrit2, more, subp:[/,o,/,/,/,/,o,/] | - * +----------------------------------------------|---------|----+ - * | | - * +---------------------------------------------------+ | - * | | - * | +--------------------------------------+ | - * +--> | BODY: mass, pos, next, vel, acc, phi | | - * +--------------------------------------+ | - * | - * +-------------------------------------------------------------+ - * | - * | +-------------------------------------------------------------+ - * +--> | CELL: mass, pos, next, rcrit2, more, subp:[o,/,/,o,/,/,o,/] | - * +--------------------------------------------|-----|-----|----+ - * etc etc etc - * - * After the tree is complete, it is threaded to permit linear force - * calculation, using the next and more pointers. The storage used for - * the subp arrays may be reused to store quadrupole moments. - * - * +-----------------------------------------------+ - * root --> | CELL: mass, pos, next:/, rcrit2, more:o, quad | - * +---------------------------------------|-------+ - * | - * +--------------------------------------------+ - * | - * | +----------------------------------------+ - * +--> | BODY: mass, pos, next:o, vel, acc, phi | - * +-----------------------|----------------+ - * | - * +----------------------------+ - * | - * | +-----------------------------------------------+ - * +--> | CELL: mass, pos, next:/, rcrit2, more:o, quad | - * +---------------------------------------|-------+ - * etc - */ - -/* - * NODE: data common to BODY and CELL structures. - */ - -typedef struct _node { - short type; /* code for node type */ - real mass; /* total mass of node */ - vector pos; /* position of node */ - struct _node *next; /* link to next force-calc */ -} node, *nodeptr; - -#define Type(x) (((nodeptr) (x))->type) -#define Mass(x) (((nodeptr) (x))->mass) -#define Pos(x) (((nodeptr) (x))->pos) -#define Next(x) (((nodeptr) (x))->next) - -/* - * BODY: data structure used to represent particles. - */ - -#define BODY 01 /* type code for bodies */ - -typedef struct { - node bodynode; /* data common to all nodes */ - vector vel; /* velocity of body */ - vector acc; /* acceleration of body */ - real phi; /* potential at body */ -} body, *bodyptr; - - -#define Body body - -#if defined(CCURED) && !defined(NO_PERF_CHANGES) - extern bodyptr node2body(nodeptr x); -#else - // when not in box mode, or when we want to measure the original program's - // performance, use an ordinary cast - #define node2body(x) ((bodyptr)(x)) -#endif - -#define Vel(x) (((x))->vel) -#define Acc(x) (((x))->acc) -#define Phi(x) (((x))->phi) - -// Field accessor functions from nodeptr -#define VelN(x) ((node2body(x))->vel) -#define AccN(x) ((node2body(x))->acc) -#define PhiN(x) ((node2body(x))->phi) - -/* - * CELL: structure used to represent internal nodes of tree. - */ - -#define CELL 02 /* type code for cells */ - -#define NSUB (1 << NDIM) /* subcells per cell */ - -#ifndef __SAFEUNION -#define __SAFEUNION -#endif - -typedef struct { - node cellnode; /* data common to all nodes */ - real rcrit2; /* critical c-of-m radius^2 */ - nodeptr more; /* link to first descendent */ - union { /* shared storage for... */ - nodeptr subp[NSUB]; /* descendents of cell */ - matrix quad; /* quad. moment of cell */ - } __SAFEUNION stuff; -} cell, *cellptr; - -#if defined(CCURED) && !defined(NO_PERF_CHANGES) - extern cellptr node2cell(nodeptr x); -#else - #define node2cell(x) ((cellptr)(x)) -#endif - -#define Rcrit2(x) ((x)->rcrit2) -#define More(x) ((x)->more) -#define Subp(x) ((x)->stuff.subp) -#define Quad(x) ((x)->stuff.quad) - -#define Rcrit2N(x) ((node2cell(x))->rcrit2) -#define MoreN(x) ((node2cell(x))->more) -#define SubpN(x) ((node2cell(x))->stuff.subp) -#define QuadN(x) ((node2cell(x))->stuff.quad) - -/* - * Variables used in tree construction. - */ - -global cellptr root; /* pointer to root cell */ - -global real rsize; /* side-length of root cell */ - -global int cellused; /* count of cells in tree */ - -global int maxlevel; /* count of levels in tree */ - -/* - * Parameters and results for gravitational calculation. - */ - -global string options; /* various option keywords */ - -global real theta; /* accuracy parameter: 0.0 => exact */ - -global bool usequad; /* use quadrupole corrections */ - -global real eps; /* potential softening parameter */ - -global int n2bterm; /* number 2-body of terms evaluated */ - -global int nbcterm; /* num of body-cell terms evaluated */ - -/* - * Utility routines used in load.c and grav.c. These are defined in - * util.c, which must be compiled with the same choice of precision. - */ - -bool scanopt(string, string); /* find option in string */ -real cputime(void); /* return elapsed CPU time */ - -#ifdef CCURED - #pragma ccuredvararg("error", printf(1)) - #pragma ccuredvararg("eprintf", printf(1)) - #ifndef NO_PERF_CHANGES - #pragma ccuredalloc("allocate", zero, sizein(1)) - #endif -#endif -void *allocate(int); /* allocate and zero memory */ - -real distv(vector, vector); /* distance between vectors */ - -void error(string, ...); /* report error and exit */ - -void eprintf(string, ...); /* printf to error stream */ - - - diff --git a/test/ccured_olden/bh/getparam.c b/test/ccured_olden/bh/getparam.c deleted file mode 100644 index 9f3d1cf2..00000000 --- a/test/ccured_olden/bh/getparam.c +++ /dev/null @@ -1,142 +0,0 @@ -/****************************************************************************/ -/* GETPARAM.C: export version prompts user for values. Public routines: */ -/* initparam(), getparam(), getiparam(), getbparam(), getrparam(). */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "stdinc.h" -#include "real.h" -#include <string.h> -#include <stdlib.h> - -void *allocate(int); -void error(string, ...); - -local string *defaults = NULL; /* "name=value" strings */ - -/* - * INITPARAM: ignore arg vector, remember defaults. - */ - -void initparam(string *argv, string *defv) -{ - defaults = defv; -} - -/* - * GETPARAM: export version prompts user for value of name. - */ - -local int scanbind(string *, string); -local string extrvalue(string); - -string getparam(string name) -{ - int i, len; - string def; - char buf[128]; - - if (defaults == NULL) /* check initialization */ - error("getparam: called before initparam\n"); - i = scanbind(defaults, name); /* find name in defaults */ - if (i < 0) - error("getparam: %s unknown\n", name); - def = extrvalue(defaults[i]); /* extract default value */ - if (*def == NULLCHR) - fprintf(stderr, "enter %s: ", name); /* prompt user for value */ - else - fprintf(stderr, "enter %s [%s]: ", name, def); - gets(buf); /* read users response */ - len = strlen(buf); - if (len > 0) /* if user gave a value... */ - return (strcpy((string) allocate(len+1), buf)); - else /* else return default */ - return (def); -} - -/* - * GETIPARAM, ..., GETDPARAM: get int, long, bool, or double parameters. - */ - -int getiparam(string name) -{ - string val; - - for (val = ""; *val == NULLCHR; ) /* while nothing input */ - val = getparam(name); /* obtain value from user */ - return (atoi(val)); /* convert to an integer */ -} - -bool getbparam(string name) -{ - string val; - - for (val = ""; *val == NULLCHR; ) - val = getparam(name); - if (strchr("tTyY1", *val) != NULLCHR) /* is value true? */ - return (TRUE); - if (strchr("fFnN0", *val) != NULLCHR) /* is value false? */ - return (FALSE); - error("getbparam: %s=%s not bool\n", name, val); - return (FALSE); -} - -real getrparam(string name) -{ - string val; - - for (val = ""; *val == NULLCHR; ) - val = getparam(name); - return ((real) atof(val)); /* convert & return real */ -} - -/* - * SCANBIND: scan binding vector for name, return index. - */ - -local bool matchname(string, string); - -local int scanbind(string bvec[], string name) -{ - int i; - - for (i = 0; bvec[i] != NULL; i++) - if (matchname(bvec[i], name)) - return (i); - return (-1); -} - -/* - * MATCHNAME: determine if "name=value" matches "name". - */ - -local bool matchname(string bind, string name) -{ - char *bp, *np; - - bp = bind; - np = name; - while (*bp == *np) { - bp++; - np++; - } - return (*bp == '=' && *np == NULLCHR); -} - -/* - * EXTRVALUE: extract value from name=value string. - */ - -local string extrvalue(string arg) -{ - char *ap; - - ap = (char *) arg; - while (*ap != NULLCHR) - if (*ap++ == '=') - return ((string) ap); - return (NULL); -} - diff --git a/test/ccured_olden/bh/grav.c b/test/ccured_olden/bh/grav.c deleted file mode 100644 index 06009df1..00000000 --- a/test/ccured_olden/bh/grav.c +++ /dev/null @@ -1,123 +0,0 @@ -/****************************************************************************/ -/* GRAV.C: routines to compute gravity. Public routines: hackgrav(). */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "defs.h" - -local void treescan(nodeptr); /* does force calculation */ -local bool subdivp(cellptr); /* can cell be accepted? */ -local void gravsub(nodeptr); /* compute grav interaction */ - -/* - * HACKGRAV: evaluate gravitational field on body p; checks to be - * sure self-interaction was handled correctly if intree is true. - */ - -local bodyptr pskip; /* skip in force evaluation */ -local vector pos0; /* point to evaluate field */ -local real phi0; /* resulting potential */ -local vector acc0; /* resulting acceleration */ -local bool skipself; /* self-interaction skipped */ -local bool treeincest = FALSE; /* tree-incest occured */ - -void hackgrav(bodyptr p, bool intree) -{ - pskip = p; /* exclude p from f.c. */ - SETV(pos0, Pos(p)); /* set field point */ - phi0 = 0.0; /* init total potential */ - CLRV(acc0); /* and total acceleration */ - n2bterm = nbcterm = 0; /* count body & cell terms */ - skipself = FALSE; /* watch for tree-incest */ - treescan((nodeptr) root); /* scan tree from root */ - if (intree && ! skipself) { /* did tree-incest occur? */ - if (! scanopt(options, "allow-incest")) /* treat as catastrophic? */ - error("hackgrav: tree-incest detected\n"); - if (! treeincest) /* for the first time? */ - eprintf("\n[hackgrav: tree-incest detected]\n"); - treeincest = TRUE; /* don't repeat warning */ - } - Phi(p) = phi0; /* store total potential */ - SETV(Acc(p), acc0); /* and acceleration */ -} - -/* - * TREESCAN: iterative routine to do force calculation, starting - * with node q, which is typically the root cell. - */ - -local void treescan(nodeptr q) -{ - while (q != NULL) { /* while not at end of scan */ - if (Type(q) == CELL && /* is node a cell and... */ - subdivp(node2cell(q))) /* too close to accept? */ - q = MoreN(q); /* follow to next level */ - else { /* else accept this term */ - if (q == (nodeptr) pskip) /* self-interaction? */ - skipself = TRUE; /* then just skip it */ - else { /* not self-interaction */ - gravsub(q); /* so compute gravity */ - if (Type(q) == BODY) - n2bterm++; /* count body-body */ - else - nbcterm++; /* count body-cell */ - } - q = Next(q); /* follow next link */ - } - } -} - -/* - * SUBDIVP: decide if cell q is too close to accept as a single - * term. Also sets qmem, dr, and drsq for use by gravsub. - */ - -local cellptr qmem; /* data shared with gravsub */ -local vector dr; /* vector from q to pos0 */ -local real drsq; /* squared distance to pos0 */ - -local bool subdivp(cellptr q) -{ - SUBV(dr, Pos(q), pos0); /* compute displacement */ - DOTVP(drsq, dr, dr); /* and find dist squared */ - qmem = q; /* remember we know them */ - return (drsq < Rcrit2(q)); /* apply standard rule */ -} - -/* - * GRAVSUB: compute contribution of node q to gravitational field at - * point pos0, and add to running totals phi0 and acc0. - */ - -local void gravsub(nodeptr q) -{ - real drab, phii, mor3; - vector ai, quaddr; - real dr5inv, phiquad, drquaddr; - - if (q != (nodeptr) qmem) { /* cant use memorized data? */ - SUBV(dr, Pos(q), pos0); /* then compute sep. */ - DOTVP(drsq, dr, dr); /* and sep. squared */ - } - drsq += eps*eps; /* use standard softening */ - drab = rsqrt(drsq); - phii = Mass(q) / drab; - mor3 = phii / drsq; - MULVS(ai, dr, mor3); - phi0 -= phii; /* add to total grav. pot. */ - ADDV(acc0, acc0, ai); /* ... and to total accel. */ - if (usequad && Type(q) == CELL) { /* if cell, add quad term */ - dr5inv = 1.0/(drsq * drsq * drab); /* form dr^-5 */ - MULMV(quaddr, QuadN(q), dr); /* form Q * dr */ - DOTVP(drquaddr, dr, quaddr); /* form dr * Q * dr */ - phiquad = -0.5 * dr5inv * drquaddr; /* get quad. part of phi */ - phi0 = phi0 + phiquad; /* increment potential */ - phiquad = 5.0 * phiquad / drsq; /* save for acceleration */ - MULVS(ai, dr, phiquad); /* components of acc. */ - SUBV(acc0, acc0, ai); /* increment */ - MULVS(quaddr, quaddr, dr5inv); - SUBV(acc0, acc0, quaddr); /* acceleration */ - } -} diff --git a/test/ccured_olden/bh/input b/test/ccured_olden/bh/input deleted file mode 100644 index a72ad2d0..00000000 --- a/test/ccured_olden/bh/input +++ /dev/null @@ -1,12 +0,0 @@ - -16384 -123 - -0.025 -0.05 -1.0 -2.0 -5.0 -0.075 -0.25 -1 diff --git a/test/ccured_olden/bh/io.c b/test/ccured_olden/bh/io.c deleted file mode 100644 index cf2dbb9a..00000000 --- a/test/ccured_olden/bh/io.c +++ /dev/null @@ -1,252 +0,0 @@ -/****************************************************************************/ -/* IO.C: I/O routines for export version of hierarchical N-body code. */ -/* Public routines: inputdata(), initoutput(), stopoutput(), output(). */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "code.h" - -local void diagnostics(void); -local void in_int(stream, int *); -local void in_real(stream, real *); -local void in_vector(stream, vector); -local void out_int(stream, int); -local void out_real(stream, real); -local void out_vector(stream, vector); -local void printvec(string, vector); - -/* - * INPUTDATA: read initial conditions from input file. - */ - -void inputdata(void) -{ - stream instr; - permanent char headbuf[128]; - int ndim; - bodyptr p; - - instr = fopen(infile, "r"); /* open input stream */ - if (instr == NULL) - error("inputdata: cannot find file %s\n", infile); - sprintf(headbuf, "Hierarchical code: input file %s", infile); - headline = headbuf; - in_int(instr, &nbody); - if (nbody < 1) - error("inputdata: nbody = %d is absurd\n", nbody); - in_int(instr, &ndim); - if (ndim != NDIM) - error("inputdata: ndim = %d is absurd\n", ndim); - in_real(instr, &tnow); - bodytab = (bodyptr) allocate(nbody * sizeof(body)); - for (p = bodytab; p < bodytab+nbody; p++) /* loop over new bodies */ - Type(p) = BODY; /* init body type */ - for (p = bodytab; p < bodytab+nbody; p++) - in_real(instr, &Mass(p)); - for (p = bodytab; p < bodytab+nbody; p++) - in_vector(instr, Pos(p)); - for (p = bodytab; p < bodytab+nbody; p++) - in_vector(instr, Vel(p)); - fclose(instr); /* close input stream */ -} - -/* - * INITOUTPUT: initialize output routines. - */ - -local stream outstr; /* output stream pointer */ - -void initoutput(void) -{ - printf("\n%s\n\n", headline); /* print headline, params */ - printf("%10s%10s%10s%10s%10s%10s%10s\n", "nbody", "dtime", "eps", - "theta", "usequad", "dtout", "tstop"); - printf("%10d%10.5f%10.4f%10.2f%10s%10.4f%10.4f\n\n", nbody, 1/freq, eps, - theta, usequad ? "true" : "false", 1/freqout, tstop); - if (*options != NULLCHR) /* print options, if any */ - printf("\tOptions: %s\n\n", options); - printf("\n"); - if (*outfile != NULLCHR) { /* output file specified? */ - outstr = fopen(outfile, "w"); /* setup output stream */ - if (outstr == NULL) - error("initoutput: cannot open file %s\n", outfile); - } else - outstr = NULL; /* turn off data output */ -} - -/* - * STOPOUTPUT: finish up after a run. - */ - -void stopoutput(void) -{ - if (outstr != NULL) - fclose(outstr); -} - -/* - * Counters and accumulators for output routines. - */ - -local real mtot; /* total mass of N-body system */ -local real etot[3]; /* binding, kinetic, potential energy */ -local matrix keten; /* kinetic energy tensor */ -local matrix peten; /* potential energy tensor */ -local vector cmphase[2]; /* center of mass coordinates */ -local vector amvec; /* angular momentum vector */ - -/* - * OUTPUT: compute diagnostics and output data. - */ - -void output(void) -{ - int nttot, nbavg, ncavg; - bodyptr p; - - diagnostics(); /* compute std diagnostics */ - nttot = n2bcalc + nbccalc; - nbavg = (int) ((real) n2bcalc / (real) nbody); - ncavg = (int) ((real) nbccalc / (real) nbody); - printf("%10s%10s%10s%10s%10s%10s%10s\n", "tnow", "T+U", - "T/U", "nttot", "nbavg", "ncavg", "cputime"); - printf("%10.3f%10.4f%10.4f%10d%10d%10d%10.2f\n\n", tnow, etot[0], - etot[1]/etot[2], nttot, nbavg, ncavg, cputime()); - if (scanopt(options, "tree-report")) { /* report on tree structure */ - printf("\t %20s%20s%20s\n", "rsize", "cellused", "maxlevel"); - printf("\t %20.2f%20d%20d\n\n", rsize, cellused, maxlevel); - } - printvec("cm pos", cmphase[0]); - printvec("cm vel", cmphase[1]); - printvec("am vec", amvec); - printf("\n"); - if (outstr != NULL && /* output stream open and */ - (tout - 0.01 / freq) <= tnow) { /* ...time for next output? */ - out_int(outstr, nbody); /* write particle data */ - out_int(outstr, NDIM); - out_real(outstr, tnow); - for (p = bodytab; p < bodytab+nbody; p++) - out_real(outstr, Mass(p)); - for (p = bodytab; p < bodytab+nbody; p++) - out_vector(outstr, Pos(p)); - for (p = bodytab; p < bodytab+nbody; p++) - out_vector(outstr, Vel(p)); - fflush(outstr); /* drain output buffer */ - printf("\tParticle data written to file %s\n\n", outfile); - tout += 1 / freqout; /* schedule next data out */ - } -} - -/* - * DIAGNOSTICS: compute various dynamical diagnostics. - */ - -local void diagnostics(void) -{ - register bodyptr p; - real velsq; - vector tmpv; - matrix tmpt; - - mtot = 0.0; /* zero total mass */ - etot[1] = etot[2] = 0.0; /* zero total KE and PE */ - CLRM(keten); /* zero ke tensor */ - CLRM(peten); /* zero pe tensor */ - CLRV(cmphase[0]); /* zero c. of m. position */ - CLRV(cmphase[1]); /* zero c. of m. velocity */ - CLRV(amvec); /* zero am vector */ - for (p = bodytab; p < bodytab+nbody; p++) { /* loop over all particles */ - mtot += Mass(p); /* sum particle masses */ - DOTVP(velsq, Vel(p), Vel(p)); /* square vel vector */ - etot[1] += 0.5 * Mass(p) * velsq; /* sum current KE */ - etot[2] += 0.5 * Mass(p) * Phi(p); /* and current PE */ - MULVS(tmpv, Vel(p), 0.5 * Mass(p)); /* sum 0.5 m v_i v_j */ - OUTVP(tmpt, tmpv, Vel(p)); - ADDM(keten, keten, tmpt); - MULVS(tmpv, Pos(p), Mass(p)); /* sum m r_i a_j */ - OUTVP(tmpt, tmpv, Acc(p)); - ADDM(peten, peten, tmpt); - MULVS(tmpv, Pos(p), Mass(p)); /* sum cm position */ - ADDV(cmphase[0], cmphase[0], tmpv); - MULVS(tmpv, Vel(p), Mass(p)); /* sum cm momentum */ - ADDV(cmphase[1], cmphase[1], tmpv); - CROSSVP(tmpv, Pos(p), Vel(p)); /* sum angular momentum */ - MULVS(tmpv, tmpv, Mass(p)); - ADDV(amvec, amvec, tmpv); - } - etot[0] = etot[1] + etot[2]; /* sum KE and PE */ - DIVVS(cmphase[0], cmphase[0], mtot); /* normalize cm coords */ - DIVVS(cmphase[1], cmphase[1], mtot); -} - -/* - * Low-level input and output operations. - */ - -local void in_int(stream str, int *iptr) -{ -#ifdef CCURED - if((resetScanfCount(), - *iptr = ccured_fscanf_int(str, "%d"), - getScanfCount()) != 1) - error("in_int: input conversion error\n"); -#else - if (fscanf(str, "%d", iptr) != 1) - error("in_int: input conversion error\n"); -#endif -} - -local void in_real(stream str, real *rptr) -{ - double tmp; - -#ifdef CCURED - if((resetScanfCount(), - tmp = ccured_fscanf_double(str, "%lf"), - getScanfCount()) != 1) -#else - if (fscanf(str, "%lf", &tmp) != 1) -#endif - error("in_real: input conversion error\n"); - *rptr = tmp; -} - -local void in_vector(stream str, vector vec) -{ - double tmpx, tmpy, tmpz; -#ifdef CCURED - if((resetScanfCount(), - tmpx = ccured_fscanf_double(str, "%lf"), - tmpx = ccured_fscanf_double(str, "%lf"), - tmpx = ccured_fscanf_double(str, "%lf"), - getScanfCount()) != 3) -#else - if (fscanf(str, "%lf%lf%lf", &tmpx, &tmpy, &tmpz) != 3) -#endif - error("in_vector: input conversion error\n"); - - vec[0] = tmpx; vec[1] = tmpy; vec[2] = tmpz; -} - -local void out_int(stream str, int ival) -{ - fprintf(str, " %d\n", ival); -} - -local void out_real(stream str, real rval) -{ - fprintf(str, " %21.14E\n", rval); -} - -local void out_vector(stream str, vector vec) -{ - fprintf(str, " %21.14E %21.14E %21.14E\n", vec[0], vec[1], vec[2]); -} - -local void printvec(string name, vector vec) -{ - printf(" %10s%10.4f%10.4f%10.4f\n", - name, vec[0], vec[1], vec[2]); -} diff --git a/test/ccured_olden/bh/load.c b/test/ccured_olden/bh/load.c deleted file mode 100644 index ef1155fb..00000000 --- a/test/ccured_olden/bh/load.c +++ /dev/null @@ -1,287 +0,0 @@ -/****************************************************************************/ -/* LOAD.C: routines to create tree. Public routines: maketree(). */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "defs.h" - -local void newtree(void); /* flush existing tree */ -local cellptr makecell(void); /* create an empty cell */ -local void expandbox(bodyptr, int); /* set size of root cell */ -local void loadbody(bodyptr); /* load body into tree */ -local int subindex(bodyptr, cellptr); /* compute subcell index */ -local void hackcofm(cellptr, real); /* find centers of mass */ -local void setrcrit(cellptr, vector, real); /* set cell's crit. radius */ -local void threadtree(nodeptr, nodeptr); /* set next and more links */ -local void hackquad(cellptr); /* compute quad moments */ - -/* - * MAKETREE: initialize tree structure for hierarchical force calculation - * from body array btab, which contains nbody bodies. - */ - -local bool bh86, sw93; /* use alternate criteria */ - -void maketree(bodyptr btab, int nbody) -{ - bodyptr p; - - newtree(); /* flush existing tree, etc */ - root = makecell(); /* allocate the root cell */ - CLRV(Pos(root)); /* initialize the midpoint */ - expandbox(btab, nbody); /* and expand cell to fit */ - maxlevel = 0; /* init count of levels */ - for (p = btab; p < btab+nbody; p++) /* loop over bodies... */ - if (Mass(p) != 0.0) /* exclude test particles */ - loadbody(p); /* and insert into tree */ - bh86 = scanopt(options, "bh86"); /* set flags for alternate */ - sw93 = scanopt(options, "sw93"); /* ...cell opening criteria */ - if (bh86 && sw93) /* can't have both at once */ - error("maketree: options bh86 and sw93 are incompatible\n"); - hackcofm(root, rsize); /* find c-of-m coordinates */ - threadtree((nodeptr) root, NULL); /* add Next and More links */ - if (usequad) /* including quad moments? */ - hackquad(root); /* assign Quad moments */ -} - -/* - * NEWTREE: reclaim cells in tree, prepare to build new one. - */ - -local nodeptr freecell = NULL; /* list of free cells */ - -local void newtree(void) -{ - permanent bool firstcall = TRUE; - nodeptr p; - - if (! firstcall) { /* tree data to reclaim? */ - p = (nodeptr) root; /* start with the root */ - while (p != NULL) /* loop scanning tree */ - if (Type(p) == CELL) { /* found cell to free? */ - Next(p) = freecell; /* link to front of */ - freecell = p; /* ...existing list */ - p = MoreN(p); /* scan down tree */ - } else /* skip over bodies */ - p = Next(p); /* go on to next */ - } else /* first time through */ - firstcall = FALSE; /* so just note it */ - root = NULL; /* flush existing tree */ - cellused = 0; /* reset cell count */ -} - -/* - * MAKECELL: return pointer to free cell. - */ - -local cellptr makecell(void) -{ - cellptr c; - int i; - - if (freecell == NULL) { /* no free cells left? */ - c = (cellptr) allocate(sizeof(cell)); /* allocate a new one */ - #ifndef NO_PERF_CHANGES - Type(c) = CELL; /* initialize cell type */ - #endif - } else { /* use existing free cell */ - Type(freecell) = CELL; /* initialize cell type */ - c = node2cell (freecell); /* take one on front */ - freecell = Next(c); /* go on to next one */ - } - #ifdef NO_PERF_CHANGES - Type(c) = CELL; /* initialize cell type */ - #endif - for (i = 0; i < NSUB; i++) /* loop over subcells */ - Subp(c)[i] = NULL; /* and empty each one */ - cellused++; /* count one more cell */ - return (c); -} - -/* - * EXPANDBOX: find range of coordinate values (with respect to root) - * and expand root cell to fit. The size is doubled at each step to - * take advantage of exact representation of powers of two. - */ - -local void expandbox(bodyptr btab, int nbody) -{ - real xyzmax; - bodyptr p; - int k; - - xyzmax = 0.0; - for (p = btab; p < btab+nbody; p++) - for (k = 0; k < NDIM; k++) - xyzmax = MAX(xyzmax, rabs(Pos(p)[k] - Pos(root)[k])); - while (rsize < 2 * xyzmax) - rsize = 2 * rsize; -} - -/* - * LOADBODY: descend tree and insert body p in appropriate place. - */ - -local void loadbody(bodyptr p) -{ - cellptr q, c; - int qind, lev, k; - real qsize; - - q = root; /* start with tree root */ - qind = subindex(p, q); /* get index of subcell */ - qsize = rsize; /* keep track of cell size */ - lev = 0; /* count levels descended */ - while (Subp(q)[qind] != NULL) { /* loop descending tree */ - if (Type(Subp(q)[qind]) == BODY) { /* reached a "leaf"? */ - c = makecell(); /* allocate new cell */ - for (k = 0; k < NDIM; k++) /* initialize midpoint */ - Pos(c)[k] = Pos(q)[k] + /* offset from parent */ - (Pos(p)[k] < Pos(q)[k] ? - qsize : qsize) / 4; - Subp(c)[subindex(node2body(Subp(q)[qind]), c)] = Subp(q)[qind]; - /* put body in cell */ - Subp(q)[qind] = (nodeptr) c; /* link cell in tree */ - } - q = node2cell(Subp(q)[qind]); /* advance to next level */ - qind = subindex(p, q); /* get index to examine */ - qsize = qsize / 2; /* shrink current cell */ - lev++; /* count another level */ - } - Subp(q)[qind] = (nodeptr) p; /* found place, store p */ - maxlevel = MAX(maxlevel, lev); /* remember maximum level */ -} - -/* - * SUBINDEX: compute subcell index for body p in cell q. - */ - -local int subindex(bodyptr p, cellptr q) -{ - int ind, k; - - ind = 0; /* accumulate subcell index */ - for (k = 0; k < NDIM; k++) /* loop over dimensions */ - if (Pos(q)[k] <= Pos(p)[k]) /* if beyond midpoint */ - ind += NSUB >> (k + 1); /* skip over subcells */ - return (ind); -} - -/* - * HACKCOFM: descend tree finding center-of-mass coordinates and - * setting critical cell radii. - */ - -local void hackcofm(cellptr p, real psize) -{ - vector cmpos, tmpv; - int i, k; - nodeptr q; - - Mass(p) = 0.0; /* init total mass... */ - CLRV(cmpos); /* and center of mass */ - for (i = 0; i < NSUB; i++) /* loop over subnodes */ - if ((q = Subp(p)[i]) != NULL) { /* does subnode exist? */ - if (Type(q) == CELL) /* and is it a cell? */ - hackcofm(node2cell(q), psize/2); /* find subcell cm */ - Mass(p) += Mass(q); /* sum total mass */ - MULVS(tmpv, Pos(q), Mass(q)); /* weight pos by mass */ - ADDV(cmpos, cmpos, tmpv); /* sum c-of-m position */ - } - DIVVS(cmpos, cmpos, Mass(p)); /* rescale cms position */ - for (k = 0; k < NDIM; k++) /* check tree structure... */ - if (cmpos[k] < Pos(p)[k] - psize/2 || /* if out of bounds */ - Pos(p)[k] + psize/2 <= cmpos[k]) /* in either direction */ - error("hackcofm: tree structure error\n"); - setrcrit(p, cmpos, psize); /* set critical radius */ - SETV(Pos(p), cmpos); /* and center-of-mass pos */ -} - -/* - * SETRCRIT: assign critical radius for cell p, using center-of-mass - * position cmpos and cell size psize. - */ - -local void setrcrit(cellptr p, vector cmpos, real psize) -{ - real rc, bmax2, dmin; - int k; - - if (theta == 0.0) /* exact force calculation? */ - rc = 2 * rsize; /* always open cells */ - else if (bh86) /* use old BH criterion? */ - rc = psize / theta; /* using size of cell */ - else if (sw93) { /* use S&W's criterion? */ - bmax2 = 0.0; /* compute max distance^2 */ - for (k = 0; k < NDIM; k++) { /* loop over dimensions */ - dmin = cmpos[k] - (Pos(p)[k] - psize/2); - /* dist from 1st corner */ - bmax2 += rsqr(MAX(dmin, psize - dmin)); - /* sum max distance^2 */ - } - rc = rsqrt(bmax2) / theta; /* using max dist from cm */ - } else { /* use new criterion? */ - rc = psize / theta + distv(cmpos, Pos(p)); - /* use size plus offset */ - } - Rcrit2(p) = rsqr(rc); /* store square of radius */ -} - -/* - * THREADTREE: do a recursive treewalk starting from node p, - * with next stop n, installing Next and More links. - */ - -local void threadtree(nodeptr p, nodeptr n) -{ - int ndesc, i; - nodeptr desc[NSUB+1]; - - Next(p) = n; /* link to next node */ - if (Type(p) == CELL) { /* any children to thread? */ - ndesc = 0; /* count extant children */ - for (i = 0; i < NSUB; i++) /* loop over subnodes */ - if (SubpN(p)[i] != NULL) /* found a live one? */ - desc[ndesc++] = SubpN(p)[i]; /* store in table */ - MoreN(p) = desc[0]; /* link to first child */ - desc[ndesc] = n; /* end table with next */ - for (i = 0; i < ndesc; i++) /* loop over children */ - threadtree(desc[i], desc[i+1]); /* thread each w/ next */ - } -} - -/* - * HACKQUAD: descend tree, evaluating quadrupole moments. Note that this - * routine is coded so that the Subp() and Quad() components of a cell can - * share the same memory locations. - */ - -local void hackquad(cellptr p) -{ - int i; - nodeptr psub[NSUB], q; - vector dr; - real drsq; - matrix drdr, Idrsq, tmpm; - - for (i = 0; i < NSUB; i++) /* loop over subnodes */ - psub[i] = Subp(p)[i]; /* copy each to safety */ - CLRM(Quad(p)); /* init quadrupole moment */ - for (i = 0; i < NSUB; i++) /* loop over subnodes */ - if ((q = psub[i]) != NULL) { /* does subnode exist? */ - if (Type(q) == CELL) /* and is it a call? */ - hackquad(node2cell(q)); /* process it first */ - SUBV(dr, Pos(q), Pos(p)); /* displacement vect. */ - OUTVP(drdr, dr, dr); /* outer prod. of dr */ - DOTVP(drsq, dr, dr); /* dot prod. dr * dr */ - SETMI(Idrsq); /* init unit matrix */ - MULMS(Idrsq, Idrsq, drsq); /* scale by dr * dr */ - MULMS(tmpm, drdr, 3.0); /* scale drdr by 3 */ - SUBM(tmpm, tmpm, Idrsq); /* form quad. moment */ - MULMS(tmpm, tmpm, Mass(q)); /* from cm of subnode */ - if (Type(q) == CELL) /* if subnode is cell */ - ADDM(tmpm, tmpm, QuadN(q)); /* add its moment */ - ADDM(Quad(p), Quad(p), tmpm); /* add to qm of cell */ - } -} diff --git a/test/ccured_olden/bh/normalize.pl b/test/ccured_olden/bh/normalize.pl deleted file mode 100755 index 102d372f..00000000 --- a/test/ccured_olden/bh/normalize.pl +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/perl -w -# strip wallclock times from output so we can compare - -while ($line = <STDIN>) { - # I don't know if it's a problem, but we seem to get some difference - # about whether the 0's are positive or negative.. so let's change - # all occurrances of "-0.0000" to simply " 0.0000" - $line =~ s/-0\.0000/ 0.0000/g; - - ($firstSix) = ($line =~ /^(\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+\S+$/); - if ($firstSix) { - # only output the first 6 columns - print ("$firstSix\n"); - } - else { - # no match; print whole line - print ($line); - } -} diff --git a/test/ccured_olden/bh/real.h b/test/ccured_olden/bh/real.h deleted file mode 100644 index 75e58d69..00000000 --- a/test/ccured_olden/bh/real.h +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************/ -/* REAL.H: include file to support compile-time specification of precision */ -/* in floating-point calculations. If the DOUBLEPREC symbol is defined to */ -/* the preprocessor, calculations are done in double precision; otherwise, */ -/* they may be done in single precision. */ -/* */ -/* Rationale: ANSI C enables programmers to write single-precision code, */ -/* but does not make it easy to change the precision of code at compile */ -/* time, since different functions names are used for floating and double */ -/* calculations. This package introduces the keyword "real", which may be */ -/* either float or double, and defines functions which compute with */ -/* real-valued numbers. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -/* - * REAL, REALPTR: real-valued number, and pointer to same. - */ - -#ifndef DOUBLEPREC - -typedef float real, *realptr; - -#else - -typedef double real, *realptr; - -#endif - -/* - * RPROC: pointer to a real-valued function. This prototype does - * not specify the types of any arguments. - */ - -typedef real (*rproc)(); - -/* - * Include math.h to get prototypes for standard C math functions. - */ - -#include <math.h> - -/* - * Real-valued library functions. Most of these are actually supplied - * by the standard C libraries. - */ - -#ifndef DOUBLEPREC - -# define rsqrt sqrtf -# define rsqr fsqr -# define rsin sinf -# define rcos cosf -# define rtan tanf -# define rasin asinf -# define racos acosf -# define ratan atanf -# define ratan2 atan2f -# define rlog logf -# define rexp expf -# define rlog10 log10f -# define rsinh sinhf -# define rcosh coshf -# define rtanh tanhf -# define rpow powf -# define rabs fabsf -# define rfloor floorf -# define rceil ceilf - -/* - * These functions are not part of the standard C libraries. - */ - -float fsqr(float); /* square function */ - -#else - -# define rsqrt sqrt -# define rsqr sqr -# define rsin sin -# define rcos cos -# define rtan tan -# define rasin asin -# define racos acos -# define ratan atan -# define ratan2 atan2 -# define rlog log -# define rexp exp -# define rlog10 log10 -# define rsinh sinh -# define rcosh cosh -# define rtanh tanh -# define rpow pow -# define rabs fabs -# define rfloor floor -# define rceil ceil - -/* - * These functions are not part of the standard C libraries. - */ - -double sqr(double); /* square function */ - -#endif diff --git a/test/ccured_olden/bh/stdinc.h b/test/ccured_olden/bh/stdinc.h deleted file mode 100644 index 7d0d99f4..00000000 --- a/test/ccured_olden/bh/stdinc.h +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************/ -/* STDINC.H: standard include file for C programs. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -/* - * If not already loaded, include stdio.h. - */ - -#ifndef FILE -# include <stdio.h> -#endif - -/* - * STREAM: a tasteful replacement for FILE *. - */ - -typedef FILE *stream; - -/* - * NULL: denotes a pointer to nothing. - */ - -#ifndef NULL -# define NULL 0 -#endif - -/* - * GLOBAL: make something global when declared at file level; a workaround - * for the Strict-Ref/Def-initialization model in ANSI C. Predefine with - * something innocuous (like a comment) to actually allocate the data. - */ - -#ifndef global -# define global extern -#endif - -/* - * LOCAL: make something local when declared at file level. - */ - -#define local static - -/* - * PERMANENT: make data declared within a function static. - */ - -#define permanent static - -/* - * BOOL, TRUE and FALSE: standard names for logical values. - */ - -#ifndef TRUE - typedef short int bool; -# define FALSE 0 -# define TRUE 1 -#endif - -/* - * STRING: for null-terminated character strings. - */ - -typedef char *string; -// sm: this isn't a performance change, it's a boxing crankiness change -#define NULLCHR 0 - -/* - * PROC, IPROC: pointers to procedures and integer-valued functions. - */ - -typedef void (*proc)(); -typedef int (*iproc)(); - -/* - * PI, etc. -- mathematical constants - */ - -#define PI 3.14159265358979323846 -#define TWO_PI 6.28318530717958647693 -#define FOUR_PI 12.56637061435917295385 -#define HALF_PI 1.57079632679489661923 -#define FRTHRD_PI 4.18879020478639098462 - -/* - * ABS: returns the absolute value of its argument - * MAX: returns the argument with the highest value - * MIN: returns the argument with the lowest value - */ - -#define ABS(x) (((x) < 0) ? -(x) : (x)) -#define MAX(x,y) (((x) > (y)) ? (x) : (y)) -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) - - diff --git a/test/ccured_olden/bh/t.out b/test/ccured_olden/bh/t.out deleted file mode 100644 index fb9d37d0..00000000 --- a/test/ccured_olden/bh/t.out +++ /dev/null @@ -1,462 +0,0 @@ - -Hierarchical code: Plummer model - - nbody nbody dtime dtime eps eps theta - 1024 0.03125 0.0250 1.00 false 0.0000 0.0000 - - - tnow tnow T+U T+U T/U T/U nttot - 0.000 -0.2605 -0.4941 208234 85 118 0.00 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 0.0000 0.0000 - am vec389878422291490397703532363838372957298630836310583829481040641106834769576818099195699704101879631937750115697603016463285311330468738817905192360225013760.0000-20133801167155037325873435901952.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.031 -0.2605 -0.4945 211569 89 116 0.00 - - cm pos48767523418596704838523946240732817085722217120112445882955090940174783491954759580198817590747865525311087993955204647833281515592585841124673085889618013847552.0000 -0.0000 -0.0000 - cm vel 0.0000 -0.0000 0.0000 - am vec1559236002703774781021278153871856315038382557752792736683869239689689036392574782890254419095632625220214596570955325121650716821745262456633791107947124940398935007346099179645105137569424172018554827397930584451172298405685470573741803483135862466270638747854944830385951648776192.0000-2440213101955252164764871308604279706618905144693668439643070676519663768507696241138708085832026275121811611967136537777542436519701974614016.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.062 -0.2606 -0.4949 213299 90 117 0.01 - - cm pos 0.0000 -0.0000 0.0000 - cm vel 0.0000-59895636067774350999802060694796748793832479178531276624501570931901147191978903998797094450874790314219459403379011595168279797604476932033300509092028858118249159129140068208362592551338686730024901419420884197145543791729844646848781005668704382099371294815839075222644724858880.0000-34304238178392950207535507133362209821902207889607483682089075151755707595496927664474092813783398015223065446303850270623229965194082751029829057245842250731094016.0000 - am vec -0.0000 0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.094 -0.2606 -0.4954 213209 91 116 0.01 - - cm pos993351373657076610062312278610554488534848731779782051627008.0000 0.0000-1118429463701675004166438727081989400588012830642169445393367040.0000 - cm vel -0.00001585488814076009121115235303854341157810423314372413222796102290009989368447283916006261266276278410773098926643004648243979996411223785702280162904634372242876872108434991304556939983997976894184226482289262496438803898943600119361274014595750417965118622564688757121215375186329600.000019081946387294468538983897080928707648685678081325571021978053292334133644518624518107413086208.0000 - am vec 0.0000-1052177637002965011136512.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.125 -0.2606 -0.4957 214475 90 118 0.01 - - cm pos -0.0000 0.0000-2302699907111971357846485514152419491468807814108223906017032377374227981869015717886039696953247825910868765310976.0000 - cm vel-15507023057431145584565206457665247866817949289667375154357635978154825289910164352381842258913727693829009709173430125334544217761458477764531171623672700685829938676620090702262248564363444092928.00001229858773826100404973380226814223889095307742350714935231516126060487709192395267739090579310853010481524182411640591646460762296357852990674110125002654917720972780950718889540664250010801546101240516252270592.0000 -0.0000 - am vec 0.0000 0.0022346444089834345117428848079358572499482380273334106571722441585638578168266752.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.156 -0.2606 -0.4959 212360 87 119 0.01 - - cm pos315921480765813379089838780091228970007395801379080371735261734862731027216739443148219556090994157732966814789913461059703725772528759757672071285717336064.0000-141259921440297382698655734668343831625855342291566246901055488.000082593600281560438693094027403777947973968116005409601641297845784918959006160639746528136088554574683678221271040.0000 - cm vel-4633822142057183858197369124544939560116510065121526501724042717035591477898487686152006247597188881958265726378706767535675305089429388411932175731349037063598448888583815168.0000 0.0000 0.0000 - am vec-3986756325765554751178454067643019324664159843216872557177762016988286941764021137382434923953830640315188084610358347806277632.0000-473363046102399837125588658668705710424574587720697404562895807652025236969343698054745390760567196189116864184986178458052959250756111857922780635472048854457811495568474457760813153893501852178505007104.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.188 -0.2606 -0.4961 215638 90 120 0.01 - - cm pos 0.0000 0.0000 0.0000 - cm vel 0.0000 0.0000-715402636198797069701822383327363708052875939146530282568918901271078556048028349820618460494773931288880317520285883627978755879496318976.0000 - am vec-13240639590929336102736471851418567661077666965175740458314592350710026001932396745522968121539503492339335306307686658086998950117663248149989180110225302093824.0000-4794368498948739564077828211221176487838842148215254315752251028576322570107431802779970902357249241757358193089742748237257425705341825318912.000015181075527895958806204102198713781288132931207305370313588684089996542314275071087747648185925542104706401467105280.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.219 -0.2607 -0.4962 213907 90 118 0.02 - - cm pos358304390221261030736494761262053873660818104605297471591777894910417593068265034855970239229512879832172748484651053980740868777455823682265763784091719812371261401648209163827194656525896630860429610269318442939702758948732928.0000353895558253845751255480850176210835386783235723651047855262247300602546428580449972907194718561432416957328592586525713713543738288710263101372734729893544445334077064984994004331842447814794113414869286912.0000 -0.0000 - cm vel 0.000051478538076260147609324661887119700695360463938271445206883256722393008705007960879990682351577196189942401520994524698703970322516498232387577598885819083662497103847677801529344.0000 -0.0000 - am vec-2623136701653195585794141396966373988766431089320327325512851627951458911761685020848908852791993066747540922418249024231102800628933611617991255288583884211595261667627200034514219164331431632516633984209102807608072009350581701268326711698539104549017223168.0000 0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.250 -0.2606 -0.4966 211413 88 118 0.02 - - cm pos32715052170377176594144725452710740791518547863861068996544730670845835402420285664334223583903115815470293942793507050350314662384000024692879342744314576896.0000 -0.0000-1559078566300162717897624445844426298177825521814863628001995701650865276586616064838724715736735303976513235205622778647748834406008785464562399987654831628091392.0000 - cm vel -0.0000222211318481829860678065401797560246642410464069412484897981019091358610186742724957661876450484048016953147300859823541994042469704025130967227963711523127296.0000 -0.0000 - am vec-7173881670514734427194339338834689155953107117676251548042953916401736462513284053275335345910655176557449450234347893935181468515192285319928422038080816945336365875200.0000 0.0000-1222427404997770496.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.281 -0.2607 -0.4968 212516 90 116 0.02 - - cm pos-190029402056222696118782436139960735564162265781213373117275130186929497395388587607668177533553689346918346401915950264223165522544402414138961194593170087811052328760227189147310043968527191429996144591575166383403894695118992117872760167267138791212597602584916305084723576700928.0000-763061469521186.6250 -0.0000 - cm vel 0.0000 0.0000-29372985744500523738562497950096264916629543960484823952841942898144712689601378691847509486023812811600048904492537924588527545221120.0000 - am vec -0.0000 -0.0000888146957076605102712107714052858211248176709741229376596680386667010953515136398978201012036207720967899486504353792.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.312 -0.2606 -0.4971 212043 91 115 0.02 - - cm pos-56546462200310022635210794849254085278148558263149032795056990675297068685400113023412567467653873022679640642441778815215756300360936002823501503987858536860205783938986022755823716644370605113412881909177909248.0000 -0.00006518995959258198466527212648524087444843462826259134659770362685670292204873719409889266784459025898514815407271806118295106582441292528586198089728.0000 - cm vel113365132101979339298439168.000040837337821099740386253318931908230731427261783763678138675485347459456111784318155839335620698390205295125871651830430986261004342955090998671682525483274951913682547834250659812343705387748174144975643495990151120314006555112110438708684777881958753970494322615580058102853310995234816.0000-8271750520762773995180801771142763397805276936763268243366875234304.0000 - am vec2922994468943541006620166639828598784.0000 0.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.344 -0.2606 -0.4974 210500 90 115 0.02 - - cm pos -0.0000 -124.6407 -0.0000 - cm vel6001819926036494290396528636023431924287041337318797951557538297274228215829326924370269899804458218267917746898252635012800710793236406634913564339412057263219685601441695035486388235884363930423570447393211424627537416506878060179127121863581958913436680192.0000 -0.0000 0.0001 - am vec-3616773584374425841520239327954730268919795568642617746685502830801977654140787702108258304.0000-17386008495170032302230932870364231267158793823681212144426257156810689781776193319519682095527647564732216296385580162351104.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.375 -0.2605 -0.4976 210875 90 115 0.03 - - cm pos2484951936182915939417650167293582724522865089712214449518269978333360855952949864882409235751676682406952510210730300793260417254407361992406406486142649929988112884851321153109027287875188929070190872093523968.000089096239.684914519619128271487631551311402708094746386123370103629738911006697714366936369692802519082946346894333470654118828400119095834784700536924158005148682390368039961302568130281231160037675013437675226927240766657046133401953992212792190784134853982776668574142958099065021364722313179432046219684074695426048.0000 - cm vel 0.00001321925753339103592200945594347848231593167993063395553238947539443752334911885331741651426889625115526987976265724384000081879538984241927075766446857244064164042371884723962221993978458485897078667818306837091429577570210296639782912.000019214147284816494530652208901903192512506453848938485916535163999675637217361920.0000 - am vec 0.000026832853489418133022093533133522353356202036261107217342778065459939669750884069516715770433592392699731518550215226919980327876361046418999421970629047837287469088742572910055363612365837799612605821616128.0000944627768013246909517781238529406765616539506746837900828021751330179475535898434725081997673045276300669862172626963198915512379436416658464981617980674719101713706751604134951190603514917356104919176721907463432779275866353962324941576536239408672250375602585290166423662948719263744.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.406 -0.2605 -0.4976 211891 91 115 0.03 - - cm pos-145575734455450364390472888281562841702172131216353354919018758144.0000 -0.0000622760459361952476629674378378173396657941815856958669448454635169078311463552565140269950167526938971978437845038045518301699163977219264421650572721628742539452357495116145285267480298592424001860163305251716124585640173420163960194680116183616414810112.0000 - cm vel -0.0000923700119237036720235647948747547839435585794791057287852300742220346349609020501063401987420995638060982960145300145070678322694056049460091003514912768.0000-18294819220685837696386822316717600220831646794078562039109252334423737867032859209016289840028348211245766683355146370761638079889408.0000 - am vec84347896327438881900052766466094709687673292339452185986411625762302043149371797140992412050233672879430002654873176331135417133230456832.0000-439341592299408492625434987462656.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.438 -0.2606 -0.4975 212886 92 115 0.03 - - cm pos 0.0000 0.00003089595385953746065442452617603829264784115340557570073893083220019746389601923125306099819014408928728460261413130286448599337970230360374606287697704899476917078776610552358951359457963065142322839697971172830347264.0000 - cm vel-329754580980891486875747407375417575549365006054651412541380858093092833236753232182935608982610086547059580161161764354540732778152662735873363150284541204465529022054400.0000 0.0000-103908830512218744660734417026510660636683529613176344879145339835827789821477605598862081173816880993536011703299222197177873706756423950260081212376475576962630395223674613279398128768210447066198305316554712659809736067804825356611937484447016276170358144475141767168.0000 - am vec-31866279385416210773197142884352.0000 0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.469 -0.2606 -0.4975 214848 93 115 0.03 - - cm pos7224111724422352714706235080250833347141246886409821722436692968139213874949223839424959914086834197560825502689656832.0000 -0.0000-61004628683756041022000656218347090928915513690597207830009953393258936961112967336602035687760415488747545844167404088156866605169963816519057052476477663168951437148726187534070660568166733161264522997276683412674977858869901069662585161501785708032394022658214325125120.0000 - cm vel 0.0000 0.00001954954516231289424576512.0000 - am vec-273419625010818823566465413951660052879423655285233148219008706695468924252535459513871368804581393274781985851066578743489288276074747789949731114227911219402877728777528125588263110507291847793943656156506115918925662257152.0000 0.0000-1419446172356323986265259071534187198843349828649060229773435121435455683497202587656473703437101381860968430194523179331770880587120234391104573589785262145733125536681200041556668823907422175232.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.500 -0.2604 -0.4976 212165 90 116 0.03 - - cm pos -0.0000164831660687959733322187964384399317580615495122205387064395991022895132439839585050034176.0000 0.0000 - cm vel -0.0000 0.0000 0.0000 - am vec 0.0000 -0.0000-4326436889443077377991583136081893394707706993321142780323953279764799793203977581628386726378402151236658116644301492989625244742716065013750500503568215320334217162769253120206559104041576948072025084561757995792804087152835886106907275067291754174099832685197353455703818240.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.531 -0.2605 -0.4974 212366 90 117 0.04 - - cm pos-5193655565329048664186489695833408905410542795749977352019413639742264802079070467861701581047278790017197708622277812436534317797960080267601019267814992026942272468677267778799849039391345508605107568407095595352487970040793540836282005483196673171051481706401574114270759498797424261075403014144.0000 -0.00002245171591305709517270312065310942262311464955758713693770069707995536528478576423585354757863318392276576881182944084886553432461025326177341089384784301639560974165087558350940546846860459689382716782850359415304093503821844837256275357871481509573167487194595754796198682510003263540319320276992.0000 - cm vel 0.0000-20480988340732831768688924713361652143823980336974905474272608050801331518846861208535451802632401768666690617509984848014475264.0000 -0.0000 - am vec-13085257721087411874583299039155978240.000028218186104472249195448653391568103714894530797884471996153495462735308208602978677778134005106387951319375323996257085554688.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.562 -0.2606 -0.4971 212423 92 115 0.04 - - cm pos1237944920454925237806384815732575008781172737613407986615582720.0000 0.0000-3631909347976786029364103215641341758871692200141574411717313145054141828711550533320831994042892088522420936078370939982084507622032624998344170562001489677099640615779734152245660797122182643712.0000 - cm vel-48415551309695701869275528936262100829732248746471718912.0000-45947345104457839174024441671867282844378394525894107202340067245400328964000989745081832824886382098464888706900980825121129989659817981032869841265322577918018239596078533208488496070656.0000 -0.0000 - am vec -0.00004129892291571269031986152478601425957049434438530552949959045368530568985117032191588330424859486246287473919309054155039478644736.00001081892199566021437263454574179525904867591578918243907745180876668332189806064484098191745459060349141250355762012871711844982852117271723067099041727818489118636904524943046060579810234971736623808512.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.594 -0.2606 -0.4969 212283 93 113 0.04 - - cm pos-1905025499151980034274534469510169958183059726500390841066136964584857044595008769483832775855757328868765739951565412159263311805689378283822856776293361039664752566992896.0000-18513680079660101951614321723674450322087698153924574957787525369758710122880996463101277685092974592.0000-34668040130561827018028167481500511513173163893890814855804555544421044200301242613014729079885399568859168737854867235643450768762682660956178060745389500292195388606373919512804742090441767635283717878972416.0000 - cm vel 0.000015196951813461841521486836701756956444224784853043472160684046690647345415258299606291181347180308664850570968817091314870783992977099570040345054092861926102818687180028861911716827199242418377219961620622109576309460896548766071974088591420837080289752944580953196135514790168625152.000073554904292334743059715730810303602435661306680354774229327446824869118773461089173702460071928588404979370313608541723509082525406656287643985300302649540648731481451251740266150249905893364060668324763505203491298413935555574550679062173518529617194487345327992464715672028159465999727033844768964608.0000 - am vec-684197197245369380398698148637883055842570268576757364617298949449267921781171801975276829201855225528320.0000-101744418212194207272053357245629914515538029536942357335986220181249137161741167925112262217088664669032302481415162247186608761084695649663825827839191677270482323076073977140992774265312718186910950787052359436270235436365878711934550292538851328.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.625 -0.2604 -0.4969 211770 93 113 0.04 - - cm pos 0.0000477331350524916948053883772533839128147297411143853893076742726311758736792767174763256895458672495066463879183880747854582352839947965489037557840421389341612462045821594521556459536974348288.0000 -0.0000 - cm vel-2858268226850200346502218383360.0000 0.0000-2907011599666720609852821602358022994135563500065076026248411292895751132492574529244655633249813397504.0000 - am vec 0.0000-6531189342130129070000606521798601487918648691487720724594371643455948782894424711116425641185310518667203477884735480097030217328391130496538172147552148206137835283709270612273699664117397375383197648578713395658650373702578796921425494016.0000-68667070982252915723296702559193038560287981944082791399757306142237668333667034347778320748130935054072547814251025111934915682925339040550628950325566279759769915211704604078479980904811981684055542081132630501814512996647644042941678205978129496143621587001442857564241920.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.656 -0.2604 -0.4966 213017 94 113 0.04 - - cm pos -0.0000 -0.0000 -0.0000 - cm vel 0.0000 -0.0000750590408672451273437300408836574839027921292052670349195709767494793619393454218523365641587041784622753423705585876767321892764964924163371587839599634649299654248543362077075142218505781248.0000 - am vec -0.0000-13723471631533968294277467902175311036416.00001483758922498238013885805186613205816736559669268686995754441163775919388535175792833681310410619463417637317680574765383078543996818093787967728736890272570506895503083446918402517893756334261234953860792458609848630254067934258081421275875940666980649450958118218366976.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.688 -0.2605 -0.4964 211250 93 113 0.05 - - cm pos -0.0000198174628871799517542138597507510961620835701551283799098466077037228119215914968513405186723670892610408156771537536223387415406585739079755883116708009272694747820311183360.0000-131324276297875931264929471087299892847514892244626681282688551648691616888001457114016177119227008467708400249163901084212992038296428336859749707148174328998330709756320508948310180026343874550108307712889137762960733682472664844214972149441046375946663939539494681513165526439468119799877706186752.0000 - cm vel124034099279727094654203020633441177035091783218463709800993364625044003959514490457768757657726074391096296807294941918385930240.00003659564859968775261092082239720636556249203956012581449105408.000076241262963115679898798988812839344826385170285935382413786461902228635394912538601201241714092174577819370601331114548713789162841440256.0000 - am vec-179674443543109063378572009866384474121168792461839681103739438547174628457367728363144452845382658219414837980312560310995123291864300818192462580437808178192575021246363489617810535917232689115815673860633034015933202432.0000 -0.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.719 -0.2604 -0.4964 211170 92 113 0.05 - - cm pos145181572433379571777139946417325705919906499813137239162026588627570142377672704.0000 0.0000 0.0000 - cm vel-14699411899733106689748807015162959158928574151927680508283408582610553651996271049668200329027069014474383340647890531969702835931813294041310400068088607643420501257001311114625024.0000-9521153043431234469315064285137440158695082669030622056319028334025512244630488595266122214451398817990054436067606528.0000 -0.0000 - am vec-12045879150450533245385545559568586746363904.0000 -0.0000282370292201227098153047249690389638229877729824366991622295073783734645635477603339207504681661661280265855802808138464704624240728435159978684445067601007176778669674535023631286380807247004502997493334363881735695800196660870713966592.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.750 -0.2604 -0.4962 210947 92 113 0.05 - - cm pos 0.00004016150150127866080115702772697064343311599368161510930366079707739755527702397349223712354183244031626000751060270526274828774967655549975664954845997684685101945345426985074177099767327076598845399690291969151723560978972620821288546335293145907562122021799087395967262474788208158390393595184524820480.0000 -0.0000 - cm vel1623189956441278890339236934590139261744004405015153945450634855413269570561470320887698089531442018085140098312501085601792.000039614144650989338516600720234197699261284939531927656808969818614988261754401233520680503491425535440871903308118818892451938910743213451645617276982956705919381497071532482391941976057150696547496879359093165331853237281185630670459238489668986583272840060850842221795403059025249361970855936.000019953842142340906105848235594528849920.0000 - am vec -0.0000101020281520834370545282970034795196376647900805355916366570812334772584448.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.781 -0.2604 -0.4959 210270 92 112 0.05 - - cm pos183216982574229823237929135776530763138372743348947347847026123070316598326169552160156796080224372210078933304712113237936839361582251484913999522092189287920693811526827844777238394731292944111275086008511741418370272922046088137072969984249954304.00004542087181785447321837764608.0000 -0.0000 - cm vel -0.0000 -0.0000-31389825249711979418716765108862686175677335591130706700028969363859640627826770203814328510285646950663891739634364801403484790013768484673669254271581293757402632498440338281667791145469165721764370850192277306809766477227059966738999644301095448274307186749670227019777301380514726088487563159404544.0000 - am vec -0.000047261817541080303488270043079981915504463622506656891202599058486139865388841418916956824506728448.0000-1288919023974797694999492118209282202558885036231325367462064947274027872132933953918428957658462369874349504167565234741960793244693243531359562674296471905720890227637767943591331742727452311439175983089013751808.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.812 -0.2604 -0.4957 210869 92 112 0.05 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel 0.0000-125363259473055671997958481619760307697368431794277880196569756912553936311224492964687569714221449790105838943734880632212773343123762005566579673883000863683772416.0000-1993462524.7853 - am vec-443473364127565922047863933948357433712444532126085085956266669375488.0000-11713846823645734.000040470663841389663140511168328625478295313993293916996211176312269992282671807520592456708047757531392063952577053136105135635736447146994174442347093059106198404785907061019413148924469559573450659463168.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.844 -0.2603 -0.4954 210822 93 112 0.06 - - cm pos-452830899921176980625258599874812581697407939791561300037248272083638882389536192638724097049870575558046905964216985306497728560281436158111544920302200243413808997976456564051352410165130960347123112420688265162793846704202738036632758225910943242566376620032.0000 -0.0000-247511551281747162911845622313133480945357510273788577407812528727874976532452267474747118830624855354826667900188835672150381755289635005635704818441915912019357393169444994670613704924042705783897473165551845591667246506817135575040.0000 - cm vel-1614028238200568527225314018603691985082252555144765878547514977979183585991442048962735855006715178879941287426527095903896541289105883967727431925130110731116120428733928127228600955970340777000695607583019739051316355576870198624932331520.0000-2601782495214573201114218113189376022825707404027140790035993004190098787307709002135351360492659029673200698993994305539388077270377680283551657607722909371116523437933800933356646162735615921228457871774803825172407225579946901504.0000 0.0000 - am vec 0.0000 -0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.875 -0.2602 -0.4951 212697 95 112 0.06 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel-19306661078617178572224813626024776810283247475658843957761955076648689450881868930119045198143300505031129624938927233912212011985853796459698205029703609690121029440877560352624804919152470801348425013005673612234551401268513147028321410519535382177078103244800.0000143692216243397104163039105913045535485765615616.0000-1576070982493234714555901213991383788026837513132711553659830272.0000 - am vec 0.00001660143119630844461519604255393637825986158357748963861762983166230499084409832766705060288154216208265287014277989390098829036785072853526199379928128242321538046142824029298509043571893903239026120647268112223540710376892492388665539137529010204825095987753249813001404416.0000-35347515084456870874061659067740772364112036557987124746872056727607627972778271378707235362132772643254059070743702210677691440983551764157998676574208.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.906 -0.2602 -0.4948 210581 93 112 0.06 - - cm pos -0.0000 0.0000 -0.0000 - cm vel -0.0000-15247983296560167778211932486244175892736743727315918995683864287940855201792.0000-2042115773287014409525195569174679107691145344266070067382924354266339546800861614316835983554118203040470648672251757898394844818929420302672771570196283392.0000 - am vec 0.0000 0.0000-5566552186488478500528006169116694511119799672381501876947652390499892715784927199341987602890752.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.938 -0.2603 -0.4943 209929 93 111 0.06 - - cm pos 0.0000641205551613691206880303639445048366115608121902868990187146794379122326538620092652091641681582240467759787189987370818689717364112598421028018358598922488416452376441067598800030393883453317684973257496012437585920.0000 -0.0000 - cm vel-24724659289366587858294886602115186074016934183324274803344506056653279780018234227723166095291868765029101687505518039060589202196688699213144962341303524523032320482483137744760319247857050439346238205550816181354496.0000-1119539020855603051504330137968398282241153721107890093671038417468094790807690867702688539579545090159083432565236956306906287139789201512641872499354908014526820893089245805637467743427359508941484622391083272323057329448997102164667698953132049547624689845189578110855430228917178430002600869888.0000-454864934728744038083034251920848382049822504127291308337963210625178898542033120895153030023650330623712798830119522040115257281012213740349486183105180447180083791228300972089694437601864071547328641953014014906106676480169762610778463039815380288008022632682935020197732193870700589185284056251629568.0000 - am vec27573568503517059612360030070320201203712.0000 -0.000022559461730324852197697168407153972405887776561437623314537676993837897947060384071216824610286001472386192283366731464737261503413164239163750532003693737298453769688210004869946971945051357184.0000 - - tnow tnow T+U T+U T/U T/U nttot - 0.969 -0.2603 -0.4939 212661 95 112 0.06 - - cm pos -0.0000-36072800456023979874988372895794798295976563261308928.0000 0.0000 - cm vel-317601098528199476059069237855858684610872686976871767562721824287458184753783230640344668875149619938207619414727194450446640648804920659592264069916583590157316395904822085974127074449470660473017863617544723233239924793926828345779081600206650752276365312.0000 0.000034616983.9001 - am vec-11873884539013573106688102081826956595495800772419848370340636494041758194447527612770538906281643421466624.0000-415573802432.6354 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.000 -0.2603 -0.4935 212223 94 112 0.07 - - cm pos-361349128.0290-180489240100535258692298298120580773637905896082720313266266035855500783144171592328663292694721485960782812352747157594259640844588824073220048866957476675814000489792350424037698361645665131063670976273972283165983525886926782464.0000-588284731426293800619387605200382877092778077833328494710470549796433579280747265196208062363899211266732521376930633482575188822102952962180133287335040742960510011909379385423155974170681301767013805600201564802308366139392.0000 - cm vel-792348.0157 -0.000017276507867718913437973844405822559527936453572152956134533302493055014236859612269710280825892871802274901185962242732740801293707629252292784522485256435159128733404285307624612006848444873310208.0000 - am vec -0.0000-211652718723195536133000463032621902998210238809916675034348243402279770537493182421902819328.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.031 -0.2602 -0.4932 211476 92 113 0.07 - - cm pos-40087524642354090177162277031779457754073858728524598212520900057000059718284318199972113410724016694017298307045434288302823422621896183743360904404979981899552555156330832451429990863531838725366022825401782993683338193002299392.0000-298361428424471336261568991321431171435208152318134458095066986543349181497290163584519803872491924676559858733652720317985013834748824577104739959651582856921088.0000 0.0000 - cm vel 0.000039189313548520790111915155914815724226508096196157475815406514085043663410920491698918112609902455726474793014038334471819505653528309199655731845808083045960242270810300252900663754752.000031144847919189000.0000 - am vec26970646631640567331310833479720917986653581565660843532315901690656368322918751533647592626739302873823172484389608571700382481765787667411138352822432434090341073472177209143725904610801927558528960775936308676731739381272546712892043193020424967848464577822807705070203285992648454691582027650899640320.000046738133919390499223561289862785435166572544.000024698848102251647841885312369614341628099684826013193458362979217437566747443306213017948712523578670080531014982128383520762362587973738028200519756275691552768.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.062 -0.2601 -0.4930 212513 95 112 0.07 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel7829004378509742740511201308831780786082047696482112982523869303137284076259681821487178674759694106945713393750023034383258037754503896656879192442684266798038478897793585905664.0000 -0.0000 0.0000 - am vec 0.0000-398527518772044354721235707163681011104543258433165687083334248937031321304243226085982030141146645903040964485965719703950206948379370949627035558250362717770407154426597086377936502609822850620522783909313778431737632612513195878143492096.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.094 -0.2602 -0.4926 212473 96 111 0.07 - - cm pos-16241367798983889928342349697986462773700791589569878873119200334994408340840578865679601922351600412056695702512788486839737390001553408.0000 0.0000-5701981805246544340338493134313287476078307829232888376230201540209850478758766188011280230840358461462671132243001344.0000 - cm vel66464063855427411598727294799838619468506496323432346489202933760.0000 -0.0000 0.0000 - am vec -0.0000-37417900726557283051207837633825548022252641850827692164603303264768592850197226404776379926381525678998338597981087024390602752.00001492017855644381087980486176414782596806339684881920655203567761620992.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.125 -0.2601 -0.4924 212418 94 112 0.07 - - cm pos 0.0000-711820219261389002484083103518768000301683639186447940017119095003311272366543708744939575901072447673459822910034728318489773581764224585217153590961090283595820398858105722543085108253031913037015131991785988446669896493624021704540383213682693642603381558861756401006411776.00004683213089645237545539045399467265044027898253730019963078979383578052041222051926796589570077417948896732982410855041085164437800747008.0000 - cm vel77513150682505029279103790970169343667701805875384195717014678133760291158822242486081400335994452583038528915116699834526606667181808276937445211887255579958286037842701315111972929924685529388446078111580160.0000 0.0000 -0.0000 - am vec9059263110707568578116497975265644723676831585418624934771103766307015726810385337112561881634723102974654718100188493043660592688376631528302962769405658369193435359931078418230365420910633418004410737455655981292535053748065309945508787666368339516652162289428819474632704986550632448.00001143192904791952881014942925806970147119788558873372533569273678384853347926697505158141548564171206388323330905973176677101053053751620972964408710306326267965921195655590013300145488289564499615338723228516352.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.156 -0.2601 -0.4921 211307 94 111 0.08 - - cm pos46106792064030743980379413467179399668360544256.0000281295444016688699612918967705434093373162474641330499477105393684832366013265335376148639086493538841387157610470935813907382321506611625984.00009666517315509855716454739897669650270466078043503403206862105887915163665506802394218805863268327248294464047677884185386996866564882183999449870602261960210875183887243400031117284391263831851008.0000 - cm vel54483249131201038533930473660635342738292736.000042980177895297377877502516865771765835744492885168030125650081947981240314053086066585773277184.0000 -0.0000 - am vec-82289380027828886803819444844586043553295727463710427849410310072734958145577816754585430580037201759165483006525865319660881941871732719114753814328137388485088556194004506627854322782799380501409703222751141785461539159909589656478182014976.0000-726871714679445778173842567769245425023633446948028327361345672396639700828573012077971834771949486080.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.188 -0.2601 -0.4919 212029 96 110 0.08 - - cm pos1173952957709304029590898011596930729396102538056360773552057094915010373355989028375226875745267969723652622036914592501355018593257345504755067378001178111927966771445760.0000 -0.0000 0.0000 - cm vel 0.000012186243317740609276404195489043283244467804926033971742984147954866408288950849306860246852118091060094444732867068830629362621831536705536.0000411625571163601.7500 - am vec-635527994611094978402897787090918059797079752254911007374148601942359499949809925599953582266407866530488581074179512991378723937669962210969595063204437679538853175466771960964858528804582956348735488.0000141817699951243368228015948539755474907523085940521885692233263485261908509133659649720138179170237633715832664983728318757789781765486006712604213718994986339867038623787021972412282092344461471916249215905227828087810129841329573952391085060879748885051863805350324092487551170143193931148275663895107993600.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.219 -0.2600 -0.4916 211871 95 111 0.08 - - cm pos-120985436684330252264306434868021595142782550358351884824405228636331343470148887056832333804437210663697102098494040878623318130623475617337602852662867510372795897081745857471976555719416736434666602496.0000 0.0000-20024624269744565835179983237339164844817835131113178253451788001425028636652594227484360553228147260268669190746931200.0000 - cm vel2011544566099649492048188597367058649199398113220349325532967374908254249724850543535600345675771997492938397036854347756681567704953638131023113331965998136143100834771646322866913280.0000251057729491665618972134555619496650866688.0000 -0.0000 - am vec-6139049881771361014128301191904934535254493516299161416962253368222981211547715922415924983305625289358590882112203958869616692873767504933409840832451513942016.0000-88490438247454588592935039357726767452907794081541320262041509868748906391533595544388850087500096845902034797027175828160979203499841356338370751785794895980137278470909370374896915096900553727447093343131354871845608542480234941775872.0000-11810496874220612736909567086361690581163030733939317339782125233037888389926957133607177314205702239388674638666092641481288742904241549862433552808124420051397737375108575445959059727912721917978320064181436416.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.250 -0.2602 -0.4912 212729 93 113 0.08 - - cm pos1273435642992046424015604690932350824385579109700695775975310098298877739965830181769851460221753187451704625877772608257264622241162737726340988928.0000 -0.0000 -0.0000 - cm vel 0.000081060712903431677612554564458042283076944989144070513214166401360296099559887826136146844312319309727175246851421018786049945172519984821769550879003762491392.0000 -0.0000 - am vec14360477624155394185460570705344263839262659796327399723668122673092935650850943305308906552544214351736273370717352858888893591806647914594173096663670930837901188010461542958382541370903183194518942006385751762732433204219665924682627726342639105718935327798464211269971301381632425984.0000-462084768610954317182059675648.00009050058522339333588012706522864839983418904746538012955631953361524486110611351145396009056371728309085644996721887597318306764125478357933014123320804947192929875203875154479805701002074066426240602970067642944477744966385606437803356409189482585489581738901440036864.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.281 -0.2603 -0.4908 211198 91 115 0.08 - - cm pos 0.0000 -0.0000 -0.0000 - cm vel 0.0000 -0.0000 0.0000 - am vec-48498627658717163227016770141411545767562400375846123389116808828335983427584.0000-429760820705290235732805020479556150727558251621364111716012784101957340934333844903051458787857563947440436214697995593832406166643186117505775499250687675399902202072937011139217955731806924662796439626646177117561743378144889309864364179349162231639148855296.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.312 -0.2603 -0.4906 213544 93 115 0.09 - - cm pos-1310791951328902450962864801029672735925979813883184244239154751586586268557811988765934952938105334281660866812898909191842362087581056547512845303123846203703296.0000 -0.0000-1104912413265488.1250 - cm vel-496140930645809553769392202647710502359571452556424972271517309661349855244249760533254282565100951737127472858492118761472.00002863847416899913766897408939450562123675266235497641053288621457129399587503348796473028441823971336221992098306051557742499699290286191542272.00002118819716729291538408868965489305002764552458818124819844833476608.0000 - am vec-2767913261879495921154709700944301687352292175936086776336282226299577725522519443045240792923997597076632906622817295434327836891541743162204657341343213157276305832103154647183219837900641884698204319820653307451068809076531003392.0000 -0.0000331617118667140670569724590061211734618669056.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.344 -0.2602 -0.4906 212351 92 114 0.09 - - cm pos-2952230708914117461506679284584935233586489704176421136824254457562482032894084717253250524907219453272768081113858036447894916017965130316756834704354201393319917977860279044669440.0000886583622295715713705011893009567037044429263168844549318258480789887293711139580157372426878976.0000408142908406317387072609295578735954860105510377760916649676201459066078961079747545502740905439685250952971181299438498091223944689389490119836846556893249038535048151855654216509653504001666675290728370783272340330556921788320490089264977869238793791349066825728.0000 - cm vel -0.0000 0.0000 -0.0000 - am vec420626916235524775431397044859305902851734784067780201503987246343239383324282393884515461236086338864821660986089887430912237893901340524433373871208905023681122533358446140785814958631695144918906258124795681887927141447077568392704583660835612655616.0000-58241194026643089040554064644562583618088695352096309147172709730047005663746428866293277359182446348089090699385101400540415430492160.0000-474782950883144755455664860666399228933423692301612056581485821323740949279046485769931509310862974602478211197745044499085156346945863031986216469946718150400812237337285203501489564277703209624298478742475494506413162496.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.375 -0.2603 -0.4903 211854 91 115 0.09 - - cm pos 0.0000-149387766096574070026946462232401144057041135910815116199622323556540006390831292497608813805131998121800041471523182745361870732436850857698180699346948799013055040379727743637450038732873549798497202193397166549244579168990609234134151016095446485434368.0000 0.0000 - cm vel 0.0000 0.0000 0.0000 - am vec6483276144632959707142260210586001314762733906222826094011793505888633997780105007486483693272519671808.00004465327215326859545300225761942351511790133828270557228519747603655800389632.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.406 -0.2603 -0.4902 211998 91 115 0.09 - - cm pos -0.0000 0.0000 0.0000 - cm vel574849778902932162667465850843028909967879540182192353443177471001849129580699303542784.0000 0.0000 -0.0000 - am vec-1951760531337000174128688401473641675921595829988367435616348542454645433134706519096875752761721233163831873649852156701588030004267613799625785344.0000 0.00008337409578392775611401276811274841623984098736517680015191302255782196585952100398758985746807094936584991396739729576645988689518054190514041504515881296020278043708146963522663773051841051111311012064060220000931592696166788391045787587063330779749958809449321090323857774074959634965565901111296.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.438 -0.2604 -0.4900 210887 89 116 0.09 - - cm pos-1979304811692934348767704848639541416171171640639955935381111190324846855635818407156655871210390445913050854545311527227305866723181120287199506183659177747867024879099203225657015760992179624253304922360002184873087465611530097515466846477264169482972250109008893759071025819181967542145964310528.0000 -0.0000 0.0000 - cm vel-152487974370892820518557674941954836184158044485993567317412029400462039617759762361699166879725435702422679528382865060057024376463957392541098047948677027044870507866197352812785408092426910431956477373579264.0000 0.0000 -0.0000 - am vec1105168042386423777583519450879841917449956703937836276810521982286218395648.0000 -0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.469 -0.2604 -0.4899 210486 88 117 0.10 - - cm pos -0.0000 0.0000 0.0000 - cm vel 0.0000 -0.0000 0.0000 - am vec1351344885406422904868937054414736050693973460643962476160972548024709426274289029948163561575347800770268946641962093751144342232204572533709340985908379296727040.0000 0.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.500 -0.2604 -0.4897 210373 87 117 0.10 - - cm pos-2725280.0627 -0.0000283783563129400597350243800094820644500356220799942656.0000 - cm vel -0.0000 0.0000 0.0000 - am vec -0.000043896014770123912245841280976286021021600546969027443962003061554034738913220371373160602057945146602528226743743037578978632396919083765175039383481898291923935869181081953902500495661881847820968184531703181761854488514535163566870180237225415308626834156573583554379776.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.531 -0.2604 -0.4896 210691 88 117 0.10 - - cm pos10355310058783655135085586629928935950190888351966426203034475932945843379786654748797949191854729206009306596939733239151349155898348349417586056494634388821160839165463505700240650500606053752768669818601847444465224852593531819568006059940917925117983767263614883498481571825797688901763072.0000-3230235918674462511519796443928569731105704905339428723014429033637796452047295231414797139242719288094305089670382289276241428664501255842909864840022020796690310863821952348314197063793991187185578674656894293187863964558587080076989473658241688708689730009878637235740831053702884878165656656150528.0000-438403697707222419332951258955776.0000 - cm vel 0.0000 0.0000-183750650419507818712961900347392.0000 - am vec -0.0000 -0.0000-148833928483867088340060668267068801970966232686508882951812355679334669982170822817362399474814900416378768492691073781391461831854996996166639464529737469039470376640639799801759183503145284688619543572310772857695825827549789088626752193798953148135513844967218442409907180822211854336.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.562 -0.2603 -0.4895 211982 89 117 0.10 - - cm pos 0.00005684314831021164005739860443008135719517508714669595652103230062005424951694693293923421995646546827804809929186436351610867956780833042988788559346507194540747470128086515712.0000-8602197758631784112444631628921878990661862919844298846291062764552350235107600355780196738030096218648173645188094441993976459133470004771532223293526634913014278340715028648165784709167636312752128.0000 - cm vel-1677115480490552137693753385714865930225808070229945668410008714127261971497400242890653597063751610784478459934525537610986975925204739019368923607087315061819860962497188709044410553927574144687387793050757965971128827477542190079541248.0000-1990974969502340762287064037769248518848173682664173595165164014673108223225786049030893280513146682593720440485397687824700962124138961164159203761652616867682713404509131518593762962037134640584162972946194222410893293556389809356663656803220487929856.0000-765983291793779229909275775196136993127268413204213982178997490589245531437603610227988517061730198090536381971088476226018892567643629943945264123546769150313328346983070520683195089420479794906760122688007206410122619613896022461124286368447096493927723922620416.0000 - am vec11222722812604683071432374349855445824410622906488739583247633626923679879141840253177261685626948819724671880204215192038799619156411728118163701760.0000-20721296133684398824473624300333312854433571954856671330589620572967760582447498485487820609008216439685698591760722778329363378980510034762802483151605815439360077783602028683812697561669488438793640738686548461447307466550723283080099907641572930612118002148063995494400.0000131201676459368643345162059782646870277468970969112735584315467606306837003584256819994561216990187931171997604791994745240568634165765426198957382587825695973797573713514675708444703013446121417443127624543688560723357716931750856143774040280819691697686511787798957941877584725306335297536.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.594 -0.2602 -0.4894 213499 93 115 0.10 - - cm pos 0.0000 0.000060841271415260356419719197703369402391201850721933956656505535193776294698498126345382933333478341742767082206769500244630198184852783047131270462264003785624274337792.0000 - cm vel 0.00002988289027997682802693983497751848374759464011395388493715503291889250668375404034786777329217118437365011920371230849645601103000134271894791446901050921490720855825203207522697438493901527828811325393933463185340888887921678060957375073571162831679438004985386492230975356928.0000 0.0000 - am vec -0.000089678487447784630535911721631433827311764825159952537231832093551065171855032510222217984633427839467904278870962666597930982256223630049361285038151203819142836564770524067628027199296714196058952346837390072556161114795929882883518256528471185424384.000025932200433322053982192952106770811199263256861309132113964652146401362788488305797914716666117351861970284087561158656.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.625 -0.2602 -0.4892 214135 93 115 0.11 - - cm pos 0.0000 0.00007056187426054677493924467331418854824134159380228222538254402369341376679000430350937449706059256747929550390153556622978181448508607075631748689148266679893210927487859991568232827355043513036462620672.0000 - cm vel9455060674212031355581578771901879604125962553448307097600.0000 -0.0000905195160386234450740183558978604172199329792.0000 - am vec-423141848135701272406023541467931437765674988468612873501954086457315580459366065951211148150216363060684673068843401216.0000125443642165140234698752.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.656 -0.2600 -0.4891 212530 93 113 0.11 - - cm pos-386273933468065619173985927804919147162497699559454583073956195626200141480431296462331784685832260331541946668649339092828557868365025285470331254654019146977640448.0000 0.0000 -0.0000 - cm vel 0.0000-4743632426372061158511341209478427049984.0000 -0.0000 - am vec 0.0000-239671508137325590634863843622155833814981285994835032601270614092658842291431684040953083543400211671223431241893256294795585728275833182457304790693217990730311496158756774405546243960233591674835800011741111645345153024.0000-49006483581136799791641888765814459878578389959132951085056.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.688 -0.2601 -0.4889 212150 93 113 0.11 - - cm pos-1487877691353051346813520336017885540717350200296943508643073805990714385716229283691650362523040265199312029531821608704020321139945030962963163134541471336463841208991353543530388041219235849358604243269187075829952583083412936687997595390131332549137399808.000040431607191786761427104280235990972267707427172122822410294439962386301812790286105750215820881849925130162115777206193116849495846358291714289820468973224841672266675554448106613374976.0000 -13.2929 - cm vel 0.0000-11643251192651135742202374015453695540762798882149109098056725959688116354151628798102358944813718655277288382536360031944704.000012214127581259127926085825924987929167959258823571338100692129269283544063459288458864672341430185836854168023394227560937501291047368584484892000666079498089560737607549155698544459847334549094863664733777468082618368.0000 - am vec -0.0000 -0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.719 -0.2600 -0.4886 212527 94 113 0.11 - - cm pos 0.0000 0.0000 -0.0000 - cm vel 0.0000-3740937435991330069141514183491046417018724477946895454742107797489367777651503363566961278124056778866179715697966013576194403899237985489979803333540796727857673818941610261164804175120928880995351628255464015896807598848228836431639275231370254795600210205941245916684764056020582400.0000-1496375143483907907202549691919803677796316676246757056763836145805924583914704210627705140289198718001323725056146519199218637170162712517048569896173780970119785070021058008587680219337631265573225593616508441974463349118760084145210014072326362943633595430732406036357386404506894336.0000 - am vec 0.0000-506299477813233561955550035855612263891948926396244145840929646082785280.0000-2684.9614 - - tnow tnow T+U T+U T/U T/U nttot - 1.750 -0.2599 -0.4882 214475 95 113 0.11 - - cm pos 0.0000570847744204721723776232849408.0000 -0.0000 - cm vel 0.00009303607028694346891264.000021843041568780036096522682587664510881616848279258075297722038326617290297922028252001711372388398988242004113159931608364256454785453845998318603445295919123531750863561293824.0000 - am vec-700071569435402216638880302142017276395802762833015640618709164542800072312688106229248106059986522595859399212024995928633470497187216698955866116508470781436116811431924583306537348690067597667317555776145055312004449953924960057820272526737333775511010924855369057378236567058532416561738678272.0000-243456541315596890445264715776.0000513257732687017105626118865708907316318212506516191568959281071650953163681544723234410311036750630144125272089295090772098918921862630415546013508832518229169275813676454317317868366413577531877798248124850876435237226083329977779649022787584.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.781 -0.2600 -0.4877 211398 91 114 0.12 - - cm pos 0.00002538767724261615285475428033880680745792006663422018224505287822966819943819333990035342023814910659520289606932673252852631492890355067269168256419129146222607384729988471012995209998647132004151371030385506262594086904318799071623748634288324608.0000 0.0000 - cm vel -0.0000 0.0000268422787389278285271797801631966585676267684972192725911204560992505586897553306560563286382962671483260864624210919316562369601477625228271486094738593784420517225704744562865436386463903278971969808758943219470938662287088591831040.0000 - am vec837892062621074121031680.0000-132651279428511567728320929138659552334884047864190970907987079738416890249908717681017771033859318913957888.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.812 -0.2601 -0.4874 212928 92 115 0.12 - - cm pos-23586053241842823245135748944728488268082619255211287698013802893306567539200322049913195098064694329682755230335454508989279460782795390976.0000 -0.000070241440506970972450347016211701085578921687019780308992.0000 - cm vel91169676794840547328.0000 0.0000-312485246178787499574531571855500319353058166133757521121229774733759219541233886788987530449641599447143484297448632828066529280.0000 - am vec550232859802479646353259776081220260536098562860406935542491773061360505706269193462888787400969095542198385491880413046180563628988464777570521854407192482773386701088342530776506535354974876767728366277722149418465140042290765040127300423723795199567519062541409814871944288389824512000.0000 -0.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.844 -0.2600 -0.4872 209464 86 117 0.12 - - cm pos -0.0000861707301861909157906082304171714659075465173542154683532334113325731026448459584625937939655005720799303189459229959264408324640317687966456790286446917991932177093416002625497464101695147794492865941398880256.0000252666357010502975621462733565699411846362936271402100906174394592957904290370055642541212933501991580773285441505073994549836783929041879040.0000 - cm vel -0.0000 -0.0000 -0.0000 - am vec-68490608628676523224720856037532446715355599902134806937953332627552826123427487958097226812935634441238287857672166554780652706213996011313215089657401764117079558838555354107722541273189961062652583734464235992056162569682944.000050456618611297886829757354662160239172340530892665167675282029350961536444081111603413846550938515835667024684958982650979252154412918582473548105930921184941240745984.0000-120410843834118465704508216705794312168686915722200368269626879150755912090314435502783930575303895989357367614664167186658206319076710106403318550304104380714027837600765589377793316349151402363932422582541971661783040.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.875 -0.2600 -0.4871 207897 83 119 0.12 - - cm pos -0.0000 0.0000 0.0000 - cm vel-66162802194851512475163350965597860351791525983944182333141413076927899249282161844394703978496.0000 -0.0000 0.0000 - am vec11728483527803680454149351588444369675886633479622192345377930537664319668078524032122394797090467856602221462554615236757693276373803464453850095590841455151417594286053991557048074315726107994886213012948800287237491790170924852578465945723095510069441227108775747918659444262567936.00006582488281356740775580741453573930863167553481592182449429463571380844369219358044538685193793404725407286121289479508977708874840016945614322852797958836589119901047151097491372353129411510272.0000 55.5065 - - tnow tnow T+U T+U T/U T/U nttot - 1.906 -0.2599 -0.4871 209291 84 119 0.12 - - cm pos-6385407501542423356344755806443061288270744245271733424263391144172174415569762012748184697079435521029609866400382808289470873191676170913571324939072982848473856751012074292708062394740535433385954246656.0000-644869229673901272406156825127923652332469225409703600584491151210108331287504937876181340192947630284835925570132146913280.0000-437668470614432896856264312069700291181983845628797688075868840875753777929389526518230980868592805843229623026837241918909335524940739117863686355452748922059575422451777510660296836423288852539144758507851012664840256497425686700400193743706206982105132609568768.0000 - cm vel91738830422806813664480961997610673203605020789679260166918736755863713592580010368522647064518273177534427837963926429695193972295091693219854824951171329605908614895111815547825621544646356421422716734241892684707921920.0000 -0.0000-121243859867853206740646684895908078250471680915696676398905280833144119433693665607520902571821648315567518233518535689457025036703426743927676786809940669086813177513589928090177251229303204492507220689006984235908654867421622446393976284930574252011503484928.0000 - am vec1730582.0314 -0.0000 0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.938 -0.2599 -0.4870 208078 85 118 0.13 - - cm pos -0.0000 0.000033395408529609668545900087356741858626434687930018017154439459965780325063224136005981384682966837503201613185024.0000 - cm vel 0.0000 -0.0000 -0.0000 - am vec -0.0000 -0.000027389789144495919449353820222436523639840246996854991721274763678689626460095830498736729629319683568713072640.0000 - - tnow tnow T+U T+U T/U T/U nttot - 1.969 -0.2599 -0.4866 209032 86 117 0.13 - - cm pos2111126978254212190896032110963505517223209986732864848944365090759632121978562470532728892131013766535744886868300497309522872821223266685425227527010331702576239218982835496030604650047787545596755887684191381441436712960.0000 0.0000 -0.0000 - cm vel -0.0000 -0.00006104709079556268540863807959478225927762031564494065094919212127507518028144940147284465673258377308288760565424364149004424205658263108939439948970025853793338794903375769680650550757274736944078163976294004356798080264175616.0000 - am vec488557743030398575148588878336285926971136613741538351720650706714165379575801120920205589038035377801011584056505567547239551809464492359680.0000-57697119730310729279552069842804905030114276571601040109621109713774995878340556166888163327606900708361060685934377038941483270633441513572880889869444249990292808502969114770120113558694264365951053959505364172061258257620919380388284989440.0000 -0.0000 - - tnow tnow T+U T+U T/U T/U nttot - 2.000 -0.2600 -0.4864 208927 85 118 0.13 - - cm pos -0.0000-7367171723037541795094124434151519831792112034691840854356613346938449759299255409681446804939826068923097543887086184194872084937290308755997140123240935810488290471873347584000.0000 -0.0000 - cm vel1006425721044856206000950062318392931898789353280274728983606558081433802045802861222818251758628458130325450533798649833034385272614630675871168760915286373163131622823786325277511140221770339768338481152.0000 0.0000-3144606464799229038263042987182620982102812047995738848406011579833110289130714648195731710966795169629551135090130652751542070025361201103838722768428417950975157384354212310551007046512936849306202144768.0000 - am vec -0.0000-310585348040367212540466107933093981683394433536104796407776575005538885413170465336561984232650364092881885733701424906648778163815612342027107172352.0000187499318643495772928899061436600658023508244482639265792.0000 - diff --git a/test/ccured_olden/bh/testit b/test/ccured_olden/bh/testit deleted file mode 100755 index 8c758c7e..00000000 --- a/test/ccured_olden/bh/testit +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# test a bh binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./code.exe" - exit 0 -fi - -echo "running: $1 <data.in >data.out 2>/dev/null" -if ! $1 <data.in >data.out 2>/dev/null; then - echo "$1 failed directly" - exit 2 -fi - -if ! perl ./normalize.pl <data.out | diff - data.orig.out >/dev/null; then - echo "$1 got the wrong answer" - exit 4 -else - echo "$1 seems to work" -fi - diff --git a/test/ccured_olden/bh/trusted_bh.c b/test/ccured_olden/bh/trusted_bh.c deleted file mode 100644 index 6c76f8c2..00000000 --- a/test/ccured_olden/bh/trusted_bh.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "defs.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <sys/types.h> -#ifndef _MSVC -#include <sys/times.h> -#include <sys/param.h> -#endif - - -#ifndef NO_PERF_CHANGES -///* -// * ALLOCATE: memory allocation with error checking. -// */ -//void *allocate(int nb) -//{ -// void *mem; -// -// mem = (void *) calloc(nb, 1); /* calloc zeros memory */ -// if (mem == NULL) { -// fprintf(stderr, "allocate: not enuf memory (%d bytes)\n", nb); -// exit(1); -// } -// return (mem); -//} -#endif // NO_PERF_CHANGES - - - -// Now some wrappers -typedef struct { - void *_p; - void *_b; -} fatp_void; - -//fatp_void strcpy_fss(char *dest, char *src) { -// fatp_void res; -// strcpy(dest, src); -// res._p = (void*)dest; -// res._b = (void*)(dest + strlen(dest)); -// return res; -//} - -#ifndef NO_PERF_CHANGES - #ifdef node2body - #undef node2body - #endif - bodyptr node2body(nodeptr x) { - return (bodyptr)x; - } -#endif - -// And the wild version. I'm being lazy about types -fatp_void node2body_ww(fatp_void x) { - return x; -} - -typedef struct { - nodeptr *_p; - void *_b; - void *_e; -} seqp_node; -bodyptr node2body_sq(seqp_node x) { - if((void*)x._p < x._b || (void*)((char*)x._p + sizeof(body)) > x._e) { - fprintf(stderr, "Bounds check failed in node2body_sq\n"); - exit(1); - } - return (bodyptr)x._p; -} - -#ifndef NO_PERF_CHANGES - #ifdef node2cell - #undef node2cell - #endif - cellptr node2cell(nodeptr x) { - return (cellptr)x; - } -#endif - -// And the wild version.. I'm being lazy about types -fatp_void node2cell_ww(fatp_void x) { - return x; -} - -cellptr node2cell_sq(seqp_node x) { - // if((void*)x._p < x._b || (void*)((char*)x._p + sizeof(cell)) > x._e) { - // fprintf(stderr, "Bounds check failed in node2cell_sq\n"); - // exit(1); - // } - return (cellptr)x._p; -} diff --git a/test/ccured_olden/bh/util.c b/test/ccured_olden/bh/util.c deleted file mode 100644 index b7e3347d..00000000 --- a/test/ccured_olden/bh/util.c +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************************************/ -/* UTIL: various useful routines and functions. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#include "stdinc.h" -#include "real.h" -#include "vectmath.h" -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <sys/types.h> -#ifndef _MSVC -#include <sys/times.h> -#include <sys/param.h> -#endif - - -#ifndef HZ -# include <time.h> -# define HZ CLK_TCK -#endif - -/* - * ERROR: print error message and exit. - */ - -void error(string msg, ...) -{ - va_list args; - - va_start(args, msg); - vfprintf(stderr, msg, args); - va_end(args); - exit(-1); /* quit with error status */ -} - -/* - * EPRINTF: print error message, but don't exit. - */ - -void eprintf(string msg, ...) -{ - va_list args; - - va_start(args, msg); - vfprintf(stderr, msg, args); - va_end(args); -} - - -extern double drand48(void); /* should be in math.h */ - -/* - * XRANDOM: generate floating-point random number. - */ - -real xrandom(real xl, real xh) -{ - real r = (real)rand() / (real)RAND_MAX; - return (xl + (xh - xl) * r); -} - -/* - * RSQR: compute x*x. - */ - -real rsqr(real x) -{ - return (x * x); -} - -/* - * DISTV: subtract vectors and return distance between. - */ - -real distv(vector v, vector u) -{ - real s, d; - int n = NDIM; - - s = 0.0; - while (--n >= 0) { - d = (*v++) - (*u++); - s += d * d; - } - return (rsqrt(s)); -} - -/* - * STREQ: test for equality of strings. - */ - -bool streq(string a, string b) -{ - return (strcmp(a, b) == 0); -} - -/* - * SCANOPT: scan string of the form "word1,word2,..." for match. Warning: - * words must be separated by exactly one comma -- no spaces allowed! - */ - -bool scanopt(string opt, string key) -{ - char *op, *kp; - - op = (char *) opt; /* start scan of options */ - while (*op != NULLCHR) { /* loop over words in opt */ - kp = (char *) key; /* start at front of key */ - while ((*op != ',' ? *op : NULLCHR) /* loop while this word */ - == *kp) { /* ...matches text of key */ - if (*kp++ == NULLCHR) /* at end of key word? */ - return (TRUE); /* keyword found */ - op++; /* else advance ptrs */ - } - while (*op != NULLCHR && *op++ != ',') /* loop till end of word, */ - continue; /* passing "," at end */ - } - return (FALSE); /* keyword not found */ -} - -/* - * CPUTIME: compute CPU time in minutes. - */ - -real cputime() -{ -#ifdef _MSVC - return 1.0; -#else - struct tms buffer; - - if (times(&buffer) == -1) - error("times() call failed\n"); - return (buffer.tms_utime / (60.0 * HZ)); -#endif -} - - -void *allocate(nb) -int nb; -{ - void *mem; - - mem = (void *) calloc(nb, 1); /* calloc zeros memory */ - if (mem == NULL) - error("allocate: not enuf memory (%d bytes)\n", nb); - return (mem); -} diff --git a/test/ccured_olden/bh/vectmath.h b/test/ccured_olden/bh/vectmath.h deleted file mode 100644 index 7d1b503a..00000000 --- a/test/ccured_olden/bh/vectmath.h +++ /dev/null @@ -1,371 +0,0 @@ -/****************************************************************************/ -/* VECTMATH.H: include file for vector/matrix operations. */ -/* */ -/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI. */ -/* It's free because it's yours. */ -/****************************************************************************/ - -#ifndef THREEDIM -# ifndef TWODIM -# ifndef NDIM -# define THREEDIM -# endif -# endif -#endif - -#ifdef TWODIM -# define NDIM 2 -#endif - -#ifdef THREEDIM -# define NDIM 3 -#endif - -typedef real vector[NDIM], matrix[NDIM][NDIM]; - -/* - * Vector operations. - */ - -#define CLRV(v) /* CLeaR Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = 0.0; \ -} - -#define UNITV(v,j) /* UNIT Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (_i == (j) ? 1.0 : 0.0); \ -} - -#define SETV(v,u) /* SET Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i]; \ -} - -#ifdef THREEDIM - -#ifdef NO_PERF_CHANGES - -#define ADDV(v,u,w) /* ADD Vector */ \ -{ \ - real *_vp = (v), *_up = (u), *_wp = (w); \ - *_vp++ = (*_up++) + (*_wp++); \ - *_vp++ = (*_up++) + (*_wp++); \ - *_vp = (*_up ) + (*_wp ); \ -} - -#define SUBV(v,u,w) /* SUBtract Vector */ \ -{ \ - real *_vp = (v), *_up = (u), *_wp = (w); \ - *_vp++ = (*_up++) - (*_wp++); \ - *_vp++ = (*_up++) - (*_wp++); \ - *_vp = (*_up ) - (*_wp ); \ -} - -#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \ -{ \ - real *_vp = (v), *_up = (u); \ - *_vp++ = (*_up++) * (s); \ - *_vp++ = (*_up++) * (s); \ - *_vp = (*_up ) * (s); \ -} - -#else // NO_PERF_CHANGES - -#define ADDV(v,u,w) /* ADD Vector */ \ -{ \ - real *_vp = (v), *_up = (u), *_wp = (w); \ - _vp[2] = _up[2] + _wp[2]; \ - _vp[1] = _up[1] + _wp[1]; \ - _vp[0] = _up[0] + _wp[0]; \ -} - -#define SUBV(v,u,w) /* SUBtract Vector */ \ -{ \ - real *_vp = (v), *_up = (u), *_wp = (w); \ - _vp[2] = _up[2] - _wp[2]; \ - _vp[1] = _up[1] - _wp[1]; \ - _vp[0] = _up[0] - _wp[0]; \ -} - -#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \ -{ \ - real *_vp = (v), *_up = (u); \ - _vp[2] = (_up[2]) * (s); \ - _vp[1] = (_up[1]) * (s); \ - _vp[0] = (_up[0]) * (s); \ -} -#endif // NO_PERF_CHANGES - -#else - -#define ADDV(v,u,w) /* ADD Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i] + (w)[_i]; \ -} - -#define SUBV(v,u,w) /* SUBtract Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i] - (w)[_i]; \ -} - -#define MULVS(v,u,s) /* MULtiply Vector by Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i] * (s); \ -} - -#endif - -#define DIVVS(v,u,s) /* DIVide Vector by Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i] / (s); \ -} - -#ifdef THREEDIM - -#ifdef NO_PERF_CHANGES - -#define DOTVP(s,v,u) /* DOT Vector Product */ \ -{ \ - real *_vp = (v), *_up = (u); \ - (s) = (*_vp++) * (*_up++); \ - (s) += (*_vp++) * (*_up++); \ - (s) += (*_vp ) * (*_up ); \ -} - -#else // NO_PERF_CHANGES - -#define DOTVP(s,v,u) /* DOT Vector Product */ \ -{ \ - real *_vp = (v), *_up = (u); \ - (s) = (_vp[2]) * (_up[2]); \ - (s) += (_vp[1]) * (_up[1]); \ - (s) += (_vp[0]) * (_up[0]); \ -} - -#endif // NO_PERF_CHANGES - -#else - -#define DOTVP(s,v,u) /* DOT Vector Product */ \ -{ \ - int _i; \ - (s) = 0.0; \ - for (_i = 0; _i < NDIM; _i++) \ - (s) += (v)[_i] * (u)[_i]; \ -} - -#endif - -#define ABSV(s,v) /* ABSolute value of a Vector */ \ -{ \ - real _tmp; \ - int _i; \ - _tmp = 0.0; \ - for (_i = 0; _i < NDIM; _i++) \ - _tmp += (v)[_i] * (v)[_i]; \ - (s) = rsqrt(_tmp); \ -} - -#define DISTV(s,u,v) /* DISTance between Vectors */ \ -{ \ - real _tmp; \ - int _i; \ - _tmp = 0.0; \ - for (_i = 0; _i < NDIM; _i++) \ - _tmp += ((u)[_i]-(v)[_i]) * ((u)[_i]-(v)[_i]); \ - (s) = rsqrt(_tmp); \ -} - -#ifdef TWODIM - -#define CROSSVP(s,v,u) /* CROSS Vector Product */ \ -{ \ - (s) = (v)[0]*(u)[1] - (v)[1]*(u)[0]; \ -} - -#endif - -#ifdef THREEDIM - -#define CROSSVP(v,u,w) /* CROSS Vector Product */ \ -{ \ - (v)[0] = (u)[1]*(w)[2] - (u)[2]*(w)[1]; \ - (v)[1] = (u)[2]*(w)[0] - (u)[0]*(w)[2]; \ - (v)[2] = (u)[0]*(w)[1] - (u)[1]*(w)[0]; \ -} - -#endif - -#define INCADDV(v,u) /* INCrementally ADD Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] += (u)[_i]; \ -} - -#define INCSUBV(v,u) /* INCrementally SUBtract Vector */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] -= (u)[_i]; \ -} - -#define INCMULVS(v,s) /* INCrementally MULtiply Vector by Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] *= (s); \ -} - -#define INCDIVVS(v,s) /* INCrementally DIVide Vector by Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] /= (s); \ -} - -/* - * Matrix operations. - */ - -#define CLRM(p) /* CLeaR Matrix */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = 0.0; \ -} - -#define SETMI(p) /* SET Matrix to Identity */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (_i == _j ? 1.0 : 0.0); \ -} - -#define SETM(p,q) /* SET Matrix */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_i][_j]; \ -} - -#define TRANM(p,q) /* TRANspose Matrix */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_j][_i]; \ -} - -#define ADDM(p,q,r) /* ADD Matrix */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_i][_j] + (r)[_i][_j]; \ -} - -#define SUBM(p,q,r) /* SUBtract Matrix */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_i][_j] - (r)[_i][_j]; \ -} - -#define MULM(p,q,r) /* Multiply Matrix */ \ -{ \ - int _i, _j, _k; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) { \ - (p)[_i][_j] = 0.0; \ - for (_k = 0; _k < NDIM; _k++) \ - (p)[_i][_j] += (q)[_i][_k] * (r)[_k][_j]; \ - } \ -} - -#define MULMS(p,q,s) /* MULtiply Matrix by Scalar */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_i][_j] * (s); \ -} - -#define DIVMS(p,q,s) /* DIVide Matrix by Scalar */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (q)[_i][_j] / (s); \ -} - -#define MULMV(v,p,u) /* MULtiply Matrix by Vector */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) { \ - (v)[_i] = 0.0; \ - for (_j = 0; _j < NDIM; _j++) \ - (v)[_i] += (p)[_i][_j] * (u)[_j]; \ - } \ -} - -#define OUTVP(p,v,u) /* OUTer Vector Product */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (v)[_i] * (u)[_j]; \ -} - -#define TRACEM(s,p) /* TRACE of Matrix */ \ -{ \ - int _i; \ - (s) = 0.0; \ - for (_i = 0.0; _i < NDIM; _i++) \ - (s) += (p)[_i][_i]; \ -} - -/* - * Misc. impure operations. - */ - -#define SETVS(v,s) /* SET Vector to Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (s); \ -} - -#define ADDVS(v,u,s) /* ADD Vector and Scalar */ \ -{ \ - int _i; \ - for (_i = 0; _i < NDIM; _i++) \ - (v)[_i] = (u)[_i] + (s); \ -} - -#define SETMS(p,s) /* SET Matrix to Scalar */ \ -{ \ - int _i, _j; \ - for (_i = 0; _i < NDIM; _i++) \ - for (_j = 0; _j < NDIM; _j++) \ - (p)[_i][_j] = (s); \ -} diff --git a/test/ccured_olden/bisort/.cvsignore b/test/ccured_olden/bisort/.cvsignore deleted file mode 100644 index 14e4fb3b..00000000 --- a/test/ccured_olden/bisort/.cvsignore +++ /dev/null @@ -1,25 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -allcfiles -ope.m -*_comb.c -*cured.c -*.optim.c -changes -*.browser -*optimcured* diff --git a/test/ccured_olden/bisort/CVS/Entries b/test/ccured_olden/bisort/CVS/Entries deleted file mode 100644 index 6bd4f26b..00000000 --- a/test/ccured_olden/bisort/CVS/Entries +++ /dev/null @@ -1,12 +0,0 @@ -/HOWTO/1.1/Thu Jul 5 20:05:08 2001// -/Makefile/1.4/Wed Oct 3 00:09:43 2001// -/README/1.1/Tue Jun 12 16:43:34 2001// -/args.c/1.1/Thu Jul 5 20:05:08 2001// -/bitonic.c/1.3/Wed Oct 3 00:09:43 2001// -/node.h/1.2/Thu Jul 5 20:05:08 2001// -/proc.h/1.1/Tue Jun 12 16:43:34 2001// -/swap.c/1.2/Thu Jul 5 20:05:08 2001// -/ssplain.c/1.4/Fri Nov 9 00:51:25 2001// -/.cvsignore/1.7/Wed Aug 7 01:48:34 2002// -/ssplain.h/1.6/Mon Jan 6 23:28:32 2003// -D diff --git a/test/ccured_olden/bisort/CVS/Repository b/test/ccured_olden/bisort/CVS/Repository deleted file mode 100644 index 08d61689..00000000 --- a/test/ccured_olden/bisort/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/bisort diff --git a/test/ccured_olden/bisort/CVS/Root b/test/ccured_olden/bisort/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/bisort/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/bisort/HOWTO b/test/ccured_olden/bisort/HOWTO deleted file mode 100644 index 170ad73c..00000000 --- a/test/ccured_olden/bisort/HOWTO +++ /dev/null @@ -1 +0,0 @@ -250000 0
\ No newline at end of file diff --git a/test/ccured_olden/bisort/Makefile b/test/ccured_olden/bisort/Makefile deleted file mode 100644 index b030ced2..00000000 --- a/test/ccured_olden/bisort/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = bisort.exe -PROGS = bitonic args ssplain - -ifdef _MSVC -CC = cl - -SRC = .c -OBJ = .obj -ASM = .s - -EXTRA_CDEFS = /DI_TIME /DI_SYS_TIME /DULTRIX -CDEFS = /DPLAIN /DSS_PLAIN -OPTFLAGS = /Ox - -LIBS = -LIBPATH = -else -CC = gcc -arch ppc # MacOS X -#CC=gcc # other systems -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -SRC = .c -OBJ = .o -ASM = .s - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN -OPTFLAGS = -g -Wall -O3 - -LIBS = # MacOS X -# LIBS = -lm -LIBPATH = -endif - -SRCS = $(addsuffix $(SRC),$(PROGS)) -OBJS = $(addsuffix $(OBJ),$(PROGS)) -ASMS = $(addsuffix $(ASM),$(PROGS)) - -#defaulttarget: $(BINARY) - -#$(BINARY): $(OBJS) -# $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJS) $(LIBPATH) $(LIBS) - -#$(SRC)$(OBJ): -# $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - -clean: - rm -f $(BINARY) $(OBJS) $(ASMS) *~ *.light.c *.cil.* - diff --git a/test/ccured_olden/bisort/README b/test/ccured_olden/bisort/README deleted file mode 100644 index 7b12c4bb..00000000 --- a/test/ccured_olden/bisort/README +++ /dev/null @@ -1,22 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ -****************** -olden_v1.0/benchmarks/bisort/README -January 3, 1995 -Martin C. Carlisle - -this directory contains the Bitonic Sort benchmark: -G. Bilardi and A. Nicolau. "Adaptive Bitonic Sorting: An optimal -parallel algorithm for shared-memory machines." SIAM J. Comput. -18(2):216-228, 1989. - -as implemented for Olden by Martin C. Carlisle -****************** - -Makefile - "make bisort" makes executable - -args.c - handle command line arguments -bitonic.c - main routines -swap.c - used to swap subtrees -node.h - declarations -code.h - prototypes - diff --git a/test/ccured_olden/bisort/args.c b/test/ccured_olden/bisort/args.c deleted file mode 100644 index 12591026..00000000 --- a/test/ccured_olden/bisort/args.c +++ /dev/null @@ -1,32 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -int mylog(int num) -{ - int j=0,k=1; - - while(k<num) { k*=2; j++; } - return j; -} - -extern int flag; -int dealwithargs(int argc, char *argv[]) -{ - int size; - - if (argc > 2) - flag = atoi(argv[2]); - else - flag = 0; - - if (argc > 1) - size = atoi(argv[1]); - else - size = 16; - - return size; -} - diff --git a/test/ccured_olden/bisort/bitonic.c b/test/ccured_olden/bisort/bitonic.c deleted file mode 100644 index 72ff8611..00000000 --- a/test/ccured_olden/bisort/bitonic.c +++ /dev/null @@ -1,267 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* =================== PROGRAM bitonic===================== */ -/* UP - 0, DOWN - 1 */ - -#include "node.h" /* Node Definition */ -#include "proc.h" /* Procedure Types/Nums */ - -#define CONST_m1 10000 -#define CONST_b 31415821 -#define RANGE 100 - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -#define put(a) chatting("%d",a) -#define puts(a) chatting(a) - - -int flag=0,foo=0; - -#define NewNode(h,v) \ - \ -{ \ - h = (HANDLE *) malloc(sizeof(struct node)); \ - h->value = v; \ - h->left = NIL; \ - h->right = NIL; \ - }; - - -void InOrder(h) - HANDLE *h; -{ - HANDLE *l, *r; - if ((h != NIL)) - { - l = h->left; - r = h->right; - InOrder(l); - chatting("%d @ 0x%x\n", h->value, (long)h); - InOrder(r); - } -} - -int mult(int p, int q) -{ - int p1, p0, q1, q0; - - p1=p/CONST_m1; p0=p%CONST_m1; - q1=q/CONST_m1; q0=q%CONST_m1; - return (((p0*q1+p1*q0) % CONST_m1)*CONST_m1+p0*q0); -} - -int skiprand(int seed, int n) -{ -#ifdef SS_PLAIN - for (; n; n--) seed=mult(seed,CONST_b)+1; -#else SS_PLAIN - for (; n; n--) seed=random(seed); -#endif SS_PLAIN - return seed; -} - -#ifndef SS_PLAIN -int random(int seed) -{ - int tmp; - tmp = (mult(seed,CONST_b)+1); - return tmp; -} -#endif SS_PLAIN - -HANDLE* RandTree(n,seed,level) - int n,seed,level; - -{ - int next_val,my_name; - HANDLE *h; - my_name=foo++; - - if (n > 1) - { -#ifdef SS_PLAIN - seed = mult(seed,CONST_b)+1; -#else SS_PLAIN - seed = random(seed); -#endif SS_PLAIN - next_val=seed % RANGE; - NewNode(h,next_val); - - h->left = RandTree((n/2),seed,level+1); - h->right = RandTree((n/2),skiprand(seed,(n)+1),level+1); - } - else - h = NIL; - return(h); -} - -void SwapVal(l,r) - HANDLE *l, *r; -{ - int temp; - - temp = l->value; /* MISS PROBLEM */ - l->value = r->value; - r->value = temp; -} - -void SwapLeft(l,r) - HANDLE *l, *r; -{ - HANDLE *h; - - h = r->left; - r->left = l->left; - l->left = h; -} - -void SwapRight(l,r) - HANDLE *l, *r; -{ - HANDLE *h; - - h = r->right; - r->right = l->right; /* MISS PROBLEM */ - l->right = h; -} - -int Bimerge(root,spr_val,dir) - HANDLE *root; - int spr_val,dir; -{ - int rightexchange, elementexchange; - HANDLE *pl, *pr; - - /*chatting("enter bimerge %x\n", root);*/ - rightexchange = ((root->value > spr_val) ^ dir); - if (rightexchange) - { - int temp; - temp = root->value; - root->value = spr_val; - spr_val = temp; - } - - pl = root->left; - pr = root->right; - - while (pl != NIL) - { - elementexchange = ((pl->value > /* MISS PROBLEM */pr->value) ^ dir); - if (rightexchange) - { - if (elementexchange) - { - SwapVal(pl,pr); - SwapRight(pl,pr); - pl = pl->left; - pr = pr->left; - } - else - { - pl = pl->right; - pr = pr->right; - } - } - else - { - if (elementexchange) - { - SwapVal(pl,pr); - SwapLeft(pl,pr); - pl = pl->right; - pr = pr->right; - } - else - { - pl = pl->left; - pr = pr->left; /* MISS PROBLEM */ - } - } - } - - if (root->left != NIL) - { - root->value=Bimerge(root->left,root->value,dir); - spr_val=Bimerge(root->right,spr_val,dir); - } - /*chatting("exit bimerge %x\n", root);*/ - return spr_val; -} - -int Bisort(root,spr_val,dir) - HANDLE *root; - int spr_val,dir; -{ - /*chatting("bisort %x\n", root);*/ - if (root->left == NIL) - { - if ((root->value > spr_val) ^ dir) - { - int val; - val = spr_val; - spr_val = root->value; - root->value =val; - } - } - else - { - /* Bisort both halves of the tree and merge */ - root->value=Bisort(root->left,root->value,dir); - spr_val=Bisort(root->right,spr_val,!dir); - spr_val=Bimerge(root,spr_val,dir); - } - /*chatting("exit bisort %x\n", root);*/ - return spr_val; -} - -void main(argc,argv) - int argc; - char *argv[]; - - -{ - HANDLE *h; - int sval; - int n; - - n = dealwithargs(argc,argv); - - chatting("Bisort with %d size\n", n); - h = RandTree(n,12345768,0); -#ifdef SS_PLAIN - sval = (mult(245867,CONST_b)+1) % RANGE; -#else SS_PLAIN - sval = random(245867) % RANGE; -#endif SS_PLAIN - if (flag) { - InOrder(h); - chatting("%d\n",sval); - } - chatting("**************************************\n"); - chatting("BEGINNING BITONIC SORT ALGORITHM HERE\n"); - chatting("**************************************\n"); - - chatting("Sorting forward..."); - sval=Bisort(h,sval,0); - if (flag) { - chatting("Sorted Tree:\n"); - InOrder(h); - chatting("%d\n",sval); - } - chatting("done\n"); - - chatting("sorting backward..."); - sval=Bisort(h,sval,1); - if (flag) { - chatting("Sorted Tree:\n"); - InOrder(h); - chatting("%d\n",sval); - } - chatting("done\n"); - exit(0); -} - diff --git a/test/ccured_olden/bisort/node.h b/test/ccured_olden/bisort/node.h deleted file mode 100644 index c1b81c6d..00000000 --- a/test/ccured_olden/bisort/node.h +++ /dev/null @@ -1,18 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* =============== NODE STRUCTURE =================== */ - -struct node { - int value; - struct node *left; - struct node *right; - }; - -typedef struct node HANDLE; - -#define NIL ((HANDLE *) 0) -#ifdef FUTURES -#define makenode(procid) ALLOC(procid,sizeof(struct node)) -#else -#define makenode(procid) mymalloc(sizeof(struct node)) -#endif diff --git a/test/ccured_olden/bisort/proc.h b/test/ccured_olden/bisort/proc.h deleted file mode 100644 index eadb80aa..00000000 --- a/test/ccured_olden/bisort/proc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* ========== PROCEDURE TYPES/NUMS ================== */ - - -HANDLE *RandTree(); - -void SwapValue(); -void SwapValLeft(); -void SwapValRight(); -int Bimerge(); -int Bisort(); -#define DD_EXIT 0 - - -/* ================= PROC NAMES ==============*/ - -#ifdef EXTERN - extern char *procnames[]; -#else - static char *procnames[] = - { - "EXIT" - }; -#endif diff --git a/test/ccured_olden/bisort/ssplain.c b/test/ccured_olden/bisort/ssplain.c deleted file mode 100644 index 43d3f9db..00000000 --- a/test/ccured_olden/bisort/ssplain.c +++ /dev/null @@ -1,69 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - -void chatting(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - - -#ifndef BEFOREBOX -static unsigned long bytes_allocated = 0; -static unsigned long allocations = 0; - -void* -ssplain_malloc(int size) -{ - allocations++; - bytes_allocated+=size; - return malloc(size); -} - -void* -ssplain_calloc(int nelems, int size) -{ - void *p; - allocations++; - bytes_allocated+= nelems * size; - p = calloc(nelems, size); - if(! p) { printf("Allocation failed\n"); exit(3); } - return p; -} - -void -ssplain_alloc_stats() -{ - chatting("Allocation stats: %d bytes allocated in %d allocations\n", - bytes_allocated, allocations); -} -#endif diff --git a/test/ccured_olden/bisort/ssplain.h b/test/ccured_olden/bisort/ssplain.h deleted file mode 100644 index 54f3a3ed..00000000 --- a/test/ccured_olden/bisort/ssplain.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -#pragma ccuredvararg("chatting", printf(1)); -void chatting(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/bisort/swap.c b/test/ccured_olden/bisort/swap.c deleted file mode 100644 index e1e98749..00000000 --- a/test/ccured_olden/bisort/swap.c +++ /dev/null @@ -1,145 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#define COLLECT_SIZE 256 -#define DFS_SIZE 20 -#include "node.h" - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - - -typedef struct { - int top; - HANDLE *handles[DFS_SIZE]; -} stack; - -#define push(s,v) (s)->handles[++((s)->top)] = v -#define pop(s) (s)->handles[((s)->top)--] -#define stackempty(s) ((s)->top < 0) -void VisitCollect(HANDLE *t, local int *collect) -{ - register int val; - val = t->value; - *collect = val; -} - -void VisitCollectReplace(HANDLE *t, local int *collect) -{ - register int temp = *collect; - register int val = t->value; - *collect = val; - t->value = temp; -} - -void VisitReplace(HANDLE *t, local int *collect) -{ - register int val = *collect; - t->value = val; -} - -void swapDFS(local stack *s, local int collection[], void visit()) -{ - int num=0; - - while (!stackempty(s) && num < COLLECT_SIZE) - { - HANDLE *v = pop(s); - visit(v,&collection[num]); - num++; - if (v->left != NULL) - { - HANDLE *child; - child = v->right; - push(s,child); - child = v->left; - push(s,child); - } - } -} - -void NewSwapSubTree(HANDLE *t1, HANDLE *t2) -{ - local stack c1, r1, s2; - int collection[COLLECT_SIZE]; - - /*chatting("starting swapping\n");*/ - - if (t1!=NULL) - { - c1.top = -1; - r1.top = -1; - s2.top = -1; - push(&c1,t1); - push(&r1,t1); - push(&s2,t2); - while (!stackempty(&c1)) - { - MLOCAL(t1); - swapDFS(&c1,collection,VisitCollect); - MLOCAL(t2); - swapDFS(&s2,collection,VisitCollectReplace); - MLOCAL(t1); - swapDFS(&r1,collection,VisitReplace); - } - } - /*chatting("ending swapping\n");*/ - -} - - -int *Collect(HANDLE *t1, local int collection[]) -{ - register int val; - if (t1==NULL) return collection; - MLOCAL(t1); - val = t1->value; - *collection = val; - collection += 1; - collection = Collect(t1->left,collection); - collection = Collect(t1->right,collection); - return collection; -} - -int *Collect_Replace(HANDLE *t1, local int collection[]) -{ - register int temp,val; - if (t1==NULL) return collection; - MLOCAL(t1); - temp = *collection; - val = t1->value; - *collection = val; - t1->value = temp; - collection += 1; - collection = Collect_Replace(t1->left,collection); - collection = Collect_Replace(t1->right,collection); - return collection; -} - -int *Replace(HANDLE *t1, local int collection[]) -{ - register int val; - if (t1==NULL) return collection; - MLOCAL(t1); - val = *collection; - t1->value = val; - collection +=1; - collection = Replace(t1->left,collection); - collection = Replace(t1->right,collection); - return collection; -} - - -void SwapSubTree(HANDLE *t1, HANDLE *t2) -{ - int collection[COLLECT_SIZE]; - HANDLE *t1loc, *t2loc; - - MLOCAL(t1); - Collect(t1,collection); - MLOCAL(t2); - Collect_Replace(t2,collection); - MLOCAL(t1); - Replace(t1,collection); -} - diff --git a/test/ccured_olden/em3d/.cvsignore b/test/ccured_olden/em3d/.cvsignore deleted file mode 100644 index 7601f0ad..00000000 --- a/test/ccured_olden/em3d/.cvsignore +++ /dev/null @@ -1,29 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -em3d -em3d.*box - -allcfiles -ope.m -*cured.c -*optimcured* -*_comb.c -changes -*.browser -*optimcured* -*.out diff --git a/test/ccured_olden/em3d/CVS/Entries b/test/ccured_olden/em3d/CVS/Entries deleted file mode 100644 index 32532e6f..00000000 --- a/test/ccured_olden/em3d/CVS/Entries +++ /dev/null @@ -1,17 +0,0 @@ -/HOWTO/1.1/Fri Jun 29 11:36:12 2001// -/MY_HOWTO/1.1/Fri Jun 29 11:36:12 2001// -/Makefile.plain/1.1/Fri Jun 29 11:36:12 2001// -/Makefile.ss/1.1/Fri Jun 29 11:36:12 2001// -/em3d.c/1.1/Fri Jun 29 11:36:12 2001// -/main.c/1.2/Mon Jul 9 19:38:57 2001// -/make_graph.h/1.1/Fri Jun 29 11:36:12 2001// -/util.c/1.1/Fri Jun 29 11:36:12 2001// -/util.h/1.1/Fri Jun 29 11:36:12 2001// -/ssplain.c/1.5/Sat Nov 3 05:27:15 2001// -/Makefile/1.7/Fri Nov 9 01:27:01 2001// -/args.c/1.2/Mon Mar 18 00:14:04 2002// -/make_graph.c/1.2/Wed May 29 03:29:06 2002// -/.cvsignore/1.9/Sat Aug 10 01:19:31 2002// -/em3d.h/1.2/Sat Aug 10 01:19:31 2002// -/ssplain.h/1.6/Mon Jan 6 23:28:11 2003// -D diff --git a/test/ccured_olden/em3d/CVS/Repository b/test/ccured_olden/em3d/CVS/Repository deleted file mode 100644 index cb6d74d1..00000000 --- a/test/ccured_olden/em3d/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/em3d diff --git a/test/ccured_olden/em3d/CVS/Root b/test/ccured_olden/em3d/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/em3d/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/em3d/HOWTO b/test/ccured_olden/em3d/HOWTO deleted file mode 100644 index 061698dd..00000000 --- a/test/ccured_olden/em3d/HOWTO +++ /dev/null @@ -1 +0,0 @@ -2000 100 1 diff --git a/test/ccured_olden/em3d/MY_HOWTO b/test/ccured_olden/em3d/MY_HOWTO deleted file mode 100644 index fe67f7a8..00000000 --- a/test/ccured_olden/em3d/MY_HOWTO +++ /dev/null @@ -1,2 +0,0 @@ -2000 100 1? -(These should be Mowry's arguments.) diff --git a/test/ccured_olden/em3d/Makefile b/test/ccured_olden/em3d/Makefile deleted file mode 100644 index aa0de0af..00000000 --- a/test/ccured_olden/em3d/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = em3d.exe -BINARYCCOMP = em3d.exe.compcert -PROGS = main em3d make_graph util args ssplain - - -OLDENHOME = /tmp/olden - -CC = gcc -arch ppc -CCOMP = ../../../ccomp -CCOMPFLAGS=-dump-c - -SRC = .c -OBJ = .o -ASM = .s -SRCS = $(addsuffix $(SRC),$(PROGS)) -OBJS = $(addsuffix $(OBJ),$(PROGS)) -ASMS = $(addsuffix $(ASM),$(PROGS)) -INCDIRS = /usr/include - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN -DSS_RAND #-I$(OLDENHOME)/common -OPTFLAGS = -g -Wall -O3 - -LIBS = -LIBPATH = - -#$(BINARY): $(OBJS) -# $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJS) $(LIBPATH) $(LIBS) - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - - - -#$(BINARYCCOMP): $(OBJSCCOMP) -# $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJSCCOMP) $(LIBPATH) $(LIBS) - -#$(OBJCCOMP): -# $(CCOMP) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - -$(SRC)$(OBJ): - $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - -clean: - rm -f $(BINARY) $(BINARYCCOMP) $(OBJS) $(ASMS) *~ *.light.c *.cil.* - -links: - /bin/rm -f ssplain.[hc] - ln -s $(OLDENHOME)/common/ssplain.h - ln -s $(OLDENHOME)/common/ssplain.c diff --git a/test/ccured_olden/em3d/Makefile.plain b/test/ccured_olden/em3d/Makefile.plain deleted file mode 100644 index b87f77b1..00000000 --- a/test/ccured_olden/em3d/Makefile.plain +++ /dev/null @@ -1,7 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = em3d -FILES = main em3d make_graph util args ssplain - -include ../Makefile.plain - diff --git a/test/ccured_olden/em3d/Makefile.ss b/test/ccured_olden/em3d/Makefile.ss deleted file mode 100644 index f07d9395..00000000 --- a/test/ccured_olden/em3d/Makefile.ss +++ /dev/null @@ -1,8 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = em3d -FILES = main em3d make_graph util args ssplain - -MY_CDEFS = -DAMIR -include ../Makefile.ss - diff --git a/test/ccured_olden/em3d/args.c b/test/ccured_olden/em3d/args.c deleted file mode 100644 index f48638e6..00000000 --- a/test/ccured_olden/em3d/args.c +++ /dev/null @@ -1,21 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include "em3d.h" - -void dealwithargs(int argc, char *argv[]) -{ - if (argc > 1) - n_nodes = atoi(argv[1]); - else - n_nodes = 10; - - if (argc > 2) - d_nodes = atoi(argv[2]); - else - d_nodes = 3; - - if (argc > 3) - iters = atoi(argv[3]); - else - iters = 100; -} diff --git a/test/ccured_olden/em3d/em3d.c b/test/ccured_olden/em3d/em3d.c deleted file mode 100644 index 760dd1a0..00000000 --- a/test/ccured_olden/em3d/em3d.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "em3d.h" - -void compute_nodes(node_t *nodelist) -{ - int i; - - for (; nodelist; nodelist = nodelist->next) - for (i=0; i < nodelist->from_count; i++) /* bad load */ - { - node_t *other_node = nodelist->from_nodes[i]; /* bad load */ - double coeff = nodelist->coeffs[i]; /* bad load */ - double value = other_node->value; /* bad load: 50% */ - - nodelist->value -= coeff * value; - } -} diff --git a/test/ccured_olden/em3d/em3d.h b/test/ccured_olden/em3d/em3d.h deleted file mode 100644 index ba1eac22..00000000 --- a/test/ccured_olden/em3d/em3d.h +++ /dev/null @@ -1,38 +0,0 @@ -/* em3d.h - Header file for the electromagnetic problem in 3 dimensions - * - * By: Martin C. Carlisle - * Date: Feb. 23, 1994 - * - */ - -#ifndef EM3D -#define EM3D - -extern int n_nodes; /* number of nodes (E and H) */ -extern int d_nodes; /* degree of nodes */ -extern int iters; /* number of iterations */ - -#define ALLOC malloc -#define DIST_SPAN 6 - -#define assert(a) if (!a) {printf("Assertion failure\n"); exit(-1);} - - -typedef struct node_t { - double value; - struct node_t *next; - struct node_t ** to_nodes; /* array of nodes pointed to */ - struct node_t ** from_nodes; /* array of nodes data comes from */ - double * coeffs; /* array of coeffs on edges */ - int from_count; -} node_t; - -typedef struct graph_t { - node_t *e_nodes; - node_t *h_nodes; -} graph_t; - -/* Perform 1 step for a nodelist */ -void compute_nodes(node_t *nodelist); -#endif - diff --git a/test/ccured_olden/em3d/main.c b/test/ccured_olden/em3d/main.c deleted file mode 100644 index 61a3af4f..00000000 --- a/test/ccured_olden/em3d/main.c +++ /dev/null @@ -1,45 +0,0 @@ -#include <stdio.h> - -#include "em3d.h" -#include "make_graph.h" - -#define chatting(A) - -void print_graph(graph_t graph) -{ -#ifdef GET_OUT - node_t *cur_node; - - for(cur_node=graph.e_nodes; cur_node; cur_node=cur_node->next) - { - chatting(("E: value %f, from_count %d\n",cur_node->value, - cur_node->from_count)); - } - for(cur_node=graph.h_nodes; cur_node; cur_node=cur_node->next) - { - chatting(("H: value %f, from_count %d\n",cur_node->value, - cur_node->from_count)); - } -#endif GET_OUT -} - -int iters; - -int main(int argc, char *argv[]) -{ - int i; - graph_t graph; - - dealwithargs(argc,argv); - graph=initialize_graph(); - print_graph(graph); - - for (i = 0; i < iters; i++) - { - compute_nodes(graph.e_nodes); - compute_nodes(graph.h_nodes); - fprintf(stderr, "Completed a computation phase: %d\n", i); - print_graph(graph); - } - return 0; -} diff --git a/test/ccured_olden/em3d/make_graph.c b/test/ccured_olden/em3d/make_graph.c deleted file mode 100644 index 6bec340d..00000000 --- a/test/ccured_olden/em3d/make_graph.c +++ /dev/null @@ -1,173 +0,0 @@ -/* make_graph.c - Create a graph to be solved for the electromagnetic - * problem in 3 dimensions. - * - * By: Martin C. Carlisle - * Date: Feb 23, 1994 - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include "em3d.h" -#include "util.h" - -#define NUM_H_NODES n_nodes -#define H_NODE_DEGREE d_nodes - -#define NUM_E_NODES n_nodes -#define E_NODE_DEGREE d_nodes - -int n_nodes; -int d_nodes; - -node_t **make_table(int size) -{ - node_t **retval; - - retval = (node_t **) ALLOC(size*sizeof(node_t *)); - assert(retval); - return retval; -} - -// post: -// all 'next' fields valid or null -// to_nodes, from_nodes, coefs are dead -void fill_table(node_t **table, int size) -{ - int i; - - /* Now we fill the table with allocated nodes */ - for (i=0; i<size; i++) - { - table[i] = (node_t *) ALLOC(sizeof(node_t)); - table[i]->value = gen_uniform_double(); - table[i]->from_count = 0; - - if (i > 0) - table[i-1]->next = table[i]; - } - table[size-1]->next = NULL; -} - -// post: -// nodes in 'nodelist' have their 'to_nodes' array created, of -// size 'degree'; then this array is filled with pointers to -// randomly-chosen nodes (no duplicates); 'from_count' in the -// pointed-to node keeps track of its in-degree -void make_neighbors(node_t *nodelist, node_t **table, int tablesz, - int degree) -{ - node_t *cur_node; - - for(cur_node = nodelist; cur_node; cur_node=cur_node->next) - { - node_t *other_node; - int j,k; - - cur_node->to_nodes = (node_t **) ALLOC(degree*(sizeof(node_t *))); - for (j=0; j<degree; j++) - { - /* Make sure no duplicates are generated */ - do - { - other_node = table[gen_number(tablesz)]; - for (k=0; k<j; k++) - if (other_node == cur_node->to_nodes[k]) break; - } - while (k<j); - cur_node->to_nodes[j]=other_node; - other_node->from_count++; /* bad load: 50% */ - } - } -} - -// post: -// from_nodes and coeffs get allocated, size specified by 'from_count', -// which is the 'degree' from above; coeff's entries are set randomly, -// from_nodes' entries left dead; from_count then set to 0 -void update_from_coeffs(node_t *nodelist) -{ - node_t *cur_node; - - /* Setup coefficient and from_nodes vectors for h nodes */ - for (cur_node = nodelist; cur_node; cur_node=cur_node->next) - { - int from_count = cur_node->from_count; - int k; - - cur_node->from_nodes = (node_t **) ALLOC(from_count * sizeof(node_t *)); - cur_node->coeffs = (double *) ALLOC(from_count * sizeof(double)); - for (k=0; k<from_count; k++) - cur_node->coeffs[k] = gen_uniform_double(); - - cur_node->from_count = 0; - } -} - -// post: -// nodes pointed-to by those on 'nodelist' have their from_nodes' -// entries filled with back-edges; from_count is used to add -// information contiguously; global algorithm structure keeps the -// array access in bounds (we counted in-degree before, and that -// count was used to allocate, and now we one again enumerate the -// pointers to a node); perhaps a runtime check is in order here -void fill_from_fields(node_t *nodelist, int degree) -{ - node_t *cur_node; - for(cur_node = nodelist; cur_node; cur_node = cur_node->next) - { - int j; - - for (j=0; j<degree; j++) - { - node_t *other_node = cur_node->to_nodes[j]; - other_node->from_nodes[other_node->from_count] = cur_node; - other_node->from_count++; - } - } -} - -// post: -// two arrays of nodes are created; all 'h' nodes are then pointed to -// H_NODE_DEGREE 'e' nodes, and vice-versa for 'e' nodes; backedge -// information is also computed; pointers to the first nodes of each -// set are stashed in a graph_t and returned (sets are linked together -// as a linked list) -graph_t initialize_graph() -{ - node_t **h_table; - node_t **e_table; - graph_t retval; - - /* We start by creating a table of pointers to the h nodes */ - h_table = make_table(NUM_H_NODES); - fill_table(h_table,NUM_H_NODES); - - /* We repeat the same for the e nodes */ - e_table = make_table(NUM_E_NODES); - fill_table(e_table,NUM_E_NODES); - - /* At this point, for each h node, we give it the appropriate number - of neighbors as defined by the degree */ - make_neighbors(h_table[0],e_table,NUM_E_NODES,H_NODE_DEGREE); - make_neighbors(e_table[0],h_table,NUM_H_NODES,E_NODE_DEGREE); - - /* We now create from count and initialize coefficients */ - update_from_coeffs(h_table[0]); - update_from_coeffs(e_table[0]); - - /* Fill the from fields in the nodes */ - fill_from_fields(h_table[0],H_NODE_DEGREE); - fill_from_fields(e_table[0],E_NODE_DEGREE); - - retval.e_nodes=e_table[0]; - retval.h_nodes=h_table[0]; - - free(h_table); - free(e_table); - - return retval; -} - - - diff --git a/test/ccured_olden/em3d/make_graph.h b/test/ccured_olden/em3d/make_graph.h deleted file mode 100644 index 2433c018..00000000 --- a/test/ccured_olden/em3d/make_graph.h +++ /dev/null @@ -1,13 +0,0 @@ -/* make_graph.h - * - * By: Martin C. Carlisle - * Date: Feb 23, 1994 - * - */ - -#include "em3d.h" - -/* initialize graph returns a structure with pointers to lists of e and h - * nodes. - */ -graph_t initialize_graph(); diff --git a/test/ccured_olden/em3d/ssplain.c b/test/ccured_olden/em3d/ssplain.c deleted file mode 100644 index 346c5ed2..00000000 --- a/test/ccured_olden/em3d/ssplain.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - - -void chatting(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - - -#ifndef BEFOREBOX -static unsigned long bytes_allocated = 0; -static unsigned long allocations = 0; - -void* -ssplain_malloc(int size) -{ - allocations++; - bytes_allocated+=size; - return malloc(size); -} - -void* -ssplain_calloc(int nelems, int size) -{ - void *p; - allocations++; - bytes_allocated+= nelems * size; - p = calloc(nelems, size); - if(!p) { printf("Cannot allocate\n"); exit(3); } - return p; -} - -void -ssplain_alloc_stats() -{ - chatting("Allocation stats: %d bytes allocated in %d allocations\n", - bytes_allocated, allocations); -} -#endif diff --git a/test/ccured_olden/em3d/ssplain.h b/test/ccured_olden/em3d/ssplain.h deleted file mode 100644 index 54f3a3ed..00000000 --- a/test/ccured_olden/em3d/ssplain.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -#pragma ccuredvararg("chatting", printf(1)); -void chatting(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/em3d/util.c b/test/ccured_olden/em3d/util.c deleted file mode 100644 index 3dc5592d..00000000 --- a/test/ccured_olden/em3d/util.c +++ /dev/null @@ -1,34 +0,0 @@ -#define CONST_seed 45 -#include <stdlib.h> - -/* initialize the random number generator for a particular processor */ -void init_random(int myid) -{ - srand48(myid*CONST_seed); -} - -/* return a random number from 0 to range-1 */ -int gen_number(int range) -{ - return lrand48() % range; -} - -/* return a random number in [-range+1,range-1] */ -int gen_signed_number(int range) -{ - int temp; - - temp = lrand48() % (2*range-1); /* 0..2*range-2 */ - return temp-(range-1); -} - -/* Generate a double from 0.0 to 1.0 */ -double gen_uniform_double() -{ - return drand48(); -} - -int check_percent(int percent) -{ - return (drand48() < (double) (percent/100.0)); -} diff --git a/test/ccured_olden/em3d/util.h b/test/ccured_olden/em3d/util.h deleted file mode 100644 index a6b09f28..00000000 --- a/test/ccured_olden/em3d/util.h +++ /dev/null @@ -1,23 +0,0 @@ -/* util.h - * - * headers for randomizing utilities - * - * By: Martin C. Carlisle - * Date: Feb 23, 1994 - * - */ - -/* initialize the random number generator for a particular processor */ -void init_random(int myid); - -/* return a random number from 0 to range-1 */ -int gen_number(int range); - -/* return a random number in [-range+1,range-1] */ -int gen_signed_number(int range); - -/* Generate a double from 0.0 to 1.0 */ -double gen_uniform_double(); - -/* Return 1, percent percent of the time and 0 otherwise */ -int check_percent(int percent); diff --git a/test/ccured_olden/health/.cvsignore b/test/ccured_olden/health/.cvsignore deleted file mode 100644 index 4d714a14..00000000 --- a/test/ccured_olden/health/.cvsignore +++ /dev/null @@ -1,30 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -changes.out -health.cil -health.*box -health.exe_comb.browser -health -allcfiles -ope.m -*cured.c -*.optim.c -*_comb.c -changes -output -out.diff diff --git a/test/ccured_olden/health/.gdbinit b/test/ccured_olden/health/.gdbinit deleted file mode 100644 index ce03cd23..00000000 --- a/test/ccured_olden/health/.gdbinit +++ /dev/null @@ -1,6 +0,0 @@ -# .gdbinit - -file health -set args 2 5 1 -break main -run diff --git a/test/ccured_olden/health/CVS/Entries b/test/ccured_olden/health/CVS/Entries deleted file mode 100644 index 87bb1a82..00000000 --- a/test/ccured_olden/health/CVS/Entries +++ /dev/null @@ -1,16 +0,0 @@ -/.gdbinit/1.1/Sat Jul 21 16:09:41 2001// -/HOWTO/1.1/Sat Jul 14 22:53:03 2001// -/README/1.1/Mon Jun 11 22:47:26 2001// -/health.h/1.3/Sat Jul 21 16:09:41 2001// -/list.c/1.3/Sat Jul 21 16:09:41 2001// -/poisson.c/1.2/Mon Jul 9 16:14:59 2001// -/ssplain.c/1.5/Fri Nov 9 01:27:01 2001// -/args.c/1.5/Mon Nov 12 15:44:12 2001// -/health.c/1.7/Mon Nov 12 15:44:12 2001// -/out.orig/1.2/Mon Nov 12 15:44:12 2001// -/out.orig.msvc/1.1/Tue Dec 4 04:57:46 2001// -/testit/1.2/Tue Dec 4 05:07:50 2001// -/Makefile/1.11/Tue Dec 18 06:56:15 2001// -/.cvsignore/1.14/Fri Oct 4 16:28:44 2002// -/ssplain.h/1.5/Mon Jan 6 23:28:55 2003// -D diff --git a/test/ccured_olden/health/CVS/Repository b/test/ccured_olden/health/CVS/Repository deleted file mode 100644 index 8167847a..00000000 --- a/test/ccured_olden/health/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/health diff --git a/test/ccured_olden/health/CVS/Root b/test/ccured_olden/health/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/health/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/health/HOWTO b/test/ccured_olden/health/HOWTO deleted file mode 100644 index 8f57aa46..00000000 --- a/test/ccured_olden/health/HOWTO +++ /dev/null @@ -1 +0,0 @@ -5 500 1 1 diff --git a/test/ccured_olden/health/Makefile b/test/ccured_olden/health/Makefile deleted file mode 100644 index 53c5a9fd..00000000 --- a/test/ccured_olden/health/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = health.exe -PROGS = health poisson list args ssplain - -# ------- msvc ------ -ifdef _MSVC -CC = cl - -CFLAGS = -CONLY = /c -SRC = .c -OBJ = .obj -ASM = .s -EXEOUT = /Fe - -EXTRA_CDEFS = /DI_TIME /DI_SYS_TIME /DULTRIX -CDEFS = /DPLAIN /DSS_PLAIN -ifdef _DEBUG -OPTFLAGS = /Zi /MLd -else -OPTFLAGS = /Ox -endif - -LIBS = -LIBPATH = - -# ------- gcc ------ -else -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -CFLAGS = -O3 -CONLY = -c -SRC = .c -OBJ = .gcc -OBJCCOMP = .compcert -ASM = .s - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN -OPTFLAGS = -g -Wall -O3 -EXEOUT = -gcc - -LIBS = -LIBPATH = -endif - -# ------- common -------- - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - - -clean: - rm -f $(BINARY) *.o *~ *.s *.light.c *.cil.* *.compcert - - - diff --git a/test/ccured_olden/health/README b/test/ccured_olden/health/README deleted file mode 100644 index aff90729..00000000 --- a/test/ccured_olden/health/README +++ /dev/null @@ -1,20 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ -********************** -olden_v1.0/benchmarks/health/README -January 3, 1995 -Martin C. Carlisle - -this directory contains the health benchmark: - -G. Lomow, J. Cleary, B. Unger and D. West. "A Performance Study of Time Warp" -In SCS Multiconference on Distributed Simulation, pages 50-55, Feb. 1988. - -as implemented for Olden by Gordon C. Mackenzie -********************** - -Makefile - use "make health" to create executable - -args.c - process command line args -health.[ch] - health routines -list.c - list routines -poisson.c - random routines diff --git a/test/ccured_olden/health/args.c b/test/ccured_olden/health/args.c deleted file mode 100644 index f8e7a8cc..00000000 --- a/test/ccured_olden/health/args.c +++ /dev/null @@ -1,34 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/***************************************************************** - * args.c: Handles arguments to command line. * - * To be used with health.c. * - *****************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include "health.h" - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -void dealwithargs(int argc, char *argv[]) { - - if (argc < 4) - { - fprintf(stderr, "usage: health <# levels> <time> <seed>\n"); - exit(1); - } - - max_level = atoi(argv[1]); - fprintf(stderr, "This is max_level : %d\n", max_level); - max_time = atol(argv[2]); - fprintf(stderr, "This is max_time : %ld\n", max_time); // sm: "%d" -> "%ld" - seed = atol(argv[3]); -} - - - - - diff --git a/test/ccured_olden/health/health.c b/test/ccured_olden/health/health.c deleted file mode 100644 index 6de1d0d7..00000000 --- a/test/ccured_olden/health/health.c +++ /dev/null @@ -1,309 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/******************************************************************* - * Health.c : Model of the Colombian Health Care System * - *******************************************************************/ -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include "health.h" -#include <assert.h> - -struct Village *alloc_tree(int level, int label, struct Village *back) -{ - if (level == 0) - { - return NULL; - } - else - { - int i; - struct Village *new; - - new = (struct Village *)malloc(sizeof(struct Village)); - - new->back = back; - new->label = label; - new->seed = label * (IQ + seed); - new->hosp.personnel = (int)pow(2, level - 1); - new->hosp.free_personnel = new->hosp.personnel; - new->hosp.num_waiting_patients = 0; - new->hosp.assess.forward = NULL; - new->hosp.assess.back = NULL; - new->hosp.waiting.forward = NULL; - new->hosp.waiting.back = NULL; - new->hosp.inside.forward = NULL; - new->hosp.inside.back = NULL; - new->returned.back = NULL; - new->returned.forward = NULL; - - for (i = 0; i < 4; i++) - new->forward[i] = - alloc_tree(level - 1, (label * 4) + i + 1, new); - - return new; - } -} - - -struct Results get_results(struct Village *village) -{ - int i; - struct List *list; - struct Patient *p; - struct Village *v; - struct Results r1; - - r1.total_hosps = 0.0; - r1.total_patients = 0.0; - r1.total_time = 0.0; - - if (village == NULL) return r1; - - for (i = 0; i < 4; i++ ) { - struct Results res; - - v = village->forward[i]; - res = get_results(v); - - r1.total_hosps += res.total_hosps; - r1.total_patients += res.total_patients; - r1.total_time += res.total_time; - } - - list = village->returned.forward; - while (list != NULL) { - p = list->patient; - r1.total_hosps += (float)(p->hosps_visited); - r1.total_time += (float)(p->time); - r1.total_patients += 1.0; - list = list->forward; - } - - return r1; -} - - -void check_patients_inside(struct Village *village, struct List *list) -{ - struct Patient *p; - - while (list != NULL) - { - - p = list->patient; - p->time_left--; - - if (p->time_left == 0) - { - village->hosp.free_personnel++; - removeList(&(village->hosp.inside), p); - addList(&(village->returned), p); - } - list = list->forward; - } -} - - -struct List *check_patients_assess(struct Village *village, struct List *list) -{ - float rand; - struct Patient *p; - int label; - - while (list != NULL) - { - p = list->patient; - p->time_left--; - label = village->label; - - if (p->time_left == 0) - { - rand = my_rand(village->seed); - village->seed = (long)(rand * IM); - label = village->label; - - if (rand > 0.1 || label == 0) - { - removeList(&(village->hosp.assess), p); - addList(&(village->hosp.inside), p); - p->time_left = 10; - p->time += p->time_left; - } - else - { - village->hosp.free_personnel++; - removeList(&(village->hosp.assess), p); - addList(&(village->hosp.up), p); - } - } - - list = list->forward; - } - return &(village->hosp.up); -} - - -void check_patients_waiting(struct Village *village, struct List *list) -{ - int i; - struct Patient *p; - - while (list != NULL) - { - i = village->hosp.free_personnel; - p = list->patient; /* This is a bad load */ - - if (i > 0) - { - village->hosp.free_personnel--; - p->time_left = 3; - p->time += p->time_left; - removeList(&(village->hosp.waiting), p); - addList(&(village->hosp.assess), p); - } - else - { - p->time++; /* so is this */ - } - list = list->forward; - } -} - - -void put_in_hosp(struct Hosp *hosp, struct Patient *patient) -{ - patient->hosps_visited++; - - if (hosp->free_personnel > 0) - { - hosp->free_personnel--; - addList(&(hosp->assess), patient); - patient->time_left = 3; - patient->time += patient->time_left; - } - else - { - addList(&(hosp->waiting), patient); - } -} - - -struct Patient *generate_patient(struct Village *village) -{ - struct Patient *patient = NULL; - float rand; - - rand = my_rand(village->seed); - village->seed = (long)(rand * IM); - - if (rand > 0.666) - { - patient = (struct Patient *)mymalloc(sizeof(struct Patient)); - patient->hosps_visited = 0; - patient->time = 0; - patient->time_left = 0; - patient->home_village = village; - } - - return patient; -} - -int -main(int argc, char *argv[]) -{ - struct Results results; - struct Village *top; - long i; - float total_time, - total_patients, - total_hosps; - - dealwithargs(argc, argv); - - top = alloc_tree(max_level, 0, NULL); - - chatting("\n\n Colombian Health Care Simulator\n\n"); - chatting("Working...\n"); - - // sm: changed "%d" to "%ld" to silence gcc warning - fprintf(stderr, "This is max_time right before the loop: %ld\n", max_time); - for (i = 0; i < max_time; i++) - { - //printf("This is i with each iteration: %d\n", i); - if ((i % 10) == 0) - chatting("iteration %d\n", i); - sim(top); - } - - results = get_results(top); - total_patients = results.total_patients; - total_time = results.total_time; - total_hosps = results.total_hosps; - - chatting("Done.\n\n"); - chatting("# of people treated: %f people\n", - total_patients); - chatting("Average length of stay: %f time units\n", - total_time / total_patients); - chatting("Average # of hospitals visited: %f hospitals\n\n", - total_hosps / total_patients); - return 0; -} - - -struct List *sim(struct Village *village) -{ - int i; - struct Patient *patient, *p; - struct List *l, *vl, *up; - - if (village == NULL) - return NULL; - - for (i = 0; i < 4; i++) - { - l = vl = sim(village->forward[i]); - - if (l != NULL) - { - l = l->forward; - while (l != NULL) - { - p = l->patient; - put_in_hosp(&(village->hosp), p); - removeList(vl, p); - l = l->forward; - } - } - } - - - /* Uses lists inside, and return */ - check_patients_inside(village, village->hosp.inside.forward); - - /* Uses lists assess, inside, and up */ - up = check_patients_assess(village, village->hosp.assess.forward); - - /* Uses lists waiting, and assess */ - check_patients_waiting(village, village->hosp.waiting.forward); - - if ((patient = generate_patient(village)) != NULL) - { - put_in_hosp(&(village->hosp), patient); - } - - return up; -} - - - - - - - - diff --git a/test/ccured_olden/health/health.h b/test/ccured_olden/health/health.h deleted file mode 100644 index 4d3c4fd8..00000000 --- a/test/ccured_olden/health/health.h +++ /dev/null @@ -1,76 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/**************************************************************** - * health.h: header file for health.c * - *************************************************************** */ - - -#ifndef _HEALTH -#define _HEALTH - -#include <stdio.h> -#include <stdlib.h> - -#define IA 16807 -#define IM 2147483647 -#define AM (1.0 / IM) -#define IQ 127773 -#define IR 2836 -#define MASK 123459876 - -int max_level; -long max_time, - seed; - -struct Results { - float total_patients; - float total_time; - float total_hosps; }; - -struct Patient { - int hosps_visited; - int time; - int time_left; - struct Village *home_village; }; - -struct List { - struct Patient *patient; - struct List *back; - struct List *forward; }; - -struct Hosp { - int personnel; - int free_personnel; - int num_waiting_patients; - struct List waiting; - struct List assess; - struct List inside; - struct List up; }; - -struct Village { - struct Village *forward[4], - *back; - struct List returned; - struct Hosp hosp; - int label; - long seed; }; - -void dealwithargs(int argc, char *argv[]); -float my_rand(long idum); -struct Patient *generate_patient(struct Village *village); -void put_in_hosp(struct Hosp *hosp, struct Patient *patient); -void addList(struct List *list, struct Patient *patient); -void removeList(struct List *list, struct Patient *patient); -struct List *sim(struct Village *village); -void check_patients_inside(struct Village *village, struct List *list); -struct List *check_patients_assess(struct Village *village, struct List *list); -void check_patients_waiting(struct Village *village, struct List *list); -float get_num_people(struct Village *village); -float get_total_time(struct Village *village); -float get_total_hosps(struct Village *village); -struct Results get_results(struct Village *village); - -#endif - - - diff --git a/test/ccured_olden/health/list.c b/test/ccured_olden/health/list.c deleted file mode 100644 index dcd268cc..00000000 --- a/test/ccured_olden/health/list.c +++ /dev/null @@ -1,55 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/******************************************************************** - * List.c: Handles lists. * - * To be used with health.c * - ******************************************************************* */ - -#include <stdio.h> -#include <stdlib.h> -#include "health.h" - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -void addList(struct List *list, struct Patient *patient) { - struct List *b; - - while (list != NULL) - { - b = list; - list = list->forward; - } - - list = (struct List *)mymalloc(sizeof(struct List)); - list->patient = patient; - list->forward = NULL; - list->back = b; - b->forward = list; -} - - -void removeList(struct List *list, struct Patient *patient) -{ - struct List *l1,*l2; - struct Patient *p; - - p = list->patient; - while(p != patient) - { - list = list->forward; - p = list->patient; - } - - l1 = list->back; - l2 = list->forward; - l1->forward = l2; - if (list->forward != NULL) - { - l1 = list->forward; - l2 = list->back; - l1->back = l2; - } -} - diff --git a/test/ccured_olden/health/out.orig b/test/ccured_olden/health/out.orig deleted file mode 100644 index 42fd5748..00000000 --- a/test/ccured_olden/health/out.orig +++ /dev/null @@ -1,64 +0,0 @@ -This is max_level : 5 -This is max_time : 500 - - - Colombian Health Care Simulator - -Working... -This is max_time right before the loop: 500 -iteration 0 -iteration 10 -iteration 20 -iteration 30 -iteration 40 -iteration 50 -iteration 60 -iteration 70 -iteration 80 -iteration 90 -iteration 100 -iteration 110 -iteration 120 -iteration 130 -iteration 140 -iteration 150 -iteration 160 -iteration 170 -iteration 180 -iteration 190 -iteration 200 -iteration 210 -iteration 220 -iteration 230 -iteration 240 -iteration 250 -iteration 260 -iteration 270 -iteration 280 -iteration 290 -iteration 300 -iteration 310 -iteration 320 -iteration 330 -iteration 340 -iteration 350 -iteration 360 -iteration 370 -iteration 380 -iteration 390 -iteration 400 -iteration 410 -iteration 420 -iteration 430 -iteration 440 -iteration 450 -iteration 460 -iteration 470 -iteration 480 -iteration 490 -Done. - -# of people treated: 17508.000000 people -Average length of stay: 155.341615 time units -Average # of hospitals visited: 1.074195 hospitals - diff --git a/test/ccured_olden/health/out.orig.msvc b/test/ccured_olden/health/out.orig.msvc deleted file mode 100644 index 6de26a47..00000000 --- a/test/ccured_olden/health/out.orig.msvc +++ /dev/null @@ -1,64 +0,0 @@ -This is max_level : 5 -This is max_time : 500 - - - Colombian Health Care Simulator - -Working... -This is max_time right before the loop: 500 -iteration 0 -iteration 10 -iteration 20 -iteration 30 -iteration 40 -iteration 50 -iteration 60 -iteration 70 -iteration 80 -iteration 90 -iteration 100 -iteration 110 -iteration 120 -iteration 130 -iteration 140 -iteration 150 -iteration 160 -iteration 170 -iteration 180 -iteration 190 -iteration 200 -iteration 210 -iteration 220 -iteration 230 -iteration 240 -iteration 250 -iteration 260 -iteration 270 -iteration 280 -iteration 290 -iteration 300 -iteration 310 -iteration 320 -iteration 330 -iteration 340 -iteration 350 -iteration 360 -iteration 370 -iteration 380 -iteration 390 -iteration 400 -iteration 410 -iteration 420 -iteration 430 -iteration 440 -iteration 450 -iteration 460 -iteration 470 -iteration 480 -iteration 490 -Done. - -# of people treated: 17510.000000 people -Average length of stay: 153.627927 time units -Average # of hospitals visited: 1.068646 hospitals - diff --git a/test/ccured_olden/health/output b/test/ccured_olden/health/output deleted file mode 100644 index 42fd5748..00000000 --- a/test/ccured_olden/health/output +++ /dev/null @@ -1,64 +0,0 @@ -This is max_level : 5 -This is max_time : 500 - - - Colombian Health Care Simulator - -Working... -This is max_time right before the loop: 500 -iteration 0 -iteration 10 -iteration 20 -iteration 30 -iteration 40 -iteration 50 -iteration 60 -iteration 70 -iteration 80 -iteration 90 -iteration 100 -iteration 110 -iteration 120 -iteration 130 -iteration 140 -iteration 150 -iteration 160 -iteration 170 -iteration 180 -iteration 190 -iteration 200 -iteration 210 -iteration 220 -iteration 230 -iteration 240 -iteration 250 -iteration 260 -iteration 270 -iteration 280 -iteration 290 -iteration 300 -iteration 310 -iteration 320 -iteration 330 -iteration 340 -iteration 350 -iteration 360 -iteration 370 -iteration 380 -iteration 390 -iteration 400 -iteration 410 -iteration 420 -iteration 430 -iteration 440 -iteration 450 -iteration 460 -iteration 470 -iteration 480 -iteration 490 -Done. - -# of people treated: 17508.000000 people -Average length of stay: 155.341615 time units -Average # of hospitals visited: 1.074195 hospitals - diff --git a/test/ccured_olden/health/poisson.c b/test/ccured_olden/health/poisson.c deleted file mode 100644 index c3ff696f..00000000 --- a/test/ccured_olden/health/poisson.c +++ /dev/null @@ -1,35 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/********************************************************** - * poisson.c: handles math routines for health.c * - **********************************************************/ - -#include <stdio.h> -#include <math.h> -#include "health.h" - - -float my_rand(long idum) -{ - long k; - float answer; - - idum ^= MASK; - k = idum / IQ; - idum = IA * (idum - k * IQ) - IR * k; - idum ^= MASK; - if (idum < 0) - idum += IM; - answer = AM * idum; -#ifdef GET_OUT - fprintf(stderr, "my_rand: idum = %d, AM = %e, answer = %4.3f\n", - idum, AM, answer); -#endif GET_OUT - return answer; -} - - - - - - diff --git a/test/ccured_olden/health/ssplain.c b/test/ccured_olden/health/ssplain.c deleted file mode 100644 index 04a150fb..00000000 --- a/test/ccured_olden/health/ssplain.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - -void chatting(char *s, ...) -{ - //printf("Here is a character: %c", *s); - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - - - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - -#ifndef BEFOREBOX -static unsigned long bytes_allocated = 0; -static unsigned long allocations = 0; - -void* -ssplain_malloc(int size) -{ - allocations++; - bytes_allocated+=size; - return malloc(size); -} - -void* -ssplain_calloc(int nelems, int size) -{ - void *p; - allocations++; - bytes_allocated+= nelems * size; - p = calloc(nelems, size); - if(!p) { printf("Cannot allocate\n"); exit(3); } - return p; -} - -void -ssplain_alloc_stats() -{ - chatting("Allocation stats: %d bytes allocated in %d allocations\n", - bytes_allocated, allocations); -} -#endif diff --git a/test/ccured_olden/health/ssplain.h b/test/ccured_olden/health/ssplain.h deleted file mode 100644 index 157c1cbe..00000000 --- a/test/ccured_olden/health/ssplain.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -#ifdef CCURED - #pragma ccuredvararg("chatting", printf(1)) -#endif -void chatting(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/health/testit b/test/ccured_olden/health/testit deleted file mode 100755 index 6b943eac..00000000 --- a/test/ccured_olden/health/testit +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# test a health binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./health.exe" - exit -fi - -# all of health's output is to stderr -echo "running: $1 5 500 1 1 2>output" -if ! $1 5 500 1 1 2>output; then - echo "$1 failed directly" - exit 2 -fi - -if ! diff out.orig output >out.diff 2>&1 ; then - if ! diff out.orig.msvc output >/dev/null ; then - echo "$1 got the wrong answer. See out.diff" - exit 4 - fi -fi - -echo "$1 seems to work" -rm -f out.diff -
\ No newline at end of file diff --git a/test/ccured_olden/mst/.cvsignore b/test/ccured_olden/mst/.cvsignore deleted file mode 100644 index 0b0377b1..00000000 --- a/test/ccured_olden/mst/.cvsignore +++ /dev/null @@ -1,26 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -allcfiles -ope.m -*cured.c -*.optim.c -*_comb.c -*.exe_comb.browser -changes -output -out.diff diff --git a/test/ccured_olden/mst/CVS/Entries b/test/ccured_olden/mst/CVS/Entries deleted file mode 100644 index 862ae447..00000000 --- a/test/ccured_olden/mst/CVS/Entries +++ /dev/null @@ -1,16 +0,0 @@ -/HOWTO/1.1/Fri Jun 29 11:07:28 2001// -/Makefile/1.6/Fri Oct 12 01:25:10 2001// -/Makefile.plain/1.1/Fri Jun 29 11:07:28 2001// -/Makefile.ss/1.1/Fri Jun 29 11:07:28 2001// -/args.c/1.1/Fri Jun 29 11:07:28 2001// -/hash.h/1.1/Fri Jun 29 11:07:28 2001// -/main.c/1.1/Fri Jun 29 11:07:28 2001// -/makegraph.c/1.1/Fri Jun 29 11:07:28 2001// -/mst.h/1.1/Fri Jun 29 11:07:28 2001// -/ssplain.c/1.6/Wed Oct 31 04:00:37 2001// -/out.orig/1.1/Mon Nov 12 08:08:28 2001// -/testit/1.2/Tue Dec 4 05:07:50 2001// -/.cvsignore/1.8/Fri Oct 4 16:28:44 2002// -/hash.c/1.8/Tue Jan 7 00:17:16 2003// -/ssplain.h/1.6/Mon Jan 6 23:29:27 2003// -D diff --git a/test/ccured_olden/mst/CVS/Repository b/test/ccured_olden/mst/CVS/Repository deleted file mode 100644 index 8ebc6045..00000000 --- a/test/ccured_olden/mst/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/mst diff --git a/test/ccured_olden/mst/CVS/Root b/test/ccured_olden/mst/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/mst/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/mst/HOWTO b/test/ccured_olden/mst/HOWTO deleted file mode 100644 index 1058d0f1..00000000 --- a/test/ccured_olden/mst/HOWTO +++ /dev/null @@ -1 +0,0 @@ -1024 1 diff --git a/test/ccured_olden/mst/Makefile b/test/ccured_olden/mst/Makefile deleted file mode 100644 index 07e18801..00000000 --- a/test/ccured_olden/mst/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = mst.exe -PROGS = main makegraph hash args ssplain - -OLDENHOME = /tmp/olden - -ifdef _MSVC -CC = cl -DEF = /D -CONLY = /c -OBJOUT = /Fo -EXEOUT = /Fe -OBJ = .obj - -OPTFLAGS = /Ox -LIBS = - -else - -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c -DEF = -D -CONLY = -c -OBJOUT= -o -EXEOUT= -o - -OBJ = .o - -OPTFLAGS = -g -Wall -O3 - -LIBS = -LIBPATH = -endif - -SRC = .c -ASM = .s -EXTRA_CDEFS = $(DEF)I_TIME $(DEF)I_SYS_TIME $(DEF)ULTRIX -CDEFS = $(DEF)PLAIN $(DEF)SS_PLAIN -SRCS = $(addsuffix $(SRC),$(PROGS)) -OBJS = $(addsuffix $(OBJ),$(PROGS)) -ASMS = $(addsuffix $(ASM),$(PROGS)) - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - -clean: - rm -f $(BINARY) $(OBJS) $(OBJS) *~ *infer.c *cured.c *cil.c *_comb.c *.i *.light.c - diff --git a/test/ccured_olden/mst/Makefile.plain b/test/ccured_olden/mst/Makefile.plain deleted file mode 100644 index 7e4450ac..00000000 --- a/test/ccured_olden/mst/Makefile.plain +++ /dev/null @@ -1,7 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = mst -FILES = main makegraph hash args ssplain - -include ../Makefile.plain - diff --git a/test/ccured_olden/mst/Makefile.ss b/test/ccured_olden/mst/Makefile.ss deleted file mode 100644 index 92ac11a1..00000000 --- a/test/ccured_olden/mst/Makefile.ss +++ /dev/null @@ -1,7 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = mst -FILES = main makegraph hash args ssplain - -include ../Makefile.ss - diff --git a/test/ccured_olden/mst/args.c b/test/ccured_olden/mst/args.c deleted file mode 100644 index 169d87ab..00000000 --- a/test/ccured_olden/mst/args.c +++ /dev/null @@ -1,20 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#include "mst.h" -#endif SS_PLAIN - - -int dealwithargs(int argc, char *argv[]) -{ - int level; - - if (argc > 1) - level = atoi(argv[1]); - else - level = 1024; - - return level; -} - diff --git a/test/ccured_olden/mst/args.s b/test/ccured_olden/mst/args.s deleted file mode 100644 index a397dc72..00000000 --- a/test/ccured_olden/mst/args.s +++ /dev/null @@ -1,37 +0,0 @@ - .text - .align 2 -Latoi$i$stub: - mflr r0 - stwu r1, -56(r1) - stw r0, 60(r1) - addis r11, 0, ha16(Latoi$i$ptr) - lwz r11, lo16(Latoi$i$ptr)(r11) - mtctr r11 - bctrl - lwz r0, 60(r1) - mtlr r0 - addi r1, r1, 56 - blr - .non_lazy_symbol_pointer -Latoi$i$ptr: - .indirect_symbol _atoi - .long 0 - .text - .align 2 - .globl _dealwithargs -_dealwithargs: - stwu r1, -32(r1) - mflr r2 - stw r2, 12(r1) - cmpwi cr0, r3, 1 - bt 1, L100 - addi r3, 0, 1024 - b L101 -L100: - lwz r3, 4(r4) - bl Latoi$i$stub -L101: - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr diff --git a/test/ccured_olden/mst/hash.c b/test/ccured_olden/mst/hash.c deleted file mode 100644 index 67e460dd..00000000 --- a/test/ccured_olden/mst/hash.c +++ /dev/null @@ -1,105 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#include "ssplain.h" -#ifdef SS_PLAIN -#include "mst.h" -#else SS_PLAIN -#include "hash.h" -#endif SS_PLAIN -#include <string.h> - -#define assert(num,a) if (!(a)) {chatting("Assertion failure:%d in hash\n",num); exit(-1);} -#undef assert -#define assert(num,a) - -#ifndef CCURED - #define __NOCUREBLOCK -#endif - -#ifdef CCURED - #pragma ccuredalloc("localmalloc", nozero, sizein(1)) -#endif -static char *localmalloc(int size); - -static int remaining = 0; -static char *temp; -static char *localmalloc(int size) { - char *blah; - - if (size>remaining) - { - temp = (char *) malloc(32768); - if (!temp) chatting("Error! malloc returns null\n"); - remaining = 32768; - } - blah = temp; - temp += size; - remaining -= size; - return blah; -} - -#define localfree(sz) - -Hash MakeHash(int size, int (*map)(unsigned int)) -{ - Hash retval; - - retval = (Hash) localmalloc(sizeof(*retval)); - retval->array = (HashEntry *) localmalloc(size*sizeof(retval->array[0])); - { __NOCUREBLOCK - memset((char*)retval->array, 0, size * sizeof(retval->array[0])); - } - retval->mapfunc = map; - retval->size = size; - retval->padding = 0; - return retval; -} - -void *HashLookup(unsigned int key, Hash hash) -{ - int j; - HashEntry ent; - - j = (hash->mapfunc)(key); - assert(1,j>=0); - assert(2,j<hash->size); - - for (ent = hash->array[j]; ent && ent->key!=key; ent=ent->next) ; - - if (ent) return ent->entry; - return NULL; -} - -void HashInsert(void *entry,unsigned int key,Hash hash) -{ - HashEntry ent; - int j; - - assert(3,!HashLookup(key,hash)); - - j = (hash->mapfunc)(key); - - ent = (HashEntry) localmalloc(sizeof(*ent)); - ent->next = hash->array[j]; - hash->array[j]=ent; - ent->key = key; - ent->entry = entry; -} - -void HashDelete(unsigned int key,Hash hash) -{ - HashEntry *ent; - HashEntry tmp; - int j; - - j = (hash->mapfunc)(key); - for (ent=&(hash->array[j]); (*ent) && (*ent)->key!=key; ent=&((*ent)->next)); - assert(4,*ent); - tmp = *ent; - *ent = (*ent)->next; - localfree(tmp); -} - - - - diff --git a/test/ccured_olden/mst/hash.h b/test/ccured_olden/mst/hash.h deleted file mode 100644 index 99475263..00000000 --- a/test/ccured_olden/mst/hash.h +++ /dev/null @@ -1,23 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#include "stdio.h" - -typedef struct hash_entry { - unsigned int key; - void *entry; - struct hash_entry *next; - unsigned int padding; -} *HashEntry; - -typedef struct hash { - HashEntry *array; - int (*mapfunc)(unsigned int); - int size; - unsigned int padding; -} *Hash; - -Hash MakeHash(int size, int map(unsigned int)); -void *HashLookup(unsigned int key, Hash hash); -void HashInsert(void *entry,unsigned int key, Hash hash); -void HashDelete(unsigned int key, Hash hash); - diff --git a/test/ccured_olden/mst/hash.s b/test/ccured_olden/mst/hash.s deleted file mode 100644 index f418b39d..00000000 --- a/test/ccured_olden/mst/hash.s +++ /dev/null @@ -1,354 +0,0 @@ - .data - .globl __hash__stringlit_1 -__hash__stringlit_1: - .byte 69 - .byte 114 - .byte 114 - .byte 111 - .byte 114 - .byte 33 - .byte 32 - .byte 109 - .byte 97 - .byte 108 - .byte 108 - .byte 111 - .byte 99 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 115 - .byte 32 - .byte 110 - .byte 117 - .byte 108 - .byte 108 - .byte 10 - .byte 0 - .data - .globl _remaining -_remaining: - .long 0 - .data - .globl _temp -_temp: - .space 4 - .text - .align 2 -Lchatting$i$stub: - mflr r0 - stwu r1, -56(r1) - stw r0, 60(r1) - addis r11, 0, ha16(Lchatting$i$ptr) - lwz r11, lo16(Lchatting$i$ptr)(r11) - mtctr r11 - bctrl - lwz r0, 60(r1) - mtlr r0 - addi r1, r1, 56 - blr - .non_lazy_symbol_pointer -Lchatting$i$ptr: - .indirect_symbol _chatting - .long 0 - .text - .align 2 -Lmalloc$stub: - addis r11, 0, ha16(Lmalloc$ptr) - lwz r11, lo16(Lmalloc$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -Lmalloc$ptr: - .indirect_symbol _malloc - .long 0 - .text - .align 2 -LMakeHash$stub: - addis r11, 0, ha16(LMakeHash$ptr) - lwz r11, lo16(LMakeHash$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -LMakeHash$ptr: - .indirect_symbol _MakeHash - .long 0 - .text - .align 2 -LHashLookup$stub: - addis r11, 0, ha16(LHashLookup$ptr) - lwz r11, lo16(LHashLookup$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -LHashLookup$ptr: - .indirect_symbol _HashLookup - .long 0 - .text - .align 2 -LHashInsert$stub: - addis r11, 0, ha16(LHashInsert$ptr) - lwz r11, lo16(LHashInsert$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -LHashInsert$ptr: - .indirect_symbol _HashInsert - .long 0 - .text - .align 2 -LHashDelete$stub: - addis r11, 0, ha16(LHashDelete$ptr) - lwz r11, lo16(LHashDelete$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -LHashDelete$ptr: - .indirect_symbol _HashDelete - .long 0 - .text - .align 2 -Lmemset$stub: - addis r11, 0, ha16(Lmemset$ptr) - lwz r11, lo16(Lmemset$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -Lmemset$ptr: - .indirect_symbol _memset - .long 0 - .text - .align 2 -Llocalmalloc$stub: - addis r11, 0, ha16(Llocalmalloc$ptr) - lwz r11, lo16(Llocalmalloc$ptr)(r11) - mtctr r11 - bctr - .non_lazy_symbol_pointer -Llocalmalloc$ptr: - .indirect_symbol _localmalloc - .long 0 - .text - .align 2 - .globl Llocalmalloc$stub -Llocalmalloc$stub: - stwu r1, -32(r1) - mflr r2 - stw r2, 12(r1) - stw r13, 28(r1) - mr r13, r3 - addis r2, 0, ha16(_remaining) - lwz r6, lo16(_remaining)(r2) - cmpw cr0, r13, r6 - bf 1, L100 - addis r3, 0, 0 - ori r3, r3, 32768 - bl Lmalloc$stub - addis r2, 0, ha16(_temp) - stw r3, lo16(_temp)(r2) - addis r2, 0, ha16(_temp) - lwz r3, lo16(_temp)(r2) - cmplwi cr0, r3, 0 - bf 2, L101 - addis r3, 0, hi16(__hash__stringlit_1) - ori r3, r3, lo16(__hash__stringlit_1) - bl Lchatting$i$stub -L101: - addis r8, 0, 0 - ori r8, r8, 32768 - addis r2, 0, ha16(_remaining) - stw r8, lo16(_remaining)(r2) -L100: - addis r2, 0, ha16(_temp) - lwz r3, lo16(_temp)(r2) - add r4, r3, r13 - addis r2, 0, ha16(_temp) - stw r4, lo16(_temp)(r2) - addis r2, 0, ha16(_remaining) - lwz r5, lo16(_remaining)(r2) - subfc r7, r13, r5 - addis r2, 0, ha16(_remaining) - stw r7, lo16(_remaining)(r2) - lwz r13, 28(r1) - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr - .text - .align 2 - .globl LMakeHash$stub -LMakeHash$stub: - stwu r1, -48(r1) - mflr r2 - stw r2, 12(r1) - stw r13, 36(r1) - stw r14, 40(r1) - stw r15, 44(r1) - mr r14, r3 - mr r13, r4 - addi r3, 0, 16 - bl Llocalmalloc$stub - mr r15, r3 - rlwinm r3, r14, 2, 0xfffffffc - bl Llocalmalloc$stub - stw r3, 0(r15) - lwz r3, 0(r15) - addi r4, 0, 0 - rlwinm r5, r14, 2, 0xfffffffc - bl Lmemset$stub - stw r13, 4(r15) - stw r14, 8(r15) - addi r3, 0, 0 - stw r3, 12(r15) - mr r3, r15 - lwz r13, 36(r1) - lwz r14, 40(r1) - lwz r15, 44(r1) - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr - .text - .align 2 - .globl LHashLookup$stub -LHashLookup$stub: - stwu r1, -48(r1) - mflr r2 - stw r2, 12(r1) - stw r13, 28(r1) - stw r14, 32(r1) - mr r14, r3 - mr r13, r4 - lwz r8, 4(r13) - mr r0, r8 - mr r3, r14 - mtctr r0 - bctrl - lwz r4, 0(r13) - rlwinm r5, r3, 2, 0xfffffffc - lwzx r3, r4, r5 -L102: - cmplwi cr0, r3, 0 - bt 2, L103 - lwz r7, 0(r3) - cmplw cr0, r7, r14 - bt 2, L104 - addi r6, 0, 1 - b L105 -L104: - addi r6, 0, 0 - b L105 -L103: - addi r6, 0, 0 -L105: - cmpwi cr0, r6, 0 - bt 2, L106 - lwz r3, 8(r3) - b L102 -L106: - cmplwi cr0, r3, 0 - bt 2, L107 - lwz r3, 4(r3) - b L108 -L107: - addi r3, 0, 0 -L108: - lwz r13, 28(r1) - lwz r14, 32(r1) - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr - .text - .align 2 - .globl LHashInsert$stub -LHashInsert$stub: - stwu r1, -48(r1) - mflr r2 - stw r2, 12(r1) - stw r13, 28(r1) - stw r14, 32(r1) - stw r15, 36(r1) - stw r16, 40(r1) - mr r14, r3 - mr r13, r4 - mr r16, r5 - lwz r6, 4(r16) - mr r0, r6 - mr r3, r13 - mtctr r0 - bctrl - mr r15, r3 - addi r3, 0, 16 - bl Llocalmalloc$stub - lwz r7, 0(r16) - rlwinm r4, r15, 2, 0xfffffffc - lwzx r5, r7, r4 - stw r5, 8(r3) - lwz r5, 0(r16) - stwx r3, r5, r4 - stw r13, 0(r3) - stw r14, 4(r3) - # undef r3 - lwz r13, 28(r1) - lwz r14, 32(r1) - lwz r15, 36(r1) - lwz r16, 40(r1) - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr - .text - .align 2 - .globl LHashDelete$stub -LHashDelete$stub: - stwu r1, -48(r1) - mflr r2 - stw r2, 12(r1) - stw r13, 28(r1) - stw r14, 32(r1) - mr r14, r3 - mr r13, r4 - lwz r9, 4(r13) - mr r0, r9 - mr r3, r14 - mtctr r0 - bctrl - lwz r4, 0(r13) - rlwinm r8, r3, 2, 0xfffffffc - add r3, r4, r8 -L109: - lwz r5, 0(r3) - cmplwi cr0, r5, 0 - bt 2, L110 - lwz r4, 0(r5) - cmplw cr0, r4, r14 - bt 2, L111 - addi r7, 0, 1 - b L112 -L111: - addi r7, 0, 0 - b L112 -L110: - addi r7, 0, 0 -L112: - cmpwi cr0, r7, 0 - bt 2, L113 - lwz r10, 0(r3) - addi r3, r10, 8 - b L109 -L113: - lwz r4, 0(r3) - lwz r6, 8(r4) - stw r6, 0(r3) - # undef r3 - lwz r13, 28(r1) - lwz r14, 32(r1) - lwz r2, 12(r1) - mtlr r2 - lwz r1, 0(r1) - blr diff --git a/test/ccured_olden/mst/main.c b/test/ccured_olden/mst/main.c deleted file mode 100644 index 0e464d7c..00000000 --- a/test/ccured_olden/mst/main.c +++ /dev/null @@ -1,142 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#include <string.h> -#include "mst.h" -#include "ssplain.h" - -typedef struct blue_return { - Vertex vert; - int dist; -} BlueReturn; - -static BlueReturn BlueRule(Vertex inserted, Vertex vlist) -{ - BlueReturn retval; - Vertex tmp,prev; - Hash hash; - int dist,dist2; - int count; - - if (!vlist) { - retval.dist = 999999; - return retval; - } - prev = vlist; - retval.vert = vlist; - retval.dist = vlist->mindist; - hash = vlist->edgehash; - dist = (int) HashLookup((unsigned int) inserted, hash); - /*chatting("Found %d at 0x%x for 0x%x\n",dist,inserted,vlist);*/ - if (dist) - { - if (dist<retval.dist) - { - vlist->mindist = dist; - retval.dist = dist; - } - } - else chatting("Not found\n"); - - count = 0; - - /* We are guaranteed that inserted is not first in list */ - for (tmp=vlist->next; tmp; prev=tmp,tmp=tmp->next) - { - count++; - - /* Splice chosen vertex out of the list */ - if (tmp==inserted) - { - Vertex next; - next = tmp->next; - prev->next = next; - } - /* Find the shortest distance to any other vertex not in the list */ - else - { - hash = tmp->edgehash; - dist2 = tmp->mindist; - dist = (int) HashLookup((unsigned int) inserted, hash); - /*chatting("Found %d at 0x%x for 0x%x\n",dist,inserted,tmp);*/ - if (dist) - { - if (dist<dist2) - { - tmp->mindist = dist; - dist2 = dist; - } - } - else chatting("Not found\n"); - if (dist2<retval.dist) - { - retval.vert = tmp; - retval.dist = dist2; - } - } /* else */ - - } /* for */ - /*chatting("Count was %d\n",count);*/ - return retval; -} - - - -static Vertex MyVertexList = NULL; - -static int ComputeMst(Graph graph,int numvert) -{ - Vertex inserted,tmp; - int cost=0,dist; - - /* make copy of graph */ - chatting("Compute phase 1\n"); - - /* Insert first node */ - inserted = graph->vlist; - tmp = inserted->next; - graph->vlist = tmp; - MyVertexList = tmp; - numvert--; - - /* Announce insertion and find next one */ - chatting("Compute phase 2\n"); - while (numvert) - { - BlueReturn br; - - if (inserted == MyVertexList) - MyVertexList = MyVertexList->next; - br = BlueRule(inserted, MyVertexList); - inserted = br.vert; - dist = br.dist; - numvert--; - cost = cost+dist; - } - return cost; -} - -extern int dealwithargs(int argc, char *argv[]); - -int main(int argc, char *argv[]) -{ - Graph graph; - int dist; - int size; - - chatting("Hash entry size = %d\n", sizeof(struct hash_entry)); - chatting("Hash size = %d\n", sizeof(struct hash)); - chatting("Vertex size = %d\n", sizeof(struct vert_st)); - - size = dealwithargs(argc,argv); - - chatting("Making graph of size %d\n",size); - graph = MakeGraph(size); - chatting("Graph completed\n"); - - chatting("About to compute mst \n"); - dist = ComputeMst(graph,size); - - chatting("MST has cost %d\n",dist); - exit(0); -} - diff --git a/test/ccured_olden/mst/makegraph.c b/test/ccured_olden/mst/makegraph.c deleted file mode 100644 index c99fad96..00000000 --- a/test/ccured_olden/mst/makegraph.c +++ /dev/null @@ -1,93 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#include "mst.h" -#include "ssplain.h" - -#define CONST_m1 10000 -#define CONST_b 31415821 -#define RANGE 2048 -static int HashRange; - -static int mult(int p, int q) -{ - int p1, p0, q1, q0; - - p1=p/CONST_m1; p0=p%CONST_m1; - q1=q/CONST_m1; q0=q%CONST_m1; - return (((p0*q1+p1*q0) % CONST_m1)*CONST_m1+p0*q0); -} - -static int mst_random(int seed) -{ - int tmp; - tmp = (mult(seed,CONST_b)+1); - return tmp; -} - -static int compute_dist(int i,int j, int numvert) -{ - int less, gt; - if (i<j) {less = i; gt = j;} else {less = j; gt = i;} - return (mst_random(less*numvert+gt) % RANGE)+1; -} - -static int hashfunc(unsigned int key) -{ - return ((key>>4) % HashRange); -} - -static void AddEdges(Graph retval, int numvert) -{ - Vertex src, dest; - Hash hash; - int i, j, dist, num_inserted = 0; - - for (j = 0; j < numvert; j++) - { - src = &(retval->vlist[j]); - hash = src->edgehash; - - for (i=0; i<numvert; i++) - { - if (i!=j) - { - dist = compute_dist(i,j,numvert); - dest = &(retval->vlist[i]); - HashInsert((void *) dist,(unsigned int) dest,hash); - num_inserted++; - } - } /* for i */ - } /* for j */ - - chatting("%d edges inserted\n", num_inserted); -} - -Graph MakeGraph(int numvert) -{ - int i; - Vertex vf, vt; - Graph retval; - - retval = (Graph) malloc (sizeof(*retval)); - - chatting("Make phase 1: Creating hash tables\n"); - retval->vlist = (Vertex) malloc (numvert*(sizeof(*vf))); - vt = NULL; - - for (i = numvert - 1; i >= 0; i--) - { - vf = &(retval->vlist[i]); - HashRange = numvert/4; - vf->mindist = 9999999; - vf->edgehash = MakeHash(HashRange,hashfunc); - vf->next = vt; - vt=vf; - } - - chatting("Make phase 3: Creating graph\n"); - AddEdges(retval, numvert); - chatting("Make returning\n"); - return retval; -} - - diff --git a/test/ccured_olden/mst/mst.h b/test/ccured_olden/mst/mst.h deleted file mode 100644 index 4af1e346..00000000 --- a/test/ccured_olden/mst/mst.h +++ /dev/null @@ -1,33 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include <stdlib.h> -#endif SS_PLAIN - -#include "hash.h" -#define MAXPROC 1 - -#ifndef SS_PLAIN -/* Amir: Get these out of here for SS, piggyback on the PLAIN definition */ -#include "mem-ref.h" -#define NULL 0 -#endif SS_PLAIN - -typedef struct vert_st { - int mindist; - struct vert_st *next; - Hash edgehash; - unsigned int padding; -} *Vertex; - -typedef struct graph_st { - Vertex vlist; -} *Graph; - -Graph MakeGraph(int numvert); - -#ifdef SS_PLAIN -#include <stdarg.h> -void chatting(char *s, ...); -#endif SS_PLAIN - diff --git a/test/ccured_olden/mst/out.orig b/test/ccured_olden/mst/out.orig deleted file mode 100644 index a50096d7..00000000 --- a/test/ccured_olden/mst/out.orig +++ /dev/null @@ -1,13 +0,0 @@ -Hash entry size = xx -Hash size = xx -Vertex size = xx -Making graph of size 2048 -Make phase 1: Creating hash tables -Make phase 3: Creating graph -4192256 edges inserted -Make returning -Graph completed -About to compute mst -Compute phase 1 -Compute phase 2 -MST has cost 13615 diff --git a/test/ccured_olden/mst/output b/test/ccured_olden/mst/output deleted file mode 100644 index d2677157..00000000 --- a/test/ccured_olden/mst/output +++ /dev/null @@ -1,13 +0,0 @@ -Hash entry size = 16 -Hash size = 20 -Vertex size = 20 -Making graph of size 2048 -Make phase 1: Creating hash tables -Make phase 3: Creating graph -4192256 edges inserted -Make returning -Graph completed -About to compute mst -Compute phase 1 -Compute phase 2 -MST has cost 13615 diff --git a/test/ccured_olden/mst/ssplain.c b/test/ccured_olden/mst/ssplain.c deleted file mode 100644 index 645d3a1e..00000000 --- a/test/ccured_olden/mst/ssplain.c +++ /dev/null @@ -1,38 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - -void chatting(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - diff --git a/test/ccured_olden/mst/ssplain.h b/test/ccured_olden/mst/ssplain.h deleted file mode 100644 index 865fbf47..00000000 --- a/test/ccured_olden/mst/ssplain.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -#pragma ccuredvararg("chatting", printf(1)) -void chatting(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/mst/testit b/test/ccured_olden/mst/testit deleted file mode 100755 index 2ef87d18..00000000 --- a/test/ccured_olden/mst/testit +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# test an mst binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./mst.exe" - exit -fi - -# all of mst's output is to stderr -echo "running: $1 2048 1 2>output" -if ! $1 2048 1 2>output; then - echo "$1 failed directly" - exit 2 -fi - -# mst prints sizes of its structures, which increase after boxing -if ! sed 's/size = [0-9][0-9]/size = xx/' <output | diff out.orig - >out.diff; then - if test -s out.diff; then - echo "$1 got the wrong answer. See out.diff" - exit 4 - fi -fi -echo "$1 seems to work" -rm -f out.diff -
\ No newline at end of file diff --git a/test/ccured_olden/newbisort/.cvsignore b/test/ccured_olden/newbisort/.cvsignore deleted file mode 100644 index 5c56af15..00000000 --- a/test/ccured_olden/newbisort/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -changes diff --git a/test/ccured_olden/newbisort/CVS/Entries b/test/ccured_olden/newbisort/CVS/Entries deleted file mode 100644 index cb3bbed9..00000000 --- a/test/ccured_olden/newbisort/CVS/Entries +++ /dev/null @@ -1,13 +0,0 @@ -/HOWTO/1.1/Fri Jul 6 09:37:30 2001// -/Makefile/1.2/Sat Jul 21 16:09:41 2001// -/Makefile.plain/1.1/Fri Jul 6 09:37:30 2001// -/Makefile.ss/1.1/Fri Jul 6 09:37:30 2001// -/args.c/1.1/Fri Jul 6 09:37:30 2001// -/bitonic.c/1.1/Fri Jul 6 09:37:30 2001// -/node.h/1.1/Fri Jul 6 09:37:30 2001// -/proc.h/1.1/Fri Jul 6 09:37:30 2001// -/ssplain.c/1.1/Fri Jul 6 09:37:30 2001// -/ssplain.h/1.1/Fri Jul 6 09:37:30 2001// -/swap.c/1.1/Fri Jul 6 09:37:30 2001// -/.cvsignore/1.1/Thu Nov 8 23:31:03 2001// -D diff --git a/test/ccured_olden/newbisort/CVS/Repository b/test/ccured_olden/newbisort/CVS/Repository deleted file mode 100644 index 9cf3bd6a..00000000 --- a/test/ccured_olden/newbisort/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/newbisort diff --git a/test/ccured_olden/newbisort/CVS/Root b/test/ccured_olden/newbisort/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/newbisort/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/newbisort/HOWTO b/test/ccured_olden/newbisort/HOWTO deleted file mode 100644 index dd53dde0..00000000 --- a/test/ccured_olden/newbisort/HOWTO +++ /dev/null @@ -1 +0,0 @@ -250000 0 diff --git a/test/ccured_olden/newbisort/Makefile b/test/ccured_olden/newbisort/Makefile deleted file mode 100644 index 6f4f4662..00000000 --- a/test/ccured_olden/newbisort/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = bisort -PROGS = bitonic args ssplain - -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -SRC = .c -OBJ = .o -ASM = .s -SRCS = $(addsuffix $(SRC),$(PROGS)) -OBJS = $(addsuffix $(OBJ),$(PROGS)) -ASMS = $(addsuffix $(ASM),$(PROGS)) -INCDIRS = /usr/include - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN #-I$(OLDENHOME)/common -OPTFLAGS = -g -Wall -O3 - -LIBS = -lc -lgcc -lm -LIBPATH = - -#$(BINARY): $(OBJS) -# $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJS) $(LIBPATH) $(LIBS) - -#$(SRC)$(OBJ): -# $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $(CDEFS) $(EXTRA_CDEFS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - -clean: - rm -f $(BINARY) $(OBJS) *~ $(ASMS) *.light.c - diff --git a/test/ccured_olden/newbisort/Makefile.orig b/test/ccured_olden/newbisort/Makefile.orig deleted file mode 100644 index 81e77568..00000000 --- a/test/ccured_olden/newbisort/Makefile.orig +++ /dev/null @@ -1,33 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = bisort -FILES = bitonic args ssplain - - - -CC = gcc - -SRC = .c -OBJ = .o -ASM = .s -SRCS = $(addsuffix $(SRC),$(FILES)) -OBJS = $(addsuffix $(OBJ),$(FILES)) -ASMS = $(addsuffix $(ASM),$(FILES)) -INCDIRS = /usr/include - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN #-I$(OLDENHOME)/common -OPTFLAGS = -g -Wall -O3 - -LIBS = -lc -lgcc -lm -LIBPATH = - -$(BINARY): $(OBJS) - $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJS) $(LIBPATH) $(LIBS) - -$(SRC)$(OBJ): - $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - -clean: - rm -f $(BINARY) $(OBJS) *~ - diff --git a/test/ccured_olden/newbisort/Makefile.plain b/test/ccured_olden/newbisort/Makefile.plain deleted file mode 100644 index b1240250..00000000 --- a/test/ccured_olden/newbisort/Makefile.plain +++ /dev/null @@ -1,7 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = bisort -FILES = bitonic args ssplain - -include ../Makefile.plain - diff --git a/test/ccured_olden/newbisort/Makefile.ss b/test/ccured_olden/newbisort/Makefile.ss deleted file mode 100644 index 00028730..00000000 --- a/test/ccured_olden/newbisort/Makefile.ss +++ /dev/null @@ -1,7 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = bisort -FILES = bitonic args ssplain - -include ../Makefile.ss - diff --git a/test/ccured_olden/newbisort/args.c b/test/ccured_olden/newbisort/args.c deleted file mode 100644 index 12591026..00000000 --- a/test/ccured_olden/newbisort/args.c +++ /dev/null @@ -1,32 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -int mylog(int num) -{ - int j=0,k=1; - - while(k<num) { k*=2; j++; } - return j; -} - -extern int flag; -int dealwithargs(int argc, char *argv[]) -{ - int size; - - if (argc > 2) - flag = atoi(argv[2]); - else - flag = 0; - - if (argc > 1) - size = atoi(argv[1]); - else - size = 16; - - return size; -} - diff --git a/test/ccured_olden/newbisort/bitonic.c b/test/ccured_olden/newbisort/bitonic.c deleted file mode 100644 index 7b08a0a2..00000000 --- a/test/ccured_olden/newbisort/bitonic.c +++ /dev/null @@ -1,267 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* =================== PROGRAM bitonic===================== */ -/* UP - 0, DOWN - 1 */ - -#include "node.h" /* Node Definition */ -#include "proc.h" /* Procedure Types/Nums */ - -#define CONST_m1 10000 -#define CONST_b 31415821 -#define RANGE 100 - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -#define put(a) chatting("%d",a) -#define puts(a) chatting(a) - - -int flag=0,foo=0; - -#define NewNode(h,v) \ - \ -{ \ - h = (HANDLE *) malloc(sizeof(struct node)); \ - h->value = v; \ - h->left = NIL; \ - h->right = NIL; \ - }; - - -void InOrder(h) - HANDLE *h; -{ - HANDLE *l, *r; - if ((h != NIL)) - { - l = h->left; - r = h->right; - InOrder(l); - chatting("%d @ 0x%x\n",h->value,h); - InOrder(r); - } -} - -int mult(int p, int q) -{ - int p1, p0, q1, q0; - - p1=p/CONST_m1; p0=p%CONST_m1; - q1=q/CONST_m1; q0=q%CONST_m1; - return (((p0*q1+p1*q0) % CONST_m1)*CONST_m1+p0*q0); -} - -int skiprand(int seed, int n) -{ -#ifdef SS_PLAIN - for (; n; n--) seed=mult(seed,CONST_b)+1; -#else SS_PLAIN - for (; n; n--) seed=random(seed); -#endif SS_PLAIN - return seed; -} - -#ifndef SS_PLAIN -int random(int seed) -{ - int tmp; - tmp = (mult(seed,CONST_b)+1); - return tmp; -} -#endif SS_PLAIN - -HANDLE* RandTree(n,seed,level) - int n,seed,level; - -{ - int next_val,my_name; - HANDLE *h; - my_name=foo++; - - if (n > 1) - { -#ifdef SS_PLAIN - seed = mult(seed,CONST_b)+1; -#else SS_PLAIN - seed = random(seed); -#endif SS_PLAIN - next_val=seed % RANGE; - NewNode(h,next_val); - - h->left = RandTree((n/2),seed,level+1); - h->right = RandTree((n/2),skiprand(seed,(n)+1),level+1); - } - else - h = NIL; - return(h); -} - -void SwapVal(l,r) - HANDLE *l, *r; -{ - int temp; - - temp = l->value; /* MISS PROBLEM */ - l->value = r->value; - r->value = temp; -} - -void SwapLeft(l,r) - HANDLE *l, *r; -{ - HANDLE *h; - - h = r->left; - r->left = l->left; - l->left = h; -} - -void SwapRight(l,r) - HANDLE *l, *r; -{ - HANDLE *h; - - h = r->right; - r->right = l->right; /* MISS PROBLEM */ - l->right = h; -} - -int Bimerge(root,spr_val,dir) - HANDLE *root; - int spr_val,dir; -{ - int rightexchange, elementexchange; - HANDLE *pl, *pr; - - /*chatting("enter bimerge %x\n", root);*/ - rightexchange = ((root->value > spr_val) ^ dir); - if (rightexchange) - { - int temp; - temp = root->value; - root->value = spr_val; - spr_val = temp; - } - - pl = root->left; - pr = root->right; - - while (pl != NIL) - { - elementexchange = ((pl->value > /* MISS PROBLEM */pr->value) ^ dir); - if (rightexchange) - { - if (elementexchange) - { - SwapVal(pl,pr); - SwapRight(pl,pr); - pl = pl->left; - pr = pr->left; - } - else - { - pl = pl->right; - pr = pr->right; - } - } - else - { - if (elementexchange) - { - SwapVal(pl,pr); - SwapLeft(pl,pr); - pl = pl->right; - pr = pr->right; - } - else - { - pl = pl->left; - pr = pr->left; /* MISS PROBLEM */ - } - } - } - - if (root->left != NIL) - { - root->value=Bimerge(root->left,root->value,dir); - spr_val=Bimerge(root->right,spr_val,dir); - } - /*chatting("exit bimerge %x\n", root);*/ - return spr_val; -} - -int Bisort(root,spr_val,dir) - HANDLE *root; - int spr_val,dir; -{ - /*chatting("bisort %x\n", root);*/ - if (root->left == NIL) - { - if ((root->value > spr_val) ^ dir) - { - int val; - val = spr_val; - spr_val = root->value; - root->value =val; - } - } - else - { - /* Bisort both halves of the tree and merge */ - root->value=Bisort(root->left,root->value,dir); - spr_val=Bisort(root->right,spr_val,!dir); - spr_val=Bimerge(root,spr_val,dir); - } - /*chatting("exit bisort %x\n", root);*/ - return spr_val; -} - -void main(argc,argv) - int argc; - char *argv[]; - - -{ - HANDLE *h; - int sval; - int n; - - n = dealwithargs(argc,argv); - - chatting("Bisort with %d size\n", n); - h = RandTree(n,12345768,0); -#ifdef SS_PLAIN - sval = (mult(245867,CONST_b)+1) % RANGE; -#else SS_PLAIN - sval = random(245867) % RANGE; -#endif SS_PLAIN - if (flag) { - InOrder(h); - chatting("%d\n",sval); - } - chatting("**************************************\n"); - chatting("BEGINNING BITONIC SORT ALGORITHM HERE\n"); - chatting("**************************************\n"); - - chatting("Sorting forward..."); - sval=Bisort(h,sval,0); - if (flag) { - chatting("Sorted Tree:\n"); - InOrder(h); - chatting("%d\n",sval); - } - chatting("done\n"); - - chatting("sorting backward..."); - sval=Bisort(h,sval,1); - if (flag) { - chatting("Sorted Tree:\n"); - InOrder(h); - chatting("%d\n",sval); - } - chatting("done\n"); - exit(0); -} - diff --git a/test/ccured_olden/newbisort/node.h b/test/ccured_olden/newbisort/node.h deleted file mode 100644 index c1b81c6d..00000000 --- a/test/ccured_olden/newbisort/node.h +++ /dev/null @@ -1,18 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* =============== NODE STRUCTURE =================== */ - -struct node { - int value; - struct node *left; - struct node *right; - }; - -typedef struct node HANDLE; - -#define NIL ((HANDLE *) 0) -#ifdef FUTURES -#define makenode(procid) ALLOC(procid,sizeof(struct node)) -#else -#define makenode(procid) mymalloc(sizeof(struct node)) -#endif diff --git a/test/ccured_olden/newbisort/proc.h b/test/ccured_olden/newbisort/proc.h deleted file mode 100644 index eadb80aa..00000000 --- a/test/ccured_olden/newbisort/proc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* ========== PROCEDURE TYPES/NUMS ================== */ - - -HANDLE *RandTree(); - -void SwapValue(); -void SwapValLeft(); -void SwapValRight(); -int Bimerge(); -int Bisort(); -#define DD_EXIT 0 - - -/* ================= PROC NAMES ==============*/ - -#ifdef EXTERN - extern char *procnames[]; -#else - static char *procnames[] = - { - "EXIT" - }; -#endif diff --git a/test/ccured_olden/newbisort/ssplain.c b/test/ccured_olden/newbisort/ssplain.c deleted file mode 100644 index b178e5f5..00000000 --- a/test/ccured_olden/newbisort/ssplain.c +++ /dev/null @@ -1,75 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - -void chatting(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - -void __Olden_panic(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); - exit(-1); -} - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - - -static unsigned long bytes_allocated = 0; -static unsigned long allocations = 0; - -void* -ssplain_malloc(int size) -{ - allocations++; - bytes_allocated+=size; - return malloc(size); -} - -void* -ssplain_calloc(int nelems, int size) -{ - void *p; - allocations++; - bytes_allocated+= nelems * size; - p = calloc(nelems, size); - assert (p); - return p; -} - -void -ssplain_alloc_stats() -{ - chatting("Allocation stats: %d bytes allocated in %d allocations\n", - bytes_allocated, allocations); -} diff --git a/test/ccured_olden/newbisort/ssplain.h b/test/ccured_olden/newbisort/ssplain.h deleted file mode 100644 index cb9b3eed..00000000 --- a/test/ccured_olden/newbisort/ssplain.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc ssplain_malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -void chatting(char *s, ...); -void __Olden_panic(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/newbisort/swap.c b/test/ccured_olden/newbisort/swap.c deleted file mode 100644 index e1e98749..00000000 --- a/test/ccured_olden/newbisort/swap.c +++ /dev/null @@ -1,145 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#define COLLECT_SIZE 256 -#define DFS_SIZE 20 -#include "node.h" - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - - -typedef struct { - int top; - HANDLE *handles[DFS_SIZE]; -} stack; - -#define push(s,v) (s)->handles[++((s)->top)] = v -#define pop(s) (s)->handles[((s)->top)--] -#define stackempty(s) ((s)->top < 0) -void VisitCollect(HANDLE *t, local int *collect) -{ - register int val; - val = t->value; - *collect = val; -} - -void VisitCollectReplace(HANDLE *t, local int *collect) -{ - register int temp = *collect; - register int val = t->value; - *collect = val; - t->value = temp; -} - -void VisitReplace(HANDLE *t, local int *collect) -{ - register int val = *collect; - t->value = val; -} - -void swapDFS(local stack *s, local int collection[], void visit()) -{ - int num=0; - - while (!stackempty(s) && num < COLLECT_SIZE) - { - HANDLE *v = pop(s); - visit(v,&collection[num]); - num++; - if (v->left != NULL) - { - HANDLE *child; - child = v->right; - push(s,child); - child = v->left; - push(s,child); - } - } -} - -void NewSwapSubTree(HANDLE *t1, HANDLE *t2) -{ - local stack c1, r1, s2; - int collection[COLLECT_SIZE]; - - /*chatting("starting swapping\n");*/ - - if (t1!=NULL) - { - c1.top = -1; - r1.top = -1; - s2.top = -1; - push(&c1,t1); - push(&r1,t1); - push(&s2,t2); - while (!stackempty(&c1)) - { - MLOCAL(t1); - swapDFS(&c1,collection,VisitCollect); - MLOCAL(t2); - swapDFS(&s2,collection,VisitCollectReplace); - MLOCAL(t1); - swapDFS(&r1,collection,VisitReplace); - } - } - /*chatting("ending swapping\n");*/ - -} - - -int *Collect(HANDLE *t1, local int collection[]) -{ - register int val; - if (t1==NULL) return collection; - MLOCAL(t1); - val = t1->value; - *collection = val; - collection += 1; - collection = Collect(t1->left,collection); - collection = Collect(t1->right,collection); - return collection; -} - -int *Collect_Replace(HANDLE *t1, local int collection[]) -{ - register int temp,val; - if (t1==NULL) return collection; - MLOCAL(t1); - temp = *collection; - val = t1->value; - *collection = val; - t1->value = temp; - collection += 1; - collection = Collect_Replace(t1->left,collection); - collection = Collect_Replace(t1->right,collection); - return collection; -} - -int *Replace(HANDLE *t1, local int collection[]) -{ - register int val; - if (t1==NULL) return collection; - MLOCAL(t1); - val = *collection; - t1->value = val; - collection +=1; - collection = Replace(t1->left,collection); - collection = Replace(t1->right,collection); - return collection; -} - - -void SwapSubTree(HANDLE *t1, HANDLE *t2) -{ - int collection[COLLECT_SIZE]; - HANDLE *t1loc, *t2loc; - - MLOCAL(t1); - Collect(t1,collection); - MLOCAL(t2); - Collect_Replace(t2,collection); - MLOCAL(t1); - Replace(t1,collection); -} - diff --git a/test/ccured_olden/perimeter/.cvsignore b/test/ccured_olden/perimeter/.cvsignore deleted file mode 100644 index 9cd22bfd..00000000 --- a/test/ccured_olden/perimeter/.cvsignore +++ /dev/null @@ -1,32 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -changes.out -perimeter.cil -perimeter.*box -allcfiles -ope.m -ope.m -*cured.c -*.optim.c -*_comb.c -changes -output -out.diff -*.browser -*optimcured* - diff --git a/test/ccured_olden/perimeter/CVS/Entries b/test/ccured_olden/perimeter/CVS/Entries deleted file mode 100644 index 4d821ece..00000000 --- a/test/ccured_olden/perimeter/CVS/Entries +++ /dev/null @@ -1,9 +0,0 @@ -/Makefile/1.3/Sun Jul 8 14:10:47 2001// -/README/1.1/Tue Jun 12 04:17:59 2001// -/main.c/1.1/Tue Jun 12 04:17:59 2001// -/maketree.c/1.1/Tue Jun 12 04:17:59 2001// -/out.orig/1.1/Mon Nov 12 08:08:28 2001// -/testit/1.2/Tue Dec 4 05:07:50 2001// -/.cvsignore/1.14/Wed Aug 7 01:48:13 2002// -/perimeter.h/1.4/Sat Jan 11 20:38:42 2003// -D diff --git a/test/ccured_olden/perimeter/CVS/Repository b/test/ccured_olden/perimeter/CVS/Repository deleted file mode 100644 index 63138464..00000000 --- a/test/ccured_olden/perimeter/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/perimeter diff --git a/test/ccured_olden/perimeter/CVS/Root b/test/ccured_olden/perimeter/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/perimeter/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/perimeter/Makefile b/test/ccured_olden/perimeter/Makefile deleted file mode 100644 index 2e0ad696..00000000 --- a/test/ccured_olden/perimeter/Makefile +++ /dev/null @@ -1,99 +0,0 @@ -# /* For copyright information, see olden_v1.01/COPYRIGHT */ -.KEEP_STATE: -SRCS = main.c maketree.c - -OLDEN_DIR=/u/ac/carlisle/olden_v1.01 -RCC = $(OLDEN_DIR)/mcc/sparc/backend/mcc -CPP = gcc -E -U__GNUC__ -D_NO_LONGLONG -#CPPFLAGS = -DVERIFY_AFFINITIES -CPPFLAGS = -#LIBFLAGS = "CPPFLAGS=-DPROF" -#LIBFLAGS = "CPPFLAGS=-DVISUALIZE" "VFLAG=-v" -LIBFLAGS = -#PFLAG = -p -PFLAG = -PLIBOBJS = plain.o plain2.o -LIBOBJS = libolden.a -OBJS = $(SRCS:%.c=%.o) args.o -ROBJS = $(SRCS:%.c=%.r.o) args.o -LIBLINK = $(LIBOBJS:%=$(OLDEN_DIR)/runtime/%) -RLIBLINK = $(PLIBOBJS:%=$(OLDEN_DIR)/runtime/%) -INCDIRS = /usr/include $(OLDEN_DIR)/runtime -NODELIBS = -LIBDIRS = - -CC = cc -#sm: CFLAGS = -CFLAGS = -O2 - - -# sm: -PLAIN=1 -all: defaulttarget - -ifdef PLAIN -ifdef _MSVC -EXTOBJ = .obj -OBJOUT = /Fo -EXEOUT = /Fe -CFLAGS = /DPLAIN -CONLY = /c -CC = cl -else -EXTOBJ = .o -OBJOUT = -o -EXEOUT = -o -CFLAGS += -DPLAIN -CONLY = -c -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -endif - -OBJS = maketree$(EXTOBJ) main$(EXTOBJ) - -%.obj : %.c - $(CC) $(CONLY) $(CFLAGS) $< $(OBJOUT)$@ - - -defaulttarget: $(OBJS) - $(CC) $(CFLAGS) $(OBJS) $(EXEOUT)perimeter.exe -endif - -perm: $(OBJS) target - /usr/bin/cmmd-ld \ - -comp $(CC) $(OBJS) $(LIBLINK) -v -o /scratch1/carlisle/perm \ - $(LIBDIRS:%=-L%) $(NODELIBS:%=-l%) - -plain: $(ROBJS) target - /usr/bin/cmmd-ld \ - -comp $(CC) $(ROBJS) $(RLIBLINK) -v -o /scratch1/carlisle/plainperm \ - $(LIBDIRS:%=-L%) $(NODELIBS:%=-l%) - -ifndef PLAIN -args.s: args.c - /lib/cpp $(CPPFLAGS) $(INCDIRS:%=-I%) args.c | $(RCC) > args.s -endif - -%.s: %.c - $(CPP) -DFUTURES $(CPPFLAGS) $(INCDIRS:%=-I%) $< | $(RCC) $(PFLAG) -n -m -k > $*.s - - -%.p.s: %.c - /lib/cpp -DPLAIN $(CPPFLAGS) $(INCDIRS:%=-I%) $< | $(RCC) -f > $*.p.s - -%.o: %.s - $(CC) $(CFLAGS) -c $< - - -%.r.o: %.p.s - $(CC) $(CFLAGS) -c $< -o $*.r.o - -target: - cd $(OLDEN_DIR)/runtime; make $(LIBFLAGS) - -clean: - rm -f $(TARGET) $(OBJS) *.exe *.o *.obj *~ .make.state .nse_depinfo *.s *.light.c - - diff --git a/test/ccured_olden/perimeter/README b/test/ccured_olden/perimeter/README deleted file mode 100644 index c8f557c9..00000000 --- a/test/ccured_olden/perimeter/README +++ /dev/null @@ -1,20 +0,0 @@ -/* For copyright information, see olden_v1.01/COPYRIGHT */ -********************** -olden_v1.01/benchmarks/perimeter/README -June 1996 -Martin C. Carlisle - -this directory contains the Perimeter benchmark: - -H. Samet. "Computing Perimeters of Regions in Images Represented by Quad- -Trees". IEEE Trans. on Pattern Analysis and Machine Intelligence -PAMI-3(6), Nov. 1981 - -as implemented for Olden by Martin C. Carlisle -********************** - -Makefile - use "make perm" to create executable - -args.c - process command line args -main.c,perimeter.h - main routines -maketree.c - creates random quad-tree diff --git a/test/ccured_olden/perimeter/main.c b/test/ccured_olden/perimeter/main.c deleted file mode 100644 index ff58925a..00000000 --- a/test/ccured_olden/perimeter/main.c +++ /dev/null @@ -1,221 +0,0 @@ -#include "perimeter.h" -#ifdef MIGRONLY -#define BLAH MIGRPH() -#else -#define BLAH -#endif - -#ifdef VERIFY_AFFINITIES -#include "affinity.h" -CHECK4(QuadTree,nw,ne,sw,se,tree) -#endif - -static int adj(Direction d, ChildType ct) -{ - BLAH; - switch (d) - { - case north: - return ((ct==northeast) || (ct==northwest)); - case south: - return ((ct==southeast) || (ct==southwest)); - case east: - return ((ct==northeast) || (ct==southeast)); - case west: - return ((ct==southwest) || (ct==northwest)); - } -} - -static ChildType reflect(Direction d, ChildType ct) -{ - BLAH; - if ((d==west) || (d==east)) - { - switch(ct) - { - case northwest: - return northeast; - case northeast: - return northwest; - case southeast: - return southwest; - case southwest: - return southeast; - } - } - switch(ct) - { - case northwest: - return southwest; - case northeast: - return southeast; - case southeast: - return northeast; - case southwest: - return northwest; - } -} - -int CountTree(QuadTree tree) -{ - QuadTree nw,ne,sw,se; - - BLAH; - nw = tree->nw; ne = tree->ne; sw = tree->sw; se = tree->se; - if (nw==NULL && ne==NULL && sw==NULL && se==NULL) - return 1; - else - return CountTree(nw) + CountTree(ne) + CountTree(sw) + - CountTree(se); -} - -static QuadTree child(QuadTree tree, ChildType ct) -{ - BLAH; - switch(ct) - { - case northeast: - return tree->ne; - case northwest: - return tree->nw; - case southeast: - return tree->se; - case southwest: - return tree->sw; - } -} - -static QuadTree gtequal_adj_neighbor(QuadTree tree, Direction d) -{ - QuadTree q,parent; - ChildType ct; - - BLAH; - parent=tree->parent; - ct=tree->childtype; - if ((parent!=NULL) && adj(d,ct)) - q=gtequal_adj_neighbor(parent,d); - else q=parent; - if (q && q->color==grey) { - return child(q,reflect(d,ct)); - } - else return q; -} - -static int sum_adjacent(QuadTree p, ChildType q1, ChildType q2, int size) -{ - BLAH; - if (p->color==grey) - { - return sum_adjacent(child(p,q1),q1,q2,size/2) + - sum_adjacent(child(p,q2),q1,q2,size/2); - } - else if (p->color==white) - { - return size; - } - else return 0; -} - -int perimeter(QuadTree tree, int size) -{ - int retval = 0; - QuadTree neighbor; - - BLAH; - if (tree->color==grey) - { - QuadTree child; -#ifdef FUTURES - future_cell_int fc_sw,fc_se,fc_ne; -#endif - -#ifndef FUTURES - child = tree->sw; - retval += perimeter(child,size/2); - child = tree->se; - retval += perimeter(child,size/2); - child = tree->ne; - retval += perimeter(child,size/2); - child = tree->nw; - retval += perimeter(child,size/2); -#else - child = tree->sw; - FUTURE(child,size/2,perimeter,&fc_sw); - child = tree->se; - FUTURE(child,size/2,perimeter,&fc_se); - child = tree->ne; - FUTURE(child,size/2,perimeter,&fc_ne); - child = tree->nw; - retval = perimeter(child,size/2); - TOUCH(&fc_sw); - TOUCH(&fc_se); - TOUCH(&fc_ne); - retval += fc_sw.value + fc_se.value + fc_ne.value; -#endif - } - else if (tree->color==black) - { - /* North */ - neighbor=gtequal_adj_neighbor(tree,north); - if ((neighbor==NULL) || (neighbor->color==white)) retval+=size; - else if (neighbor->color==grey) - retval+=sum_adjacent(neighbor,southeast,southwest,size); - /* East */ - neighbor=gtequal_adj_neighbor(tree,east); - if ((neighbor==NULL) || (neighbor->color==white)) retval+=size; - else if (neighbor->color==grey) - retval+=sum_adjacent(neighbor,southwest,northwest,size); - /* South */ - neighbor=gtequal_adj_neighbor(tree,south); - if ((neighbor==NULL) || (neighbor->color==white)) retval+=size; - else if (neighbor->color==grey) - retval+=sum_adjacent(neighbor,northwest,northeast,size); - /* West */ - neighbor=gtequal_adj_neighbor(tree,west); - if ((neighbor==NULL) || (neighbor->color==white)) retval+=size; - else if (neighbor->color==grey) - retval+=sum_adjacent(neighbor,northeast,southeast,size); - } - return retval; -} - -#ifdef PLAIN -double wallclock; -int __NumNodes; -#endif - -int main() -{ - QuadTree tree; - int count; - int level; - int i; - - BLAH; - level = 12; - __NumNodes = 1; - - chatting("Perimeter with %d levels on %d processors\n",level,__NumNodes); - tree=MakeTree(2048,0,0,0,__NumNodes-1,NULL,southeast,level); -#ifdef VERIFY_AFFINITIES - Docheck_tree(tree); -#endif - count=CountTree(tree); - chatting("# of leaves is %d\n",count); - - - timer_start(0); - for(i=0;i<100;i++) { - count=perimeter(tree,4096); - } - timer_stop(0); - - chatting("perimeter is %d\n",count); - chatting("Time elapsed = %f milliseconds\n", timer_elapsed(0)); -#ifdef FUTURES - __ShutDown(); -#endif - exit(0); -} - diff --git a/test/ccured_olden/perimeter/maketree.c b/test/ccured_olden/perimeter/maketree.c deleted file mode 100644 index 294ff028..00000000 --- a/test/ccured_olden/perimeter/maketree.c +++ /dev/null @@ -1,120 +0,0 @@ -#include "perimeter.h" - -static int CheckOutside(int x, int y) -{ - int euclid = x*x+y*y; - - if (euclid > 4194304) return 1; - if (euclid < 1048576) return -1; - return 0; -} - -static int CheckIntersect(int center_x, int center_y, int size) -{ - int sum; - - if (!CheckOutside(center_x+size,center_y+size) && - !CheckOutside(center_x+size,center_y-size) && - !CheckOutside(center_x-size,center_y-size) && - !CheckOutside(center_x-size,center_y+size)) return 2; - sum=CheckOutside(center_x+size,center_y+size) + - CheckOutside(center_x+size,center_y-size) + - CheckOutside(center_x-size,center_y-size) + - CheckOutside(center_x-size,center_y+size); - if ((sum==4) || (sum==-4)) return 0; - return 1; -} - -QuadTree MakeTree(int size, int center_x, int center_y, int lo_proc, - int hi_proc, QuadTree parent, ChildType ct, int level) -{ - int intersect=0; - QuadTree retval; - -#ifdef FUTURES - retval = (QuadTree) ALLOC(lo_proc,sizeof(*retval)); -#else - retval = (QuadTree) mymalloc(sizeof(*retval)); -#endif - retval->parent = parent; - retval->childtype = ct; - - intersect = CheckIntersect(center_x,center_y,size); - size = size/2; - if ((intersect==0) && (size<512)) - { - retval->color = white; - retval->nw = NULL; - retval->ne = NULL; - retval->sw = NULL; - retval->se = NULL; - } - else if (intersect==2) - { - retval->color=black; - retval->nw = NULL; - retval->ne = NULL; - retval->sw = NULL; - retval->se = NULL; - } - else - { - if (!level) - { - retval->color = black; - retval->nw = NULL; - retval->ne = NULL; - retval->sw = NULL; - retval->se = NULL; - } - else - { - int mid1,mid2; -#ifdef FUTURES - future_cell_int fc_sw,fc_se,fc_ne; -#endif - - mid1 = (lo_proc+hi_proc)/2; - mid2 = (lo_proc+hi_proc+1)/2; - -#ifndef FUTURES - retval->sw = MakeTree(size,center_x-size,center_y-size, - (mid2+hi_proc+1)/2,hi_proc,retval, - southwest,level-1); - retval->se = MakeTree(size,center_x+size,center_y-size, - mid2,(mid2+hi_proc)/2,retval, - southeast,level-1); - retval->ne = MakeTree(size,center_x+size,center_y+size, - (lo_proc+mid1+1)/2,mid1,retval, - northeast,level-1); - retval->nw = MakeTree(size,center_x-size,center_y+size, - lo_proc,(lo_proc+mid1)/2,retval, - northwest,level-1); -#else - FUTURE(size,center_x-size,center_y-size, - (mid2+hi_proc+1)/2,hi_proc,retval, - southwest,level-1,MakeTree,&fc_sw); - FUTURE(size,center_x+size,center_y-size, - mid2,(mid2+hi_proc)/2,retval, - southeast,level-1,MakeTree,&fc_se); - FUTURE(size,center_x+size,center_y+size, - (lo_proc+mid1+1)/2,mid1,retval, - northeast,level-1,MakeTree,&fc_ne); - retval->nw = MakeTree(size,center_x-size,center_y+size, - lo_proc,(lo_proc+mid1)/2,retval, - northwest,level-1); - TOUCH(&fc_sw); - retval->sw = (QuadTree) fc_sw.value; - TOUCH(&fc_se); - retval->se = (QuadTree) fc_se.value; - TOUCH(&fc_ne); - retval->ne = (QuadTree) fc_ne.value; -#endif - retval->color = grey; - } - } - return retval; -} - - - diff --git a/test/ccured_olden/perimeter/out.orig b/test/ccured_olden/perimeter/out.orig deleted file mode 100644 index 98edab51..00000000 --- a/test/ccured_olden/perimeter/out.orig +++ /dev/null @@ -1,3 +0,0 @@ -Perimeter with 12 levels on 1 processors -# of leaves is 73432 -perimeter is 24576 diff --git a/test/ccured_olden/perimeter/output b/test/ccured_olden/perimeter/output deleted file mode 100644 index 5906be43..00000000 --- a/test/ccured_olden/perimeter/output +++ /dev/null @@ -1,4 +0,0 @@ -Perimeter with 12 levels on 1 processors -# of leaves is 73432 -perimeter is 24576 -Time elapsed = 2970.000000 milliseconds diff --git a/test/ccured_olden/perimeter/perimeter.h b/test/ccured_olden/perimeter/perimeter.h deleted file mode 100644 index e5cc086b..00000000 --- a/test/ccured_olden/perimeter/perimeter.h +++ /dev/null @@ -1,54 +0,0 @@ -#define NULL 0 - -#ifndef PLAIN -#include <cm/cmmd.h> - -#ifdef FUTURES -#include "future-cell.h" -#endif -#include "mem-ref.h" -#endif - -typedef enum {black, white, grey} Color; -typedef enum {northwest, northeast, southwest, southeast} ChildType; -typedef enum {north, east, south, west} Direction; - -typedef struct quad_struct { - Color color; - ChildType childtype; - struct quad_struct *nw ; // {50}; - struct quad_struct *ne ; //{50}; - struct quad_struct *sw ; // {50}; - struct quad_struct *se ; //{50}; - struct quad_struct *parent; // {50}; -} *QuadTree; - -QuadTree MakeTree(int size, int center_x, int center_y, int lo_proc, - int hi_proc, QuadTree parent, ChildType ct, int level); - - -#include <stdlib.h> //malloc -#include <stdio.h> // printf - -extern void exit(int); - -extern int __NumNodes; - -#ifdef PLAIN -#include <time.h> -#define local -#define mymalloc malloc -#define CMMD_node_timer_clear(x) (void)0 -#define TIMESTART(clk) {clk=(double)clock();} -#define TIMESTOP(clk) {clk=1000000.0 * ((double)clock()-(clk))/CLOCKS_PER_SEC;} -extern double wallclock; -#define timer_start(x) TIMESTART(wallclock) -#define timer_stop(x) TIMESTOP(wallclock) -#define timer_elapsed(x) (wallclock / 1000.0) -#define chatting printf -#define NOTEST() (void)0 -#define RETEST() (void)0 -#define mymalloc malloc -#endif - - diff --git a/test/ccured_olden/perimeter/testit b/test/ccured_olden/perimeter/testit deleted file mode 100755 index 35723c5f..00000000 --- a/test/ccured_olden/perimeter/testit +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# test a perimeter binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./perimeter.exe" - exit -fi - -# all of perimeter's output is to stdout -echo "running: $1 >output" -if ! $1 >output; then - echo "$1 failed directly" - exit 2 -fi - -if ! grep -v "Time elapsed" <output | diff out.orig - >out.diff 2>&1 ; then - # For some reason diff returns error code but an empty diff ! - if test -s out.diff; then - echo "$1 got the wrong answer. See out.diff." - exit 4 - fi -fi -echo "$1 seems to work" -rm -f out.diff -
\ No newline at end of file diff --git a/test/ccured_olden/power/.cvsignore b/test/ccured_olden/power/.cvsignore deleted file mode 100644 index c4eadcc3..00000000 --- a/test/ccured_olden/power/.cvsignore +++ /dev/null @@ -1,21 +0,0 @@ -*.i -*_all*.c -*cil.c -*box.c -code -data.in -data.out -*.origi -*_ppp.c -power.cil -power.*box -*infer.c -changes.out -allcfiles -ope.m -*cured.c -*.optim.c -*_comb.c -*.exe_comb.browser -changes -output diff --git a/test/ccured_olden/power/.gdbinit b/test/ccured_olden/power/.gdbinit deleted file mode 100644 index 81003d62..00000000 --- a/test/ccured_olden/power/.gdbinit +++ /dev/null @@ -1,5 +0,0 @@ -# .gdbinit - -file power.exe.orig -break main -run diff --git a/test/ccured_olden/power/CVS/Entries b/test/ccured_olden/power/CVS/Entries deleted file mode 100644 index fccdd5e3..00000000 --- a/test/ccured_olden/power/CVS/Entries +++ /dev/null @@ -1,11 +0,0 @@ -/README/1.1/Mon Jun 11 21:20:00 2001// -/build.c/1.1/Mon Jun 11 21:20:00 2001// -/compute.c/1.2/Wed Jun 13 18:16:23 2001// -/main.c/1.2/Mon Jun 11 22:47:26 2001// -/.gdbinit/1.1/Mon Nov 12 08:08:28 2001// -/Makefile/1.5/Mon Nov 12 15:44:12 2001// -/out.orig/1.1/Mon Nov 12 08:08:28 2001// -/testit/1.1/Mon Nov 12 08:08:28 2001// -/.cvsignore/1.10/Fri Oct 4 16:28:44 2002// -/power.h/1.6/Sat Jan 11 20:33:38 2003// -D diff --git a/test/ccured_olden/power/CVS/Repository b/test/ccured_olden/power/CVS/Repository deleted file mode 100644 index edf93de9..00000000 --- a/test/ccured_olden/power/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/power diff --git a/test/ccured_olden/power/CVS/Root b/test/ccured_olden/power/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/power/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/power/Makefile b/test/ccured_olden/power/Makefile deleted file mode 100644 index 9396957b..00000000 --- a/test/ccured_olden/power/Makefile +++ /dev/null @@ -1,41 +0,0 @@ - -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -CFLAGS = $(EXTRA_CFLAGS) -#CFLAGS = -O2 -LDFLAGS = $(EXTRA_LDFLAGS) - -CFLAGS += -DPLAIN - -ifdef _MSVC - # ... -else - MATH = -lm - CFLAGS += -g -ffloat-store - LDFLAGS += -g -ffloat-store -endif - -PROGS = compute build main - -#defaulttarget: $(OBJS) -# $(CC) $(LDFLAGS) $(OBJS) $(EXTRA_LIBS) -o power.exe $(MATH) - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(LDFALGS) -o $*.compcert $*.s - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c - -clean: - rm -f $(TARGET) $(OBJS) *~ *.obj *.o *.exe .make.state .nse_depinfo *.light.c *.s *.compcert diff --git a/test/ccured_olden/power/README b/test/ccured_olden/power/README deleted file mode 100644 index 478692e8..00000000 --- a/test/ccured_olden/power/README +++ /dev/null @@ -1,21 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ -********************** -olden_v1.0/benchmarks/power/README -January 3, 1995 -Martin C. Carlisle - -this directory contains the Power Pricing benchmark: - -S. Lumetta, L. Murphy, X. Li, D. Culler, and I. Khalil. "Decentralized -optimal power pricing: The development of a parallel program." -Supercomputing '93, 243-249 - -as implemented for Olden by Martin C. Carlisle -********************** - -Makefile - use "make power" to create executable - -args.c - process command line args -main.c,power.h - main routines -build.c - build tree -compute.c - compute prices diff --git a/test/ccured_olden/power/build.c b/test/ccured_olden/power/build.c deleted file mode 100644 index 881b8e60..00000000 --- a/test/ccured_olden/power/build.c +++ /dev/null @@ -1,154 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* build.c - * - * By: Martin C. Carlisle - * 6/15/94 - * builds the tree for the Power Pricing problem - * - * based on code by: Steve Lumetta, Sherry Li, and Ismail Khalil - * University of California at Berkeley - */ - -#include "power.h" - -Root build_tree() -{ - register int i; - register Root t; -#ifdef FUTURES - int j; - future_cell_int fc[NUM_FEEDERS]; -#else - register Lateral l; -#endif - - t = (Root) ALLOC(0,sizeof(*t)); -#ifdef FUTURES - for (i=0,j=0; i<NUM_FEEDERS; i++,j+=LATERALS_PER_FEEDER) { - FUTURE(j,LATERALS_PER_FEEDER,build_lateral,&fc[i]); - } - for (i=0; i<NUM_FEEDERS; i++) { - TOUCH(&fc[i]); - t->feeders[i]=(Lateral) fc[i].value; - } -#else - for (i=0; i<NUM_FEEDERS; i++) { - /* Insert future here, split into two loops */ - l = build_lateral(i*LATERALS_PER_FEEDER,LATERALS_PER_FEEDER); - t->feeders[i]=l; - } -#endif - t->theta_R = 0.8; - t->theta_I = 0.16; - return t; -} - -Lateral build_lateral(int i, int num) -{ - register int j,k; - register Lateral l; - register Branch b; -#ifdef FUTURES - future_cell_int fc; -#else - register Lateral next; -#endif - - if (num == 0) return NULL; - -#ifndef PLAIN - { int x,m,q,proc; - x = (i+num-1)*BRANCHES_PER_LATERAL+BRANCHES_PER_LATERAL-1; - m = 1000%__NumNodes; - q = 1000/__NumNodes; - if (x<m*(q+1)) proc = x/(q+1); - else proc = (x-m)/q; - l = (Lateral) ALLOC(__NumNodes-1-proc,sizeof(*l)); - } -#else - l = (Lateral) ALLOC(0,sizeof(*l)); -#endif - -#ifdef FUTURES - FUTURE(i,num-1,build_lateral,&fc); - b = build_branch(i*BRANCHES_PER_LATERAL,(num-1)*BRANCHES_PER_LATERAL, - BRANCHES_PER_LATERAL); -#else - next = build_lateral(i,num-1); - b = build_branch(i*BRANCHES_PER_LATERAL,(num-1)*BRANCHES_PER_LATERAL, - BRANCHES_PER_LATERAL); -#endif - -#ifdef FUTURES - TOUCH(&fc); - l->next_lateral = (Lateral) fc.value; -#else - l->next_lateral = next; -#endif - l->branch = b; - l->R = 1/300000.0; - l->X = 0.000001; - l->alpha = 0.0; - l->beta = 0.0; - return l; -} - -Branch build_branch(int i, int j, int num) -{ - register Leaf l; - register Branch b; -#ifdef FUTURES - future_cell_int fc; -#endif - - if (num == 0) return NULL; - /* allocate branch */ -#ifndef PLAIN - { int x,m,q,proc; - x = i+j+num-1; - m = 1000%__NumNodes; - q = 1000/__NumNodes; - if (x<m*(q+1)) proc = x/(q+1); - else proc = (x-m)/q; - b = (Branch) ALLOC(__NumNodes-1-proc,sizeof(*b)); - } -#else - b = (Branch) ALLOC(0,sizeof(*b)); -#endif - - /* fill in children */ -#ifndef FUTURES - b->next_branch= build_branch(i,j,num-1); -#else - FUTURE(i,j,num-1,build_branch,&fc); -#endif - - for (i=0; i<LEAVES_PER_BRANCH; i++) { - l = build_leaf(); - b->leaves[i] = l; - } - - -#ifdef FUTURES - TOUCH(&fc); - b->next_branch = (Branch) fc.value; -#endif - - /* fill in values */ - b->R = 0.0001; - b->X = 0.00002; - b->alpha = 0.0; - b->beta = 0.0; - return b; -} - -Leaf build_leaf() -{ - register Leaf l; - - l = (Leaf) mymalloc(sizeof(*l)); - l->D.P = 1.0; - l->D.Q = 1.0; - return l; -} diff --git a/test/ccured_olden/power/compute.c b/test/ccured_olden/power/compute.c deleted file mode 100644 index 83d47b59..00000000 --- a/test/ccured_olden/power/compute.c +++ /dev/null @@ -1,379 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* compute.c - * - * By: Martin C. Carlisle - * 6/15/94 - * - * Implements computation phase of the Power Pricing problem - * based on code by: Steve Lumetta, Sherry Li, and Ismail Khalil - * University of California at Berkeley - * - */ - -#include "power.h" -#include <math.h> - -/*----------------------------------------------------------------------*/ -/* Leaf optimization 'global' variables */ - - static double P=1.0; - static double Q=1.0; - - -/*----------------------------------------------------------------------*/ -/* Leaf optimization procedures */ - -void optimize_node (double pi_R, double pi_I); -double find_g (); -double find_h (); -double find_gradient_f (double pi_R, double pi_I, local double* gradient); -double find_gradient_g (local double* gradient); -double find_gradient_h (local double* gradient); -void find_dd_grad_f (double pi_R, double pi_I, local double* dd_grad); -double make_orthogonal (local double* v_mod, local double* v_static); - - -void Compute_Tree(Root r) { - register int i; - Lateral l; -#ifndef FUTURES - Demand a; -#else - future_cell_demand fc[NUM_FEEDERS]; -#endif - Demand tmp; - double theta_R,theta_I; - - tmp.P = 0.0; - tmp.Q = 0.0; -#ifndef FUTURES - for (i=0; i<NUM_FEEDERS; i++) { - l = r->feeders[i]; - theta_R = r->theta_R; - theta_I = r->theta_I; - a = Compute_Lateral(l,theta_R,theta_I,theta_R,theta_I); - tmp.P += a.P; - tmp.Q += a.Q; - - } -#else - for (i=0; i<NUM_FEEDERS; i++) { - l = r->feeders[i]; - theta_R = r->theta_R; - theta_I = r->theta_I; - FUTURE(l,theta_R,theta_I,theta_R,theta_I,Compute_Lateral,&fc[i]); - } - for (i=NUM_FEEDERS-1; i>=0; i--) { - TOUCH(&fc[i]); - tmp.P += fc[i].value.P; - tmp.Q += fc[i].value.Q; - } -#endif - r->D.P = tmp.P; - r->D.Q = tmp.Q; -} - -Demand Compute_Lateral(Lateral l, double theta_R, double theta_I, - double pi_R, double pi_I) { -#ifndef FUTURES - Demand a1; -#else - future_cell_demand fc; -#endif - Demand a2; - double new_pi_R, new_pi_I; - double a,b,c,root; - Lateral next; - Branch br; - - new_pi_R = pi_R + l->alpha*(theta_R+(theta_I*l->X)/l->R); - new_pi_I = pi_I + l->beta*(theta_I+(theta_R*l->R)/l->X); - - next = l->next_lateral; - if (next != NULL) -#ifndef FUTURES - a1 = Compute_Lateral(next,theta_R,theta_I,new_pi_R,new_pi_I); -#else - FUTURE(next,theta_R,theta_I,new_pi_R,new_pi_I,Compute_Lateral,&fc); -#endif - - br = l->branch; - a2 = Compute_Branch(br,theta_R,theta_I,new_pi_R,new_pi_I); - - if (next != NULL) { -#ifndef FUTURES - l->D.P = a1.P + a2.P; - l->D.Q = a1.Q + a2.Q; -#else - TOUCH(&fc); - l->D.P = a2.P + fc.value.P; - l->D.Q = a2.Q + fc.value.Q; -#endif - } else { - l->D.P = a2.P; - l->D.Q = a2.Q; - } - - /* compute P,Q */ - a = l->R*l->R + l->X*l->X; - b = 2*l->R*l->X*l->D.Q - 2*l->X*l->X*l->D.P - l->R; - c = l->R*l->D.Q - l->X*l->D.P; - c = c*c + l->R*l->D.P; - root = (-b-sqrt(b*b-4*a*c))/(2*a); - l->D.Q = l->D.Q + ((root-l->D.P)*l->X)/l->R; - l->D.P = root; - - /* compute alpha, beta */ - a = 2*l->R*l->D.P; - b = 2*l->X*l->D.Q; - l->alpha = a/(1-a-b); - l->beta = b/(1-a-b); - return l->D; -} - -Demand Compute_Branch(Branch br, double theta_R, double theta_I, - double pi_R, double pi_I) { - Demand a2,tmp; - double new_pi_R, new_pi_I; - double a,b,c,root; - Leaf l; - Branch next; - int i; -#ifdef FUTURES - future_cell_demand fc; -#else - Demand a1; -#endif - - new_pi_R = pi_R + br->alpha*(theta_R+(theta_I*br->X)/br->R); - new_pi_I = pi_I + br->beta*(theta_I+(theta_R*br->R)/br->X); - - next = br->next_branch; - if (next != NULL) { -#ifndef FUTURES - a1 = Compute_Branch(next,theta_R,theta_I,new_pi_R,new_pi_I); -#else - FUTURE(next,theta_R,theta_I,new_pi_R,new_pi_I,Compute_Branch,&fc); -#endif - } - - /* Initialize tmp */ - tmp.P = 0.0; tmp.Q = 0.0; - - for (i=0; i<LEAVES_PER_BRANCH; i++) { - l = br->leaves[i]; - a2 = Compute_Leaf(l,new_pi_R,new_pi_I); - tmp.P += a2.P; - tmp.Q += a2.Q; - } - if (next != NULL) { -#ifndef FUTURES - br->D.P = a1.P + tmp.P; - br->D.Q = a1.Q + tmp.Q; -#else - TOUCH(&fc); - br->D.P = fc.value.P + tmp.P; - br->D.Q = fc.value.Q + tmp.Q; -#endif - } else { - br->D.P = tmp.P; - br->D.Q = tmp.Q; - } - - /* compute P,Q */ - a = br->R*br->R + br->X*br->X; - b = 2*br->R*br->X*br->D.Q - 2*br->X*br->X*br->D.P - br->R; - c = br->R*br->D.Q - br->X*br->D.P; - c = c*c + br->R*br->D.P; - root = (-b-sqrt(b*b-4*a*c))/(2*a); - br->D.Q = br->D.Q + ((root-br->D.P)*br->X)/br->R; - br->D.P = root; - /* compute alpha, beta */ - a = 2*br->R*br->D.P; - b = 2*br->X*br->D.Q; - br->alpha = a/(1-a-b); - br->beta = b/(1-a-b); - - return br->D; -} - -Demand Compute_Leaf(Leaf l, double pi_R, double pi_I) { - P = l->D.P; - Q = l->D.Q; - - optimize_node(pi_R,pi_I); - - if (P<0.0) { - P = 0.0; - Q = 0.0; - } - l->D.P = P; - l->D.Q = Q; - return l->D; -} - -/*----------------------------------------------------------------------*/ - -void optimize_node (double pi_R, double pi_I) -{ - double g; - double h; - - double grad_f[2]; - double grad_g[2]; - double grad_h[2]; - double dd_grad_f[2]; - double magnitude; - - int i; - double total; - double max_dist; - - do { - /* Move onto h=0 line */ - h=find_h (); - if (fabs (h)>H_EPSILON) { - magnitude=find_gradient_h (grad_h); - total=h/magnitude; - P-=total*grad_h[0]; - Q-=total*grad_h[1]; - } - - /* Check that g is still valid */ - g=find_g (); - if (g>G_EPSILON) { - magnitude=find_gradient_g (grad_g); - find_gradient_h (grad_h); - magnitude*=make_orthogonal (grad_g,grad_h); - total=g/magnitude; - P-=total*grad_g[0]; - Q-=total*grad_g[1]; - } - - /* Maximize benefit */ - magnitude=find_gradient_f (pi_R,pi_I,grad_f); - find_dd_grad_f (pi_R,pi_I,dd_grad_f); - total=0.0; - for (i=0; i<2; i++) - total+=grad_f[i]*dd_grad_f[i]; - magnitude/=fabs (total); - find_gradient_h (grad_h); - magnitude*=make_orthogonal (grad_f,grad_h); - find_gradient_g (grad_g); - total=0.0; - for (i=0; i<2; i++) - total+=grad_f[i]*grad_g[i]; - if (total>0) { - max_dist=-find_g ()/total; - if (magnitude>max_dist) - magnitude=max_dist; - } - P+=magnitude*grad_f[0]; - Q+=magnitude*grad_f[1]; - - h=find_h (); - g=find_g (); - find_gradient_f (pi_R,pi_I,grad_f); - find_gradient_h (grad_h); - - } while (fabs (h)>H_EPSILON || g>G_EPSILON || - (fabs (g)>G_EPSILON && - fabs (grad_f[0]*grad_h[1]-grad_f[1]*grad_h[0])>F_EPSILON)); -} - -double find_g () -{ - return (P*P+Q*Q-0.8); -} - -double find_h () -{ - return (P-5*Q); -} - -double find_gradient_f (double pi_R, double pi_I, local double* gradient) -{ - int i; - double magnitude=0.0; - - gradient[0]=1/(1+P)-pi_R; - gradient[1]=1/(1+Q)-pi_I; - for (i=0; i<2; i++) - magnitude+=gradient[i]*gradient[i]; - magnitude=sqrt (magnitude); - for (i=0; i<2; i++) - gradient[i]/=magnitude; - - return magnitude; -} - -double find_gradient_g (local double* gradient) -{ - int i; - double magnitude=0.0; - - gradient[0]=2*P; - gradient[1]=2*Q; - for (i=0; i<2; i++) - magnitude+=gradient[i]*gradient[i]; - magnitude=sqrt (magnitude); - for (i=0; i<2; i++) - gradient[i]/=magnitude; - - return magnitude; -} - -double find_gradient_h (local double* gradient) -{ - int i; - double magnitude=0.0; - - gradient[0]=1.0; - gradient[1]=-5.0; - for (i=0; i<2; i++) - magnitude+=gradient[i]*gradient[i]; - magnitude=sqrt (magnitude); - for (i=0; i<2; i++) - gradient[i]/=magnitude; - - return magnitude; -} - -void find_dd_grad_f (double pi_R, double pi_I, local double* dd_grad) -{ - double P_plus_1_inv=1/(P+1); - double Q_plus_1_inv=1/(Q+1); - double P_grad_term=P_plus_1_inv-pi_R; - double Q_grad_term=Q_plus_1_inv-pi_I; - double grad_mag; - - grad_mag=sqrt (P_grad_term*P_grad_term+Q_grad_term*Q_grad_term); - - dd_grad[0]=-P_plus_1_inv*P_plus_1_inv*P_grad_term/grad_mag; - dd_grad[1]=-Q_plus_1_inv*Q_plus_1_inv*Q_grad_term/grad_mag; -} - -double make_orthogonal (local double* v_mod, local double* v_static) -{ - int i; - double total=0.0; - double length=0.0; - - for (i=0; i<2; i++) - total+=v_mod[i]*v_static[i]; - for (i=0; i<2; i++) { - v_mod[i]-=total*v_static[i]; - length+=v_mod[i]*v_mod[i]; - } - length=sqrt (length); - for (i=0; i<2; i++) - v_mod[i]/=length; - - if (1-total*total<0) /* Roundoff error--vectors are parallel */ - return 0; - - return sqrt (1-total*total); -} - -/*----------------------------------------------------------------------*/ diff --git a/test/ccured_olden/power/main.c b/test/ccured_olden/power/main.c deleted file mode 100644 index 0fb87c0f..00000000 --- a/test/ccured_olden/power/main.c +++ /dev/null @@ -1,116 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* main.c - * - * By: Martin C. Carlisle - * 6/16/94 - * - * main routine for the Power Pricing problem - * adapted from code by: Steve Lumetta, Sherry Li, and Ismail Khalil - * University of California at Berkeley - * - * Cleaned up the CM stuff. George Necula - */ - -#include "power.h" - -/* Domain of thetaR->P map is 0.65 to 1.00 [index*0.01+0.65] */ -double map_P[36] = -{8752.218091048, 8446.106670416, 8107.990680283, - 7776.191574285, 7455.920518777, 7146.602181352, - 6847.709026813, 6558.734204024, 6279.213382291, - 6008.702199986, 5746.786181029, 5493.078256495, - 5247.206333097, 5008.828069358, 4777.615815166, - 4553.258735900, 4335.470002316, 4123.971545694, - 3918.501939675, 3718.817618538, 3524.683625800, - 3335.876573044, 3152.188635673, 2973.421417103, - 2799.382330486, 2629.892542617, 2464.782829705, - 2303.889031418, 2147.054385395, 1994.132771399, - 1844.985347313, 1699.475053321, 1557.474019598, - 1418.860479043, 1283.520126656, 1151.338004216}; - -#define MIN_THETA_R 0.65 -#define PER_INDEX_R 0.01 -#define MAX_THETA_R 0.995 - -/* Domain of thetaI->Q map is 0.130 to 0.200 [index*0.002+0.130] */ -double map_Q[36] = -{1768.846590190, 1706.229490046, 1637.253873079, - 1569.637451623, 1504.419525242, 1441.477913810, - 1380.700660446, 1321.980440476, 1265.218982201, - 1210.322424636, 1157.203306183, 1105.780028163, - 1055.974296746, 1007.714103979, 960.930643875, - 915.558722782, 871.538200178, 828.810882006, - 787.322098340, 747.020941334, 707.858376214, - 669.787829741, 632.765987756, 596.751545633, - 561.704466609, 527.587580585, 494.365739051, - 462.004890691, 430.472546686, 399.738429196, - 369.773787595, 340.550287137, 312.041496095, - 284.222260660, 257.068973074, 230.557938283}; - -#define MIN_THETA_I 0.13 -#define PER_INDEX_I 0.002 -#define MAX_THETA_I 0.199 - -#ifdef PLAIN -double wallclock; -#endif - -main(int argc,char *argv[]) -{ - Root r; - int i,finished=0; - double d_theta_R,d_theta_I; - - chatting("Past initialization\n"); - - timer_start(0); - - /* initial pass */ - r = build_tree(); - chatting("Built tree\n"); - Compute_Tree(r); - r->last.P = r->D.P; - r->last.Q = r->D.Q; - r->last_theta_R = r->theta_R; - r->last_theta_I = r->theta_I; - r->theta_R = 0.7; - r->theta_I = 0.14; - - while (!finished) { - Compute_Tree(r); - chatting("TR=%13.9f, TI=%13.9f, P0=%13.9f, Q0=%13.9f\n", - r->theta_R,r->theta_I,r->D.P,r->D.Q); - if (fabs(r->D.P/10000.0 - r->theta_R) < ROOT_EPSILON && - fabs(r->D.Q/10000.0 - r->theta_I) < ROOT_EPSILON) { - finished = 1; - } else { - i = (int)((r->theta_R - MIN_THETA_R) / PER_INDEX_R); - if (i<0) i=0; - if (i>35) i=35; - d_theta_R = -(r->theta_R - r->D.P/10000.0) / - (1 - (map_P[i+1] - map_P[i]) / (PER_INDEX_R * 10000.0)); - - i = (int)((r->theta_I - MIN_THETA_I) / PER_INDEX_I); - if (i<0) i=0; - if (i>35) i=35; - d_theta_I = -(r->theta_I - r->D.Q/10000.0) / - (1 - (map_Q[i+1] - map_Q[i]) / (PER_INDEX_I * 10000.0)); - - chatting("D TR-%13.9f, TI=%13.9f\n", d_theta_R,d_theta_I); - r->last.P = r->D.P; - r->last.Q = r->D.Q; - r->last_theta_R = r->theta_R; - r->last_theta_I = r->theta_I; - r->theta_R = r->theta_R + d_theta_R; - r->theta_I = r->theta_I + d_theta_I; - } - } /* while */ - timer_stop(0); - chatting("Elapsed time %f\n", timer_elapsed(0)); - -#ifdef FUTURES - __ShutDown(0); -#endif - return 0; -} diff --git a/test/ccured_olden/power/out.orig b/test/ccured_olden/power/out.orig deleted file mode 100644 index ce4ccae8..00000000 --- a/test/ccured_olden/power/out.orig +++ /dev/null @@ -1,37 +0,0 @@ -Past initialization -Built tree -TR= 0.70000, TI= 0.14000, P0=7368.11283, Q0=1486.61206 -D TR- 0.00899, TI= 0.00214 -TR= 0.70899, TI= 0.14214, P0=6825.69077, Q0=1376.20403 -D TR- -0.00662, TI= -0.00114 -TR= 0.70236, TI= 0.14099, P0=7102.87981, Q0=1432.59759 -D TR- 0.00198, TI= 0.00056 -TR= 0.70435, TI= 0.14155, P0=7000.94922, Q0=1411.85085 -D TR- -0.00106, TI= -0.00009 -TR= 0.70328, TI= 0.14146, P0=7047.52523, Q0=1421.32891 -D TR- 0.00036, TI= 0.00016 -TR= 0.70365, TI= 0.14162, P0=7029.01641, Q0=1417.56197 -D TR- -0.00018, TI= 0.00003 -TR= 0.70346, TI= 0.14166, P0=7037.01709, Q0=1419.19017 -D TR- 0.00005, TI= 0.00006 -TR= 0.70352, TI= 0.14172, P0=7033.77002, Q0=1418.52933 -D TR- -0.00003, TI= 0.00003 -TR= 0.70348, TI= 0.14175, P0=7035.10974, Q0=1418.80198 -D TR- 0.00000, TI= 0.00003 -TR= 0.70349, TI= 0.14178, P0=7034.59229, Q0=1418.69667 -D TR- -0.00000, TI= 0.00002 -TR= 0.70348, TI= 0.14180, P0=7034.76550, Q0=1418.73192 -D TR- -0.00000, TI= 0.00001 -TR= 0.70348, TI= 0.14182, P0=7034.73206, Q0=1418.72511 -D TR- -0.00000, TI= 0.00001 -TR= 0.70348, TI= 0.14183, P0=7034.72701, Q0=1418.72409 -D TR- -0.00000, TI= 0.00000 -TR= 0.70347, TI= 0.14184, P0=7034.72601, Q0=1418.72388 -D TR- -0.00000, TI= 0.00000 -TR= 0.70347, TI= 0.14185, P0=7034.72675, Q0=1418.72403 -D TR- -0.00000, TI= 0.00000 -TR= 0.70347, TI= 0.14185, P0=7034.72767, Q0=1418.72422 -D TR- -0.00000, TI= 0.00000 -TR= 0.70347, TI= 0.14186, P0=7034.72812, Q0=1418.72431 -D TR- -0.00000, TI= 0.00000 -TR= 0.70347, TI= 0.14186, P0=7034.72817, Q0=1418.72432 diff --git a/test/ccured_olden/power/output b/test/ccured_olden/power/output deleted file mode 100644 index 5d8d9f14..00000000 --- a/test/ccured_olden/power/output +++ /dev/null @@ -1,38 +0,0 @@ -Past initialization -Built tree -TR= 0.700000000, TI= 0.140000000, P0=7368.112832298, Q0=1486.612062522 -D TR- 0.008993314, TI= 0.002144467 -TR= 0.708993314, TI= 0.142144467, P0=6825.690778967, Q0=1376.204035288 -D TR- -0.006624389, TI= -0.001149403 -TR= 0.702368925, TI= 0.140995064, P0=7102.879810214, Q0=1432.597592989 -D TR- 0.001985258, TI= 0.000560726 -TR= 0.704354182, TI= 0.141555790, P0=7000.949225527, Q0=1411.850856419 -D TR- -0.001067770, TI= -0.000091784 -TR= 0.703286413, TI= 0.141464005, P0=7047.525235387, Q0=1421.328911557 -D TR- 0.000367545, TI= 0.000165612 -TR= 0.703653957, TI= 0.141629618, P0=7029.016413235, Q0=1417.561973965 -D TR- -0.000188601, TI= 0.000031340 -TR= 0.703465356, TI= 0.141660958, P0=7037.017091019, Q0=1419.190170854 -D TR- 0.000059252, TI= 0.000063894 -TR= 0.703524609, TI= 0.141724852, P0=7033.770028540, Q0=1418.529337079 -D TR- -0.000037004, TI= 0.000031712 -TR= 0.703487605, TI= 0.141756564, P0=7035.109740779, Q0=1418.801987979 -D TR- 0.000005859, TI= 0.000030611 -TR= 0.703493463, TI= 0.141787176, P0=7034.592291756, Q0=1418.696672935 -D TR- -0.000008582, TI= 0.000020424 -TR= 0.703484881, TI= 0.141807600, P0=7034.765506561, Q0=1418.731929644 -D TR- -0.000002088, TI= 0.000016240 -TR= 0.703482793, TI= 0.141823841, P0=7034.732061514, Q0=1418.725114927 -D TR- -0.000002403, TI= 0.000012051 -TR= 0.703480389, TI= 0.141835891, P0=7034.727015389, Q0=1418.724090079 -D TR- -0.000001927, TI= 0.000009042 -TR= 0.703478462, TI= 0.141844933, P0=7034.726010052, Q0=1418.723886296 -D TR- -0.000001469, TI= 0.000006798 -TR= 0.703476993, TI= 0.141851731, P0=7034.726755730, Q0=1418.724038175 -D TR- -0.000001082, TI= 0.000005119 -TR= 0.703475910, TI= 0.141856849, P0=7034.727670658, Q0=1418.724224195 -D TR- -0.000000788, TI= 0.000003856 -TR= 0.703475122, TI= 0.141860705, P0=7034.728128768, Q0=1418.724317198 -D TR- -0.000000579, TI= 0.000002903 -TR= 0.703474543, TI= 0.141863609, P0=7034.728179600, Q0=1418.724327425 -Elapsed time 5130.000000 diff --git a/test/ccured_olden/power/power.h b/test/ccured_olden/power/power.h deleted file mode 100644 index b8fbd2dd..00000000 --- a/test/ccured_olden/power/power.h +++ /dev/null @@ -1,114 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* - * power.h - * - * By: Martin C. Carlisle - * 6/15/94 - * - * Header file for the Power Pricing problem - * adapted from code by Steve Lumetta, Sherry Li, and Ismail Khalil - * University of California at Berkeley - * - */ - -typedef struct demand { - double P; - double Q; -} Demand; - -#ifndef PLAIN -#include "future-cell.h" -#include "mem-ref.h" -typedef struct fc_demand { - future_cell_impl impl; - Demand value; /* cell's value */ - } future_cell_demand; -#endif - -#ifdef PLAIN -#include <time.h> -#define local -#define mymalloc malloc -#define CMMD_node_timer_clear(x) (void)0 -#define TIMESTART(clk) {clk=(double)clock();} -#define TIMESTOP(clk) {clk=1000000.0 * ((double)clock()-(clk))/CLOCKS_PER_SEC;} -extern double wallclock; -#define timer_start(x) TIMESTART(wallclock) -#define timer_stop(x) TIMESTOP(wallclock) -#define timer_elapsed(x) (wallclock / 1000.0) -#endif - -#include "math.h" -#include <stdlib.h> // malloc -#include <stdio.h> // printf - -#ifndef NULL -#define NULL 0 -#endif - -#define NUM_FEEDERS 10 -#define LATERALS_PER_FEEDER 20 -#define BRANCHES_PER_LATERAL 5 -#define LEAVES_PER_BRANCH 10 - -#define F_EPSILON 0.000001 -#define G_EPSILON 0.000001 -#define H_EPSILON 0.000001 -#define ROOT_EPSILON 0.00001 - -typedef struct root { - Demand D; - double theta_R; - double theta_I; - Demand last; - double last_theta_R; - double last_theta_I; - struct lateral *feeders[NUM_FEEDERS]; -} *Root; - -typedef struct lateral { - Demand D; - double alpha; - double beta; - double R; - double X; - struct lateral *next_lateral; - struct branch *branch; -} *Lateral; - -typedef struct branch { - Demand D; - double alpha; - double beta; - double R; - double X; - struct branch *next_branch; - struct leaf *leaves[LEAVES_PER_BRANCH]; -} *Branch; - -typedef struct leaf { - Demand D; - double pi_R; - double pi_I; -} *Leaf; - -#ifdef PLAIN -#define ALLOC(pn,sz) malloc(sz) -#define chatting printf -#define __NumNodes 1 -#define __MyNodeId 0 -#endif - -/* Prototypes */ -Root build_tree(); -Lateral build_lateral(int i, int num); -Branch build_branch(int i, int j, int num); -Leaf build_leaf(); - -void Compute_Tree(Root r); -Demand Compute_Lateral(Lateral l, double theta_R, double theta_I, - double pi_R, double pi_I); -Demand Compute_Branch(Branch b, double theta_R, double theta_I, - double pi_R, double pi_I); -Demand Compute_Leaf(Leaf l, double pi_R, double pi_I); diff --git a/test/ccured_olden/power/testit b/test/ccured_olden/power/testit deleted file mode 100755 index b5132dd7..00000000 --- a/test/ccured_olden/power/testit +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# test a power binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./power.exe" - exit -fi - -# all of power's output is to stdout -echo "running: $1 >output" -if ! $1 >output; then - echo "$1 failed directly" - exit 2 -fi - -# must strip elapsed time -# must truncate precision to only 5 decimal places, because gcc's optimizer -# (even with -ffloat-store) seems to change the answer under boxing -if ! grep -v "Elapsed time" <output | \ - sed 's/\(\.[0-9]\{5\}\)[0-9]*/\1/g' | diff out.orig - >/dev/null; then - echo "$1 got the wrong answer" - exit 4 -else - echo "$1 seems to work" -fi -
\ No newline at end of file diff --git a/test/ccured_olden/rapportCompcert_all.txt b/test/ccured_olden/rapportCompcert_all.txt deleted file mode 100644 index 25a7e4cf..00000000 --- a/test/ccured_olden/rapportCompcert_all.txt +++ /dev/null @@ -1,82 +0,0 @@ -********** Répertoire bh ************************ -************************************************* - -../../../../ccomp -dump-c io.c -/usr/include/stdio.h:250: Unsupported C feature: integer type specifier --> int fclose(FILE ); ????? -make: *** [io.compcert] Error 2 - -../../../../ccomp -dump-c getparam.c -/usr/include/stdio.h:171: Warning: array type of unspecified size -/usr/include/stdio.h:171: Unsupported C feature: integer type specifier --> extern FILE __sF[]; -make: *** [getparam.compcert] Error 2 - -********** Répertoire bisort ******************** -************************************************* -../../../../ccomp -dump-c bitonic.c -bitonic.c:42: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:91: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:231: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:233: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:242: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:244: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:245: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:246: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:248: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:251: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:253: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:255: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:257: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:260: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:262: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:264: Warning: working around a call to a variadic or non-prototyped function -bitonic.c:265: Warning: working around a call to a variadic or non-prototyped function -Error in translation Csyntax -> PPC - -********** Répertoire bisort ******************** -************************************************* -../../../../ccomp -dump-c bitonic.c - -même problème que pour bitonic.c du répertoire bisort. - -********** Répertoire health ******************** -************************************************* -../../../../ccomp -dump-c poisson.c - -../../../../ccomp -dump-c list.c -list.c:16: Unsupported C feature: ill-formed recursive structure or union ---> void addList(struct List *list, struct Patient *patient) { -make: *** [list.s] Error 2 - -********** Répertoire em3d ********************** -************************************************* -../../../../ccomp -dump-c make_graph.c -make_graph.c:28: Warning: working around a call to a variadic or non-prototyped function -make_graph.c:43: Warning: working around a call to a variadic or non-prototyped function -make_graph.c:101: Warning: working around a call to a variadic or non-prototyped function -make_graph.c:136: Unsupported C feature: return value of struct or union type --> graph_t initialize_graph() -{ - node_t **h_table; - node_t **e_table; - graph_t retval; -................ -make: *** [make_graph.s] Error 2 - -********** Répertoire treeadd ********************* -************************************************* - -node.c:38: Error: Cannot resolve variable stderr. --> fprintf(stderr, "Iteration %d...", i); - -error in doExp (Errormsg.Error) - -error in doExp (Errormsg.Error) -node.c:27: Warning: working around a call to a variadic or non-prototyped function -node.c:30: Warning: working around a call to a variadic or non-prototyped function -node.c:32: Warning: working around a call to a variadic or non-prototyped function -node.c:33: Warning: working around a call to a variadic or non-prototyped function -node.c:34: Warning: working around a call to a variadic or non-prototyped function -node.c:38: Unsupported C feature: inline assembly --> fprintf(stderr, "Iteration %d...", i); diff --git a/test/ccured_olden/treeadd/.cvsignore b/test/ccured_olden/treeadd/.cvsignore deleted file mode 100644 index ea04e03d..00000000 --- a/test/ccured_olden/treeadd/.cvsignore +++ /dev/null @@ -1,27 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -treeadd -allcfiles -ope.m -*_comb.c -*.exe_comb.browser -*cured.c -*.optim.c -changes -output -out.diff diff --git a/test/ccured_olden/treeadd/CVS/Entries b/test/ccured_olden/treeadd/CVS/Entries deleted file mode 100644 index c689f04f..00000000 --- a/test/ccured_olden/treeadd/CVS/Entries +++ /dev/null @@ -1,27 +0,0 @@ -/HOWTO/1.1/Fri Jun 29 11:24:14 2001// -/HOWTO.bak/1.1/Fri Jun 29 11:24:14 2001// -/Makefile.plain/1.1/Fri Jun 29 11:24:14 2001// -/Makefile.ss/1.1/Fri Jun 29 11:24:14 2001// -/args.c/1.1/Fri Jun 29 11:24:14 2001// -/node.c/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1.mac_cnt/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1.mac_cnt_sil/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1.mac_nocnt_sil/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1.nm_nocnt/1.1/Fri Jun 29 11:24:14 2001// -/out_20_1.nwm_nocnt/1.1/Fri Jun 29 11:24:14 2001// -/out_22_1/1.1/Fri Jun 29 11:24:14 2001// -/out_22_1.mac_nocnt_sil/1.1/Fri Jun 29 11:24:14 2001// -/out_23_1/1.1/Fri Jun 29 11:24:14 2001// -/out_23_1.mac_nocnt_sil/1.1/Fri Jun 29 11:24:14 2001// -/out_25_1/1.1/Fri Jun 29 11:24:14 2001// -/out_25_1.mac_nocnt_sil/1.1/Fri Jun 29 11:24:14 2001// -/par-alloc.c/1.1/Fri Jun 29 11:24:14 2001// -/tree.h/1.1/Fri Jun 29 11:24:14 2001// -/ssplain.c/1.5/Sat Nov 3 05:33:28 2001// -/Makefile/1.6/Fri Nov 9 01:27:01 2001// -/out.orig/1.1/Mon Nov 12 08:08:28 2001// -/testit/1.2/Tue Dec 4 05:07:50 2001// -/.cvsignore/1.9/Fri Oct 4 16:28:44 2002// -/ssplain.h/1.6/Mon Jan 6 23:29:45 2003// -D/old-exe//// diff --git a/test/ccured_olden/treeadd/CVS/Repository b/test/ccured_olden/treeadd/CVS/Repository deleted file mode 100644 index 6d2ed236..00000000 --- a/test/ccured_olden/treeadd/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/treeadd diff --git a/test/ccured_olden/treeadd/CVS/Root b/test/ccured_olden/treeadd/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/treeadd/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/treeadd/HOWTO b/test/ccured_olden/treeadd/HOWTO deleted file mode 100644 index d456a9ee..00000000 --- a/test/ccured_olden/treeadd/HOWTO +++ /dev/null @@ -1 +0,0 @@ -21 1 diff --git a/test/ccured_olden/treeadd/HOWTO.bak b/test/ccured_olden/treeadd/HOWTO.bak deleted file mode 100644 index bfd056e3..00000000 --- a/test/ccured_olden/treeadd/HOWTO.bak +++ /dev/null @@ -1 +0,0 @@ -20 1 diff --git a/test/ccured_olden/treeadd/Makefile b/test/ccured_olden/treeadd/Makefile deleted file mode 100644 index f17f1155..00000000 --- a/test/ccured_olden/treeadd/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = treeadd.exe -FILES = par-alloc node args ssplain - - -OLDENHOME = /tmp/olden - -CC = gcc - -SRC = .c -OBJ = .o -ASM = .s -SRCS = $(addsuffix $(SRC),$(FILES)) -OBJS = $(addsuffix $(OBJ),$(FILES)) -ASMS = $(addsuffix $(ASM),$(FILES)) -INCDIRS = /usr/include - -EXTRA_CDEFS = -DI_TIME -DI_SYS_TIME -DULTRIX -CDEFS = -DPLAIN -DSS_PLAIN #-I$(OLDENHOME)/common -OPTFLAGS = -g -Wall -O3 - -LIBS = -lm -LIBPATH = - -$(BINARY): $(OBJS) - $(CC) $(LDFALGS) $(OPTFLAGS) -o $@ $(OBJS) $(LIBPATH) $(LIBS) - -$(SRC)$(OBJ): - $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) -c $< - -clean: - rm -f $(BINARY) $(OBJS) $(ASMS) *~ *.light.c - -links: - /bin/rm -f ssplain.[hc] - ln -s $(OLDENHOME)/common/ssplain.h - ln -s $(OLDENHOME)/common/ssplain.c diff --git a/test/ccured_olden/treeadd/Makefile.plain b/test/ccured_olden/treeadd/Makefile.plain deleted file mode 100644 index 5083bd76..00000000 --- a/test/ccured_olden/treeadd/Makefile.plain +++ /dev/null @@ -1,8 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = treeadd -FILES = par-alloc node args ssplain - -include ../Makefile.plain - - diff --git a/test/ccured_olden/treeadd/Makefile.ss b/test/ccured_olden/treeadd/Makefile.ss deleted file mode 100644 index 7d3b7d23..00000000 --- a/test/ccured_olden/treeadd/Makefile.ss +++ /dev/null @@ -1,10 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = treeadd -FILES = par-alloc node args ssplain - -MY_CDEFS = -DOLDEN - -include ../Makefile.ss - - diff --git a/test/ccured_olden/treeadd/args.c b/test/ccured_olden/treeadd/args.c deleted file mode 100644 index 279f2d12..00000000 --- a/test/ccured_olden/treeadd/args.c +++ /dev/null @@ -1,47 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#else SS_PLAIN -#include <cm/cmmd.h> -#include <fcntl.h> - -extern int __NumNodes; -#endif SS_PLAIN - -#include "tree.h" - -void filestuff() -{ -#ifndef SS_PLAIN - CMMD_fset_io_mode(stdout, CMMD_independent); - fcntl(fileno(stdout), F_SETFL, O_APPEND); - if (CMMD_self_address()) exit(0); - __InitRegs(0); -#endif SS_PLAIN -} - -int level; -int iters; - -int dealwithargs(int argc, char *argv[]) -{ -#ifndef SS_PLAIN - if (argc > 3) - __NumNodes = atoi(argv[2]); - else - __NumNodes = 4; -#endif SS_PLAIN - - if (argc > 2) - iters = atoi(argv[2]); - else - iters = 1; - - if (argc > 1) - level = atoi(argv[1]); - else - level = 5; - - return level; -} diff --git a/test/ccured_olden/treeadd/node.c b/test/ccured_olden/treeadd/node.c deleted file mode 100644 index 1e609132..00000000 --- a/test/ccured_olden/treeadd/node.c +++ /dev/null @@ -1,74 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* node.c - */ -#include <stdio.h> -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -#include "tree.h" - - -int dealwithargs(int argc, char *argv[]); - -typedef struct { - long level; -} startmsg_t; - -int TreeAdd (/* tree_t *t */); -extern tree_t *TreeAlloc (/* int level */); - -main (int argc, char *argv[]) -{ - tree_t *root; - int i, result = 0; - - filestuff(); - (void)dealwithargs(argc, argv); - - chatting("Treeadd with %d levels\n", level); - - chatting("About to enter TreeAlloc\n"); - root = TreeAlloc (level); - chatting("About to enter TreeAdd\n"); - - for (i = 0; i < iters; i++) - { - fprintf(stderr, "Iteration %d...", i); - result = TreeAdd (root); - fprintf(stderr, "done\n"); - } - - chatting("Received result of %d\n",result); - exit(0); -} - -/* TreeAdd: - */ -int TreeAdd (t) - register tree_t *t; -{ - if (t == NULL) - { - return 0; - } - else - { - int leftval; - int rightval; - tree_t *tleft, *tright; - int value; - - tleft = t->left; - leftval = TreeAdd(tleft); - tright = t->right; - rightval = TreeAdd(tright); - - value = t->val; - return leftval + rightval + value; - } -} /* end of TreeAdd */ - - - diff --git a/test/ccured_olden/treeadd/old-exe/CVS/Entries b/test/ccured_olden/treeadd/old-exe/CVS/Entries deleted file mode 100644 index 17848105..00000000 --- a/test/ccured_olden/treeadd/old-exe/CVS/Entries +++ /dev/null @@ -1 +0,0 @@ -D diff --git a/test/ccured_olden/treeadd/old-exe/CVS/Repository b/test/ccured_olden/treeadd/old-exe/CVS/Repository deleted file mode 100644 index 9518434e..00000000 --- a/test/ccured_olden/treeadd/old-exe/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/treeadd/old-exe diff --git a/test/ccured_olden/treeadd/old-exe/CVS/Root b/test/ccured_olden/treeadd/old-exe/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/treeadd/old-exe/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/treeadd/out.diff b/test/ccured_olden/treeadd/out.diff deleted file mode 100644 index e69de29b..00000000 --- a/test/ccured_olden/treeadd/out.diff +++ /dev/null diff --git a/test/ccured_olden/treeadd/out.orig b/test/ccured_olden/treeadd/out.orig deleted file mode 100644 index fde5b808..00000000 --- a/test/ccured_olden/treeadd/out.orig +++ /dev/null @@ -1,5 +0,0 @@ -Treeadd with 21 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 2097151 diff --git a/test/ccured_olden/treeadd/out_20_1 b/test/ccured_olden/treeadd/out_20_1 deleted file mode 100644 index 3ece101b..00000000 --- a/test/ccured_olden/treeadd/out_20_1 +++ /dev/null @@ -1,10 +0,0 @@ -1.83u 0.32s 0:02.28 94.2% - -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 - -1.83u 0.32s 0:02.28 94.2% - diff --git a/test/ccured_olden/treeadd/out_20_1.mac_cnt b/test/ccured_olden/treeadd/out_20_1.mac_cnt deleted file mode 100644 index c71bf72b..00000000 --- a/test/ccured_olden/treeadd/out_20_1.mac_cnt +++ /dev/null @@ -1,28 +0,0 @@ -58.54u 1.33s 1:00.23 99.4% - -[/usr/include/stdio.h:201.1] WARNING: extern with incomplete type not initialized -[/usr/include/stdio.h:230.1] WARNING: extern with incomplete type not initialized -[/usr/include/stdlib.h:119.1] WARNING: extern with incomplete type not initialized -[/usr/include/stdio.h:201.1] WARNING: extern with incomplete type not initialized -Note: strictPointer mode is OFF -Note: stack grows decreasingly! -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 -Total time: 58.540 u, 1.310 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.010 s -Prog_main: 58.530 u, 1.300 s -processReturns : tot 5242883, empty 5242878, common 5 -Macro counts (function counts): -verifyPtr : char 0(0), aggr 0(0), etc 6291452(3145725) -verifyTag : char 0(0), aggr 0(0), etc 19922937(0) - copyTag : char 0(0), aggr 0(0), etc 16777218(3145725) - setScalarTag : char 0(0), etc 11534344(0) -setScalarUninitTag : char 0(0), etc 8388607(0) -processArgTag : scalar 5242883(0) (promo 0), aggr 0(0) - -58.54u 1.33s 1:00.23 99.4% - diff --git a/test/ccured_olden/treeadd/out_20_1.mac_cnt_sil b/test/ccured_olden/treeadd/out_20_1.mac_cnt_sil deleted file mode 100644 index 6cc96e0d..00000000 --- a/test/ccured_olden/treeadd/out_20_1.mac_cnt_sil +++ /dev/null @@ -1,22 +0,0 @@ -58.02u 1.24s 0:59.66 99.3% - -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 -Total time: 58.010 u, 1.230 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.000 s -Prog_main: 58.000 u, 1.230 s -processReturns : tot 5242883, empty 5242878, common 5 -Macro counts (function counts): -verifyPtr : char 0(0), aggr 0(0), etc 6291452(3145725) -verifyTag : char 0(0), aggr 0(0), etc 19922937(0) - copyTag : char 0(0), aggr 0(0), etc 16777218(3145725) - setScalarTag : char 0(0), etc 11534344(0) -setScalarUninitTag : char 0(0), etc 8388607(0) -processArgTag : scalar 5242883(0) (promo 0), aggr 0(0) - -58.02u 1.24s 0:59.66 99.3% - diff --git a/test/ccured_olden/treeadd/out_20_1.mac_nocnt_sil b/test/ccured_olden/treeadd/out_20_1.mac_nocnt_sil deleted file mode 100644 index 66ea6134..00000000 --- a/test/ccured_olden/treeadd/out_20_1.mac_nocnt_sil +++ /dev/null @@ -1,15 +0,0 @@ -51.89u 1.42s 0:53.59 99.4% - -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 -Total time: 51.890 u, 1.390 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.000 s -Prog_main: 51.880 u, 1.390 s -processReturns : tot 5242883, empty 5242878, common 5 - -51.89u 1.42s 0:53.59 99.4% - diff --git a/test/ccured_olden/treeadd/out_20_1.nm_nocnt b/test/ccured_olden/treeadd/out_20_1.nm_nocnt deleted file mode 100644 index 6de580b0..00000000 --- a/test/ccured_olden/treeadd/out_20_1.nm_nocnt +++ /dev/null @@ -1,17 +0,0 @@ -3[/usr/include/stdio.h:201.1] -3[/usr/include/stdio.h:230.1] -3[/usr/include/stdlib.h:119.1] -3[/usr/include/stdio.h:201.1] -Note: strictPointer mode is OFF -Note: stack grows decreasingly! -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 -Total time: 47.640 u, 1.080 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.010 s -Prog_main: 47.640 u, 1.060 s -processReturns : tot 5242883, empty 5242878, common 5 -47.64u 1.10s 0:52.27 93.2% diff --git a/test/ccured_olden/treeadd/out_20_1.nwm_nocnt b/test/ccured_olden/treeadd/out_20_1.nwm_nocnt deleted file mode 100644 index c68935f6..00000000 --- a/test/ccured_olden/treeadd/out_20_1.nwm_nocnt +++ /dev/null @@ -1,6 +0,0 @@ -Treeadd with 20 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 1048575 -48.41u 1.28s 0:49.87 99.6% diff --git a/test/ccured_olden/treeadd/out_22_1 b/test/ccured_olden/treeadd/out_22_1 deleted file mode 100644 index 8a7794dd..00000000 --- a/test/ccured_olden/treeadd/out_22_1 +++ /dev/null @@ -1,10 +0,0 @@ -7.00u 3.06s 0:10.29 97.7% - -Treeadd with 22 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 4194303 - -7.00u 3.06s 0:10.29 97.7% - diff --git a/test/ccured_olden/treeadd/out_22_1.mac_nocnt_sil b/test/ccured_olden/treeadd/out_22_1.mac_nocnt_sil deleted file mode 100644 index 614d3acb..00000000 --- a/test/ccured_olden/treeadd/out_22_1.mac_nocnt_sil +++ /dev/null @@ -1,15 +0,0 @@ -208.87u 14.48s 13:01.91 28.5% - -Treeadd with 22 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 4194303 -Total time: 208.870 u, 14.430 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.000 s -Prog_main: 208.850 u, 14.430 s -processReturns : tot 20971523, empty 20971518, common 5 - -208.87u 14.48s 13:01.91 28.5% - diff --git a/test/ccured_olden/treeadd/out_23_1 b/test/ccured_olden/treeadd/out_23_1 deleted file mode 100644 index bba776e0..00000000 --- a/test/ccured_olden/treeadd/out_23_1 +++ /dev/null @@ -1,10 +0,0 @@ -13.85u 9.47s 0:23.97 97.2% - -Treeadd with 23 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 8388607 - -13.85u 9.47s 0:23.97 97.2% - diff --git a/test/ccured_olden/treeadd/out_23_1.mac_nocnt_sil b/test/ccured_olden/treeadd/out_23_1.mac_nocnt_sil deleted file mode 100644 index 378b40cc..00000000 --- a/test/ccured_olden/treeadd/out_23_1.mac_nocnt_sil +++ /dev/null @@ -1,15 +0,0 @@ -415.79u 41.59s 25:49.99 29.5% - -Treeadd with 23 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 8388607 -Total time: 415.790 u, 41.570 s -Call init functions: 0.000 u, 0.000 s -Process externs: 0.000 u, 0.000 s -Prog_main: 415.780 u, 41.570 s -processReturns : tot 41943043, empty 41943038, common 5 - -415.79u 41.59s 25:49.99 29.5% - diff --git a/test/ccured_olden/treeadd/out_25_1 b/test/ccured_olden/treeadd/out_25_1 deleted file mode 100644 index 03a8d49f..00000000 --- a/test/ccured_olden/treeadd/out_25_1 +++ /dev/null @@ -1,8 +0,0 @@ -Treeadd with 25 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 33554431 - -out_25_1: about 5-6 minutes (lost the exact timing) - diff --git a/test/ccured_olden/treeadd/out_25_1.mac_nocnt_sil b/test/ccured_olden/treeadd/out_25_1.mac_nocnt_sil deleted file mode 100644 index a688a081..00000000 --- a/test/ccured_olden/treeadd/out_25_1.mac_nocnt_sil +++ /dev/null @@ -1,7 +0,0 @@ -Some output (through starting TreeAlloc), then: - -[1] Segmentation fault treeadd-mac_nocnt_sil.instr 25 1 >& out_25_1.mac_nocnt_sil -656.30u 109.95s 12:55.55 98.8% - -out_25_1: about 5-6 minutes (lost the output) - diff --git a/test/ccured_olden/treeadd/output b/test/ccured_olden/treeadd/output deleted file mode 100644 index fde5b808..00000000 --- a/test/ccured_olden/treeadd/output +++ /dev/null @@ -1,5 +0,0 @@ -Treeadd with 21 levels -About to enter TreeAlloc -About to enter TreeAdd -Iteration 0...done -Received result of 2097151 diff --git a/test/ccured_olden/treeadd/par-alloc.c b/test/ccured_olden/treeadd/par-alloc.c deleted file mode 100644 index 4749e195..00000000 --- a/test/ccured_olden/treeadd/par-alloc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* tree-alloc.c - */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -#include "tree.h" - - -tree_t *TreeAlloc (level) - int level; -{ - - if (level == 0) - { - return NULL; - } - else - { - struct tree *new, *right, *left; - - new = (struct tree *) mymalloc(sizeof(tree_t)); - left = TreeAlloc(level-1); - right=TreeAlloc(level-1); - new->val = 1; - new->left = (struct tree *) left; - new->right = (struct tree *) right; - return new; - } -} diff --git a/test/ccured_olden/treeadd/ssplain.c b/test/ccured_olden/treeadd/ssplain.c deleted file mode 100644 index 18c8a721..00000000 --- a/test/ccured_olden/treeadd/ssplain.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <limits.h> -#include <stddef.h> -#include "ssplain.h" - - -void chatting(char *s, ...) -{ - va_list ap; - va_start(ap,s); - vfprintf(stderr, s, ap); - va_end(ap); -} - - -#ifdef SS_RAND -double drand48() -{ - double d; - d = (double) random() / LONG_MAX; - return d; -} - - -long lrand48() -{ - long l = random(); - return l; -} - -void srand48(long seed) -{ - srand(seed); -} -#endif SS_RAND - - -#ifndef BEFOREBOX -static unsigned long bytes_allocated = 0; -static unsigned long allocations = 0; - -void* -ssplain_malloc(int size) -{ - allocations++; - bytes_allocated+=size; - return malloc(size); -} - -void* -ssplain_calloc(int nelems, int size) -{ - void *p; - allocations++; - bytes_allocated+= nelems * size; - p = calloc(nelems, size); - if(! p) { printf("Cannot allocate\n"); exit(3); } - return p; -} - -void -ssplain_alloc_stats() -{ - chatting("Allocation stats: %d bytes allocated in %d allocations\n", - bytes_allocated, allocations); -} -#endif diff --git a/test/ccured_olden/treeadd/ssplain.h b/test/ccured_olden/treeadd/ssplain.h deleted file mode 100644 index 865fbf47..00000000 --- a/test/ccured_olden/treeadd/ssplain.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef SS_PLAIN_H -#define SS_PLAIN_H - -void * ssplain_malloc(int size); -void * ssplain_calloc(int nelems, int size); -void ssplain_alloc_stats(); - -/* Convert MP shutdown to exit */ -#define __ShutDown(ID) { ssplain_alloc_stats(); exit(ID); } - -/* All these CM-5 things are nops */ -#define CMMD_node_timer_clear(ID) -#define CMMD_node_timer_start(ID) -#define CMMD_node_timer_stop(ID) -#define CMMD_node_timer_elapsed(ID) ((double)0) - -#define CMMD_self_address() 0 - -#define ClearAllStats() - -/* define away the CM-5 allocator */ -#include <stdlib.h> - -#ifndef ALLOC -#define ALLOC(NUM,ESIZE) ssplain_calloc (NUM+1,ESIZE) -#endif ALLOC - -#ifndef mymalloc -#define mymalloc malloc -#endif mymalloc - -/* Get all of these multiprocessing things out of here. */ -/* My id will stay that way */ -#define IDMASK 0xffffffff - -/* Nothing is getting tested */ -#ifndef RETEST -#define RETEST() -#endif RETEST - -#ifndef NOTEST -#define NOTEST() -#endif NOTEST - -/* Everything is local */ -#ifndef local -#define local -#endif local - -#ifndef LOCAL -#define LOCAL(VAL) (VAL) -#endif LOCAL - -#ifndef ISLOCPTR -#define ISLOCPTR(VAL) (1) -#endif ISLOCPTR - -#ifndef MLOCAL -#define MLOCAL(VAL) -#endif MLOCAL - -/* An atomic increment is a normal increment */ -#ifndef ATOMICINC -#define ATOMICINC(PVAL) (*(PVAL) = *(PVAL) + 1) -#endif ATOMICINC - -/* Nothing is migrating anywhere */ -#ifndef MIGRATE -#define MIGRATE(ID) -#endif MIGRATE - -#ifndef MIGRPH -#define MIGRPH() -#endif MIGRPH - -#ifndef UNPHASE -#define UNPHASE() -#endif UNPHASE - -#ifndef PID -#define PID(VAL) (0) -#endif PID - -/* All these functions */ -#pragma ccuredvararg("chatting", printf(1)) -void chatting(char *s, ...); - -/* just define these guys, they are not going to change */ -#define __NumNodes 1 -#define __MyNodeId 0 -#define __NDim 0 - -typedef struct ss_future_cell_int { - int value; -} future_cell_int; - -/* Where are these things for real? */ -#ifdef SS_RAND -long lrand48(); -double drand48(); -void srand48(long seed); -#endif SS_RAND - -#define MOD(V,M) ((V) & ((M) - 1)) -#define INC_MOD(V,M) (V) = MOD((V) + 1, (M)) - -/* Prefetch instructions */ - -/* Use these for 1 lookahead prefetching */ - -#ifdef OVERHEAD_ONLY -#define ASSEMBLE_PREFETCH(ARG) -#define ASSEMBLE_PREFETCH_HEAD(ARG) -#else !OVERHEAD_ONLY - -#define ASSEMBLE_PREFETCH(ARG) \ - asm ("lw $0, %0" : /* no outputs */ : "g" (ARG)) - -/* Use these for infinite lookahead prefetching */ -#define ASSEMBLE_PREFETCH_HEAD(ARG) \ - asm ("lh $0, %0" : /* no outputs */ : "g" (ARG)) - -#endif OVERHEAD_ONLY - -#endif SS_PLAIN_H - - - diff --git a/test/ccured_olden/treeadd/testit b/test/ccured_olden/treeadd/testit deleted file mode 100755 index 031c54bd..00000000 --- a/test/ccured_olden/treeadd/testit +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# test a treeadd binary - -if [ "$1" = "" ]; then - echo "usage: $0 ./treeadd.exe" - exit -fi - -# all of treeadd's output is to stderr -echo "running: $1 21 1 2>output" -if ! $1 21 1 2>output; then - echo "$1 failed directly" - exit 2 -fi - -if ! diff out.orig output >out.diff; then - echo "$1 got the wrong answer. See out.diff" - exit 4 -else - echo "$1 seems to work" -fi -
\ No newline at end of file diff --git a/test/ccured_olden/treeadd/tree.h b/test/ccured_olden/treeadd/tree.h deleted file mode 100644 index 39b141dc..00000000 --- a/test/ccured_olden/treeadd/tree.h +++ /dev/null @@ -1,18 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -/* tree.h - */ - -typedef struct tree { - int val; - struct tree *left, *right; -} tree_t; - -#ifndef SS_PLAIN -#define NULL 0 -#endif SS_PLAIN - -extern tree_t *TreeAlloc (/*int level*/); - -extern int level; -extern int iters; diff --git a/test/ccured_olden/tsp/.cvsignore b/test/ccured_olden/tsp/.cvsignore deleted file mode 100644 index 83a0e7b9..00000000 --- a/test/ccured_olden/tsp/.cvsignore +++ /dev/null @@ -1,28 +0,0 @@ -*.o -*.obj -*.exe -*.pdb -*.ilk -*.cpp -*.i -*.s -*.asm -*cil.c -*.rtl -*box.c -*infer.c -*_ppp.c -*.origi -*.stackdump -*_all.c -changes.out -tsp.cil -tsp.*box -allcfiles -ope.m -ope.m -*cured.c -*.optim.c -*_comb.c -changes -*.browser diff --git a/test/ccured_olden/tsp/CVS/Entries b/test/ccured_olden/tsp/CVS/Entries deleted file mode 100644 index 92dedef2..00000000 --- a/test/ccured_olden/tsp/CVS/Entries +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile/1.4/Sun Jul 8 14:10:47 2001// -/README/1.1/Tue Jun 12 04:31:21 2001// -/tsp.c/1.1/Tue Jun 12 04:31:21 2001// -/tsp.h/1.1/Tue Jun 12 04:31:21 2001// -/main.c/1.5/Mon Mar 18 23:18:46 2002// -/build.c/1.3/Wed May 29 03:29:06 2002// -/.cvsignore/1.11/Wed Jul 31 19:35:08 2002// -D diff --git a/test/ccured_olden/tsp/CVS/Repository b/test/ccured_olden/tsp/CVS/Repository deleted file mode 100644 index feb9fc46..00000000 --- a/test/ccured_olden/tsp/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/tsp diff --git a/test/ccured_olden/tsp/CVS/Root b/test/ccured_olden/tsp/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/tsp/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/tsp/Makefile b/test/ccured_olden/tsp/Makefile deleted file mode 100644 index a27d6db9..00000000 --- a/test/ccured_olden/tsp/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -CC = gcc - -#CFLAGS = -CFLAGS = -O2 - -# sm -PLAIN=1 -all: defaulttarget - -ifdef PLAIN -ifdef _MSVC -EXTOBJ = .obj -OBJOUT = /Fo -EXEOUT = /Fe -CFLAGS = /DPLAIN -CONLY = /c -CC = cl -else -EXTOBJ = .o -OBJOUT = -o -EXEOUT = -o -CFLAGS += -DPLAIN -CONLY = -c -CC = gcc -MATH = -lm -endif - -MYOBJS = tsp$(EXTOBJ) build$(EXTOBJ) main$(EXTOBJ) - -%$(EXTOBJ) : %.c - $(CC) $(CONLY) $(CFLAGS) $< $(OBJOUT)$@ - - -defaulttarget: $(MYOBJS) - $(CC) $(CFLAGS) $(MYOBJS) $(EXTRA_LIBS) $(EXEOUT)tsp.exe $(MATH) -endif - - - -clean: - rm -f $(TARGET) $(OBJS) *.o *.obj *.exe *~ .make.state .nse_depinfo - - - diff --git a/test/ccured_olden/tsp/README b/test/ccured_olden/tsp/README deleted file mode 100644 index 29e34d88..00000000 --- a/test/ccured_olden/tsp/README +++ /dev/null @@ -1,22 +0,0 @@ -/* For copyright information, see olden_v1.01/COPYRIGHT */ -********************** -olden_v1.01/benchmarks/tsp/README -June 1996 -Martin C. Carlisle - -this directory contains the Traveling Salesman benchmark: - -Adapted for Olden from code by J. Muller using algorithm by: - -R. Karp, "Probabilistic analysis of partitioning algorithms for the traveling- -salesman problem in the plane." Mathematics of Operations Research -2(3):209-224, August 1977 - -********************** - -Makefile - use "make tsp" to create executable - -args.c - process command line args -build.c - build cities tree -tsp.[ch] - compute tsp -main.c - main routine diff --git a/test/ccured_olden/tsp/build.c b/test/ccured_olden/tsp/build.c deleted file mode 100644 index 090439bc..00000000 --- a/test/ccured_olden/tsp/build.c +++ /dev/null @@ -1,124 +0,0 @@ -/* build.c - * - * By: Martin C. Carlisle - * Princeton University - * 6/24/94 - * - * builds a two-dimensional tree for TSP - * - * distribution of median is given by modification of exponential to - * be [-1,1] - */ - -#include <stdio.h> - -extern double drand48(); -extern void srand48(long seedval); -extern double exp(double x); -extern double log(double x); -#define M_E 2.7182818284590452354 -#define M_E2 7.3890560989306502274 -#define M_E3 20.08553692318766774179 -#define M_E6 403.42879349273512264299 -#define M_E12 162754.79141900392083592475 -#ifndef NULL -#define NULL 0 -#endif - -#include "tsp.h" -#include <stdlib.h> - -#ifndef PLAIN -#include "mem-ref.h" -#ifdef FUTURES -#include "future-cell.h" -#endif -#endif - -static double median(double min,double max,int n); -static double uniform(double min, double max); - -double drand48(void) { - return (double)rand() / (double)RAND_MAX; -} - -/* Return an estimate of median of n values distributed in [min,max) */ -static double median(double min,double max,int n) { - double t; - double retval; - - t = drand48(); /* in [0.0,1.0) */ - if (t>0.5) { - retval=log(1.0-(2.0*(M_E12-1)*(t-0.5)/M_E12))/12.0; - } - else { - retval=-log(1.0-(2.0*(M_E12-1)*t/M_E12))/12.0; - } - /* We now have something distributed on (-1.0,1.0) */ - retval = (retval+1.0) * (max-min)/2.0; - retval = retval + min; - return retval; -} - -/* Get double uniformly distributed over [min,max) */ -static double uniform(double min, double max) { - double retval; - - retval = drand48(); /* in [0.0,1.0) */ - retval = retval * (max-min); - return retval + min; -} - -/* Builds a 2D tree of n nodes in specified range with dir as primary - axis (0 for x, 1 for y) */ -// post: -// if n!=0, make a node, set its left & right to valid or null, -// set next/prev to null; if n==0 return null -Tree build_tree(int n,int dir,int lo,int num_proc,double min_x, - double max_x,double min_y,double max_y) { - double med; - Tree t; -#ifdef FUTURES - future_cell_int fc; -#endif - - if (n==0) return NULL; - - t = (Tree) malloc(sizeof(*t)); - if (dir) { - dir = !dir; - med = median(min_x,max_x,n); -#ifndef FUTURES - t->left=build_tree(n/2,dir,lo+num_proc/2,num_proc/2,min_x,med,min_y,max_y); - t->right=build_tree(n/2,dir,lo,num_proc/2,med,max_x,min_y,max_y); -#else - FUTURE(n/2,dir,lo+num_proc/2,num_proc/2,min_x,med,min_y,max_y, - build_tree,&fc); - t->right=build_tree(n/2,dir,lo,num_proc/2,med,max_x,min_y,max_y); -#endif - t->x = med; - t->y = uniform(min_y,max_y); - } - else { - dir = !dir; - med = median(min_y,max_y,n); -#ifndef FUTURES - t->left=build_tree(n/2,dir,lo+num_proc/2,num_proc/2,min_x,max_x,min_y,med); - t->right=build_tree(n/2,dir,lo,num_proc/2,min_x,max_x,med,max_y); -#else - FUTURE(n/2,dir,lo+num_proc/2,num_proc/2,min_x,max_x,min_y,med, - build_tree,&fc); - t->right=build_tree(n/2,dir,lo,num_proc/2,min_x,max_x,med,max_y); -#endif - t->y = med; - t->x = uniform(min_x,max_x); - } - t->sz = n; - t->next = NULL; - t->prev = NULL; -#ifdef FUTURES - TOUCH(&fc); - t->left = (Tree) fc.value; -#endif - return t; -} diff --git a/test/ccured_olden/tsp/main.c b/test/ccured_olden/tsp/main.c deleted file mode 100644 index 3bd5679a..00000000 --- a/test/ccured_olden/tsp/main.c +++ /dev/null @@ -1,101 +0,0 @@ -#include "tsp.h" -#include <stdio.h> -#include <stdlib.h> - -#ifndef PLAIN -#include <cm/cmmd.h> -#include "mem-ref.h" -#endif - -#ifdef VERIFY_AFFINITIES -#include "affinity.h" -CHECK2(Tree,left,right,tree) -#endif - -int flag; -int __NumNodes, __NDim; - -int mylog(int num) -{ - int j=0,k=1; - - while(k<num) { k*=2; j++; } - return j; -} - -int dealwithargs(void) -{ - int num; - - flag = 0; - __NumNodes = 4; - - __NDim = mylog(__NumNodes); - - num = 150000; - - return num; -} - -void print_tree(Tree t) -{ - Tree left,right; - double x,y; - - if (!t) return; - x = t->x; y = t->y; - chatting("x=%f,y=%f\n",x,y); - left = t->left; right=t->right; - print_tree(left); - print_tree(right); -} - -void print_list(Tree t) -{ - Tree tmp; - double x,y; - - if (!t) return; - x = t->x; y = t->y; - chatting("%f %f\n",x,y); - for (tmp=t->next; tmp!=t; tmp=tmp->next) - { - x = tmp->x; y = tmp->y; - chatting("%f %f\n",x,y); - } -} - -double wallclock; - -int main() -{ - Tree t; - int num; - - num = dealwithargs(); - - chatting("Building tree of size %d\n",num); - t=build_tree(num,0,0,__NumNodes,0.0,1.0,0.0,1.0); -#ifdef VERIFY_AFFINITIES - Docheck_tree(t); -#endif - if (!flag) chatting("Past build\n"); - if (flag) chatting("newgraph\n"); - if (flag) chatting("newcurve pts\n"); - - - timer_start(0); - tsp(t,150,__NumNodes); - timer_stop(0); - if (flag) print_list(t); - if (flag) chatting("linetype solid\n"); - chatting("Time for TSP = %f\n", timer_elapsed(0)); -#ifdef VERIFY_AFFINITIES - Print_Accumulated_list(); -#endif - -#ifdef FUTURES - __ShutDown(0); -#endif - exit(0); -} diff --git a/test/ccured_olden/tsp/tsp.c b/test/ccured_olden/tsp/tsp.c deleted file mode 100644 index 5f371c86..00000000 --- a/test/ccured_olden/tsp/tsp.c +++ /dev/null @@ -1,308 +0,0 @@ -#include "tsp.h" - -#ifndef PLAIN -#include "mem-ref.h" -#ifdef FUTURES -#include "future-cell.h" -#endif -#endif - -#ifndef PLAIN -#define NULL 0 -#endif - -#ifdef VERIFY_AFFINITIES -#include "affinity.h" -CHECK1_ACCUM(Tree,next,list) -#endif - -static Tree conquer(Tree t); -static Tree merge(Tree a, Tree b, Tree t, int nproc); -static Tree makelist(Tree t); -static void reverse(Tree t); -static double distance(Tree a, Tree b); -extern double sqrt(double a); - -/* Find Euclidean distance from a to b */ -static double distance(Tree a, Tree b) { - double ax,ay,bx,by; - - ax = a->x; ay = a->y; - bx = b->x; by = b->y; - return (sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by))); -} - -/* sling tree nodes into a list -- requires root to be tail of list */ -/* only fills in next field, not prev */ -static Tree makelist(Tree t) { - Tree left, right; - Tree tleft,tright; - Tree retval = t; - - if (!t) return NULL; - - /*chatting("makelist\n");*/ - left = makelist(t->left); /* head of left list */ - right = makelist(t->right); /* head of right list */ - - if (right) { retval = right; tright = t->right; tright->next = t; } - if (left) { retval=left; tleft=t->left; tleft->next = (right) ? right : t; } - t->next = NULL; - /*chatting("end makelist\n");*/ - - return retval; -} - -/* reverse orientation of list */ -static void reverse(Tree t) { - Tree prev,back,next,tmp; - - if (!t) return; - /*chatting("REVERSE\n");*/ - /*print_list(t);*/ - prev = t->prev; - prev->next = NULL; - t->prev = NULL; - back = t; - tmp = t; - for (t=t->next; t; back=t,t=next) { - next = t->next; - t->next = back; - back->prev = t; - } - tmp->next = prev; - prev->prev = tmp; - /*printf("REVERSE result\n");*/ - /*print_list(tmp);*/ - /*printf("End REVERSE\n");*/ -} - -/* Use closest-point heuristic from Cormen Leiserson and Rivest */ -static Tree conquer(Tree t) { - Tree cycle,tmp,min,prev,next,donext; - double mindist,test; - double mintonext, mintoprev, ttonext, ttoprev; - - if (!t) return NULL; - t=makelist(t); - - /*printf("CONQUER\n");*/ - /* Create initial cycle */ - cycle = t; - t = t->next; - cycle->next = cycle; - cycle->prev = cycle; - - for (; t; t=donext) { /* loop over remaining points */ - donext = t->next; /* value won't be around later */ - min = cycle; - mindist = distance(t,cycle); - for (tmp=cycle->next; tmp!=cycle; tmp=tmp->next) { - test = distance(tmp,t); - if (test < mindist) { - mindist = test; - min = tmp; - } /* if */ - } /* for tmp... */ - next = min->next; - prev = min->prev; - mintonext = distance(min,next); - mintoprev = distance(min,prev); - ttonext = distance(t,next); - ttoprev = distance(t,prev); - if ((ttoprev - mintoprev) < (ttonext - mintonext)) { - /* insert between min and prev */ - prev->next = t; - t->next = min; - t->prev = prev; - min->prev = t; - } - else { - next->prev = t; - t->next = next; - min->next = t; - t->prev = min; - } - } /* for t... */ - /*print_list(cycle);*/ - /*printf("End CONQUER\n");*/ - return cycle; -} - -/* Merge two cycles as per Karp */ -static Tree merge(Tree a, Tree b, Tree t, int nproc) { - Tree min,next,prev,tmp; - double mindist,test,mintonext,mintoprev,ttonext,ttoprev; - Tree n1,p1,n2,p2; - double tton1,ttop1,tton2,ttop2; - double n1ton2,n1top2,p1ton2,p1top2; - int choice; - int i; - - /* Compute location for first cycle */ - min = a; - mindist = distance(t,a); - tmp = a; -#ifdef VERIFY_AFFINITIES - Accumulate_list(a,a); - Accumulate_list(b,b); -#endif - for (a=a->next; a!=tmp; a=a->next) { - test = distance(a,t); - if (test < mindist) { - mindist = test; - min = a; - } /* if */ - } /* for a... */ - next = min->next; - prev = min->prev; - mintonext = distance(min,next); - mintoprev = distance(min,prev); - ttonext = distance(t,next); - ttoprev = distance(t,prev); - if ((ttoprev - mintoprev) < (ttonext - mintonext)) { - /* would insert between min and prev */ - p1 = prev; - n1 = min; - tton1 = mindist; - ttop1 = ttoprev; - } - else { /* would insert between min and next */ - p1 = min; - n1 = next; - ttop1 = mindist; - tton1 = ttonext; - } - - /* Compute location for second cycle */ - min = b; - mindist = distance(t,b); - tmp = b; - for (b=b->next; b!=tmp; b=b->next) { - test = distance(b,t); - if (test < mindist) { - mindist = test; - min = b; - } /* if */ - } /* for tmp... */ - next = min->next; - prev = min->prev; - mintonext = distance(min,next); - mintoprev = distance(min,prev); - ttonext = distance(t,next); - ttoprev = distance(t,prev); - if ((ttoprev - mintoprev) < (ttonext - mintonext)) { - /* would insert between min and prev */ - p2 = prev; - n2 = min; - tton2 = mindist; - ttop2 = ttoprev; - } - else { /* would insert between min and next */ - p2 = min; - n2 = next; - ttop2 = mindist; - tton2 = ttonext; - } - - /* Now we have 4 choices to complete: - 1:t,p1 t,p2 n1,n2 - 2:t,p1 t,n2 n1,p2 - 3:t,n1 t,p2 p1,n2 - 4:t,n1 t,n2 p1,p2 */ - n1ton2 = distance(n1,n2); - n1top2 = distance(n1,p2); - p1ton2 = distance(p1,n2); - p1top2 = distance(p1,p2); - - mindist = ttop1+ttop2+n1ton2; - choice = 1; - - test = ttop1+tton2+n1top2; - if (test<mindist) { - choice = 2; - mindist = test; - } - - test = tton1+ttop2+p1ton2; - if (test<mindist) { - choice = 3; - mindist = test; - } - - test = tton1+tton2+p1top2; - if (test<mindist) choice = 4; - -/*chatting("p1,n1,t,p2,n2 0x%x,0x%x,0x%x,0x%x,0x%x\n",p1,n1,t,p2,n2);*/ - switch (choice) { - case 1: - /* 1:p1,t t,p2 n2,n1 -- reverse 2!*/ - /*reverse(b);*/ - reverse(n2); - p1->next = t; - t->prev = p1; - t->next = p2; - p2->prev = t; - n2->next = n1; - n1->prev = n2; - break; - case 2: - /* 2:p1,t t,n2 p2,n1 -- OK*/ - p1->next = t; - t->prev = p1; - t->next = n2; - n2->prev = t; - p2->next = n1; - n1->prev = p2; - break; - case 3: - /* 3:p2,t t,n1 p1,n2 -- OK*/ - p2->next = t; - t->prev = p2; - t->next = n1; - n1->prev = t; - p1->next = n2; - n2->prev = p1; - break; - case 4: - /* 4:n1,t t,n2 p2,p1 -- reverse 1!*/ - /*reverse(a);*/ - reverse(n1); - n1->next = t; - t->prev = n1; - t->next = n2; - n2->prev = t; - p2->next = p1; - p1->prev = p2; - break; - } - return t; -} - -/* Compute TSP for the tree t -- use conquer for problems <= sz */ -Tree tsp(Tree t,int sz,int nproc) { - Tree left,right; - Tree leftval; -#ifdef FUTURES - future_cell_pointer fc; -#endif - Tree rightval; - int nproc_2 = nproc/2; - - if (t->sz <= sz) return conquer(t); - - left = t->left; right = t->right; -#ifndef FUTURES - leftval = tsp(left,sz,nproc_2); -#else - FUTURE(left,sz,nproc_2,tsp,&fc); -#endif - rightval = tsp(right,sz,nproc_2); -#ifdef FUTURES - leftval = (Tree) TOUCH(&fc); - leftval = (Tree) fc.value; - return merge(leftval,rightval,t,nproc); -#else - return merge(leftval,rightval,t,nproc); -#endif -} diff --git a/test/ccured_olden/tsp/tsp.h b/test/ccured_olden/tsp/tsp.h deleted file mode 100644 index 8d928891..00000000 --- a/test/ccured_olden/tsp/tsp.h +++ /dev/null @@ -1,32 +0,0 @@ -typedef struct tree { - int sz; - double x,y; - struct tree *left, *right; - /*struct tree *next, *prev;*/ - struct tree *next /*{95}*/, *prev /*{95}*/; -} *Tree; - -/* Builds a 2D tree of n nodes in specified range with dir as primary - axis (0 for x, 1 for y) */ -Tree build_tree(int n,int dir,int lo,int num_proc,double min_x, - double max_x,double min_y,double max_y); -/* Compute TSP for the tree t -- use conquer for problems <= sz */ -Tree tsp(Tree t, int sz, int nproc); - -#ifdef PLAIN -#include <time.h> -#define local -#define mymalloc malloc -#define CMMD_node_timer_clear(x) (void)0 -#define TIMESTART(clk) {clk=(double)clock();} -#define TIMESTOP(clk) {clk=1000000.0 * ((double)clock()-(clk))/CLOCKS_PER_SEC;} -extern double wallclock; -#define timer_start(x) TIMESTART(wallclock) -#define timer_stop(x) TIMESTOP(wallclock) -#define timer_elapsed(x) (wallclock / 1000.0) -#define chatting printf -#define NOTEST() (void)0 -#define RETEST() (void)0 -#define LOCAL(x) x -#define mymalloc malloc -#endif diff --git a/test/ccured_olden/voronoi/.cvsignore b/test/ccured_olden/voronoi/.cvsignore deleted file mode 100644 index 3923b56f..00000000 --- a/test/ccured_olden/voronoi/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -*.i -*_all.c -*cil.c -*box.c -code -data.in -data.out -allcfiles -ope.m -ope.m -*_comb.c -*cured.c -*.optim.c -changes diff --git a/test/ccured_olden/voronoi/CVS/Entries b/test/ccured_olden/voronoi/CVS/Entries deleted file mode 100644 index 0d7c09d8..00000000 --- a/test/ccured_olden/voronoi/CVS/Entries +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile/1.3/Sat Jul 21 16:09:41 2001// -/README/1.1/Tue Jun 12 04:17:59 2001// -/defines.h/1.2/Mon Jul 9 21:12:42 2001// -/newvor.c/1.2/Mon Jul 9 21:12:42 2001// -/output.c/1.2/Mon Jul 9 21:12:42 2001// -/vector.c/1.2/Mon Jul 9 21:12:42 2001// -/.cvsignore/1.5/Thu Nov 8 23:35:28 2001// -D diff --git a/test/ccured_olden/voronoi/CVS/Repository b/test/ccured_olden/voronoi/CVS/Repository deleted file mode 100644 index 8d79f068..00000000 --- a/test/ccured_olden/voronoi/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -cil/test/olden/voronoi diff --git a/test/ccured_olden/voronoi/CVS/Root b/test/ccured_olden/voronoi/CVS/Root deleted file mode 100644 index 35f411e9..00000000 --- a/test/ccured_olden/voronoi/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -/home/cvs-repository diff --git a/test/ccured_olden/voronoi/Makefile b/test/ccured_olden/voronoi/Makefile deleted file mode 100644 index f3baec38..00000000 --- a/test/ccured_olden/voronoi/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -# /* For copyright information, see olden_v1.0/COPYRIGHT */ - -BINARY = voronoi.exe -PROGS = newvor vector output args ssplain trusted_voronoi - -ifdef _MSVC -CC = cl -DEF = /D -CONLY = /c -OBJOUT = /Fo -EXEOUT = /Fe -OBJ = .obj - -OPTFLAGS = /Ox -LIBS = - -else - -CC = gcc -arch ppc -CCOMP=../../../ccomp -CCOMPFLAGS=-dump-c - -DEF = -D -CONLY = -c -OBJOUT= -o -EXEOUT= -o - -OBJ = .o - -OPTFLAGS = -g -Wall -O3 - -LIBS = -LIBPATH = -endif - -SRC = .c -ASM = .s -EXTRA_CDEFS = $(DEF)I_TIME $(DEF)I_SYS_TIME $(DEF)ULTRIX -# sm: ?? -ifdef _MSVC -CDEFS = $(DEF)PLAIN $(DEF)SS_PLAIN $(DEF)OLDEN -else -CDEFS = $(DEF)PLAIN $(DEF)OLDEN -endif -SRCS = $(addsuffix $(SRC),$(FILES)) -OBJS = $(addsuffix $(OBJ),$(FILES)) -ASMS = $(addsuffix $(ASM),$(FILES)) - -all_s: $(PROGS:%=%.s) - -all: $(PROGS:%=%.compcert) - -all_gcc: $(PROGS:%=%.gcc) - -%.compcert: %.s - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.compcert $*.s $(LIBS) - -%.s: %.c ../../../../ccomp - $(CCOMP) $(CCOMPFLAGS) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $*.c - -%.gcc: %.c - $(CC) $(CFLAGS) $(LDFALGS) $(OPTFLAGS) -o $*.gcc $*.c $(LIBS) - -#$(BINARY): $(OBJS) -# $(CC) $(LDFALGS) $(OPTFLAGS) $(EXEOUT)$@ $(OBJS) $(LIBPATH) $(LIBS) - -#%$(OBJ) : %$(SRC) -# $(CC) $(CDEFS) $(EXTRA_CDEFS) $(MY_CDEFS) $(OPTFLAGS) $(CONLY) $< - -clean: - rm -f $(BINARY) $(OBJS) *~ - diff --git a/test/ccured_olden/voronoi/README b/test/ccured_olden/voronoi/README deleted file mode 100644 index 701a0134..00000000 --- a/test/ccured_olden/voronoi/README +++ /dev/null @@ -1,22 +0,0 @@ -/* For copyright information, see olden_v1.01/COPYRIGHT */ -********************** -olden_v1.01/benchmarks/voronoi/README -June 1996 -Martin C. Carlisle - -this directory contains the Voronoi Diagram benchmark: - -L. Guibas and J. Stolfi. "General Subdivisions and Voronoi Diagrams" -ACM Trans. on Graphics 4(2):74-123, 1985. - -Adapted for Olden by Martin C. Carlisle - -********************** - -Makefile - use "make voronoi" to create executable - -args.c - process command line args -vector.c - vector math stuff -newvor.c - main routine -defines.h - definitions -output.c - used for outputting results. diff --git a/test/ccured_olden/voronoi/defines.h b/test/ccured_olden/voronoi/defines.h deleted file mode 100644 index 651336db..00000000 --- a/test/ccured_olden/voronoi/defines.h +++ /dev/null @@ -1,186 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -extern double sqrt(); -extern double exp(); -extern double log(); -extern double drand(); - -#include <stdio.h> -#include <stdlib.h> - -#ifndef SS_PLAIN -#include "mem-ref.h" -#include "future-cell.h" - -#define NULL 0 -#endif SS_PLAIN - -#define NEW 1 -#define EPSILON (1.0e-6) - -#define BOOLEAN int -#ifndef TRUE -#define TRUE 1 -#endif TRUE -#define FALSE 0 - -struct edge_rec -{ - struct VERTEX *v; - struct edge_rec *next; - int wasseen; - int more_data; /* 16 byte align this thing */ -}; - -struct get_point -{ - struct VERTEX *v; - double curmax; - int seed; -}; - -#ifdef NEW -typedef struct edge_rec *EDGE_PTR; -typedef struct VERTEX *VERTEX_PTR; -typedef EDGE_PTR QUAD_EDGE; -#else -typedef int EDGE_PTR; -typedef int VERTEX_PTR; -#endif - -struct VEC2 { - double x,y; - double norm; -}; - -struct VERTEX { - struct VEC2 v; - struct VERTEX *left, *right; -}; - -typedef struct -{ - QUAD_EDGE left, right; -} EDGE_PAIR; - -#ifdef NEW -#define onext(a) (a)->next -#else -#define onext(a) next[a] -#endif -#define oprev(a) rot(onext(rot(a))) -#define lnext(a) rot(onext(rotinv(a))) -#define lprev(a) sym(onext(a)) -#define rnext(a) rotinv(onext(rot(a))) -#define rprev(a) onext(sym(a)) -#define dnext(a) sym(onext(sym(a))) -#define dprev(a) rotinv(onext(rotinv(a))) - -#ifdef NEW -#define X(r) r->v.x -#define Y(r) r->v.y -#define NORM(r) r->v.norm -#else -#define X(a) va[a].v.x -#define Y(a) va[a].v.y -#define NORM(a) va[a].norm -#endif -#ifdef NEW -#define orig(a) (a)->v -#define dest(a) orig(sym(a)) -#define seen(a) (a)->wasseen -#else -#define orig(a) org[a] -#define dest(a) orig(sym(a)) -#define seen(a) see[a] -#endif - -#ifndef NEW -#define origv(a) va[orig(a)].v -#define destv(a) va[dest(a)].v -#else -#define origv(a) orig(a)->v -#define destv(a) dest(a)->v -#endif - -#define ALLOC_SIZE (sizeof(struct edge_rec)) -#ifndef PLAIN -#define SIZE (sizeof(struct edge_rec) << PN_BITS) -#define ANDF ((4*sizeof(struct edge_rec) - 1) << PN_BITS) -#else -#define SIZE sizeof(struct edge_rec) -#define ANDF (4*sizeof(struct edge_rec) - 1) -#endif - -#define sym(a) ((QUAD_EDGE) (((unsigned int) (a)) ^ 2*SIZE)) -#define rot(a) ((QUAD_EDGE) ( (((unsigned int) (a) + 1*SIZE) & ANDF) | ((unsigned int) (a) & ~ANDF) )) -#define rotinv(a) ((QUAD_EDGE) ( (((unsigned int) (a) + 3*SIZE) & ANDF) | ((unsigned int) (a) & ~ANDF) )) -#define base(a) ((QUAD_EDGE) ((unsigned int a) & ~ANDF)) - -struct EDGE_STACK { - int ptr; - QUAD_EDGE *elts ; - int stack_size; -}; - -extern QUAD_EDGE alloc_edge(); -extern QUAD_EDGE makeedge(); -extern void splice(); -extern void swapedge(); -extern void deleteedge(); -extern QUAD_EDGE build_delaunay_triangulation(); -extern EDGE_PAIR build_delaunay(); -extern EDGE_PAIR do_merge(); -extern QUAD_EDGE connect_left(); -extern QUAD_EDGE connect_right(); - -extern void zero_seen(); -extern QUAD_EDGE pop_edge(); - -#ifdef SS_PLAIN -#define drand(seed) (((double) (seed=olden_random(seed))) / (double) 2147483647) -#else SS_PLAIN -#define drand(seed) (((double) (seed=random(seed))) / (double) 2147483647) -#endif SS_PLAIN - -#ifdef DEFINE_GLOBALS -#define EXTERN -#else -#define EXTERN extern -#endif - -EXTERN VERTEX_PTR *vp ; -EXTERN struct VERTEX *va ; -EXTERN EDGE_PTR *next ; -EXTERN VERTEX_PTR *org ; -EXTERN int num_vertices, num_edgeparts, stack_size ; -EXTERN int to_lincoln , to_off, to_3d_out, to_color , voronoi , delaunay , interactive , ahost ; -EXTERN char *see; - -#ifdef ODEFINE_GLOBALS -#define OEXTERN -#else -#define OEXTERN extern -#endif - -#define my_alloc(str_name, str_type, str_cnt) \ - if (NULL == (str_name = (str_type *) \ - mymalloc((unsigned) (str_cnt ) * (unsigned) (sizeof(str_type)))))\ - exit(printf(" cannot malloc (str_name) \n")) - -#define VERTEX_ALLOC 1000 - -#define RED 123 -#define GREEN (RED + 1) - -#define CY_SOLID 1 -#define CY_DOTTED 2 - - -int ccw(VERTEX_PTR a , VERTEX_PTR b , VERTEX_PTR c ); -int olden_random(int seed ); -void filestuff(void); -int dealwithargs(int argc , char * argv[] ); -void output_voronoi_diagram(QUAD_EDGE edge , int nv , struct EDGE_STACK * - my_stack ); - diff --git a/test/ccured_olden/voronoi/newvor.c b/test/ccured_olden/voronoi/newvor.c deleted file mode 100644 index 9b5a4408..00000000 --- a/test/ccured_olden/voronoi/newvor.c +++ /dev/null @@ -1,711 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#ifdef SS_PLAIN -#include "ssplain.h" -#else SS_PLAIN -#include <cm/cmmd.h> -#include <fcntl.h> -#endif SS_PLAIN - -#define DEFINE_GLOBALS -#include "defines.h" -/* WARNING! Don't use LOCAL on QUAD_EDGE as cache addresses are not aligned */ - -int flag; - -QUAD_EDGE connect_left(a, b) -QUAD_EDGE a,b; -{ - VERTEX_PTR t1,t2; - QUAD_EDGE ans,lnexta; - - t1=dest(a); - lnexta=lnext(a); - t2=orig(b); - ans = makeedge(t1,t2/*dest(a), orig(b)*/); - splice(ans, lnexta); - splice(sym(ans), b); - return(ans); -} - -QUAD_EDGE connect_right(a, b) - QUAD_EDGE a,b; -{ - VERTEX_PTR t1,t2; - QUAD_EDGE ans, oprevb; - - t1=dest(a); - t2=orig(b); - - oprevb=oprev(b); - ans = makeedge(t1,t2); - splice(ans, sym(a)); - splice(sym(ans), oprevb); - return(ans); -} - -/****************************************************************/ -/* Top-level Delaunay Triangulation Procedure */ -/****************************************************************/ - -QUAD_EDGE build_delaunay_triangulation(tree,extra) - /* builds delaunay triangulation. - va is an array of vertices, from 0 to size. Each vertex consists of - a vector and a data pointer. edge is a pointer to an - edge on the convex hull of the constructed delaunay triangulation. */ - - VERTEX_PTR tree,extra; -{ - EDGE_PAIR retval; - - retval=build_delaunay(tree,extra); - return retval.left; -} - -VERTEX_PTR get_low(tree) - VERTEX_PTR tree; -{ - VERTEX_PTR temp; - while((temp=tree->left)) tree=temp; - return tree; -} - -/****************************************************************/ -/* Recursive Delaunay Triangulation Procedure */ -/* Contains modifications for axis-switching division. */ -/****************************************************************/ - -EDGE_PAIR build_delaunay(tree,extra) - VERTEX_PTR tree,extra; -{ - QUAD_EDGE a,b,c,ldo,rdi,ldi,rdo; - EDGE_PAIR retval; - VERTEX_PTR maxx, minx; - VERTEX_PTR s1, s2, s3; - - EDGE_PAIR delleft, delright; - - if (tree && tree->right && tree->left) - { - /* more than three elements; do recursion */ - minx = get_low(tree); maxx = extra; - - delright = build_delaunay(tree->right,extra); - delleft = build_delaunay(tree->left, tree); - ldo = delleft.left; ldi=delleft.right; - rdi=delright.left; rdo=delright.right; - - retval=do_merge(ldo, ldi, rdi, rdo); - ldo = retval.left; - rdo = retval.right; - while (orig(ldo) != minx) { ldo = rprev(ldo); } - while (orig(rdo) != maxx) { rdo = lprev(rdo); } - retval.left = ldo; - retval.right = rdo; - } - else if (!tree) - { - printf("ERROR: Only 1 point!\n"); - exit(-1); - } - else if (!tree->left) - { - /* two points */ - a = makeedge(tree, extra); - retval.left = a; - retval.right = sym(a); - } - else - { /* tree->left, !tree->right */ /* three points */ - /* 3 cases: triangles of 2 orientations, and 3 points on a line. */ - s1 = tree->left; - s2 = tree; - s3 = extra; - a = makeedge(s1, s2); - b = makeedge(s2, s3); - splice(sym(a), b); - c = connect_left(b, a); - if (ccw(s1, s3, s2)) - { - retval.left = sym(c); - retval.right = c; - } - else - { - retval.left = a; - retval.right = sym(b); - if (!ccw(s1, s2, s3)) deleteedge(c); /* colinear */ - } - } - return retval; -} - -/****************************************************************/ -/* Quad-edge storage allocation */ -/****************************************************************/ -QUAD_EDGE next_edge, avail_edge; -#ifndef NEW -#define NYL -1 -#else -#define NYL NULL -#endif - -void -free_edge(e) - QUAD_EDGE e; -{ - e = (QUAD_EDGE) ((int) e ^ ((int) e & ANDF)); - onext(e) = avail_edge; - avail_edge = e; -} - -void -deleteedge(e) - /*disconnects e from the rest of the structure and destroys it. */ - QUAD_EDGE e; -{ - QUAD_EDGE f; - f=oprev(e); - splice(e, f); - f=oprev(sym(e)); - splice(sym(e),f); - free_edge(e); -} - -void -delete_all_edges() -{ - next_edge= 0; - avail_edge = NYL; -} - -QUAD_EDGE alloc_edge() -{ - QUAD_EDGE ans; - - if (avail_edge == NYL) - { - ans = (QUAD_EDGE) malloc(4*ALLOC_SIZE); -#ifdef OUT - if ((int) ans & ANDF) -#else !OUT - if (!(int) ans & 0xF) -#endif OUT - { - printf("Aborting in alloc_edge, ans = 0x%x\n",(unsigned)ans); - exit(-1); - } - } - else ans = (QUAD_EDGE) avail_edge, avail_edge = onext(avail_edge); - return ans; -} - -/****************************************************************/ -/* Geometric primitives */ -/****************************************************************/ - -BOOLEAN incircle(a,b,c,d) - /* incircle, as in the Guibas-Stolfi paper. */ - VERTEX_PTR a,b,c,d; -{ - double adx, ady, bdx, bdy, cdx, cdy, dx, dy, anorm, bnorm, cnorm, dnorm; - double dret ; - - dx = X(d); dy = Y(d); dnorm = NORM(d); - adx = X(a) - dx; ady = Y(a) - dy; anorm = NORM(a); - bdx = X(b) - dx; bdy = Y(b) - dy; bnorm = NORM(b); - cdx = X(c) - dx; cdy = Y(c) - dy; cnorm = NORM(c); - dret = (anorm - dnorm) * (bdx * cdy - bdy * cdx); - dret += (bnorm - dnorm) * (cdx * ady - cdy * adx); - dret += (cnorm - dnorm) * (adx * bdy - ady * bdx); - return( (0.0 < dret) ? TRUE : FALSE ); -} - -BOOLEAN ccw(a,b,c) - /* TRUE iff A, B, C form a counterclockwise oriented triangle */ - VERTEX_PTR a,b,c; -{ - double dret ; - double xa,ya,xb,yb,xc,yc; - - xa=X(a); ya=Y(a); - xb=X(b); yb=Y(b); - xc=X(c); yc=Y(c); - - dret = (xa-xc)*(yb-yc) - (xb-xc)*(ya-yc); - return( (dret > 0.0)? TRUE : FALSE); -} - -/****************************************************************/ -/* Quad-edge manipulation primitives */ -/****************************************************************/ -QUAD_EDGE makeedge(origin, destination) - VERTEX_PTR origin, destination; -{ - QUAD_EDGE temp, ans; - temp = alloc_edge(); - ans = temp; - - onext(temp) = ans; - orig(temp) = origin; - temp = (QUAD_EDGE) ((int) temp+SIZE); - onext(temp) = (QUAD_EDGE) ((int) ans + 3*SIZE); - temp = (QUAD_EDGE) ((int) temp+SIZE); - onext(temp) = (QUAD_EDGE) ((int) ans + 2*SIZE); - orig(temp) = destination; - temp = (QUAD_EDGE) ((int) temp+SIZE); - onext(temp) = (QUAD_EDGE) ((int) ans + 1*SIZE); - return(ans); -} - -void -splice(a,b) - QUAD_EDGE a, b; -{ - QUAD_EDGE alpha, beta, temp; - QUAD_EDGE t1; - - alpha = rot(onext(a)); - beta = rot(onext(b)); - - t1 = onext(beta); - temp = onext(alpha); - - onext(alpha) = t1; - onext(beta) = temp; - - temp = onext(a); - t1 = onext(b); - onext(b) = temp; - onext(a) = t1; -} - -void -swapedge(e) - QUAD_EDGE e; -{ - QUAD_EDGE a,b,syme,lnexttmp; - VERTEX_PTR a1,b1; - - a = oprev(e); - syme = sym(e); - b = oprev(syme); - splice(e, a); - splice(syme, b); - lnexttmp = lnext(a); - splice(e, lnexttmp); - lnexttmp = lnext(b); - splice(syme, lnexttmp); - a1 = dest(a); - b1 = dest(b); - orig(e) = a1; - dest(e) = b1; -} - -/****************************************************************/ -/* The Merge Procedure. */ -/****************************************************************/ - -int valid(l,basel) - QUAD_EDGE l,basel; -{ - VERTEX_PTR t1,t2,t3; - - t1=orig(basel); - t3=dest(basel); - - t2=dest(l); - return ccw(t1,t2,t3); -} - -void dump_quad(ptr) - QUAD_EDGE ptr; -{ - int i; - QUAD_EDGE j; - VERTEX_PTR v; - - ptr = (QUAD_EDGE) ((int) ptr & ~ANDF); - chatting("Entered DUMP_QUAD: ptr=0x%x\n",ptr); - for (i=0; i<4; i++) - { - j=onext(((QUAD_EDGE) (ptr+i))); - v = orig(j); - chatting("DUMP_QUAD: ptr=0x%x onext=0x%x,v=0x%x\n",ptr+i,j,v); - } -} - - -EDGE_PAIR do_merge(ldo, ldi, rdi, rdo) - QUAD_EDGE ldi, rdi, ldo, rdo; -{ - int rvalid, lvalid; - QUAD_EDGE basel,lcand,rcand,t; - VERTEX_PTR t1,t2,t3; - - while (TRUE) - { - t3=orig(rdi); - - t1=orig(ldi); - t2=dest(ldi); - - while (ccw(t1,t2,t3/*orig(ldi), dest(ldi), orig(rdi)*/)) - { - ldi = lnext(ldi); - - t1=orig(ldi); - t2=dest(ldi); - } - - t2=dest(rdi); - - if (ccw(t2,t3,t1/*dest(rdi), orig(rdi), orig(ldi)*/)) - { - rdi = rprev(rdi); - } - else - { - break; - } - } - - basel = connect_left(sym(rdi), ldi); - - lcand = rprev(basel); - rcand = oprev(basel); - t1 = orig(basel); - t2 = dest(basel); - - if (t1/*orig(basel)*/ == orig(rdo)) rdo = basel; - if (t2/*dest(basel)*/ == orig(ldo)) ldo = sym(basel); - - while (TRUE) - { - VERTEX_PTR v1,v2,v3,v4; - - /*chatting("valid site 1,lcand=0x%x,basel=0x%x\n",lcand,basel);*/ - /*dump_quad(lcand);*/ - t=onext(lcand); - if (valid(t,basel)) - { - v4=orig(basel); - - v1=dest(lcand); - v3=orig(lcand); - - v2=dest(t); - while (incircle(v1,v2,v3,v4 - /*dest(lcand), dest(t), orig(lcand), orig(basel)*/)) - { - deleteedge(lcand); - lcand = t; - - t = onext(lcand); - v1=dest(lcand); - v3=orig(lcand); - - v2=dest(t); - } - } - - /*chatting("valid site 2\n");*/ - t=oprev(rcand); - if (valid(t,basel)) { - v4=dest(basel); - v1=dest(t); - v2=dest(rcand); - v3=orig(rcand); - while (incircle(v1,v2,v3,v4 - /*dest(t), dest(rcand), orig(rcand), dest(basel)*/)) - { - deleteedge(rcand); - rcand = t; - t = oprev(rcand); - v2=dest(rcand); - v3=orig(rcand); - v1=dest(t); - } - } - /*chatting("Valid sites 3,4\n");*/ - lvalid = valid(lcand,basel); - /*chatting("Valid sites 3,4\n");*/ - rvalid = valid(rcand,basel); - if ((! lvalid) && (! rvalid)) - { - EDGE_PAIR retval; - retval.left = ldo; retval.right = rdo; return retval; - } - v1=dest(lcand); - v2=orig(lcand); - v3=orig(rcand); - v4=dest(rcand); - if (!lvalid || - (rvalid && incircle(v1,v2,v3,v4 - /*dest(lcand), orig(lcand), - orig(rcand), dest(rcand)*/))) - { - basel = connect_left(rcand, sym(basel)); - rcand = lnext(sym(basel)); - } - else - { - basel = sym(connect_right(lcand, basel)); - lcand = rprev(basel); - } - } -} - - - -#define DEFINE_GLOBALS -#define CONST_m1 10000 -#define CONST_b 31415821 -#define RANGE 100 - -struct EDGE_STACK *allocate_stack(); -struct get_point get_points(); -int loop = 0, randum = 1, filein = 0 , fileout = 1, statistics = 0; - -void in_order(tree) - VERTEX_PTR tree; -{ - VERTEX_PTR tleft, tright; - double x, y; - - if (!tree) { - return; - } - - x = X(tree); - y = Y(tree); - chatting("X=%f, Y=%f\n",x, y); - tleft = tree->left; - in_order(tleft); - tright = tree->right; - in_order(tright); -} - -int mult(int p, int q) -{ - int p1, p0, q1, q0; - - p1=p/CONST_m1; p0=p%CONST_m1; - q1=q/CONST_m1; q0=q%CONST_m1; - return (((p0*q1+p1*q0) % CONST_m1)*CONST_m1+p0*q0); -} - -int skiprand(int seed, int n) -/* Generate the nth random # */ -{ - for (; n; n--) -#ifdef SS_PLAIN - seed = olden_random(seed); -#else SS_PLAIN - seed=random(seed); -#endif SS_PLAIN - return seed; -} - - -#ifdef SS_PLAIN -int olden_random(int seed) -#else SS_PLAIN -int random(int seed) -#endif SS_PLAIN -{ - seed = (mult(seed,CONST_b)+1); - return seed; -} - - -void -print_extra(extra) - VERTEX_PTR extra; -{ - - double x, y; - x = X(extra); - y = Y(extra); - chatting("X=%f, Y=%f\n",x, y); -} - - -void -main(argc,argv) - int argc; - char *argv[]; -{ - struct EDGE_STACK *my_stack; - struct get_point point, extra; - QUAD_EDGE edge; - int n, retained; - to_lincoln = to_off = to_3d_out = to_color = 0; - voronoi = delaunay = 1; interactive = ahost = 0 ; - retained = 0; - - filestuff(); - chatting("argc = %d\n",argc); - n = dealwithargs(argc, argv); - - chatting("getting %d points\n", n); - extra=get_points(1,1.0,n,1023); - point=get_points(n-1,extra.curmax,n-1,extra.seed); - chatting("Done getting points\n"); - num_vertices = n + 1; - my_stack=allocate_stack(num_vertices); - -//#ifdef SS_PLAIN -// ssplain_alloc_stats(); -//#endif SS_PLAIN - - if (flag) in_order(point.v); - if (flag) print_extra(extra.v); - chatting("Doing voronoi on %d nodes\n", n); - - edge=build_delaunay_triangulation(point.v,extra.v); - - chatting("Elapsed time %f\n", CMMD_node_timer_elapsed(0)); - if (flag) output_voronoi_diagram(edge,n,my_stack); - - exit(0); -} - -struct EDGE_STACK *allocate_stack(num_vertices) - int num_vertices; -{ - struct EDGE_STACK *my_stack; - - num_edgeparts = 12*num_vertices; - my_alloc(my_stack, struct EDGE_STACK, 1); - my_alloc(my_stack->elts, QUAD_EDGE , num_edgeparts); - my_stack->stack_size = num_edgeparts/2; - return my_stack; -} - -void -free_all(cont,my_stack) - int cont; - struct EDGE_STACK *my_stack; -{ - free(my_stack->elts); - free(my_stack); -} - -struct get_point get_points(n,curmax,i,seed) - int n; - double curmax; - int i,seed; -{ - VERTEX_PTR node; - - struct get_point point; - - if (n<1 || i<=n/2) { - point.v = NULL; - point.curmax=curmax; - point.seed = seed; - return point; - } -#ifdef OUT - chatting("Get points: %d, %f, %d\n",n,curmax,i); -#endif OUT - - point = get_points(n/2,curmax,i,seed); - /*chatting("rec call n=%d\n",n);*/ - i -= n/2; - - node = (VERTEX_PTR) mymalloc(sizeof(struct VERTEX)); - - /*chatting("Get points past alloc,n=%d\n",n);*/ - X(node) = point.curmax * exp(log(drand(point.seed))/i); - Y(node) = drand(point.seed); - NORM(node) = X(node)*X(node) + Y(node)*Y(node); - node->right = point.v; - /*chatting("node = 0x%x\n",node);*/ - point = get_points(n/2,X(node),i-1,point.seed); - - node->left = point.v; - point.v = node; - return point; -} - - -/****************************************************************/ -/* Voronoi Diagram Routines. */ -/****************************************************************/ - -/****************************************************************/ -/* Graph Traversal Routines */ -/****************************************************************/ - -QUAD_EDGE pop_edge(x) - struct EDGE_STACK *x; -{ - int a=x->ptr--; - return (x)->elts[a]; -} - -void -push_edge(stack,edge) - struct EDGE_STACK *stack; - QUAD_EDGE edge; -{ - int a; - /*chatting("pushing edge \n");*/ - if (stack->ptr == stack->stack_size) { - printf("cannot push onto stack: stack is too large\n"); - } - else { - a = stack->ptr; - a++; - stack->ptr = a; - stack->elts[a] = edge; - } -} - -void -push_ring(stack, edge) - struct EDGE_STACK *stack; - QUAD_EDGE edge; -{ - QUAD_EDGE nex; - nex = onext(edge); - while (nex != edge) { - if (seen(nex) == 0) { - seen(nex) = 1; - push_edge(stack, nex); - } - nex = onext(nex); - } -} - -void -push_nonzero_ring(stack, edge) - struct EDGE_STACK *stack; - QUAD_EDGE edge; -{ - QUAD_EDGE nex; - nex = onext(edge); - while (nex != edge) { - if (seen(nex) != 0) { - seen(nex) = 0; - push_edge(stack, nex); - } - nex = onext(nex); - } -} - -void -zero_seen(my_stack,edge) - QUAD_EDGE edge; - struct EDGE_STACK *my_stack; -{ - my_stack->ptr = 0; - push_nonzero_ring(my_stack, edge); - while (my_stack->ptr != 0) { - edge = pop_edge(my_stack); - push_nonzero_ring(my_stack, sym(edge)); - } -} - diff --git a/test/ccured_olden/voronoi/output.c b/test/ccured_olden/voronoi/output.c deleted file mode 100644 index a9331f99..00000000 --- a/test/ccured_olden/voronoi/output.c +++ /dev/null @@ -1,173 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#define ODEFINE_GLOBALS -#include "defines.h" - -#ifdef SS_PLAIN -#include "ssplain.h" -#endif SS_PLAIN - -extern struct VEC2 V2_sum(); -extern struct VEC2 V2_sub(); -extern struct VEC2 V2_times(); -extern double V2_cprod(); -extern struct VEC2 V2_cross(); -extern double V2_dot(); -extern double V2_magn(); - -/****************************************************************/ -/* Voronoi Output Routines */ -/****************************************************************/ - -void -plot_dedge(p1, p2) -VERTEX_PTR p1, p2; -{ - double x1,x2,y1,y2; - - x1=X(p1); - y1=Y(p1); - x2=X(p2); - y2=Y(p2); - /* plots a Delaunay-triangulation edge on your favorite device. */ - chatting("Dedge %g %g %g %g \n",(float) x1, (float) y1, - (float) x2, (float) y2); -} - -void -plot_vedge(p1, p2) - struct VEC2 p1, p2; -{ - /* plots a Voronoi-diagram edge on your favorite device. */ - chatting("Vedge %g %g %g %g \n",(float) p1.x, (float) p1.y, (float) p2.x, - (float) p2.y); -} - -struct VEC2 circle_center(a,b,c) - /* returns the center of the circle passing through A, B & C. */ - struct VEC2 a,b,c; -{ - struct VEC2 p; - double d1,d2,d3,d4; - struct VEC2 vv1, vv2, vv3, vv4, vv5, vv6, vv7 ; - vv1 = V2_sub(b,c); - d1 = V2_magn( vv1 ); - vv1 = V2_sum(a,b); - vv2 = V2_times(0.5, vv1); - if (d1 < 0.0) /*there is no intersection point, the bisectors coincide. */ - return(vv2); - else { - vv3 = V2_sub(b,a); - vv4 = V2_sub(c,a); - d3 = V2_cprod(vv3, vv4) ; - d2 = -2.0 * d3 ; - vv5 = V2_sub(c,b); - d4 = V2_dot(vv5, vv4); - vv6 = V2_cross(vv3); - vv7 = V2_times(d4/ d2 , vv6); - p = V2_sum(vv2, vv7); - return(p); - } -} - -int *earray; - -void -output_voronoi_diagram(edge,nv,my_stack) - QUAD_EDGE edge; - int nv; - struct EDGE_STACK *my_stack; -{ - QUAD_EDGE nex, prev, snex, sprev; - struct VEC2 cvxvec, center; - double ln; - double d1; - struct VEC2 vv1, vv2, vv3; - - if (voronoi) { - zero_seen(my_stack,edge); - nex = edge; - /* Plot VD edges with one endpoint at infinity. */ - do { - struct VEC2 v21,v22,v23; - QUAD_EDGE tmp; - - v21=destv(nex); - v22=origv(nex); - tmp=onext(nex); - v23=destv(tmp); - cvxvec = V2_sub(v21,v22/*destv(nex), origv(nex)*/); - center = circle_center(v22,v21,v23 - /*origv(nex), destv(nex), destv(onext(nex))*/); - vv1 = V2_sum(v22,v21/*origv(nex), destv(nex)*/) ; - vv2 = V2_times(0.5, vv1); - vv3 = V2_sub(center, vv2) ; - ln = 1.0 + V2_magn(vv3); - d1 = ln/V2_magn(cvxvec); - vv1 = V2_cross(cvxvec); - vv2 = V2_times(d1, vv1) ; - vv3 = V2_sum(center, vv2); - plot_vedge( center, vv3 ) ; - nex = rnext(nex); - } while (nex != edge); - } - - /* Plot DT edges and finite VD edges. */ - - my_stack->ptr = 0; - push_ring(my_stack, edge); - chatting("mystack_ptr = %d\n",my_stack->ptr); - while (my_stack->ptr != 0) { - VERTEX_PTR v1,v2,v3,v4; - double d1,d2; - - - edge = pop_edge(my_stack); - if (seen(edge) == 1) - { - { - prev = edge; - nex = onext(edge); - do { - v1=orig(prev); - d1=X(v1); - v2=dest(prev); - d2=X(v2); - if (d1 >= d2 /*X(orig(prev)) >= X(dest(prev))*/) - { - /*plot_dedge(orig(prev), dest(prev));*/ - plot_dedge(v1,v2); - sprev = sym(prev); - snex = onext(sprev); - v1=orig(prev); - v2=dest(prev); - v3=dest(nex); - v4=dest(snex); - if (ccw(v1,v2,v3/*orig(prev), dest(prev), dest(nex)*/) - != ccw(v1,v2,v4/*orig(prev),dest(prev),dest(snex)*/)) - { - struct VEC2 v21, v22, v23; - v21 = origv(prev); - v22 = destv(prev); - v23 = destv(nex); - vv1 = circle_center(v21,v22,v23/*origv(prev), - destv(prev),destv(nex)*/); - v21 = origv(sprev); - v22 = destv(sprev); - v23 = destv(snex); - vv2 = circle_center(v21,v22,v23/*origv(sprev), - destv(sprev),destv(snex)*/); - plot_vedge( vv1 , vv2 ); - } - } - seen(prev) = 2; - prev = nex; - nex = onext(nex); - } while (prev != edge); - } - } - push_ring(my_stack, sym(edge)); - } - zero_seen(my_stack, edge); -} - diff --git a/test/ccured_olden/voronoi/vector.c b/test/ccured_olden/voronoi/vector.c deleted file mode 100644 index 1a288d7b..00000000 --- a/test/ccured_olden/voronoi/vector.c +++ /dev/null @@ -1,80 +0,0 @@ -/* For copyright information, see olden_v1.0/COPYRIGHT */ - -#include "defines.h" - -/****************************************************************/ -/* Vector Routines. */ -/* From CMU vision library. */ -/* They are used only for the VD, not the DT. */ -/* They are slow because of large call-by-value parameters.*/ -/****************************************************************/ - -/* V2_cprod: forms triple scalar product of [u,v,k], where k = u cross v */ -/* (returns the magnitude of u cross v in space)*/ - -double V2_cprod(u,v) - struct VEC2 u,v; -{ - return(u.x * v.y - u.y * v.x); -} - - -/* V2_dot: vector dot product */ - -double V2_dot(u,v) -struct VEC2 u,v; -{ - return(u.x * v.x + u.y * v.y); -} - -/* V2_times: multiply a vector by a scalar */ - -struct VEC2 V2_times(c,v) - double c; - struct VEC2 v; -{ - struct VEC2 ans; - ans.x = c * v.x; - ans.y = c * v.y; - return(ans); -} - -/* V2_sum, V2_sub: Vector addition and subtraction */ - -struct VEC2 V2_sum(u,v) - struct VEC2 u,v; -{ - struct VEC2 ans; - - ans.x = u.x + v.x; - ans.y = u.y + v.y; - return(ans); -} - -struct VEC2 V2_sub(u,v) - struct VEC2 u,v; -{ - struct VEC2 ans; - ans.x = u.x - v.x; - ans.y = u.y - v.y; - return(ans); -} - -/* V2_magn: magnitude of vector */ - -double V2_magn(u) - struct VEC2 u; -{ - return(sqrt(u.x*u.x+u.y*u.y)); -} - -/* returns k X v (cross product). this is a vector perpendicular to v */ - -struct VEC2 V2_cross(v) - struct VEC2 v; -{ - struct VEC2 ans; - ans.x = v.y; - ans.y = -v.x; - return(ans); -} diff --git a/test/harness/mainaes.c b/test/harness/mainaes.c deleted file mode 100644 index 7c658c75..00000000 --- a/test/harness/mainaes.c +++ /dev/null @@ -1,739 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -#define MAXNR 14 - -extern int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); -extern int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); -extern void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]); -extern void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]); - -const u32 Te0[256] = { - 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, - 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, - 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, - 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, - 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, - 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, - 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, - 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, - 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, - 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, - 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, - 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, - 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, - 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, - 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, - 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, - 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, - 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, - 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, - 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, - 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, - 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, - 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, - 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, - 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, - 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, - 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, - 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, - 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, - 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, - 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, - 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, - 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, - 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, - 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, - 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, - 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, - 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, - 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, - 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, - 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, - 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, - 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, - 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, - 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, - 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, - 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, - 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, - 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, - 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, - 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, - 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, - 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, - 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, - 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, - 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, - 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, - 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, - 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, - 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, - 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, - 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, - 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, - 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, -}; -const u32 Te1[256] = { - 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, - 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, - 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, - 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, - 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, - 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, - 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, - 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, - 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, - 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, - 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, - 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, - 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, - 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, - 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, - 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, - 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, - 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, - 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, - 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, - 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, - 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, - 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, - 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, - 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, - 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, - 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, - 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, - 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, - 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, - 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, - 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, - 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, - 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, - 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, - 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, - 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, - 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, - 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, - 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, - 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, - 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, - 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, - 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, - 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, - 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, - 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, - 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, - 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, - 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, - 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, - 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, - 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, - 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, - 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, - 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, - 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, - 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, - 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, - 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, - 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, - 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, - 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, - 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, -}; -const u32 Te2[256] = { - 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, - 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, - 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, - 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, - 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, - 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, - 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, - 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, - 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, - 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, - 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, - 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, - 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, - 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, - 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, - 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, - 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, - 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, - 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, - 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, - 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, - 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, - 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, - 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, - 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, - 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, - 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, - 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, - 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, - 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, - 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, - 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, - 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, - 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, - 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, - 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, - 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, - 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, - 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, - 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, - 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, - 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, - 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, - 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, - 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, - 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, - 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, - 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, - 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, - 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, - 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, - 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, - 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, - 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, - 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, - 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, - 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, - 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, - 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, - 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, - 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, - 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, - 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, - 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, -}; -const u32 Te3[256] = { - - 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, - 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, - 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, - 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, - 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, - 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, - 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, - 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, - 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, - 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, - 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, - 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, - 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, - 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, - 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, - 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, - 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, - 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, - 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, - 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, - 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, - 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, - 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, - 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, - 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, - 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, - 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, - 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, - 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, - 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, - 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, - 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, - 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, - 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, - 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, - 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, - 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, - 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, - 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, - 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, - 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, - 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, - 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, - 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, - 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, - 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, - 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, - 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, - 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, - 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, - 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, - 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, - 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, - 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, - 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, - 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, - 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, - 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, - 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, - 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, - 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, - 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, - 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, - 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, -}; -const u32 Te4[256] = { - 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, - 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, - 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, - 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, - 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, - 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, - 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, - 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, - 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, - 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, - 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, - 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, - 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, - 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, - 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, - 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, - 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, - 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, - 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, - 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, - 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, - 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, - 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, - 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, - 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, - 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, - 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, - 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, - 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, - 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, - 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, - 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, - 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, - 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, - 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, - 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, - 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, - 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, - 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, - 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, - 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, - 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, - 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, - 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, - 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, - 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, - 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, - 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, - 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, - 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, - 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, - 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, - 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, - 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, - 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, - 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, - 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, - 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, - 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, - 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, - 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, - 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, - 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, - 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, -}; -const u32 Td0[256] = { - 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, - 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, - 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, - 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, - 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, - 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, - 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, - 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, - 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, - 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, - 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, - 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, - 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, - 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, - 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, - 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, - 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, - 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, - 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, - 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, - 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, - 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, - 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, - 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, - 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, - 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, - 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, - 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, - 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, - 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, - 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, - 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, - 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, - 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, - 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, - 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, - 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, - 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, - 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, - 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, - 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, - 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, - 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, - 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, - 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, - 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, - 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, - 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, - 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, - 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, - 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, - 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, - 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, - 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, - 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, - 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, - 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, - 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, - 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, - 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, - 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, - 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, - 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, - 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, -}; -const u32 Td1[256] = { - 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, - 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, - 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, - 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, - 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, - 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, - 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, - 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, - 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, - 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, - 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, - 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, - 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, - 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, - 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, - 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, - 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, - 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, - 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, - 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, - 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, - 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, - 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, - 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, - 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, - 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, - 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, - 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, - 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, - 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, - 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, - 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, - 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, - 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, - 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, - 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, - 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, - 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, - 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, - 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, - 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, - 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, - 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, - 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, - 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, - 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, - 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, - 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, - 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, - 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, - 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, - 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, - 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, - 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, - 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, - 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, - 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, - 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, - 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, - 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, - 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, - 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, - 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, - 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, -}; -const u32 Td2[256] = { - 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, - 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, - 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, - 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, - 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, - 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, - 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, - 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, - 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, - 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, - 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, - 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, - 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, - 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, - 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, - 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, - 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, - 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, - 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, - 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, - - 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, - 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, - 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, - 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, - 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, - 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, - 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, - 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, - 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, - 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, - 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, - 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, - 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, - 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, - 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, - 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, - 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, - 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, - 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, - 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, - 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, - 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, - 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, - 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, - 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, - 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, - 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, - 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, - 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, - 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, - 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, - 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, - 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, - 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, - 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, - 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, - 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, - 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, - 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, - 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, - 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, - 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, - 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, - 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, -}; -const u32 Td3[256] = { - 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, - 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, - 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, - 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, - 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, - 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, - 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, - 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, - 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, - 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, - 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, - 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, - 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, - 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, - 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, - 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, - 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, - 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, - 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, - 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, - 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, - 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, - 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, - 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, - 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, - 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, - 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, - 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, - 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, - 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, - 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, - 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, - 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, - 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, - 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, - 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, - 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, - 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, - 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, - 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, - 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, - 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, - 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, - 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, - 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, - 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, - 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, - 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, - 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, - 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, - 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, - 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, - 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, - 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, - 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, - 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, - 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, - 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, - 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, - 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, - 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, - 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, - 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, - 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, -}; -const u32 Td4[256] = { - 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, - 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, - 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, - 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, - 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, - 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, - 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, - 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, - 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, - 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, - 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, - 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, - 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, - 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, - 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, - 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, - 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, - 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, - 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, - 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, - 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, - 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, - 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, - 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, - 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, - 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, - 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, - 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, - 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, - 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, - 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, - 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, - 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, - 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, - 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, - 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, - 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, - 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, - 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, - 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, - 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, - 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, - 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, - 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, - 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, - 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, - 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, - 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, - 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, - 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, - 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, - 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, - 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, - 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, - 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, - 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, - 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, - 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, - 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, - 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, - 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, - 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, - 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, - 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, -}; -const u32 rcon[] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ -}; - -static void do_test(int keybits, u8 * key, - u8 plain[16], u8 cipher[16], - int testno1, int testno2) -{ - u32 ckey[4 * (MAXNR + 1)]; - u8 temp[16]; - int nr; - int ok; - - nr = rijndaelKeySetupEnc(ckey, key, keybits); - rijndaelEncrypt(ckey, nr, plain, temp); - ok = memcmp(temp, cipher, 16) == 0; - printf("Encryption test %d %s\n", testno1, ok ? "passed" : "FAILED"); - nr = rijndaelKeySetupDec(ckey, key, keybits); - rijndaelDecrypt(ckey, nr, cipher, temp); - ok = memcmp(temp, plain, 16) == 0; - printf("Decryption test %d %s\n", testno2, ok ? "passed" : "FAILED"); -} - -static void do_bench(int nblocks) -{ - u32 ckey[4 * (MAXNR + 1)]; - u8 temp[16]; - int nr; - - nr = rijndaelKeySetupEnc(ckey, (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 128); - for (; nblocks > 0; nblocks--) - rijndaelEncrypt(ckey, nr, temp, temp); -} - -int main(int argc, char ** argv) -{ - if (argc < 2) { - do_test(128, - (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", - (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - (u8 *)"\x69\xC4\xE0\xD8\x6A\x7B\x04\x30\xD8\xCD\xB7\x80\x70\xB4\xC5\x5A", - 1, 2); - do_test(192, - (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17", - (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - (u8 *)"\xDD\xA9\x7C\xA4\x86\x4C\xDF\xE0\x6E\xAF\x70\xA0\xEC\x0D\x71\x91", - 3, 4); - do_test(256, - (u8 *)"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", - (u8 *)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF", - (u8 *)"\x8E\xA2\xB7\xCA\x51\x67\x45\xBF\xEA\xFC\x49\x90\x4B\x49\x60\x89", - 5, 6); - } else { - do_bench(atoi(argv[1])); - } - return 0; -} - - - - diff --git a/test/harness/mainalmabench.c b/test/harness/mainalmabench.c deleted file mode 100644 index c514ccae..00000000 --- a/test/harness/mainalmabench.c +++ /dev/null @@ -1,185 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <math.h> - -static const double J2000 = 2451545.0; -static const int TEST_LENGTH = 36525; - -const double amas [8] = { 6023600.0, 408523.5, 328900.5, 3098710.0, 1047.355, 3498.5, 22869.0, 19314.0 }; - -const double a [8][3] = - { { 0.3870983098, 0, 0 }, - { 0.7233298200, 0, 0 }, - { 1.0000010178, 0, 0 }, - { 1.5236793419, 3e-10, 0 }, - { 5.2026032092, 19132e-10, -39e-10 }, - { 9.5549091915, -0.0000213896, 444e-10 }, - { 19.2184460618, -3716e-10, 979e-10 }, - { 30.1103868694, -16635e-10, 686e-10 } }; - -const double dlm[8][3] = - { { 252.25090552, 5381016286.88982, -1.92789 }, - { 181.97980085, 2106641364.33548, 0.59381 }, - { 100.46645683, 1295977422.83429, -2.04411 }, - { 355.43299958, 689050774.93988, 0.94264 }, - { 34.35151874, 109256603.77991, -30.60378 }, - { 50.07744430, 43996098.55732, 75.61614 }, - { 314.05500511, 15424811.93933, -1.75083 }, - { 304.34866548, 7865503.20744, 0.21103 } }; - -const double e[8][3] = - { { 0.2056317526, 0.0002040653, -28349e-10 }, - { 0.0067719164, -0.0004776521, 98127e-10 }, - { 0.0167086342, -0.0004203654, -0.0000126734 }, - { 0.0934006477, 0.0009048438, -80641e-10 }, - { 0.0484979255, 0.0016322542, -0.0000471366 }, - { 0.0555481426, -0.0034664062, -0.0000643639 }, - { 0.0463812221, -0.0002729293, 0.0000078913 }, - { 0.0094557470, 0.0000603263, 0 } }; - -const double pi[8][3] = - { { 77.45611904, 5719.11590, -4.83016 }, - { 131.56370300, 175.48640, -498.48184 }, - { 102.93734808, 11612.35290, 53.27577 }, - { 336.06023395, 15980.45908, -62.32800 }, - { 14.33120687, 7758.75163, 259.95938 }, - { 93.05723748, 20395.49439, 190.25952 }, - { 173.00529106, 3215.56238, -34.09288 }, - { 48.12027554, 1050.71912, 27.39717 } }; - -const double dinc[8][3] = - { { 7.00498625, -214.25629, 0.28977 }, - { 3.39466189, -30.84437, -11.67836 }, - { 0, 469.97289, -3.35053 }, - { 1.84972648, -293.31722, -8.11830 }, - { 1.30326698, -71.55890, 11.95297 }, - { 2.48887878, 91.85195, -17.66225 }, - { 0.77319689, -60.72723, 1.25759 }, - { 1.76995259, 8.12333, 0.08135 } }; - -const double omega[8][3] = - { { 48.33089304, -4515.21727, -31.79892 }, - { 76.67992019, -10008.48154, -51.32614 }, - { 174.87317577, -8679.27034, 15.34191 }, - { 49.55809321, -10620.90088, -230.57416 }, - { 100.46440702, 6362.03561, 326.52178 }, - { 113.66550252, -9240.19942, -66.23743 }, - { 74.00595701, 2669.15033, 145.93964 }, - { 131.78405702, -221.94322, -0.78728 } }; - -const double kp[8][9] = - { { 69613.0, 75645.0, 88306.0, 59899.0, 15746.0, 71087.0, 142173.0, 3086.0, 0.0 }, - { 21863.0, 32794.0, 26934.0, 10931.0, 26250.0, 43725.0, 53867.0, 28939.0, 0.0 }, - { 16002.0, 21863.0, 32004.0, 10931.0, 14529.0, 16368.0, 15318.0, 32794.0, 0.0 }, - { 6345.0, 7818.0, 15636.0, 7077.0, 8184.0, 14163.0, 1107.0, 4872.0, 0.0 }, - { 1760.0, 1454.0, 1167.0, 880.0, 287.0, 2640.0, 19.0, 2047.0, 1454.0 }, - { 574.0, 0.0, 880.0, 287.0, 19.0, 1760.0, 1167.0, 306.0, 574.0 }, - { 204.0, 0.0, 177.0, 1265.0, 4.0, 385.0, 200.0, 208.0, 204.0 }, - { 0.0, 102.0, 106.0, 4.0, 98.0, 1367.0, 487.0, 204.0, 0.0 } }; - -const double ca[8][9] = - { { 4.0, -13.0, 11.0, -9.0, -9.0, -3.0, -1.0, 4.0, 0.0 }, - { -156.0, 59.0, -42.0, 6.0, 19.0, -20.0, -10.0, -12.0, 0.0 }, - { 64.0, -152.0, 62.0, -8.0, 32.0, -41.0, 19.0, -11.0, 0.0 }, - { 124.0, 621.0, -145.0, 208.0, 54.0, -57.0, 30.0, 15.0, 0.0 }, - { -23437.0, -2634.0, 6601.0, 6259.0, -1507.0, -1821.0, 2620.0, -2115.0,-1489.0 }, - { 62911.0,-119919.0, 79336.0, 17814.0,-24241.0, 12068.0, 8306.0, -4893.0, 8902.0 }, - { 389061.0,-262125.0,-44088.0, 8387.0,-22976.0, -2093.0, -615.0, -9720.0, 6633.0 }, - { -412235.0,-157046.0,-31430.0, 37817.0, -9740.0, -13.0, -7449.0, 9644.0, 0.0 } }; - -const double sa[8][9] = - { { -29.0, -1.0, 9.0, 6.0, -6.0, 5.0, 4.0, 0.0, 0.0 }, - { -48.0, -125.0, -26.0, -37.0, 18.0, -13.0, -20.0, -2.0, 0.0 }, - { -150.0, -46.0, 68.0, 54.0, 14.0, 24.0, -28.0, 22.0, 0.0 }, - { -621.0, 532.0, -694.0, -20.0, 192.0, -94.0, 71.0, -73.0, 0.0 }, - { -14614.0,-19828.0, -5869.0, 1881.0, -4372.0, -2255.0, 782.0, 930.0, 913.0 }, - { 139737.0, 0.0, 24667.0, 51123.0, -5102.0, 7429.0, -4095.0, -1976.0,-9566.0 }, - { -138081.0, 0.0, 37205.0,-49039.0,-41901.0,-33872.0,-27037.0,-12474.0,18797.0 }, - { 0.0, 28492.0,133236.0, 69654.0, 52322.0,-49577.0,-26430.0, -3593.0, 0.0 } }; - -const double kq[8][10] = - { { 3086.0, 15746.0, 69613.0, 59899.0, 75645.0, 88306.0, 12661.0, 2658.0, 0.0, 0.0 }, - { 21863.0, 32794.0, 10931.0, 73.0, 4387.0, 26934.0, 1473.0, 2157.0, 0.0, 0.0 }, - { 10.0, 16002.0, 21863.0, 10931.0, 1473.0, 32004.0, 4387.0, 73.0, 0.0, 0.0 }, - { 10.0, 6345.0, 7818.0, 1107.0, 15636.0, 7077.0, 8184.0, 532.0, 10.0, 0.0 }, - { 19.0, 1760.0, 1454.0, 287.0, 1167.0, 880.0, 574.0, 2640.0, 19.0,1454.0 }, - { 19.0, 574.0, 287.0, 306.0, 1760.0, 12.0, 31.0, 38.0, 19.0, 574.0 }, - { 4.0, 204.0, 177.0, 8.0, 31.0, 200.0, 1265.0, 102.0, 4.0, 204.0 }, - { 4.0, 102.0, 106.0, 8.0, 98.0, 1367.0, 487.0, 204.0, 4.0, 102.0 } }; - -const double cl[8][10] = - { { 21.0, -95.0, -157.0, 41.0, -5.0, 42.0, 23.0, 30.0, 0.0, 0.0 }, - { -160.0, -313.0, -235.0, 60.0, -74.0, -76.0, -27.0, 34.0, 0.0, 0.0 }, - { -325.0, -322.0, -79.0, 232.0, -52.0, 97.0, 55.0, -41.0, 0.0, 0.0 }, - { 2268.0, -979.0, 802.0, 602.0, -668.0, -33.0, 345.0, 201.0, -55.0, 0.0 }, - { 7610.0, -4997.0,-7689.0,-5841.0,-2617.0, 1115.0, -748.0, -607.0, 6074.0, 354.0 }, - { -18549.0, 30125.0,20012.0, -730.0, 824.0, 23.0, 1289.0, -352.0,-14767.0,-2062.0 }, - { -135245.0,-14594.0, 4197.0,-4030.0,-5630.0,-2898.0, 2540.0, -306.0, 2939.0, 1986.0 }, - { 89948.0, 2103.0, 8963.0, 2695.0, 3682.0, 1648.0, 866.0, -154.0, -1963.0, -283.0 } }; - -const double sl[8][10] = - { { -342.0, 136.0, -23.0, 62.0, 66.0, -52.0, -33.0, 17.0, 0.0, 0.0 }, - { 524.0, -149.0, -35.0, 117.0, 151.0, 122.0, -71.0, -62.0, 0.0, 0.0 }, - { -105.0, -137.0, 258.0, 35.0, -116.0, -88.0, -112.0, -80.0, 0.0, 0.0 }, - { 854.0, -205.0, -936.0, -240.0, 140.0, -341.0, -97.0, -232.0, 536.0, 0.0 }, - { -56980.0, 8016.0, 1012.0, 1448.0,-3024.0,-3710.0, 318.0, 503.0, 3767.0, 577.0 }, - { 138606.0,-13478.0,-4964.0, 1441.0,-1319.0,-1482.0, 427.0, 1236.0, -9167.0,-1918.0 }, - { 71234.0,-41116.0, 5334.0,-4935.0,-1848.0, 66.0, 434.0,-1748.0, 3780.0, -701.0 }, - { -47645.0, 11647.0, 2166.0, 3194.0, 679.0, 0.0, -244.0, -419.0, -2531.0, 48.0 } }; - -extern void planetpv (double epoch[2], int np, double pv[2][3]); -extern void radecdist(double state[2][3], double rdd[3]); - -static void test(void) -{ - int p; - double jd[2]; - double pv[2][3]; - double position[3]; - - jd[0] = J2000; - jd[1] = 0.0; - for (p = 0; p < 8; ++p) - { - planetpv(jd,p,pv); - radecdist(pv,position); - printf("p = %d position[0] = %g position[1] = %g\n", - p, position[0], position[1]); - } -} - - -static void bench(int nloops) -{ - int i, n, p; - double jd[2]; - double pv[2][3]; - double position[3]; - - for (i = 0; i < nloops; ++i) - { - jd[0] = J2000; - jd[1] = 0.0; - - for (n = 0; n < TEST_LENGTH; ++n) - { - jd[0] += 1.0; - - for (p = 0; p < 8; ++p) - { - planetpv(jd,p,pv); - radecdist(pv,position); - } - } - } -} - -int main(int argc, char ** argv) -{ - if (argc >= 2) - bench(atoi(argv[1])); - else - test(); - return 0; -} - diff --git a/test/harness/mainconversions.c b/test/harness/mainconversions.c deleted file mode 100644 index 4adfaa53..00000000 --- a/test/harness/mainconversions.c +++ /dev/null @@ -1,115 +0,0 @@ -#include <stdio.h> -#include <math.h> - -extern void intoffloat(int * r, double * x); -extern void intuoffloat(unsigned int * r, double * x); -extern void floatofint(double * r, int * x); -extern void floatofintu(double * r, unsigned int * x); - -/* Linear congruential PRNG */ - -static unsigned int random_seed = 0; - -unsigned int random_uint(void) -{ - random_seed = random_seed * 69069 + 25173; - return random_seed; -} - -double random_double(void) -{ - /* In range 0 .. 2^32+1 */ - unsigned int h = random_uint(); - unsigned int l = random_uint(); - return (double) h + ldexp((double) l, -32); -} - -/* Individual test runs */ - -void test_intoffloat(double x) -{ - int r; - intoffloat(&r, &x); - if (r != (int) x) - printf("intoffloat(%g): expected %d, got %d\n", x, r, (int) x); -} - -void test_intuoffloat(double x) -{ - unsigned int r; - intuoffloat(&r, &x); - if (r != (unsigned int) x) - printf("intuoffloat(%g): expected %d, got %d\n", x, r, (unsigned int) x); -} - -void test_floatofint(int x) -{ - double r; - floatofint(&r, &x); - if (r != (double) x) - printf("floatofint(%d): expected %g, got %g\n", x, r, (double) x); -} - -void test_floatofintu(unsigned int x) -{ - double r; - floatofintu(&r, &x); - if (r != (double) x) - printf("floatofint(%u): expected %g, got %g\n", x, r, (double) x); -} - -/* Limit cases */ - -double cases_intoffloat[] = { - 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.6, - -0.1, -0.5, -0.9, -1.0, -1.1, -1.6, - 2147483647.0, 2147483647.6, 2147483648.0, 2147483647.5, - 2147483648.0, 2147483648.5, 2147483649.0, 10000000000.0, - -2147483647.0, -2147483647.6, -2147483648.0, -2147483647.5, - -2147483648.0, -2147483648.5, -2147483649.0, -10000000000.0 -}; - -double cases_intuoffloat[] = { - 0.0, 0.1, 0.5, 0.9, 1.0, 1.1, 1.6, - -0.1, -0.5, -0.9, -1.0, -1.1, -1.6, - 2147483647.0, 2147483647.6, 2147483648.0, 2147483647.5, - 2147483648.0, 2147483648.5, 2147483649.0, - 4294967295.0, 4294967295.6, 4294967296.0, 4294967296.5, - 10000000000.0 -}; - -int cases_floatofint[] = { - 0, 1, 2, -1, -2, 2147483647, -2147483648 -}; - -unsigned int cases_floatofintu[] = { - 0U, 1U, 2U, 2147483647U, 2147483648U, 4294967295U -}; - -#define TEST(testfun, cases, tyarg, gen) \ - for (i = 0; i < sizeof(cases) / sizeof(tyarg); i++) \ - testfun(cases[i]); \ - for (i = 0; i < numtests; i++) \ - testfun(gen); - -int main(int argc, char ** argv) -{ - int i; - int numtests = 1000000; - - TEST(test_intoffloat, cases_intoffloat, double, - (random_double() - 2147483648.0) * 1.1); - TEST(test_intuoffloat, cases_intuoffloat, double, - random_double() * 1.1); - TEST(test_floatofint, cases_floatofint, int, - (int) random_uint()); - TEST(test_floatofintu, cases_floatofintu, unsigned int, - random_uint()); - return 0; -} - - - - - - diff --git a/test/harness/mainfft.c b/test/harness/mainfft.c deleted file mode 100644 index ce75062c..00000000 --- a/test/harness/mainfft.c +++ /dev/null @@ -1,72 +0,0 @@ -#undef DEBUG -#include <math.h> -#include <stdlib.h> -#include <stdio.h> - -#define PI 3.14159265358979323846 - -extern void dfft(double * xr, double * xi, int np); - -double * xr, * xi; - -#ifdef DEBUG -void trace() -{ - int i; - for (i=0; i<=15; i++) printf("%d %g %g\n",i,xr[i],xi[i]); - printf("-----------\n"); -} -void print_int(int n) { printf("%d\n", n); } -void print_float(double x) { printf("%g\n", x); } -#endif - -int main(int argc, char ** argv) -{ - int n, np, npm, n2, i, j; - double enp, t, y, z, zr, zi, zm, a; - double * pxr, * pxi; - - if (argc >= 2) n = atoi(argv[1]); else n = 12; - np = 1 << n; - enp = np; - npm = np / 2 - 1; - t = PI / enp; - xr = calloc(np, sizeof(double)); - xi = calloc(np, sizeof(double)); - pxr = xr; - pxi = xi; - *pxr = (enp - 1.0) * 0.5; - *pxi = 0.0; - n2 = np / 2; - *(pxr+n2) = -0.5; - *(pxi+n2) = 0.0; - for (i = 1; i <= npm; i++) { - j = np - i; - *(pxr+i) = -0.5; - *(pxr+j) = -0.5; - z = t * (double)i; - y = -0.5*(cos(z)/sin(z)); - *(pxi+i) = y; - *(pxi+j) = -y; - } -#ifdef DEBUG - trace(); -#endif - dfft(xr,xi,np); -#ifdef DEBUG - trace(); -#endif - zr = 0.0; - zi = 0.0; - npm = np-1; - for (i = 0; i <= npm; i++ ) { - a = fabs(pxr[i] - i); - if (zr < a) zr = a; - a = fabs(pxi[i]); - if (zi < a) zi = a; - } - zm = zr; - if (zr < zi) zm = zi; - printf("%d points, error %g\n", np, zm); - return 0; -} diff --git a/test/harness/mainfib.c b/test/harness/mainfib.c deleted file mode 100644 index a736d70b..00000000 --- a/test/harness/mainfib.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> - -extern int fib(int); - -int main(int argc, char ** argv) -{ - int n, r; - if (argc >= 2) n = atoi(argv[1]); else n = 30; - r = fib(n); - printf("fib(%d) = %d\n", n, r); - return 0; -} diff --git a/test/harness/maingc.c b/test/harness/maingc.c deleted file mode 100644 index c7a2e8e1..00000000 --- a/test/harness/maingc.c +++ /dev/null @@ -1,223 +0,0 @@ -/* Test harness for the simple garbage collectors */ - -#include <stdio.h> -#include <stddef.h> -#include <stdlib.h> -#include <math.h> - -extern int init_heap(int hsize); - -enum block_kind { RAWDATA = 0, PTRDATA = 1, CLOSURE = 2 }; - -struct rootblock { - struct rootblock * next; - int numroots; - void * root[8]; -}; - -extern void * alloc_block(struct rootblock * roots, - enum block_kind kind, - int size); - -#ifdef DEBUG -extern void check_heap(void); -#endif - -void gc_alarm(int live) -{ - if (live == -1) - printf("<GC...>\n"); - else - printf("<GC...%d bytes live>\n", live); -#ifdef DEBUG - check_heap(); -#endif -} - -/* Test with binary trees */ - -typedef struct { - long i; -} boxedInt; - -boxedInt * BoxInt(struct rootblock * r, long n) -{ - boxedInt * new = (boxedInt *) alloc_block(r, RAWDATA, sizeof(long)); - new->i = n; - return new; -} - -typedef struct tn { - struct tn* left; - struct tn* right; - boxedInt * item; -} treeNode; - -treeNode* NewTreeNode(struct rootblock * r, - treeNode* left, treeNode* right, long item) -{ - struct rootblock nr; - treeNode* new; - boxedInt* bitem; - - nr.next = r; nr.numroots = 2; nr.root[0] = left; nr.root[1] = right; - - bitem = BoxInt(&nr, item); - - nr.numroots = 3; nr.root[2] = bitem; - - new = (treeNode*) alloc_block(&nr, PTRDATA, sizeof(treeNode)); - - new->left = (treeNode *) nr.root[0]; - new->right = (treeNode *) nr.root[1]; - new->item = (boxedInt *) nr.root[2]; - - return new; -} - - -long ItemCheck(treeNode* tree) -{ - if (tree->left == NULL) - return tree->item->i; - else - return tree->item->i + ItemCheck(tree->left) - ItemCheck(tree->right); -} - - -treeNode* BottomUpTree(struct rootblock * r, long item, unsigned depth) -{ - struct rootblock nr; - - if (depth > 0) { - nr.next = r; nr.numroots = 0; - nr.root[0] = BottomUpTree(&nr, 2 * item - 1, depth - 1); - nr.numroots = 1; - nr.root[1] = BottomUpTree(&nr, 2 * item, depth - 1); - nr.numroots = 2; - return NewTreeNode(&nr, - (treeNode *) nr.root[0], - (treeNode *) nr.root[1], - item); - } else { - return NewTreeNode(r, NULL, NULL, item); - } -} - -treeNode* SkinnyTree(struct rootblock * r, unsigned depth) -{ - struct rootblock nr; - - if (depth > 0) { - nr.next = r; nr.numroots = 0; - nr.root[0] = SkinnyTree(&nr, depth - 1); - nr.numroots = 1; - return NewTreeNode(&nr, - (treeNode *) nr.root[0], - (treeNode *) nr.root[0], - depth); - } else { - return NULL; - } -} - -void test(unsigned N) -{ - unsigned depth, minDepth, maxDepth, stretchDepth; - struct rootblock r; - - minDepth = 4; - - if ((minDepth + 2) > N) - maxDepth = minDepth + 2; - else - maxDepth = N; - - stretchDepth = maxDepth + 1; - - r.next = NULL; r.numroots = 0; - - r.root[0] = BottomUpTree(&r, 0, stretchDepth); - printf - ( - "stretch tree of depth %u\t check: %li\n", - stretchDepth, - ItemCheck(r.root[0]) - ); - - r.root[0] = SkinnyTree(&r, stretchDepth); - - r.root[0] = BottomUpTree(&r, 0, maxDepth); - r.numroots = 1; - - r.root[1] = SkinnyTree(&r, stretchDepth); - r.numroots = 2; - - for (depth = minDepth; depth <= maxDepth; depth += 2) { - long i, iterations, check; - - iterations = pow(2, maxDepth - depth + minDepth); - - check = 0; - - for (i = 1; i <= iterations; i++) { - r.root[2] = BottomUpTree(&r, i, depth); - check += ItemCheck(r.root[2]); - r.root[2] = BottomUpTree(&r, -i, depth); - check += ItemCheck(r.root[2]); - } - - printf - ( - "%li\t trees of depth %u\t check: %li\n", - iterations * 2, - depth, - check - ); - } - - printf - ( - "long lived tree of depth %u\t check: %li\n", - maxDepth, - ItemCheck(r.root[0]) - ); - - printf - ( - "skinny tree of depth %u\t\t check: %li\n", - stretchDepth, - ItemCheck(r.root[1]) - ); -} - -int main(int argc, char ** argv) -{ - int N, heapsize; - - N = argc > 1 ? atoi(argv[1]) : 16; - heapsize = argc > 2 ? atoi(argv[2]) : 8 * 1024 * 1024; - - if (init_heap(heapsize) == -1) { - fprintf(stderr, "Failed to allocate heap.\n"); - return 2; - } - test(N); -} - -/********************************* - -PROGRAM OUTPUT -============== -stretch tree of depth 17 check: -1 -131072 trees of depth 4 check: -131072 -32768 trees of depth 6 check: -32768 -8192 trees of depth 8 check: -8192 -2048 trees of depth 10 check: -2048 -512 trees of depth 12 check: -512 -128 trees of depth 14 check: -128 -32 trees of depth 16 check: -32 -long lived tree of depth 16 check: -1 - -***********************************/ - diff --git a/test/harness/mainintegr.c b/test/harness/mainintegr.c deleted file mode 100644 index 5f5bdfe0..00000000 --- a/test/harness/mainintegr.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> - -extern double test(int); - -int main(int argc, char ** argv) -{ - int n; double r; - if (argc >= 2) n = atoi(argv[1]); else n = 10000; - r = test(n); - printf("integr(square, 0.0, 1.0, %d) = %g\n", n, r); - return 0; -} diff --git a/test/harness/mainlists.c b/test/harness/mainlists.c deleted file mode 100644 index 281b919f..00000000 --- a/test/harness/mainlists.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <stdio.h> -#include <stddef.h> -#include <stdlib.h> - -struct cons { int hd; struct cons * tl; }; -typedef struct cons * list; - -extern list buildlist(int n); -extern list reverselist(list l); - -int checklist(int n, list l) -{ - int i; - for (i = 0; i <= n; i++) { - if (l == NULL) return 0; - if (l->hd != i) return 0; - l = l->tl; - } - return (l == NULL); -} - -int main(int argc, char ** argv) -{ - int n; - - if (argc >= 2) n = atoi(argv[1]); else n = 10; - if (checklist(n, reverselist(buildlist(n)))) { - printf("OK\n"); - return 0; - } else { - printf("Bug!\n"); - return 2; - } -} - diff --git a/test/harness/mainmanyargs.c b/test/harness/mainmanyargs.c deleted file mode 100644 index 36bcf762..00000000 --- a/test/harness/mainmanyargs.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdio.h> - -void print_int(int n) { printf("%d\n", n); } -void print_float(double n) { printf("%g\n", n); } - -extern void g(int,int,int,int,int, - double,double,double,double,double); - -int main() -{ - g(1,2,3,4,5, 0.1,0.2,0.3,0.4,0.5); - return 0; -} diff --git a/test/harness/mainqsort.c b/test/harness/mainqsort.c deleted file mode 100644 index 63a76143..00000000 --- a/test/harness/mainqsort.c +++ /dev/null @@ -1,36 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -extern void quicksort(int lo, int hi, long * data); - -int cmplong(const void * i, const void * j) -{ - long vi = *((long *) i); - long vj = *((long *) j); - if (vi == vj) return 0; - if (vi < vj) return -1; - return 1; -} - -int main(int argc, char ** argv) -{ - int n, i; - long * a, * b; - int bench = 0; - - if (argc >= 2) n = atoi(argv[1]); else n = 1000; - if (argc >= 3) bench = 1; - a = malloc(n * sizeof(long)); - b = malloc(n * sizeof(long)); - for (i = 0; i < n; i++) b[i] = a[i] = rand() & 0xFFFF; - quicksort(0, n - 1, a); - if (!bench) { - qsort(b, n, sizeof(long), cmplong); - for (i = 0; i < n; i++) { - if (a[i] != b[i]) { printf("Bug!\n"); return 2; } - } - printf("OK\n"); - } - return 0; -} diff --git a/test/harness/mainsha1.c b/test/harness/mainsha1.c deleted file mode 100644 index 845a46ae..00000000 --- a/test/harness/mainsha1.c +++ /dev/null @@ -1,75 +0,0 @@ -#include <string.h> -#include <stdio.h> -#include <stdlib.h> - -typedef unsigned int u32; - -struct SHA1Context { - u32 state[5]; - u32 length[2]; - int numbytes; - unsigned char buffer[64]; -}; - -extern void SHA1_init(struct SHA1Context * ctx); -extern void SHA1_add_data(struct SHA1Context * ctx, unsigned char * data, - unsigned long len); -extern void SHA1_finish(struct SHA1Context * ctx, unsigned char output[20]); - -static void do_test(unsigned char * txt, unsigned char * expected_output) -{ - struct SHA1Context ctx; - unsigned char output[20]; - int ok; - - SHA1_init(&ctx); - SHA1_add_data(&ctx, txt, strlen((char *) txt)); - SHA1_finish(&ctx, output); - ok = memcmp(output, expected_output, 20) == 0; - printf("Test `%s': %s\n", - (char *) txt, (ok ? "passed" : "FAILED")); -} - -/* Test vectors: - * - * "abc" - * A999 3E36 4706 816A BA3E 2571 7850 C26C 9CD0 D89D - * - * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" - * 8498 3E44 1C3B D26E BAAE 4AA1 F951 29E5 E546 70F1 - */ - -unsigned char * test_input_1 = (unsigned char *) "abc"; -unsigned char test_output_1[20] = -{ 0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E , - 0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D }; - -unsigned char * test_input_2 = (unsigned char *) - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; -unsigned char test_output_2[20] = -{ 0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E, 0xBA, 0xAE, - 0x4A, 0xA1, 0xF9, 0x51, 0x29, 0xE5, 0xE5, 0x46, 0x70, 0xF1 }; - - -static void do_bench(int nblocks) -{ - struct SHA1Context ctx; - unsigned char output[20]; - unsigned char data[64]; - - SHA1_init(&ctx); - for (; nblocks > 0; nblocks--) - SHA1_add_data(&ctx, data, 64); - SHA1_finish(&ctx, output); -} - -int main(int argc, char ** argv) -{ - if (argc < 2) { - do_test(test_input_1, test_output_1); - do_test(test_input_2, test_output_2); - } else { - do_bench(atoi(argv[1])); - } - return 0; -} diff --git a/test/harness/mainswitchtbl.c b/test/harness/mainswitchtbl.c deleted file mode 100644 index 24ba17e7..00000000 --- a/test/harness/mainswitchtbl.c +++ /dev/null @@ -1,11 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> - -extern int f(int); - -int main(int argc, char ** argv) -{ - int i; - for (i = 0; i < 10; i++) printf("%2d -> %2d\n", i, f(i)); - return 0; -} diff --git a/test/harness/marksweepcheck.c b/test/harness/marksweepcheck.c deleted file mode 100644 index 92bbfe57..00000000 --- a/test/harness/marksweepcheck.c +++ /dev/null @@ -1,119 +0,0 @@ -/* Heap checking for the mark-sweep collector */ - -#include <stdio.h> -#include <stddef.h> -#include <stdlib.h> -#include <assert.h> -#include <string.h> - -#ifdef DEBUG - -enum block_kind { RAWDATA = 0, PTRDATA = 1, CLOSURE = 2 }; -enum block_color { WHITE = 0, GRAY = 4, BLACK = 0xC }; - -#define At(p,ty) (*((ty *)(p))) -#define Kind_header(h) ((h) & 3) -#define Color_header(h) ((h) & 0xC) -#define Size_header(h) (((h) >> 2) & 0xFFFFFFFC) - -extern char * heap_start, * heap_end, * freelist_head; - -char * heap_bitmap = NULL; - -static inline void bitmap_set(char * bm, unsigned i) -{ - bm[i >> 3] |= 1 << (i & 7); -} - -static inline int bitmap_get(char * bm, unsigned i) -{ - return bm[i >> 3] & (1 << (i & 7)); -} - -static void check_block(char * p, unsigned s) -{ - char * d; - for (/**/; s > 0; p += 4, s -= 4) { - d = At(p, char *); - if (d != NULL) { - assert(d >= heap_start + 4); - assert(d <= heap_end - 4); - assert(((unsigned) d & 3) == 0); - assert(bitmap_get(heap_bitmap, (d - heap_start) >> 2)); - } - } -} - -void check_heap(void) -{ - char * p, * f, * nextf; - unsigned h, s, bitmap_size; - - bitmap_size = ((heap_end - heap_start) + 31) / 32; - /* one bit per word -> one byte per 32 bytes in the heap */ - if (heap_bitmap == NULL) { - heap_bitmap = malloc(bitmap_size); - assert (heap_bitmap != NULL); - } - memset(heap_bitmap, 0, bitmap_size); - - /* Superficial check and construction of the bitmap */ - - f = freelist_head; - assert(f >= heap_start + 4); - assert(f <= heap_end - 4); - - for (p = heap_start; p < heap_end; /**/) { - h = At(p, unsigned); - s = Size_header(h); - assert(s >= 4); - assert((s & 3) == 0); - p = p + 4; - assert (p + s <= heap_end); - if (p == f) { - /* this is a free list block */ - assert((h & 0xF) == 0); - nextf = At(p, char *); - if (nextf != NULL) { - assert(nextf > f); - assert(nextf <= heap_end - 4); - } - f = nextf; - } else { - /* this is an allocated block */ - assert(Color_header(h) == WHITE); - bitmap_set(heap_bitmap, (p - heap_start) >> 2); - } - p = p + s; - } - assert (p == heap_end); - assert (f == NULL); - - /* Check block contents */ - f = freelist_head; - for (p = heap_start; p < heap_end; /**/) { - h = At(p, unsigned); - s = Size_header(h); - p = p + 4; - if (p == f) { - /* Fill free block with garbage */ - memset(p + 4, 0xEE, s - 4); - f = At(p, char *); - } else { - /* Check block contents */ - switch (Kind_header(h)) { - case RAWDATA: - break; - case PTRDATA: - check_block(p, s); break; - case CLOSURE: - check_block(p + 4, s - 4); break; - default: - assert(0); - } - } - p = p + s; - } -} - -#endif diff --git a/test/littlesemantics/Makefile b/test/littlesemantics/Makefile deleted file mode 120000 index b1ee4611..00000000 --- a/test/littlesemantics/Makefile +++ /dev/null @@ -1 +0,0 @@ -Makefile.ppc
\ No newline at end of file diff --git a/test/littlesemantics/Makefile.orig b/test/littlesemantics/Makefile.orig deleted file mode 100644 index 95c295b1..00000000 --- a/test/littlesemantics/Makefile.orig +++ /dev/null @@ -1,41 +0,0 @@ -all : interp1 interp2 - -interp1 : little.tab.c lex.yy.o little.h little.o - cc -o interp1 little.o lex.yy.o little.tab.c - -lex.yy.c : little.flex little.tab.h - flex little.flex - -little.tab.c little.tab.h : little.y - bison -d little.y - -interp2 : little_interp.ml little_syntax.cmo little_lex.cmo little.cmo - ocamlc -o interp2 \ - little.cmo little_syntax.cmo little_lex.cmo little_interp.ml - -.SUFFIXES: # Necessary to avoid that yacc is called on the .y file -.SUFFIXES: .ml .mli .cmo .cmi .c .o -.mli.cmi : - ocamlc -c $*.mli - -.ml.cmo : - ocamlc -c $*.ml - -.c.o : - cc -c $*.c - -little_syntax.ml little_syntax.mli : little_syntax.mly little.cmo - ocamlyacc little_syntax.mly - -little_syntax.cmo : little_syntax.cmi - -little_lex.cmo : little_lex.cmi - -little_lex.ml : little_lex.mll - ocamllex little_lex.mll - -clean : - rm -f little_lex.ml little_syntax.ml little_syntax.mli \ - *.cmo *.cmi interp[12] *.o little.tab.c lex.yy.c \ - little.tab.h *.output *.log *.pdf *.dvi *.aux - diff --git a/test/littlesemantics/Makefile.ppc b/test/littlesemantics/Makefile.ppc deleted file mode 100644 index 5177a42d..00000000 --- a/test/littlesemantics/Makefile.ppc +++ /dev/null @@ -1,46 +0,0 @@ -all : interp1 interp2 - -interp1.ppc : little.tab.c lex.yy.o little.h little.s - gcc -arch ppc -o interp1.ppc little.s lex.yy.o little.tab.c -interp1 : little.tab.c lex.yy.o little.h little.o - gcc -o interp1 little.o lex.yy.o little.tab.c - -lex.yy.c : little.flex little.tab.h - flex little.flex - -little.tab.c little.tab.h : little.y - bison -d little.y - - -little.s: little.c - ../../ccomp little.c -interp2 : little_interp.ml little_syntax.cmo little_lex.cmo little.cmo - ocamlc -o interp2 \ - little.cmo little_syntax.cmo little_lex.cmo little_interp.ml - -.SUFFIXES: # Necessary to avoid that yacc is called on the .y file -.SUFFIXES: .ml .mli .cmo .cmi .c .o -.mli.cmi : - ocamlc -c $*.mli - -.ml.cmo : - ocamlc -c $*.ml - -.c.o : - gcc -c $*.c - -little_syntax.ml little_syntax.mli : little_syntax.mly little.cmo - ocamlyacc little_syntax.mly - -little_syntax.cmo : little_syntax.cmi - -little_lex.cmo : little_lex.cmi - -little_lex.ml : little_lex.mll - ocamllex little_lex.mll - -clean : - rm -f little_lex.ml little_syntax.ml little_syntax.mli \ - *.cmo *.cmi interp[1234] *.o *.s little.tab.c lex.yy.c \ - little.tab.h *.output *.log *.pdf *.dvi *.aux - diff --git a/test/littlesemantics/body.c b/test/littlesemantics/body.c deleted file mode 100644 index 69163288..00000000 --- a/test/littlesemantics/body.c +++ /dev/null @@ -1,175 +0,0 @@ -#include "string.h" -#include "stdio.h" - -#define VARIABLE_LIST 1 -#define VARIABLE_VALUE 2 -#define VARIABLE 3 -#define NUMERAL 4 -#define ADDITION 5 -#define GREATER 6 -#define ASSIGNMENT 7 -#define SEQUENCE 8 -#define WHILE 9 -#define SKIP 10 - -typedef struct term { - short select; - union { - struct term **children; - int int_val; - char *string_val; - } term_body; -} term; - -void panic(char *s) { - fprintf(stderr, "%s\n", s); - exit(-1); -} - -term *make_term(int tag) { - term *ptr; - if(!(ptr = (term *)malloc(sizeof(term)))) { - panic("allocation failed in make_term"); - } - ptr->select = tag; - return ptr; -} - -term *make_binary_term(int tag, term *i1, term *i2) { - term *ptr = make_term(tag); - if(!(ptr->term_body.children - = (term **)malloc(sizeof(term*)*2))) { - panic("could not allocate memory in make_binary_term"); - } - ptr->term_body.children[0] = i1; - ptr->term_body.children[1] = i2; - return ptr; -} - -term *variable(char *s) { - term *ptr = make_term(VARIABLE); - ptr->term_body.string_val = s; - return ptr; -} - -term *numeral(int i) { - term *ptr = make_term(NUMERAL); - ptr->term_body.int_val = i; - return ptr; -} - -term *addition(term *i1, term *i2) { - make_binary_term(ADDITION, i1, i2); -} - -term *variable_list(term *i1, term *i2) { - make_binary_term(VARIABLE_LIST, i1, i2); -} - -term *variable_value(term *i1, term *i2) { - make_binary_term(VARIABLE_VALUE, i1, i2); -} - -term *greater(term *i1, term *i2) { - make_binary_term(GREATER, i1, i2); -} - -term *assignment(term *i1, term *i2) { - make_binary_term(ASSIGNMENT, i1, i2); -} - -term *sequence(term *i1, term *i2) { - make_binary_term(SEQUENCE, i1, i2); -} - -term *term_while(term *i1, term *i2) { - make_binary_term(WHILE, i1, i2); -} - -term *skip() { - make_term(SKIP); -} - -char *variable_name(term *v) { - return (v->term_body.string_val); -} - -int numeral_value(term *t) { - return(t->term_body.int_val); -} - -term *child(term *t, int rank) { - return (t->term_body.children[rank-1]); -} - -int lookup(term *env, char *var) { - if(NULL != env) { - term *pair = child(env, 1); - if(strcmp(variable_name(child(pair, 1)), var) == 0) { - return(numeral_value(child(pair, 2))); - }else { - return lookup(child(env, 2), var); - } - } else { - fprintf(stderr, "%s : ", var); - panic("no such variable in environment for lookup"); - } -} - -term *update(term *env, char *var_name, term *val) { - if(NULL != env) { - term *var = child(child(env, 1), 1); - if(strcmp(variable_name(var), var_name) == 0) { - return(variable_list(variable_value(var, val), - child(env, 2))); - } else { - return(variable_list(child(env, 1), - update(child(env, 2), var_name, val))); - } - } else { - fprintf(stderr, "%s : ", var_name); - panic("no such variable in environment for update"); - } -} - -int evaluate(term *env, term *exp) { - int n1, n2; - switch(exp->select) { - case VARIABLE: return lookup(env, variable_name(exp)); - case NUMERAL: return numeral_value(exp); - case ADDITION: - return (evaluate(env, child(exp, 1)) + - evaluate(env, child(exp, 2))); - } -} - -int evaluate_bool(term *env, term *exp) { - int n1 = evaluate(env, child(exp, 1)); - int n2 = evaluate(env, child(exp, 2)); - return (n1 > n2); -} - -term *execute(term *env, term *inst) { - switch(inst->select) { - case ASSIGNMENT: - return update(env, - variable_name(child(inst, 1)), - numeral(evaluate(env,child(inst, 2)))); - case SEQUENCE: - return execute(execute(env,child(inst, 1)),child(inst, 2)); - case WHILE: - if(evaluate_bool(env,child(inst, 1))) { - return execute(execute(env,child(inst, 2)), inst); - } else { - return env; - } - } -} - -void print_env(term *env) { - while(env != NULL) { - printf("%s : %d\n", variable_name(child(child(env,1),1)), - numeral_value(child(child(env,1),2))); - env = child(env, 2); - } -} diff --git a/test/littlesemantics/gc.tar.gz b/test/littlesemantics/gc.tar.gz Binary files differdeleted file mode 100644 index 084e5aed..00000000 --- a/test/littlesemantics/gc.tar.gz +++ /dev/null diff --git a/test/littlesemantics/intro.tex b/test/littlesemantics/intro.tex deleted file mode 100644 index ac5bfda6..00000000 --- a/test/littlesemantics/intro.tex +++ /dev/null @@ -1,629 +0,0 @@ -\documentclass{book} -\usepackage{alltt} -\title{A practical approach to Programming Language Semantics} -\begin{document} - -The purpose of this book is to study programming language semantics -in a way that highlights the practical aspects of this field. -The main objective of programming language semantics is to understand -what programs really mean. The practical outcome of this understanding -is that programming errors can be avoided. In this book, we will actually -insist on the following aspects. - -\begin{itemize} - \item - We will show that there is a continuous progression between - conventional programs and semantic descriptions. We will start - by describing tools concerning programming languages written - as simple programs, and we will show how the same tools are - related to more theoretical descriptions of programming languages. - \item Most of the questions we will study have a practical motivation. In - general, this practical motivation will be to ensure that our tools - do what we mean. - \item Some of our work consists in mathematical proofs about programming - language descriptions. All these proofs be will implemented as formal - proofs that can be verified using a mathematical proof tool. - \item We will only describe toy languages, so that the whole content - of the book can be used as an introduction to programming language - semantics. -\end{itemize} - -We hope that this practical approach, starting with programs in -conventional programming languages to describe a toy programming -language will provide a gentle introduction to the more mathematically -designed formalisms that are customarily used to describe programming -languages and to the practice of proof-verification tools. -Our attachment to the formal verification of semantics -proofs may seem debatable: proof-checkers are still difficult to -use and the constraints imposed by proof-checking add to the -constraints imposed by the formal description of languages in ways -that may discourage students who are already intimidated by the -theoretical content of the course. We believe that this extra cost is -compensated in the following points: -\begin{itemize} - \item A formal description of the concepts being used actually makes it - possible to reduce their ``theoretical load'': the fact that some - notations are just traditions hiding simple predicates is made explicit - in a formal description. - \item Formal descriptions are unambiguous. If some explanation is not - well understood, the formal description can be consulted to disambiguate - the English-language explanations. Moreover, the dependency between - theoretical concepts and practical considerations is more explicit - in formal documents. - \item Mechanical proofs and formal descriptions provide a playground for - students to build up their own experience in extending a language, - defining a new tool, or proving extra properties of an existing - language. - \item Modern proof-checkers also provide ways to extract executable programs - from formal descriptions and proofs. This characteristic will make it - possible to re-inforce the idea that the formal semantics of programming - languages are directly related to implementing tools to - program and avoid programming errors. -\end{itemize} - -The book contain the description of three toy languages: a simple -imperative programming language, a simple theoretical language inspired -from the study of logic, and simple functional programming language; and three -formal description styles: natural semantics, denotational semantics, and -axiomatic semantics. The practical tools that we will obtain -from the formal descriptions will fall in the following categories: -\begin{itemize} - \item Interpreters, that is, tools that execute programs, - \item Compilers, that is, tools that translate programs in other - languages, - \item Static analyzers, that is tools that help make sure that programs - do not contains certain categories of errors. -\end{itemize} -The purpose of mechanical verification of programming language semantics -will be to ensure that these tools respect the intending meaning of programs. - -\chapter{A simple imperative programming language} -\section{An informal description} -We want to study a small programming language whose only instructions -are sequences of assignments to memory locations, possibly repeated inside -loops that are terminated when a test is satisfied. -The values stored in each location will be integers, and for now, we will -assume that the only operations available are additions and the only -tests are strict comparison. Here are a few examples of such instructions. - -\begin{itemize} - \item A program to compute a multiplication, -\begin{verbatim} -z:=0; while x > z do t := y + t; z:=z+1 done -\end{verbatim} -If {\tt x} contains a positive value, a machine executing this program -should terminate in a state where {\tt t} contains the product of the values -in {\tt y} and {\tt x}. -\item A program to compute a square root, -\begin{verbatim} -y:=0; s := 1; - while x > s do - s:=0; y:=y+1; z:=0; - while y > z do s := y+s; z:= z+1 done -done -\end{verbatim} -If {\tt x} contains a positive value, a machine executing this program -should terminate in a state where {\tt y} contains the greatest integer -whose square is smaller than the value in {\tt x}. -\end{itemize} - -These instructions are incomplete in the sense that they do not -indicate what are all the initial values of the memory locations they -refer to. To make complete programs we will choose to associate -an instruction with a declaration of variables. Programs will thus -look as follows: -\begin{verbatim} -Variables - x=10 y=0 s=1 -in -while s < x do - s := 0; y:=y+1; z:=0; - while z < y do s := y+s; z:= z+1 done -done -\end{verbatim} - -Our programming language does not contain a conditional statement. -This statement can be simulated with the help -of while loops and describing the same language with an extra -conditional statement is not more difficult, just longer. - -\section{An interpreter, written in C} -\subsection{Representing programs} -In our interpreter, we want to have an abstract view of programs: -we don't need to know whether programs were written all in one line or -whether a lot of space was used to separate the location name from the -assignment sign in an assignment instruction. Actually, we don't even -need to know whether assignments are written with {\tt :=} (as in Pascal) -or {\tt =} (as in C). The tradition is simply to describe programs -as term structures, where each term has a label (to indicate what kind -of term it is) and a collection of subterms. For our simple programming -language the various kinds of terms available are as follows: -\begin{itemize} - \item {\tt VARIABLE\_LIST}, this term is used to hold all the variable - declarations at the beginning of a program. Terms of this kind contain - a first subterm that describes the declaration of a single variable and - a second subterm that describes the rest of the declarations. A variable - list is thus expected to be a nested collection of terms of kind - {\tt VARIABLE\_LIST}, - \item {\tt VARIABLE\_VALUE}, this term is used to hold the pair of a variable - and a value in a single variable declaration. Terms of this kind have - two subterms where the first one should be a variable and the second - should be a numeral. - \item {\tt NUMERAL}, this term is used to hold a number when it appears - in an assignment, a comparison or an addition. Terms of this kind - contain an integer value, - \item {\tt VARIABLE}, this term is used to hold a memory location name. - Terms of this kind contain a string, - \item {\tt ADDITION}, this term is used to hold an addition. Terms of - this kind have two subterms, which can themselves be other additions, - variables, or numerals, - \item {\tt GREATER}, this term is used to hold a comparison. Terms - of this kind have two subterms, which can be additions, variables, or - numerals, - \item {\tt ASSIGNMENT}, this term is used to hold the instruction - assigning a value to a variable. Terms of this kind contain two - subterms, where the first one is the variable being assigned to, and - the second is the expression that needs to be evaluated in order to - produce the value that is given to the variable, - \item {\tt SEQUENCE}, this term is used to hold two instructions that - should be executed one after the other. Terms of this kind contain - two subterms, which can themselves be sequences, while terms, - assignments, or skip statements, - \item {\tt WHILE}, this term is used to hold a while loop instruction. - Terms of this kind contain two subterms, where the first one is - a comparison (a term of the kind {\tt GREATER}) and the second one - is itself a while instruction, a sequence, an assignment, or a skip - statement, - \item {\tt SKIP}, this term is used to hold an instruction that does - nothing. Terms of this kind have no subterms. -\end{itemize} - -To keep track of these various kinds we define a collection of constant -macros in our C program: - -\begin{verbatim} -#define VARIABLE_LIST 1 -... -#define WHILE 9 -#define SKIP 10 -\end{verbatim} - -We then define a data-structure that corresponds to these terms. In -this definition, we take into account the fact that a term contains -either two subterms, a numeral, or a string of characters. - -\begin{verbatim} - typedef struct term { - short select; - union { - struct term **children; - int int_val; - char *string_val; - } term_body; -} term; -\end{verbatim} - -We then define a collection of functions that construct terms: -the function {\tt numeral} takes an integer as argument and -it constructs a term whose {\tt select} field is {\tt NUMERAL} and whose -value is the given integer. Similarly, a function {\tt sequence} -takes two term arguments and construct a new term that represents the sequence -of these two arguments. In fact, all constructors rely on the following -{\tt make\_term} function. -\begin{verbatim} -term *make_term(int tag) { - term *ptr; - if(!(ptr = (term *)malloc(sizeof(term)))) { - panic("allocation failed in make_term"); - } - ptr->select = tag; - return ptr; -} -\end{verbatim} -The {\tt panic} procedure used in this function simply reports the error -message in terminates the interpreter. The binary constructors rely on -the following {\tt make\_binary\_term} function: -\begin{verbatim} -term *make_binary_term(int tag, term *i1, term *i2) { - term *ptr = make_term(tag); - if(!(ptr->term_body.children - = (term **)malloc(sizeof(term*)*2))) { - panic("could not allocate memory in make_binary_term"); - } - ptr->term_body.children[0] = i1; - ptr->term_body.children[1] = i2; - return ptr; -} -\end{verbatim} -For instance, the {\tt variable} and {\tt addition} functions -are defined as follows: -\begin{verbatim} -term *variable(char *s) { - term *ptr = make_term(VARIABLE); - ptr->term_body.string_val = s; - return ptr; -} - -term *addition(term *i1, term *i2) { - make_binary_term(ADDITION, i1, i2); -} -\end{verbatim} - -Once we have defined all the constructors, we can combine them to build -large terms. For instance, the multiplication program is built by -the following C expression: - -\begin{verbatim} -sequence(assignment(variable("z"),numeral(0)), - term_while(greater(variable("x"),variable("z")), - sequence( - assignment(variable("t"), - addition(variable("y"),variable("t"))), - assignment(variable("z"), - addition(variable("z"),numeral(1)))))) -\end{verbatim} -\subsection{Navigating in programs} -When we have a term representing a program fragment, we access its -sub-expressions using a function {\tt child} that has the following -definition, such that executing -\begin{verbatim} - child(assignment(variable("z"),numeral(1)),2) -\end{verbatim} -should return the same term as executing -\begin{verbatim} - numeral(1) -\end{verbatim} -The function {\tt child} is defined as follows: -\begin{verbatim} -term *child(term *t, int rank) { - return (t->term_body.children[rank-1]); -} -\end{verbatim} - -We also define two functions {\tt variable\_name} and -{\tt numeral\_value} to map terms of kind {\tt VARIABLE} and -{\tt NUMERAL} to the values of type {\tt string} and {\tt int}, -respectively, that they contain: -\begin{verbatim} -char *variable_name(term *t) { - return(t->term_body.string_val); -} - -int numeral_value(term *t) { - return(t->term_body.int_val); -} -\end{verbatim} -\subsection{Execution environments} -To simulate the execution of programs, we simply want to view their -effect as modifying a collection of memory locations. We don't need -to know how these locations are laid out in memory, we simply need -to record the fact that some variable is associated to some integer -value. To keep this record, we construct a simply linked list using terms -of kind {\tt variable\_list} and {\tt variable\_value}. We -use the same kind of binary terms as for the program structure to -represent these lists. To represent the end of such a list, we use the -conventional NULL pointer. - -With these conventions, we can build the representation of a state where -the location {\tt x} contains 0 and the location {\tt y} contains 2 as -follows: -\begin{verbatim} -variable_list(variable_value(variable("x"),numeral(0)), - variable_list(variable_value(variable("y"),numeral(2)),NULL)) -\end{verbatim} - -Given an arbitrary variable, we often need to compute the value -associated to this variable in a given environment. The following -C function performs this task by navigating the list structure and -stopping as soon as it finds a pair of a variable and a value that -corresponds to the variable we are looking for and returns the -corresponding integer. -\begin{verbatim} -int lookup(term *env, char *var) { - while(NULL != env) { - term *pair = child(env, 1); - if(strcmp(variable_name(child(pair, 1)), var)==0) { - return numeral_value(child(pair, 2)); - } else { - env = child(env, 2); - } - } - fprintf(stderr, "%s : ", var); - panic("no such variable in environment for lookup"); -} -\end{verbatim} -In this function, we use the function {\tt strcmp} from the -standard {\tt string} library of the C language. This function -is used to compare two strings, it returns 0 if, and only if, the two -strings are the same. - -Similarly, we will also need to construct a new environment that -only differs from a previous one in the fact the value of a single -variable has changed. We want this function to map the environment -\begin{verbatim} -variable_list(variable_value(variable("x"),numeral(0)), - variable_list(variable_value(variable("y"),numeral(2)),NULL)), -\end{verbatim} -the variable {\tt y} and the value {\tt 4} to the environment -\begin{verbatim} -variable_list(variable_value(variable("x"),numeral(0)), - variable_list(variable_value(variable("y"),numeral(4)),NULL)), -\end{verbatim} - - -Such a mapping is described with the following function: -\begin{verbatim} -term *update(term *env, char *var_name, term *val) { - if(NULL != env) { - term *var = child(child(env, 1), 1); - if(strcmp(variable_name(var), var_name) == 0) { - return(variable_list(variable_value(var, val), - child(env, 2))); - } else { - return(variable_list(child(env, 1), - update(child(env, 2), var_name, val))); - } - } else { - fprintf(stderr, "%s : ", var_name); - panic("no such variable in environment for update"); - } -} -\end{verbatim} -\subsection{Evaluating expressions} -Consider the following program: -\begin{verbatim} -x := 1; -y := 2; -x := (x + y) + 1; -y := (x + y) + 1 -\end{verbatim} -The first time the expression {\tt x + y} is executed, on the third line, -the result should be be 4. The second time this expression is executed, -on the fourth line, the result should be 7. The evaluation of expressions -needs to take into account the value of variables. This is the reason -why we have an environment data structure, to keep track of the -value of all the variables used in the program. - -In our language there are three kinds of expressions. For variables, -we need to look in the environment to know the value that is currently -recorded. We can use the {\tt lookup} function that was defined in the -previous section. - -When the expression we want to evaluate is numeral, the value is -simply the value of this numeral. On the other hand, when the -expression is an addition, we need first to evaluate the two -components of the expression. This returns integer values that we can -add to obtain the value of the whole addition expression. Thus, the -function that evaluates the expressions is a recursive function. -This is easily described with the following function: -\begin{verbatim} -int evaluate(term *env, term *exp) { - int n1, n2; - switch(exp->select) { - case VARIABLE: return lookup(env, variable_name(exp)); - case NUMERAL: return numeral_value(exp); - case ADDITION: - return (evaluate(env, child(exp, 1)) + - evaluate(env, child(exp, 2))); - } -} -\end{verbatim} -We also need to evaluate comparison expressions and return a boolean value. -The function that implements this simply needs to evaluate the two -expressions that need to be compared in a given environment and then -compare the integer values that are received. Here is this function's -code: -\begin{verbatim} -int evaluate_bool(term *env, term *exp) { - int n1 = evaluate(env, child(exp, 1)); - int n2 = evaluate(env, child(exp, 2)); - return (n1 > n2); -} -\end{verbatim} - -\subsection{Executing instructions} -We now have enough functions to describe the behavior of the three instructions -in our language. We want to define a function {\tt execute} that takes -two arguments, an environment and an instruction. For instance, when -applied to the environment -\begin{verbatim} -variable_list(variable_value(variable("x"),numeral(0)), - variable_list(variable_value(variable("y"),numeral(2)),NULL)), -and the instruction -\begin{verbatim} - assignment(variable("x",addition(variable("y"),numeral(2))) -\end{verbatim} -we want this function {\tt execute} to return the following environment -\begin{verbatim} -variable_list(variable_value(variable("x"),numeral(0)), - variable_list(variable_value(variable("y"),numeral(4)),NULL)). -\end{verbatim} -\begin{enumerate} -\item To execute an assignment instruction in a given environment, -we simply need to evaluate the expression that occurs as this assignment's -right-hand side (using the {\tt evaluate} function) and then to -construct a new environment where only the assigned variable is changed -(using the {\tt update} function), -\item To execute a sequence of two instructions, we need to execute the -first instruction and collect the resulting environment. The second -instruction must then be executed, but in that intermediate environment. -\item To execute a while loop, we need to evaluate the condition as -a boolean expression. If the value of this expression is false, then -we can return the input environment: the loop terminates without modifying -its execution environment. If the value of the expression is true, then -the body of the while loop needs to be executed, the resulting environment -must be collected, and the while loop must be executed again, starting -from that environment. -\end{enumerate} -These behaviors can be expressed very neatly by a simple composition of -the functions, including the recursive calls of the execution function -that is being defined: -\begin{verbatim} -term *execute(term *env, term *inst) { - switch(inst->select) { - case ASSIGNMENT: - return update(env, - variable_name(child(inst, 1)), - numeral(evaluate(env,child(inst, 2)))); - case SEQUENCE: - return execute(execute(env,child(inst, 1)),child(inst, 2)); - case WHILE: - if(evaluate_bool(env,child(inst, 1))) { - return execute(execute(env,child(inst, 2)), inst); - } else { - return env; - } - } -} -\end{verbatim} -\subsection{Practical aspects: adding a parser} -It is not practical to test our interpreter if we have to build C -expressions by combining the term constructors in a C program, recompile -this C program and observe the result with the navigating functions. -A practical alternative is to define a parser to read in programs written -in a readable syntax and combine this parser with a the {\tt execute} -function. We use the Bison tool to add a simple parser to this interpreter. -For instance, the parsing rules for instructions have the following -shape -\begin{verbatim} -nst: identifier T_ASSIGN exp {$$ = assignment($1,$3); } -| inst T_SCOLUMN inst {$$ = sequence($1,$3); } -| T_WHILE b_exp T_DO inst T_DONE {$$ = term_while($2,$4); } -| T_SKIP { $$ = skip(); } -| T_OPEN_B exp T_CLOSE_B { $$ = $2; } -\end{verbatim} -For most parsing rules, the associated semantic action is simply a -term constructor, except for rules that are concerned with parentheses or -brackets, like the last parsing rule above. - -The semantic rule for the program construct triggers -the execution of the program with the initial state given by the -list of variables that was parsed (this list is reversed, because -our parser stores the variable declarations in the wrong order). -\begin{verbatim} -program : T_VARIABLES environment T_IN inst T_END -{ print_env(execute(revert_env($2), $4)); exit(0); } -; -\end{verbatim} -\section{The interpreter in OCaml} -In the OCaml language, defining the terms and the constructors is -directly done with a type definition: -\begin{verbatim} -type exp = - Addition of exp*exp | Numeral of int | Variable of string;; -type b_exp = Greater of exp*exp;; -type inst = - Assignment of string * exp | Sequence of inst * inst -| While of b_exp * inst | Skip;; -\end{verbatim} -We simply use the pre-defined type of lists to represent environments, -in fact we use lists of pairs, where the first component is a string -and the second argument is a integer. -\begin{verbatim} -type environment = (string * int) list;; -\end{verbatim} -With this data-structure, the functions {\tt lookup} and {\tt update} -are defined as follows: -\begin{verbatim} -let rec lookup (env:environment) (var:string) = - match env with - [] -> failwith(var ^ - " : no such variable in environment for lookup") - | (a,v)::tl -> if a = var then v else lookup tl var;; - -let rec update (env:environment) (var:string) (n:int) = - match env with - [] -> failwith(var ^ - " : no such variable in environment for update") - | ((a,v) as pair)::tl -> - if a = var then - (a,n)::tl - else - pair::(update tl var n);; -\end{verbatim} -The programming style of OCaml relies on pattern matching construct, -with specific syntax to describe lists. Thus the expression -\begin{alltt} - match env with [] -> \(e\sub{1}\) | a::tl -> \(e\sub{2}\) -\end{alltt} -means ``if the input data is an empty list, then return the -value of \(e_1\), otherwise, let {\tt a} be the first element of -the list and {\tt tl} be the second element, compute the value -of \(e_2\), which may depend on the value of {\tt a} and {\tt tl}, -and return this value. In the functions, we know that the elements -of the lists being processed are pairs and the pattern-matching -construct also makes it possible to access the components of -the first pair element concisely. - -The pattern-matching construct makes it possible to write the -functions more concisely than in the C programming language. This -conciseness also helps in the description of the {\tt evaluate}, -{\tt b\_evaluate}, and {\tt execute} functions. -\begin{verbatim} -let rec evaluate (env:environment)(e:exp) = - match e with - Numeral n -> n - | Variable s -> lookup env s - | Addition(e1,e2) -> evaluate env e1 + evaluate env e2;; - -let evaluate_bool (env:environment)(e:b_exp) = - match e with - Greater(e1,e2) -> evaluate env e1 > evaluate env e2;; - -let rec execute (env:environment)(i:inst) = - match i with - Skip -> env - | Assignment(s,e) -> update env s (evaluate env e) - | Sequence(i1,i2) -> execute (execute env i1) i2 - | While(b,i) as it -> - if (evaluate_bool env b) then - execute (execute env i) it - else - env;; -\end{verbatim} -The OCaml tools suite also provide means to define parsers. We -used the {\tt ocamlyacc} tool which is close to {\tt bison}. In all, -we are able to define the same interpreter more concisely with the -OCaml language. - -\section{An interpreter written in Prolog} -The Prolog programming style relies on the possibility to define -predicates with multiple arguments. Very often, these predicates -can be used to describe functions, when the last argument is actually -viewed as the result of processing the previous argument. - -Predicates are usually described in a style that is closed to OCaml's -pattern-matching. Thus, we will consider a predicate {\tt lookup} -with three arguments, so that {\tt lookup(E,X,V)} can be read as -``the value of {\tt X} in the environment {\tt E} is {\tt V}. -This predicated can actually be defined with the following two clauses. -\begin{verbatim} -lookup([(X,V)|_], X, V) :- ! . -lookup([(Y,_)|Tl], X, V) :- lookup(Tl, X, V). -\end{verbatim} -Prolog's treatement of definitions is that when a question is asked, the -defining clauses are tried to solve the question. The bang ponctuation -means that no other clause should be tested if this one succeeded. In -effect, this ensures that the second clause is applied only when {\tt X} -and {\tt Y} have different values. The {\em anonymous} variable ``{\tt \_}'' -is used to indicate that the value found in the question where this -variable lies is not important. The two clauses defining {\tt lookup} -can be read as follows: ``in any environment that is a list with -a first pair ({\tt X}, {\tt V}), the value of the variable {\tt X} is {\tt V}. -When the previous rule does not apply (when {\tt X} is different from {\tt Y}, -the value of {\tt Y} in an environment that starts with a pair -of {\tt Y} and any value and whose tail is an environment {\tt Tl}, -the value of the variable {\tt X} is the same as the value it would -have in the environment {\tt Tl}. - -Thus, in Prolog, the notation {\tt :-} can be read as an {\em if} -construct. - -We can define the operation of updating environments similarly: -\begin{verbatim} -update([(X,_)|Tl], X, V1, [(X,V1)|Tl]) :- !. -update([(Y,V)|Tl], X, V1, [(Y,V)|Tl1]) :- - update(Tl, X, V1, Tl1). -\end{verbatim} - -\end{document} diff --git a/test/littlesemantics/little.c b/test/littlesemantics/little.c deleted file mode 100644 index cb89de8c..00000000 --- a/test/littlesemantics/little.c +++ /dev/null @@ -1,181 +0,0 @@ -#include "string.h" -#include "stdio.h" - -#define VARIABLE_LIST 1 -#define VARIABLE_VALUE 2 -#define VARIABLE 3 -#define NUMERAL 4 -#define ADDITION 5 -#define GREATER 6 -#define ASSIGNMENT 7 -#define SEQUENCE 8 -#define WHILE 9 -#define SKIP 10 - -typedef struct term { - short select; - union { - struct term **children; - int int_val; - char *string_val; - } term_body; -} term; - -void panic(char *s) { - /*fprintf(stderr, "%s\n", s);*/ - printf( "%s\n", s); - exit(-1); -} - -term *make_term(int tag) { - term *ptr; - - if(!(ptr = (term *)malloc(sizeof(term)))) { - panic("allocation failed in make_term"); - } - ptr->select = tag; - return ptr; -} - -term *make_binary_term(int tag, term *i1, term *i2) { - term *ptr = make_term(tag); - if(!(ptr->term_body.children - = (term **)malloc(sizeof(term*)*2))) { - panic("could not allocate memory in make_binary_term"); - } - ptr->term_body.children[0] = i1; - ptr->term_body.children[1] = i2; - return ptr; -} - -term *variable(char *s) { - term *ptr = make_term(VARIABLE); - ptr->term_body.string_val = s; - return ptr; -} - -term *numeral(int i) { - term *ptr = make_term(NUMERAL); - ptr->term_body.int_val = i; - return ptr; -} - -term *addition(term *i1, term *i2) { - return make_binary_term(ADDITION, i1, i2); -} - -term *variable_list(term *i1, term *i2) { - return make_binary_term(VARIABLE_LIST, i1, i2); -} - -term *variable_value(term *i1, term *i2) { - return make_binary_term(VARIABLE_VALUE, i1, i2); -} - -term *greater(term *i1, term *i2) { - return make_binary_term(GREATER, i1, i2); -} - -term *assignment(term *i1, term *i2) { - return make_binary_term(ASSIGNMENT, i1, i2); -} - -term *sequence(term *i1, term *i2) { - return make_binary_term(SEQUENCE, i1, i2); -} - -term *term_while(term *i1, term *i2) { - return make_binary_term(WHILE, i1, i2); -} - -term *skip() { - return make_term(SKIP); -} - -char *variable_name(term *v) { - return (v->term_body.string_val); -} - -int numeral_value(term *t) { - return(t->term_body.int_val); -} - -term *child(term *t, int rank) { - return (t->term_body.children[rank-1]); -} - -int lookup(term *env, char *var) { - while(NULL != env) { - term *pair = child(env, 1); - if(strcmp(variable_name(child(pair, 1)), var)==0) { - return numeral_value(child(pair, 2)); - } else { - env = child(env, 2); - } - } - /* fprintf(stderr, "%s : ", var);*/ - printf( "%s : ", var); - panic("no such variable in environment for lookup"); -} - -term *update(term *env, char *var_name, term *val) { - if(NULL != env) { - term *var = child(child(env, 1), 1); - if(strcmp(variable_name(var), var_name) == 0) { - return(variable_list(variable_value(var, val), - child(env, 2))); - } else { - return(variable_list(child(env, 1), - update(child(env, 2), var_name, val))); - } - } else { - /*fprintf(stderr, "%s : ", var_name);*/ -printf( "%s : ", var_name); - panic("no such variable in environment for update"); - } -} - -int evaluate(term *env, term *exp) { - int n1, n2; - switch(exp->select) { - case VARIABLE: return lookup(env, variable_name(exp)); - case NUMERAL: return numeral_value(exp); - case ADDITION: - return (evaluate(env, child(exp, 1)) + - evaluate(env, child(exp, 2))); - } -} - -int evaluate_bool(term *env, term *exp) { - int n1 = evaluate(env, child(exp, 1)); - int n2 = evaluate(env, child(exp, 2)); - return (n1 > n2); -} - -term *execute(term *env, term *inst) { - switch(inst->select) { - case ASSIGNMENT: - return update(env, - variable_name(child(inst, 1)), - numeral(evaluate(env,child(inst, 2)))); - case SEQUENCE: - return execute(execute(env,child(inst, 1)),child(inst, 2)); - case WHILE: - if(evaluate_bool(env,child(inst, 1))) { - return execute(execute(env,child(inst, 2)), inst); - } else { - return env; - } - } -} - -void print_env(term *env) { - - while(env != NULL) { - printf("%s : %d\n", variable_name(child(child(env,1),1)), - numeral_value(child(child(env,1),2))); - env = child(env, 2); - } -} - - diff --git a/test/littlesemantics/little.flex b/test/littlesemantics/little.flex deleted file mode 100644 index 57a1e0cd..00000000 --- a/test/littlesemantics/little.flex +++ /dev/null @@ -1,41 +0,0 @@ -%option noyywrap -%{ -#include <string.h> -#include "little.tab.h" -extern char* lextext; -extern int lexnum; -%} - - -DIGIT [0-9] -ID [A-Za-z_][A-Za-z_0-9]* - -%% - --?{DIGIT}+ { lexnum = atoi(yytext); return NUM; } -"while" { return T_WHILE; } -"do" { return T_DO; } -"done" { return T_DONE; } -"end" { return T_END; } -"in" { return T_IN; } -"skip" { return T_SKIP; } -"variables" {return T_VARIABLES; } -":=" {return T_ASSIGN; } -">" {return T_GT; } -";" {return T_SCOLUMN;} -"+" {return T_PLUS;} -"(" {return T_OPEN;} -")" {return T_CLOSE;} -"{" {return T_OPEN_B;} -"}" {return T_CLOSE_B;} -[ \t\n] -{ID} { if(!(lextext =(char*)malloc(yyleng*sizeof(char)))) { - printf("failed memory allocation for variable %s", yytext); - exit(-1); - } - memcpy(lextext, yytext, yyleng); - return(ID); -} - -%% - diff --git a/test/littlesemantics/little.h b/test/littlesemantics/little.h deleted file mode 100644 index cbbd5185..00000000 --- a/test/littlesemantics/little.h +++ /dev/null @@ -1,32 +0,0 @@ -#include <stdio.h> -#include <string.h> - -typedef struct term { - short select; - union { - struct term **children; - int int_val; - char *string_val; - } term_body; -} term; - -term *true(); -term *false(); -term *numeral(int i); -term *variable(char *s); -char *variable_name(term *t); -int numeral_value(term *t); -term *variable_list(term *i1, term *i2); -term *greater(term *i1, term *i2); -term *addition(term *i1, term *i2); -term *skip(); -term *assignment(term *i1, term *i2); -term *sequence(term *i1, term *i2); -term *term_while(term *i1, term *i2); -term *variable_value(term *i1, term *i2); - -term *child(term *t, int rank); -term *lookup(term *env, char *var); -term *update(term *env, char *var_name, term *val); -term *evaluate(term *env, term *exp); -term *execute(term *env, term *inst); diff --git a/test/littlesemantics/little.ml b/test/littlesemantics/little.ml deleted file mode 100644 index 1a7a77ec..00000000 --- a/test/littlesemantics/little.ml +++ /dev/null @@ -1,43 +0,0 @@ -type exp = Addition of exp*exp | Numeral of int | Variable of string;; -type b_exp = Greater of exp*exp;; -type inst = Assignment of string * exp | Sequence of inst * inst - | While of b_exp * inst | Skip;; - -type environment = (string * int) list;; - -let rec lookup (env:environment) (var:string) = - match env with - [] -> failwith(var ^ " : no such variable in environment for lookup") - | (a,v)::tl -> if a = var then v else lookup tl var;; - -let rec update (env:environment) (var:string) (n:int) = - match env with - [] -> failwith(var ^ " : no such variable in environment for update") - | ((a,v) as pair)::tl -> - if a = var then (a,n)::tl else pair::(update tl var n);; - -let rec evaluate (env:environment)(e:exp) = - match e with - Numeral n -> n - | Variable s -> lookup env s - | Addition(e1,e2) -> evaluate env e1 + evaluate env e2;; - - -let evaluate_bool (env:environment)(e:b_exp) = - match e with - Greater(e1,e2) -> evaluate env e1 > evaluate env e2;; - -let rec execute (env:environment)(i:inst) = - match i with - Skip -> env - | Assignment(s,e) -> update env s (evaluate env e) - | Sequence(i1,i2) -> execute (execute env i1) i2 - | While(b,i) as it -> - if (evaluate_bool env b) then - execute (execute env i) it - else - env;; - -let print_env = - List.iter - (fun (s,n) -> print_string (s ^ " : " ^ (string_of_int n) ^ "\n"));; diff --git a/test/littlesemantics/little.y b/test/littlesemantics/little.y deleted file mode 100644 index 0c4bd610..00000000 --- a/test/littlesemantics/little.y +++ /dev/null @@ -1,61 +0,0 @@ -%{ -#include <stdio.h> -#include <string.h> -#include "little.h" -#define YYSTYPE term * - - char *lextext; - int lexnum; - - term *revert_env(term *t) { - term *r = NULL, *t1; - while(NULL != t) { - t1 = r; - r = t; - t = child(t,2); - r->term_body.children[1] = t1; - } - return r; - } - - void yyerror(char const *s) { - fprintf(stderr, "%s\n", s); - } -%} - -%token T_VARIABLES T_IN T_END T_WHILE T_DO T_DONE T_GT -%token T_ASSIGN T_PLUS T_SCOLUMN T_OPEN T_CLOSE T_OPEN_B T_CLOSE_B -%token T_SKIP NUM ID -%left T_PLUS -%right T_SCOLUMN -%% -program : T_VARIABLES environment T_IN inst T_END -{ print_env(execute(revert_env($2),$4)); exit(0) } -; -b_exp: exp T_GT exp {$$=greater($1, $3); } -; -num : NUM { $$=numeral(lexnum); } -; -identifier : ID { $$=variable(lextext); } -; -variable_value : identifier num { $$=variable_value($1,$2);} -; -environment : variable_value { $$ = variable_list($1, NULL); } -| environment T_SCOLUMN variable_value { $$ = variable_list($3, $1); } -; -inst: identifier T_ASSIGN exp {$$ = assignment($1,$3); } -| inst T_SCOLUMN inst {$$ = sequence($1,$3); } -| T_WHILE b_exp T_DO inst T_DONE {$$ = term_while($2,$4); } -| T_SKIP { $$ = skip(); } -| T_OPEN_B exp T_CLOSE_B { $$ = $2; } -; -exp: num {$$= $1;} -| identifier {$$=$1; } -| exp T_PLUS exp {$$=addition($1, $3); } -| T_OPEN exp T_CLOSE { $$= $2; } -; -%% - -main(int argc, char **argv) { - yyparse(); -} diff --git a/test/littlesemantics/little_interp.ml b/test/littlesemantics/little_interp.ml deleted file mode 100644 index de861419..00000000 --- a/test/littlesemantics/little_interp.ml +++ /dev/null @@ -1,4 +0,0 @@ - -try - Little_syntax.main Little_lex.token (Lexing.from_channel stdin) -with Parsing.Parse_error -> print_string("parsing_error\n");; diff --git a/test/littlesemantics/little_lex.mli b/test/littlesemantics/little_lex.mli deleted file mode 100644 index c4f15d78..00000000 --- a/test/littlesemantics/little_lex.mli +++ /dev/null @@ -1,3 +0,0 @@ -open Little_syntax - -val token : Lexing.lexbuf -> token diff --git a/test/littlesemantics/little_lex.mll b/test/littlesemantics/little_lex.mll deleted file mode 100644 index 2d6a85e0..00000000 --- a/test/littlesemantics/little_lex.mll +++ /dev/null @@ -1,23 +0,0 @@ -{ -open Little_syntax;; -} -rule token = parse - [ ' ' '\t' '\n' ] {token lexbuf} - | "variables" {T_VARIABLES} - | "in" {T_IN} - | "end" {T_END} - | "while" {T_WHILE} - | "do" {T_DO} - | "done" {T_DONE} - | ">" {T_GT} - | ":=" {T_ASSIGN} - | "+" {T_PLUS} - | ";" {T_SCOLUMN} - | "(" {T_OPEN} - | ")" {T_CLOSE} - | "{" {T_OPEN_B} - | "}" {T_CLOSE_B} - | "skip" {T_SKIP} - | "-"?['0'-'9']+ {NUM(int_of_string (Lexing.lexeme lexbuf))} - | ['a'-'z''A'-'Z']['a'-'z' 'A'-'Z' '0'-'9' '_']* - {ID(Lexing.lexeme lexbuf)} diff --git a/test/littlesemantics/little_syntax.mly b/test/littlesemantics/little_syntax.mly deleted file mode 100644 index 65575776..00000000 --- a/test/littlesemantics/little_syntax.mly +++ /dev/null @@ -1,42 +0,0 @@ -%{ - open List;; - open Little;; -%} -%token T_VARIABLES T_IN T_END T_WHILE T_DO T_DONE T_ASSIGN T_PLUS -%token T_SCOLUMN T_OPEN T_CLOSE T_OPEN_B T_CLOSE_B T_SKIP T_GT -%token <int> NUM -%token <string> ID -%left T_PLUS -%right T_SCOLUMN -%type <unit> main -%type <Little.inst> inst -%start main -%type <int> num -%type <string> identifier -%% -main : T_VARIABLES environment T_IN inst T_END -{ (print_env(execute(rev $2) $4); exit(0)) } -; -num : NUM { $1 } -; -identifier : ID { $1 } -; -variable_value : identifier num { ($1, $2) } -; -environment : { [] } -| environment variable_value { $2::$1 } -; -inst: identifier T_ASSIGN exp { Assignment($1,$3) } -| inst T_SCOLUMN inst { Sequence($1,$3) } -| T_WHILE b_exp T_DO inst T_DONE { While($2,$4) } -| T_SKIP { Skip } -| T_OPEN_B inst T_CLOSE_B { $2 } -; -exp: num { Numeral($1) } -| identifier { Variable($1) } -| exp T_PLUS exp { Addition($1, $3); } -| T_OPEN exp T_CLOSE { $2 } -; -b_exp: exp T_GT exp { Greater($1, $3) } -; -%% diff --git a/test/littlesemantics/main.c b/test/littlesemantics/main.c deleted file mode 100644 index 5749cb25..00000000 --- a/test/littlesemantics/main.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdio.h> -#include "little.h" - -main() { - term *t; - t = variable("a"); - - if(NULL == t) { - printf("call to a term constructor returns a NULL pointer"); - } else { - printf("a variable whose name is %s\n", t->term_body.string_val); - } -} diff --git a/test/c/Results/initializers b/test/regression/Results/initializers Binary files differindex 979eff32..979eff32 100644 --- a/test/c/Results/initializers +++ b/test/regression/Results/initializers diff --git a/test/c/initializers.c b/test/regression/initializers.c index 97ce99b0..97ce99b0 100644 --- a/test/c/initializers.c +++ b/test/regression/initializers.c diff --git a/test/regression/pragmas.c b/test/regression/pragmas.c new file mode 100644 index 00000000..43daa32a --- /dev/null +++ b/test/regression/pragmas.c @@ -0,0 +1,48 @@ +/* Default sections */ + +int a; /* small data */ +const double b = 2.718; /* ro small data */ +int c[4]; /* large data */ +const char d[12]; /* ro large data */ + +double g(void) { return a + b; } + +/* Custom sections */ + +#pragma section MYCODE ".mycode" ".mycode" standard RX +#pragma section MYDATA ".mydata_i" ".mydata_u" far-absolute RW +#pragma section MYCONST ".myconst" ".myconst" far-absolute R +#pragma section MYSDA ".mysda_i" ".mysda_u" near-data RW + +#pragma use_section MYDATA x, y +int x; +double y = 3.14; + +#pragma use_section MYCONST z +char z[4] = { 'a', 'b', 'c', 'd' }; + +#pragma use_section MYSDA u +int u; + +#pragma use_section MYCODE f +int f(int n) +{ + x += n; + u -= n; + return z[n]; +} + +/* Redefining some standard sections */ + +#pragma section SCONST ".myconst" ".myconst" far-absolute R +#pragma section DATA ".mysda_i" ".mysda_u" near-data RW +#pragma section CODE ".mycode" ".mycode" standard RX + +const double v = 1.414; +int w[10]; + +double h(int n) +{ + w[n] ++; + return v; +} |