From d366e22b0c8665ab73d162cf8db98b91b2e4314e Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Thu, 17 Jan 2019 19:46:11 +0100 Subject: test (does not compile yet) --- test/monniaux/Makefile | 23 +++++++++++++ test/monniaux/int_mat.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 test/monniaux/Makefile create mode 100644 test/monniaux/int_mat.c diff --git a/test/monniaux/Makefile b/test/monniaux/Makefile new file mode 100644 index 00000000..26fd90d7 --- /dev/null +++ b/test/monniaux/Makefile @@ -0,0 +1,23 @@ +CFLAGS=-Wall -O3 +K1C_CC=k1-mbr-gcc +K1C_CFLAGS=-Wall -O3 -std=c99 +K1C_CCOMP=../../ccomp +K1C_CCOMPFLAGS=-Wall -O3 -D__thread= -D__int128=int + +EXECUTABLES=int_mat.host int_mat.k1c int_mat.k1c_ccomp + +all: $(EXECUTABLES) + +int_mat.host: int_mat.c + $(CC) $(CFLAGS) $+ -o $@ + +int_mat.k1c: int_mat.c + $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ + +int_mat.k1c_ccomp: int_mat.c + $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ + +clean: + $(RM) -f $(EXECUTABLES) + +.PHONY: clean diff --git a/test/monniaux/int_mat.c b/test/monniaux/int_mat.c new file mode 100644 index 00000000..a1615e70 --- /dev/null +++ b/test/monniaux/int_mat.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include + +typedef uint32_t modint; + +#define MODULUS 257 + +void modint_mat_mul1(unsigned m, unsigned n, unsigned p, + modint * restrict c, unsigned stride_c, + const modint *a, unsigned stride_a, + const modint *b, unsigned stride_b) { + for(unsigned i=0; i