From a789b94e986375a713263d7d7584ceaac01084f2 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 28 May 2019 15:13:46 +0200 Subject: adaptation pour k1c-cos --- configure | 25 +- test/monniaux/bitsliced-aes/one_file/compare.sh | 2 +- .../bitsliced-aes/one_file/reduce/compare.sh | 2 +- test/monniaux/bitsliced-tea/reduce/compare.sh | 2 +- test/monniaux/cycles.h | 6 + test/monniaux/frame_pointer/Makefile | 4 +- test/monniaux/generate_makefiles.sh | 2 +- test/monniaux/mod_int_mat/Makefile | 2 +- test/monniaux/ocaml/byterun/make.log | 17 -- test/monniaux/ocaml/byterun/make2.log | 321 --------------------- test/monniaux/rules.mk | 4 +- test/monniaux/send_through/Makefile | 2 +- 12 files changed, 35 insertions(+), 354 deletions(-) delete mode 100644 test/monniaux/ocaml/byterun/make.log delete mode 100644 test/monniaux/ocaml/byterun/make2.log diff --git a/configure b/configure index a9bf25a6..43c90b47 100755 --- a/configure +++ b/configure @@ -55,7 +55,8 @@ Supported targets: x86_64-macosx (x86 64 bits, MacOS X) rv32-linux (RISC-V 32 bits, Linux) rv64-linux (RISC-V 64 bits, Linux) - k1c-linux (Kalray K1c, Linux) + k1c-mbr (Kalray K1c, bare runtime) + k1c-cos (Kalray K1c, ClusterOS) manual (edit configuration file by hand) For x86 targets, the "x86_32-" prefix can also be written "ia32-" or "i386-". @@ -440,15 +441,27 @@ if test "$arch" = "mppa_k1c"; then #model_options=-m64 model_options= abi="standard" - casm="k1-mbr-gcc" + if test "$target" = "mbr"; + then os="mbr"; + elif test "$target" = "cos"; + then os="cos"; + elif test "$target" = "elf"; + then os="elf"; + else + echo "Unknown K1c backend" + exit 1 + fi + osupper=`echo $os|tr a-z A-Z` + k1base="k1-$os" + casm="$k1base-gcc" casm_options="$model_options -c" - cc="k1-mbr-gcc $model_options" - clinker="k1-mbr-gcc" + cc="$k1base-gcc $model_options" + clinker="$k1base-gcc" bindir="$HOME/.usr/bin" libdir="$HOME/.usr/lib" clinker_options="$model_options -L$libdir -Wl,-rpath=$libdir" - cprepro="k1-mbr-gcc" - cprepro_options="$model_options -std=c99 -E -include ccomp_k1c_fixes.h" + cprepro="$k1base-gcc" + cprepro_options="$model_options -D __K1C_$osupper__ -std=c99 -E -include ccomp_k1c_fixes.h" libmath="-lm" system="linux" fi diff --git a/test/monniaux/bitsliced-aes/one_file/compare.sh b/test/monniaux/bitsliced-aes/one_file/compare.sh index 276a95ee..e069eef6 100755 --- a/test/monniaux/bitsliced-aes/one_file/compare.sh +++ b/test/monniaux/bitsliced-aes/one_file/compare.sh @@ -1,7 +1,7 @@ #!/bin/bash ROOT=/home/monniaux/work/Kalray/CompCert SRC=bitsliced-aes.c -k1-mbr-gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o -o bitsliced-aes.gcc.k1c && +k1-cos-gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o -o bitsliced-aes.gcc.k1c && $ROOT/ccomp -O3 -fno-unprototyped -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o -o bitsliced-aes.ccomp.k1c && gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.host.o -o bitsliced-aes.gcc.host && valgrind ./bitsliced-aes.gcc.host && diff --git a/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh b/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh index a21bb465..97939771 100755 --- a/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh +++ b/test/monniaux/bitsliced-aes/one_file/reduce/compare.sh @@ -2,7 +2,7 @@ ROOT=/home/monniaux/work/Kalray/CompCert SRC=bitsliced-aes_compute.c MAIN=/home/monniaux/work/Kalray/CompCert/test/monniaux/bitsliced-aes/one_file/reduce/bitsliced-aes_main -k1-mbr-gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o $MAIN.gcc.k1c.o -o bitsliced-aes.gcc.k1c && +k1-cos-gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o $MAIN.gcc.k1c.o -o bitsliced-aes.gcc.k1c && $ROOT/ccomp -O3 -fno-unprototyped -O3 $SRC $ROOT/test/monniaux/clock.gcc.k1c.o $MAIN.gcc.k1c.o -o bitsliced-aes.ccomp.k1c && gcc -Werror=implicit -Werror=uninitialized -O3 $SRC $ROOT/test/monniaux/clock.gcc.host.o $MAIN.c -o bitsliced-aes.gcc.host && valgrind ./bitsliced-aes.gcc.host && diff --git a/test/monniaux/bitsliced-tea/reduce/compare.sh b/test/monniaux/bitsliced-tea/reduce/compare.sh index d9f3cf86..f0b1f8d2 100755 --- a/test/monniaux/bitsliced-tea/reduce/compare.sh +++ b/test/monniaux/bitsliced-tea/reduce/compare.sh @@ -1,7 +1,7 @@ PREFIX=/home/monniaux/work/Kalray/ternary/CompCert INCLUDES=-I$PREFIX/test/monniaux/bitsliced-tea CCOMP_K1="$PREFIX/ccomp -fno-unprototyped -O3 $INCLUDES" -GCC_K1="k1-mbr-gcc -Werror=implicit -O3 $INCLUDES" +GCC_K1="k1-cos-gcc -Werror=implicit -O3 $INCLUDES" GCC_HOST="gcc -Werror=implicit -O3 $INCLUDES" FILE=bstea.c diff --git a/test/monniaux/cycles.h b/test/monniaux/cycles.h index b4160954..45c900e3 100644 --- a/test/monniaux/cycles.h +++ b/test/monniaux/cycles.h @@ -1,7 +1,13 @@ typedef unsigned long cycle_t; #ifdef __K1C__ +#ifdef __K1C_COS__ +#include +#define K1_SFR_PMC COS_SFR_PMC +#define K1_SFR_PM0 COS_SFR_PM0 +#else #include +#endif static inline void cycle_count_config(void) { /* config pmc for cycle count */ diff --git a/test/monniaux/frame_pointer/Makefile b/test/monniaux/frame_pointer/Makefile index e10d9bd3..ff4b187d 100644 --- a/test/monniaux/frame_pointer/Makefile +++ b/test/monniaux/frame_pointer/Makefile @@ -2,13 +2,13 @@ whole : a.o b.o ../../../ccomp $+ -o $@ a.s : a.c - k1-mbr-gcc -std=c99 -Wall -S $< + k1-cos-gcc -std=c99 -Wall -S $< b.s : b.c ../../../ccomp -Wall -Wno-c11-extensions -S $< %.o : %.s - k1-mbr-gcc -c $< + k1-cos-gcc -c $< clean: -rm -f a.o b.o a.s b.s whole diff --git a/test/monniaux/generate_makefiles.sh b/test/monniaux/generate_makefiles.sh index 1c05538f..ecbbdf4d 100755 --- a/test/monniaux/generate_makefiles.sh +++ b/test/monniaux/generate_makefiles.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash source benches.sh diff --git a/test/monniaux/mod_int_mat/Makefile b/test/monniaux/mod_int_mat/Makefile index d1365b34..08b97b67 100644 --- a/test/monniaux/mod_int_mat/Makefile +++ b/test/monniaux/mod_int_mat/Makefile @@ -1,5 +1,5 @@ CFLAGS=-Wall -O3 -std=c99 -K1C_CC=k1-mbr-gcc +K1C_CC=k1-cos-gcc K1C_CFLAGS=-Wall -O3 -std=c99 K1C_CCOMP=../../../ccomp K1C_CCOMPFLAGS=-Wall -O3 diff --git a/test/monniaux/ocaml/byterun/make.log b/test/monniaux/ocaml/byterun/make.log deleted file mode 100644 index 0aa95a93..00000000 --- a/test/monniaux/ocaml/byterun/make.log +++ /dev/null @@ -1,17 +0,0 @@ -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE signals.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE signals_byt.c -rm -f libcamlrun.a && ar rc libcamlrun.a interp.o misc.o stacks.o fix_code.o startup_aux.o startup.o freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o globroots.o fail.o signals.o signals_byt.o printexc.o backtrace_prim.o backtrace.o compare.o ints.o floats.o str.o array.o io.o extern.o intern.o hash.o sys.o meta.o parsing.o gc_ctrl.o md5.o obj.o lexing.o callback.o debugger.o weak.o compact.o finalise.o custom.o dynlink.o spacetime.o afl.o unix.o bigarray.o main.o && ranlib libcamlrun.a -k1-mbr-gcc -c -O3 -Wall -g -DDEBUG -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -o signals.d.o signals.c -k1-mbr-gcc -c -O3 -Wall -g -DDEBUG -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -o signals_byt.d.o signals_byt.c -rm -f libcamlrund.a && ar rc libcamlrund.a interp.d.o misc.d.o stacks.d.o fix_code.d.o startup_aux.d.o startup.d.o freelist.d.o major_gc.d.o minor_gc.d.o memory.d.o alloc.d.o roots.d.o globroots.d.o fail.d.o signals.d.o signals_byt.d.o printexc.d.o backtrace_prim.d.o backtrace.d.o compare.d.o ints.d.o floats.d.o str.d.o array.d.o io.d.o extern.d.o intern.d.o hash.d.o sys.d.o meta.d.o parsing.d.o gc_ctrl.d.o md5.d.o obj.d.o lexing.d.o callback.d.o debugger.d.o weak.d.o compact.d.o finalise.d.o custom.d.o dynlink.d.o spacetime.d.o afl.d.o unix.d.o bigarray.d.o main.d.o instrtrace.d.o && ranlib libcamlrund.a -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -o signals.i.o signals.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -o signals_byt.i.o signals_byt.c -rm -f libcamlruni.a && ar rc libcamlruni.a interp.i.o misc.i.o stacks.i.o fix_code.i.o startup_aux.i.o startup.i.o freelist.i.o major_gc.i.o minor_gc.i.o memory.i.o alloc.i.o roots.i.o globroots.i.o fail.i.o signals.i.o signals_byt.i.o printexc.i.o backtrace_prim.i.o backtrace.i.o compare.i.o ints.i.o floats.i.o str.i.o array.i.o io.i.o extern.i.o intern.i.o hash.i.o sys.i.o meta.i.o parsing.i.o gc_ctrl.i.o md5.i.o obj.i.o lexing.i.o callback.i.o debugger.i.o weak.i.o compact.i.o finalise.i.o custom.i.o dynlink.i.o spacetime.i.o afl.i.o unix.i.o bigarray.i.o main.i.o && ranlib libcamlruni.a -k1-mbr-gcc -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE -o ocamlrun prims.o libcamlrun.a -lm -/opt/Kalray/usr/local/k1rdtools/bin/../lib/gcc/k1-mbr/4.9.4/../../../../k1-mbr/lib/libgloss.a(times.o): In function `__gloss_times': -/work1/hudson/workspace/_RDTools_integration_2/label/centos7-64/rdtools/newlib/k1_build_mbr/k1-mbr/libgloss/k1-mbr/../../../../libgloss/k1-mbr/times.c:18: undefined reference to `__bsp_frequency' -/work1/hudson/workspace/_RDTools_integration_2/label/centos7-64/rdtools/newlib/k1_build_mbr/k1-mbr/libgloss/k1-mbr/../../../../libgloss/k1-mbr/times.c:18: undefined reference to `__bsp_frequency' -/work1/hudson/workspace/_RDTools_integration_2/label/centos7-64/rdtools/newlib/k1_build_mbr/k1-mbr/libgloss/k1-mbr/../../../../libgloss/k1-mbr/times.c:18: undefined reference to `__bsp_frequency' -collect2: error: ld returned 1 exit status -Makefile:187: recipe for target 'ocamlrun' failed -make: *** [ocamlrun] Error 1 diff --git a/test/monniaux/ocaml/byterun/make2.log b/test/monniaux/ocaml/byterun/make2.log deleted file mode 100644 index 719c4b6d..00000000 --- a/test/monniaux/ocaml/byterun/make2.log +++ /dev/null @@ -1,321 +0,0 @@ -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE interp.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE misc.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE stacks.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE fix_code.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE startup_aux.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE startup.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE freelist.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE major_gc.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE minor_gc.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE memory.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE alloc.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE roots.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE globroots.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE fail.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE signals.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE signals_byt.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE printexc.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE backtrace_prim.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE backtrace.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE compare.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE ints.c -ints.c: In function ‘caml_int64_bswap’: -ints.c:508:5: warning: implicit declaration of function ‘INT64_LITERAL’ [-Wimplicit-function-declaration] - (((x & INT64_LITERAL(0x00000000000000FFU)) << 56) | - ^ -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE floats.c -floats.c: In function ‘caml_Store_double_val’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c: In function ‘caml_copy_double’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_Store_double_array_field’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_float_of_string’: -floats.c:64:17: warning: ‘buffer.v[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c:64:17: warning: ‘buffer.v[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_float_of_int’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_neg_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_abs_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_add_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_sub_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_mul_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_div_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_exp_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_floor_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_fmod_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_frexp_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_ldexp_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_log_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_log10_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_modf_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_sqrt_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_power_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_sin_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_sinh_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_cos_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_cosh_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_tan_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_tanh_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_asin_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_acos_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_atan_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_atan2_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_ceil_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_hypot_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_expm1_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_log1p_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -floats.c: In function ‘caml_copysign_float’: -floats.c:64:17: warning: ‘buffer.v[1]’ is used uninitialized in this function [-Wuninitialized] - Field(val, 1) = buffer.v[1]; - ^ -floats.c:59:35: note: ‘buffer.v[1]’ was declared here - union { value v[2]; double d; } buffer; - ^ -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE str.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE array.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE io.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE extern.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE intern.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE hash.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE sys.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE meta.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE parsing.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE gc_ctrl.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE md5.c -md5.c: In function ‘caml_MD5Final’: -md5.c:218:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] - ((uint32_t *) ctx->in)[14] = ctx->bits[0]; - ^ -md5.c:219:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] - ((uint32_t *) ctx->in)[15] = ctx->bits[1]; - ^ -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE obj.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE lexing.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE callback.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE debugger.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE weak.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE compact.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE finalise.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE custom.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE dynlink.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE spacetime.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE afl.c -k1-mbr-gcc -c -O3 -Wall -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE unix.c -unix.c:48:21: fatal error: sys/dir.h: No such file or directory - #include - ^ -compilation terminated. -Makefile:211: recipe for target 'unix.o' failed -make: *** [unix.o] Error 1 diff --git a/test/monniaux/rules.mk b/test/monniaux/rules.mk index d098d1b2..781b94c7 100644 --- a/test/monniaux/rules.mk +++ b/test/monniaux/rules.mk @@ -4,8 +4,8 @@ CCOMPFLAGS=-g -O3 -Wall $(ALL_CCOMPFLAGS) $(ALL_CFLAGS) CFLAGS=-g -std=c99 -O3 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS) -K1C_CC=k1-mbr-gcc -K1C_CFLAGS =-std=c99 -O3 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS) +K1C_CC=k1-cos-gcc +K1C_CFLAGS = -D__K1C_COS__ -std=c99 -O3 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS) K1C_CFLAGS_O1 =-std=c99 -O1 -fschedule-insns2 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS) K1C_CCOMP = ../../../ccomp diff --git a/test/monniaux/send_through/Makefile b/test/monniaux/send_through/Makefile index 9e5a0cfd..72b84654 100644 --- a/test/monniaux/send_through/Makefile +++ b/test/monniaux/send_through/Makefile @@ -4,7 +4,7 @@ send_through: send_through_gcc.k1c.o send_through_ccomp.k1c.o send_through_gcc.k1c.o send_through_ccomp.k1c.o: send_through.h send_through_gcc.k1c.o : send_through_gcc.c - k1-mbr-gcc -Wall -Wextra -std=c99 -Werror=implicit -c $< -o $@ + k1-cos-gcc -Wall -Wextra -std=c99 -Werror=implicit -c $< -o $@ send_through_ccomp.k1c.o : send_through_ccomp.c ../../../ccomp -Wall -fnone -fvararg-calls -c $< -o $@ -- cgit From 436658966209181c8f365cc8d1a69e8487852d17 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 28 May 2019 23:47:44 +0200 Subject: fixes for COS --- runtime/include/ccomp_k1c_fixes.h | 2 ++ runtime/mppa_k1c/i64_sdiv.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/runtime/include/ccomp_k1c_fixes.h b/runtime/include/ccomp_k1c_fixes.h index 9a2a26c1..1404b5fc 100644 --- a/runtime/include/ccomp_k1c_fixes.h +++ b/runtime/include/ccomp_k1c_fixes.h @@ -18,3 +18,5 @@ extern __int128 __compcert_acswapd(void *address, unsigned long long new_value, #define __builtin_k1_acswapw __compcert_acswapw extern __int128 __compcert_acswapw(void *address, unsigned long long new_value, unsigned long long old_value); #endif + +#define __builtin_expect(x, y) (x) diff --git a/runtime/mppa_k1c/i64_sdiv.c b/runtime/mppa_k1c/i64_sdiv.c index 9feab791..892aac07 100644 --- a/runtime/mppa_k1c/i64_sdiv.c +++ b/runtime/mppa_k1c/i64_sdiv.c @@ -10,7 +10,17 @@ int i32_sdiv (int a, int b) return __divdi3 (a, b); } +#ifdef __K1C_COS__ +#include +#define K1_SFR_CS_IO_MASK COS_SFR_CS_IO_MASK +#define K1_SFR_CS_DZ_MASK COS_SFR_CS_DZ_MASK +#define K1_SFR_CS_OV_MASK COS_SFR_CS_OV_MASK +#define K1_SFR_CS_UN_MASK COS_SFR_CS_UN_MASK +#define K1_SFR_CS_IN_MASK COS_SFR_CS_IN_MASK +#define K1_SFR_CS COS_SFR_CS +#else #include +#endif /* DM FIXME this is for floating point */ int fetestexcept(int excepts) { -- cgit From 371ff944e3377b263506f57c71b54ea24d1f75a7 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 29 May 2019 00:18:38 +0200 Subject: more builtins --- runtime/include/ccomp_k1c_fixes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/include/ccomp_k1c_fixes.h b/runtime/include/ccomp_k1c_fixes.h index 1404b5fc..5c543d8f 100644 --- a/runtime/include/ccomp_k1c_fixes.h +++ b/runtime/include/ccomp_k1c_fixes.h @@ -20,3 +20,5 @@ extern __int128 __compcert_acswapw(void *address, unsigned long long new_value, #endif #define __builtin_expect(x, y) (x) +#define __builtin_ctz(x) __builtin_k1_ctzw(x) +#define __builtin_clz(x) __builtin_k1_clzw(x) -- cgit From 83cc11add90eea576a798bacf821a70a28d4d9cc Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Wed, 29 May 2019 00:25:01 +0200 Subject: to be able to use DDR we need 8-byte pointers in jump tables --- mppa_k1c/TargetPrinter.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mppa_k1c/TargetPrinter.ml b/mppa_k1c/TargetPrinter.ml index 15f05960..96779517 100644 --- a/mppa_k1c/TargetPrinter.ml +++ b/mppa_k1c/TargetPrinter.ml @@ -173,10 +173,10 @@ module Target (*: TARGET*) = (* Associate labels to floating-point constants and to symbols. *) let print_tbl oc (lbl, tbl) = - fprintf oc " .balign 4\n"; + fprintf oc " .balign 8\n"; fprintf oc "%a:\n" label lbl; List.iter - (fun l -> fprintf oc " .4byte %a\n" + (fun l -> fprintf oc " .8byte %a\n" print_label l) tbl @@ -408,9 +408,9 @@ module Target (*: TARGET*) = fprintf oc "%s jumptable [ " comment; List.iter (fun l -> fprintf oc "%a " print_label l) tbl; fprintf oc "]\n"; - fprintf oc " make %a = %a\n ;;\n" ireg base_reg label lbl; - fprintf oc " lwz.xs %a = %a[%a]\n ;;\n" ireg base_reg ireg idx_reg ireg base_reg; - fprintf oc " igoto %a\n ;;\n" ireg base_reg; + fprintf oc " make %a = %a\n ;;\n" ireg base_reg label lbl; + fprintf oc " ld.xs %a = %a[%a]\n ;;\n" ireg base_reg ireg idx_reg ireg base_reg; + fprintf oc " igoto %a\n ;;\n" ireg base_reg; section oc Section_jumptable; print_tbl oc (lbl, tbl); section oc Section_text -- cgit