diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-13 15:22:30 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-13 15:22:30 +0200 |
commit | dc2c7d3d2bdaffd02e97c8d4740523939989f26f (patch) | |
tree | 64f8cf5f7e3908cb9ce4970d91a559dbca890627 | |
parent | 2ba6daf409c2427767a3d2dd74aa53d9242da4ae (diff) | |
parent | 059664368a5f4ed036e87c0a5e0ed1fae1706f3d (diff) | |
download | compcert-kvx-dc2c7d3d2bdaffd02e97c8d4740523939989f26f.tar.gz compcert-kvx-dc2c7d3d2bdaffd02e97c8d4740523939989f26f.zip |
Merge remote-tracking branch 'origin/mppa-work' into mppa-non-trapping-load
35 files changed, 142 insertions, 128 deletions
diff --git a/test/c/Makefile b/test/c/Makefile index 14c856ff..b2d83352 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -3,18 +3,27 @@ include ../../Makefile.config CCOMP=../../ccomp CCOMPFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dc -dclight -dasm -CFLAGS+=-O1 -Wall +CFLAGS+=-O2 -Wall +EXECUTE:=timeout --signal=SIGTERM 20s $(EXECUTE) LIBS=$(LIBMATH) #TIME=xtime -o /dev/null -mintime 2.0 # Xavier's hack TIME=time >/dev/null # Otherwise -PROGS?=fib qsort fftw sha1 sha3 aes \ - lists binarytrees fannkuch \ - nsieve nsievebits vmach \ - chomp perlin siphash24\ - integr fft fftsp almabench knucleotide mandelbrot nbody spectral bisect +PROGS?=fib integr qsort fft fftsp fftw sha1 sha3 aes almabench \ + lists binarytrees fannkuch mandelbrot nbody \ + nsieve nsievebits spectral vmach \ + chomp perlin siphash24 + +## +# Kalray NOTE : +# * removed knucleotide from PROGS, it is hard to edit the input +# to modify its size without resulting in a seg fault, and the base input +# takes a too long time to complete in the simulator. +# * also removed bisect, who is exhibiting different float values on the Kalray +# architecture than using x86 GCC (for both CompCert and GCC ports) (tested with n=10) +## all: $(PROGS:%=%.compcert) @@ -33,15 +42,17 @@ all_gcc: $(PROGS:%=%.gcc) test: all @for i in $(PROGS); do \ - if $(EXECUTE) ./$$i.compcert | cmp -s - Results/$$i; \ + $(EXECUTE) ./$$i.compcert > $$i.compcert.out;\ + if cmp -s $$i.compcert.out Results/$$i; \ then echo "$$i: passed"; \ - else echo "$$i: FAILED"; exit 2; \ + else echo "$$i: FAILED"; \ fi; \ done test_gcc: all_gcc @for i in $(PROGS); do \ - if $(EXECUTE) ./$$i.gcc | cmp -s - Results/$$i; \ + $(EXECUTE) ./$$i.gcc > $$i.gcc.out;\ + if cmp -s $$i.gcc.out Results/$$i; \ then echo "$$i: passed"; \ else echo "$$i: FAILED"; \ fi; \ @@ -60,3 +71,4 @@ bench: all clean: rm -f *.compcert *.gcc rm -f *.compcert.c *.light.c *.parsed.c *.s *.o *.sdump *~ + rm -f *.out diff --git a/test/c/Results/binarytrees b/test/c/Results/binarytrees index 9dfe1355..72654db9 100644 --- a/test/c/Results/binarytrees +++ b/test/c/Results/binarytrees @@ -1,7 +1,4 @@ -stretch tree of depth 13 check: -1 -8192 trees of depth 4 check: -8192 -2048 trees of depth 6 check: -2048 -512 trees of depth 8 check: -512 -128 trees of depth 10 check: -128 -32 trees of depth 12 check: -32 -long lived tree of depth 12 check: -1 +stretch tree of depth 7 check: -1 +128 trees of depth 4 check: -128 +32 trees of depth 6 check: -32 +long lived tree of depth 6 check: -1 diff --git a/test/c/Results/chomp b/test/c/Results/chomp index 145b603a..7898d32f 100644 --- a/test/c/Results/chomp +++ b/test/c/Results/chomp @@ -1,10 +1,4 @@ player 0 plays at (1,1) -player 1 plays at (6,0) -player 0 plays at (0,6) -player 1 plays at (5,0) -player 0 plays at (0,5) -player 1 plays at (4,0) -player 0 plays at (0,4) player 1 plays at (3,0) player 0 plays at (0,3) player 1 plays at (2,0) diff --git a/test/c/Results/fannkuch b/test/c/Results/fannkuch index be1815d4..09ecc715 100644 --- a/test/c/Results/fannkuch +++ b/test/c/Results/fannkuch @@ -1,31 +1,31 @@ -12345678910 -21345678910 -23145678910 -32145678910 -31245678910 -13245678910 -23415678910 -32415678910 -34215678910 -43215678910 -42315678910 -24315678910 -34125678910 -43125678910 -41325678910 -14325678910 -13425678910 -31425678910 -41235678910 -14235678910 -12435678910 -21435678910 -24135678910 -42135678910 -23451678910 -32451678910 -34251678910 -43251678910 -42351678910 -24351678910 -Pfannkuchen(10) = 38 +123456 +213456 +231456 +321456 +312456 +132456 +234156 +324156 +342156 +432156 +423156 +243156 +341256 +431256 +413256 +143256 +134256 +314256 +412356 +142356 +124356 +214356 +241356 +421356 +234516 +324516 +342516 +432516 +423516 +243516 +Pfannkuchen(6) = 10 diff --git a/test/c/Results/fft b/test/c/Results/fft index a48608b0..0fc1c969 100644 --- a/test/c/Results/fft +++ b/test/c/Results/fft @@ -1 +1 @@ -262144 points, result OK +1024 points, result OK diff --git a/test/c/Results/fftsp b/test/c/Results/fftsp index cbeb0999..2b5711a6 100644 --- a/test/c/Results/fftsp +++ b/test/c/Results/fftsp @@ -1 +1 @@ -4096 points, result OK +8 points, result OK diff --git a/test/c/Results/fib b/test/c/Results/fib index 84ce6474..0e0fa4d1 100644 --- a/test/c/Results/fib +++ b/test/c/Results/fib @@ -1 +1 @@ -fib(35) = 14930352 +fib(15) = 987 diff --git a/test/c/Results/integr b/test/c/Results/integr index 973806c9..c61fdcc2 100644 --- a/test/c/Results/integr +++ b/test/c/Results/integr @@ -1 +1 @@ -integr(square, 0.0, 1.0, 10000000) = 0.333333 +integr(square, 0.0, 1.0, 100000) = 0.333328 diff --git a/test/c/Results/knucleotide b/test/c/Results/knucleotide index d13ae7dc..e69de29b 100644 --- a/test/c/Results/knucleotide +++ b/test/c/Results/knucleotide @@ -1,27 +0,0 @@ -A 30.284 -T 29.796 -C 20.312 -G 19.608 - -AA 9.212 -AT 8.950 -TT 8.948 -TA 8.936 -CA 6.166 -CT 6.100 -AC 6.086 -TC 6.042 -AG 6.036 -GA 5.968 -TG 5.868 -GT 5.798 -CC 4.140 -GC 4.044 -CG 3.906 -GG 3.798 - -562 GGT -152 GGTA -15 GGTATT -0 GGTATTTTAATT -0 GGTATTTTAATTTATAGT diff --git a/test/c/Results/mandelbrot b/test/c/Results/mandelbrot Binary files differindex b81e96bf..246f7ce1 100644 --- a/test/c/Results/mandelbrot +++ b/test/c/Results/mandelbrot diff --git a/test/c/Results/nbody b/test/c/Results/nbody index 41b648fd..99ad4fd1 100644 --- a/test/c/Results/nbody +++ b/test/c/Results/nbody @@ -1,2 +1,2 @@ -0.169075164 --0.169086185 +-0.169050762 diff --git a/test/c/Results/nsieve b/test/c/Results/nsieve index bb9b87dc..95fea812 100644 --- a/test/c/Results/nsieve +++ b/test/c/Results/nsieve @@ -1,3 +1,3 @@ -Primes up to 5120000 356244 -Primes up to 2560000 187134 -Primes up to 1280000 98610 +Primes up to 12800 1526 +Primes up to 6400 834 +Primes up to 3200 452 diff --git a/test/c/Results/nsievebits b/test/c/Results/nsievebits index bb9b87dc..2131804c 100644 --- a/test/c/Results/nsievebits +++ b/test/c/Results/nsievebits @@ -1,3 +1,3 @@ -Primes up to 5120000 356244 -Primes up to 2560000 187134 -Primes up to 1280000 98610 +Primes up to 40000 4203 +Primes up to 20000 2262 +Primes up to 10000 1229 diff --git a/test/c/Results/perlin b/test/c/Results/perlin index 4503fc1c..8438b53c 100644 --- a/test/c/Results/perlin +++ b/test/c/Results/perlin @@ -1 +1 @@ --4.0543e+03 +6.0000e+00 diff --git a/test/c/Results/spectral b/test/c/Results/spectral index 1e35f7e0..b06cd560 100644 --- a/test/c/Results/spectral +++ b/test/c/Results/spectral @@ -1 +1 @@ -1.274224148 +1.272359925 diff --git a/test/c/Results/vmach b/test/c/Results/vmach index 9caa2e51..a95237a6 100644 --- a/test/c/Results/vmach +++ b/test/c/Results/vmach @@ -1,2 +1,2 @@ -fib(30) = 1346269 -tak(18, 12, 6) = 7 +fib(15) = 987 +tak(12, 9, 6) = 9 diff --git a/test/c/binarytrees.c b/test/c/binarytrees.c index b4b10232..adc0d7b3 100644 --- a/test/c/binarytrees.c +++ b/test/c/binarytrees.c @@ -7,6 +7,7 @@ icc -O3 -ip -unroll -static binary-trees.c -lm */ +#include <assert.h> #include <math.h> #include <stdio.h> #include <stdlib.h> @@ -24,6 +25,7 @@ treeNode* NewTreeNode(treeNode* left, treeNode* right, long item) treeNode* new; new = (treeNode*)malloc(sizeof(treeNode)); + assert(new != NULL && "NewTreeNode: new malloc failed"); new->left = left; new->right = right; @@ -73,7 +75,7 @@ int main(int argc, char* argv[]) unsigned N, depth, minDepth, maxDepth, stretchDepth; treeNode *stretchTree, *longLivedTree, *tempTree; - N = argc < 2 ? 12 : atol(argv[1]); + N = argc < 2 ? 6 : atol(argv[1]); minDepth = 4; diff --git a/test/c/chomp.c b/test/c/chomp.c index 728e7a01..5b3c9cfb 100644 --- a/test/c/chomp.c +++ b/test/c/chomp.c @@ -338,8 +338,8 @@ int main(void) struct _play *tree; - ncol = 7; - nrow = 7; + ncol = 4; + nrow = 4; tree = make_play(1); /* create entire tree structure, not just the */ player = 0; /* needed part for first move */ current = make_data(nrow,ncol); /* start play at full board */ diff --git a/test/c/fannkuch.c b/test/c/fannkuch.c index 9cc7a693..6fb7912f 100644 --- a/test/c/fannkuch.c +++ b/test/c/fannkuch.c @@ -8,6 +8,7 @@ * $Id: fannkuch-gcc.code,v 1.33 2006/02/25 16:38:58 igouy-guest Exp $ */ +#include <assert.h> #include <stdio.h> #include <stdlib.h> @@ -31,8 +32,11 @@ fannkuch( int n ) if( n < 1 ) return 0; perm = calloc(n, sizeof(*perm )); + assert(perm != NULL && "fannkuch: perm malloc failed"); perm1 = calloc(n, sizeof(*perm1)); + assert(perm != NULL && "fannkuch: perm1 malloc failed"); count = calloc(n, sizeof(*count)); + assert(perm != NULL && "fannkuch: count malloc failed"); for( i=0 ; i<n ; ++i ) perm1[i] = i; /* initial (trivial) permu */ @@ -98,7 +102,7 @@ fannkuch( int n ) int main( int argc, char* argv[] ) { - int n = (argc>1) ? atoi(argv[1]) : 10; + int n = (argc>1) ? atoi(argv[1]) : 6; printf("Pfannkuchen(%d) = %ld\n", n, fannkuch(n)); return 0; diff --git a/test/c/fft.c b/test/c/fft.c index 2bd55a18..429181b1 100644 --- a/test/c/fft.c +++ b/test/c/fft.c @@ -3,6 +3,7 @@ by: Dave Edelblute, edelblut@cod.nosc.mil, 05 Jan 1993 */ +#include <assert.h> #include <math.h> #include <stdlib.h> #include <stdio.h> @@ -151,13 +152,15 @@ int main(int argc, char ** argv) double enp, t, y, z, zr, zi, zm, a; double * xr, * xi, * pxr, * pxi; - if (argc >= 2) n = atoi(argv[1]); else n = 18; + if (argc >= 2) n = atoi(argv[1]); else n = 10; np = 1 << n; enp = np; npm = np / 2 - 1; t = PI / enp; xr = calloc(np, sizeof(double)); + assert(xr != NULL && "xr calloc failed"); xi = calloc(np, sizeof(double)); + assert(xi != NULL && "xi calloc failed"); pxr = xr; pxi = xi; for (nruns = 0; nruns < NRUNS; nruns++) { diff --git a/test/c/fftsp.c b/test/c/fftsp.c index 26b18b62..2dcd4ad2 100644 --- a/test/c/fftsp.c +++ b/test/c/fftsp.c @@ -153,7 +153,7 @@ int main(int argc, char ** argv) float enp, t, y, z, zr, zi, zm, a; float * xr, * xi, * pxr, * pxi; - if (argc >= 2) n = atoi(argv[1]); else n = 12; + if (argc >= 2) n = atoi(argv[1]); else n = 3; np = 1 << n; enp = np; npm = np / 2 - 1; diff --git a/test/c/fftw.c b/test/c/fftw.c index 913091d9..755bac7f 100644 --- a/test/c/fftw.c +++ b/test/c/fftw.c @@ -74,7 +74,7 @@ const E KP1_847759065 = ((E) +1.847759065022573512256366378793576573644833252); /* Test harness */ -#define NRUNS (100 * 1000) +#define NRUNS (10 * 10) int main() { diff --git a/test/c/fib.c b/test/c/fib.c index 19548415..439b908c 100644 --- a/test/c/fib.c +++ b/test/c/fib.c @@ -12,11 +12,7 @@ int fib(int n) int main(int argc, char ** argv) { int n, r; -#ifdef __K1C_COS__ - if (argc >= 2) n = atoi(argv[1]); else n = 26; -#else - if (argc >= 2) n = atoi(argv[1]); else n = 35; -#endif + if (argc >= 2) n = atoi(argv[1]); else n = 15; r = fib(n); printf("fib(%d) = %d\n", n, r); return 0; diff --git a/test/c/integr.c b/test/c/integr.c index 882325c3..19ea78ab 100644 --- a/test/c/integr.c +++ b/test/c/integr.c @@ -25,7 +25,7 @@ double test(int n) int main(int argc, char ** argv) { int n; double r; - if (argc >= 2) n = atoi(argv[1]); else n = 10000000; + if (argc >= 2) n = atoi(argv[1]); else n = 100000; r = test(n); printf("integr(square, 0.0, 1.0, %d) = %g\n", n, r); return 0; diff --git a/test/c/knucleotide.c b/test/c/knucleotide.c index 3ac469be..1982834e 100644 --- a/test/c/knucleotide.c +++ b/test/c/knucleotide.c @@ -8,6 +8,7 @@ http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/shootout/bench/Include/?cvsroot=shootout */ +#include <assert.h> #include <stdio.h> #include <string.h> #include <ctype.h> @@ -76,9 +77,11 @@ struct ht_node *ht_node_create(char *key) { struct ht_ht *ht_create(int size) { int i = 0; struct ht_ht *ht = (struct ht_ht *)malloc(sizeof(struct ht_ht)); + assert (ht != NULL && "ht_create: ht malloc failed"); while (ht_prime_list[i] < size) { i++; } ht->size = ht_prime_list[i]; ht->tbl = (struct ht_node **)calloc(ht->size, sizeof(struct ht_node *)); + assert (ht->tbl != NULL && "ht_create: ht->tbl calloc failed"); ht->iter_index = 0; ht->iter_next = 0; ht->items = 0; @@ -250,6 +253,7 @@ write_frequencies (int fl, char *buffer, long buflen) size++; } s = calloc (size, sizeof (sorter)); + assert(s != NULL && "write_frequencies: s alloc failed"); i = 0; for (nd = ht_first (ht); nd != NULL; nd = ht_next (ht)) { @@ -293,6 +297,7 @@ main () FILE * f; line = malloc (256); + assert (line != NULL && "line alloc failed"); if (!line) return 2; seqlen = 0; @@ -308,6 +313,7 @@ main () buflen = 10240; buffer = malloc (buflen + 1); + assert (buffer != NULL && "buffer alloc failed"); if (!buffer) return 2; x = buffer; diff --git a/test/c/lists.c b/test/c/lists.c index ced384c0..a72ec398 100644 --- a/test/c/lists.c +++ b/test/c/lists.c @@ -1,5 +1,6 @@ /* List manipulations */ +#include <assert.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> @@ -11,6 +12,7 @@ struct list * buildlist(int n) struct list * r; if (n < 0) return NULL; r = malloc(sizeof(struct list)); + assert(r != NULL && "buildlist: r malloc failed"); r->hd = n; r->tl = buildlist(n - 1); return r; @@ -21,6 +23,7 @@ struct list * reverselist (struct list * l) struct list * r, * r2; for (r = NULL; l != NULL; l = l->tl) { r2 = malloc(sizeof(struct list)); + assert(r2 != NULL && "reverselist: r2 malloc failed"); r2->hd = l->hd; r2->tl = r; r = r2; @@ -58,8 +61,8 @@ int main(int argc, char ** argv) int n, niter, i; struct list * l; - if (argc >= 2) n = atoi(argv[1]); else n = 1000; - if (argc >= 3) niter = atoi(argv[1]); else niter = 20000; + if (argc >= 2) n = atoi(argv[1]); else n = 500; + if (argc >= 3) niter = atoi(argv[1]); else niter = 100; l = buildlist(n); if (checklist(n, reverselist(l))) { printf("OK\n"); diff --git a/test/c/mandelbrot.c b/test/c/mandelbrot.c index 032e7d75..84fae15c 100644 --- a/test/c/mandelbrot.c +++ b/test/c/mandelbrot.c @@ -17,12 +17,12 @@ int main (int argc, char **argv) { int w, h, bit_num = 0; char byte_acc = 0; - int i, iter = 50; + int i, iter = 30; double x, y, limit = 2.0; double Zr, Zi, Cr, Ci, Tr, Ti; if (argc < 2) { - w = h = 1000; + w = h = 50; } else { w = h = atoi(argv[1]); } @@ -51,14 +51,22 @@ int main (int argc, char **argv) if(bit_num == 8) { + printf("%c", byte_acc); putc(byte_acc,stdout); +#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster + fflush(stdout); +#endif byte_acc = 0; bit_num = 0; } else if(x == w-1) { byte_acc <<= (8-w%8); + printf("%c", byte_acc); putc(byte_acc,stdout); +#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster + fflush(stdout); +#endif byte_acc = 0; bit_num = 0; } diff --git a/test/c/nbody.c b/test/c/nbody.c index 530c41fa..1ce8d788 100644 --- a/test/c/nbody.c +++ b/test/c/nbody.c @@ -140,7 +140,7 @@ void setup_bodies(void) int main(int argc, char ** argv) { - int n = argc < 2 ? 1000000 : atoi(argv[1]); + int n = argc < 2 ? 100 : atoi(argv[1]); int i; setup_bodies(); diff --git a/test/c/nsieve.c b/test/c/nsieve.c index 819d47f1..fc79ba69 100644 --- a/test/c/nsieve.c +++ b/test/c/nsieve.c @@ -29,10 +29,10 @@ static unsigned int nsieve(int m) { #define NITER 2 int main(int argc, char * argv[]) { - int m = argc < 2 ? 9 : atoi(argv[1]); + int m = argc < 2 ? 6 : atoi(argv[1]); int i, j; for (i = 0; i < 3; i++) { - int n = 10000 << (m-i); + int n = 200 << (m-i); unsigned count; for (j = 0; j < NITER; j++) { count = nsieve(n); } printf("Primes up to %8d %8u\n", n, count); diff --git a/test/c/nsievebits.c b/test/c/nsievebits.c index 743a5ffd..15d31417 100644 --- a/test/c/nsievebits.c +++ b/test/c/nsievebits.c @@ -30,7 +30,7 @@ nsieve(unsigned int m) return (count); } -#define NITER 2 +#define NITER 1 static void test(unsigned int n) @@ -48,7 +48,7 @@ main(int ac, char **av) { unsigned int n; - n = ac < 2 ? 9 : atoi(av[1]); + n = ac < 2 ? 2 : atoi(av[1]); test(n); if (n >= 1) test(n - 1); diff --git a/test/c/perlin.c b/test/c/perlin.c index e7bbd22d..79d49d62 100644 --- a/test/c/perlin.c +++ b/test/c/perlin.c @@ -63,13 +63,16 @@ static void init(void) { p[256+i] = p[i] = permutation[i]; } +#define INCREMENT 0.5 +#define MIN -3.0 +#define MAX 3.0 int main(int argc, char ** argv) { init(); double x, y, z, sum = 0.0; - for (x = -5.0; x < 5.0; x += 0.1) - for (y = -5.0; y < 5.0; y += 0.1) - for (z = -5.0; z < 5.0; z += 0.1) + for (x = MIN; x < MAX; x += INCREMENT) + for (y = MIN; y < MAX; y += INCREMENT) + for (z = MIN; z < MAX; z += INCREMENT) sum += noise(x, y, z); printf("%.4e\n", sum); diff --git a/test/c/qsort.c b/test/c/qsort.c index 66eef68d..8a035eb5 100644 --- a/test/c/qsort.c +++ b/test/c/qsort.c @@ -34,7 +34,7 @@ int main(int argc, char ** argv) int n, i, j; int * a, * b; - if (argc >= 2) n = atoi(argv[1]); else n = 100000; + if (argc >= 2) n = atoi(argv[1]); else n = 500; a = malloc(n * sizeof(int)); b = malloc(n * sizeof(int)); for (j = 0; j < NITER; j++) { diff --git a/test/c/spectral.c b/test/c/spectral.c index f7dc90ee..b3a34070 100644 --- a/test/c/spectral.c +++ b/test/c/spectral.c @@ -43,7 +43,7 @@ void eval_AtA_times_u(int N, const double u[], double AtAu[]) int main(int argc, char *argv[]) { int i; - int N = ((argc == 2) ? atoi(argv[1]) : 1000); + int N = ((argc == 2) ? atoi(argv[1]) : 11); double * u, * v, vBv, vv; u = malloc(N * sizeof(double)); v = malloc(N * sizeof(double)); diff --git a/test/c/vmach.c b/test/c/vmach.c index 815cb710..4e6848d2 100644 --- a/test/c/vmach.c +++ b/test/c/vmach.c @@ -159,8 +159,10 @@ long wordcode_interp(unsigned int* code) #define I(a,b,c,d) ((a) + ((b) << 8) + ((c) << 16) + ((d) << 24)) +#define FIBSIZE 15 + unsigned int wordcode_fib[] = { -/* 0 */ I(WCONST, 30, 0, 0), +/* 0 */ I(WCONST, FIBSIZE, 0, 0), /* 1 */ I(WCALL1_pop1, 0, 3-1-1, 0), /* 2 */ I(WSTOP, 0, 1, 0), /* 3 */ I(WCONST, 2, 0, 0), @@ -175,10 +177,15 @@ unsigned int wordcode_fib[] = { /* 12 */ I(WCONST, 1, 0, 0), /* 13 */ I(WRETURN, 0, 2, 0) }; + +#define TAKSIZE1 6 +#define TAKSIZE2 9 +#define TAKSIZE3 12 + unsigned int wordcode_tak[] = { -/* 0 */ I(WCONST, 6, 0, 0), -/* 1 */ I(WCONST, 12, 0, 0), -/* 2 */ I(WCONST, 18, 0, 0), +/* 0 */ I(WCONST, TAKSIZE1, 0, 0), +/* 1 */ I(WCONST, TAKSIZE2, 0, 0), +/* 2 */ I(WCONST, TAKSIZE3, 0, 0), /* 3 */ I(WCALL3, 3, 6-3-2, 0), /* 4 */ I(0, 1, 2, 0), /* 5 */ I(WSTOP, 0, 1, 0), @@ -203,8 +210,8 @@ unsigned int wordcode_tak[] = { int main(int argc, char ** argv) { - printf("fib(30) = %ld\n", wordcode_interp(wordcode_fib)); - printf("tak(18, 12, 6) = %ld\n", wordcode_interp(wordcode_tak)); + printf("fib(%d) = %ld\n", FIBSIZE, wordcode_interp(wordcode_fib)); + printf("tak(%d, %d, %d) = %ld\n", TAKSIZE3, TAKSIZE2, TAKSIZE1, wordcode_interp(wordcode_tak)); return 0; } diff --git a/test/mppa/instr/i64.c b/test/mppa/instr/i64.c index b1fce564..e869d93c 100644 --- a/test/mppa/instr/i64.c +++ b/test/mppa/instr/i64.c @@ -90,6 +90,12 @@ BEGIN_TEST(long long) else c += fact(32); + if ((unsigned long long)(a & 0x1LL) >= 1) + c += fact(18); + else + c += fact(31); + + if (a-41414141 > 0) c += fact(13); else |