From: Luke Kenneth Casson Leighton Date: Wed, 10 Oct 2018 08:49:43 +0000 (+0100) Subject: add operators library to contain operator-overloads of +/-/*/div/>/>= etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76741f66364651749e7dfbd857df335656a30dee;p=riscv-isa-sim.git add operators library to contain operator-overloads of +/-/*/div/>/>= etc for all types int8, uint8, float16_t, float32_t etc. all to be template-ified --- diff --git a/Makefile.in b/Makefile.in index c09fc50..0bf8303 100644 --- a/Makefile.in +++ b/Makefile.in @@ -227,7 +227,7 @@ $(2)_test_objs := $$(patsubst %.cc, %.o, $$($(2)_test_srcs)) $(2)_test_deps := $$(patsubst %.o, %.d, $$($(2)_test_objs)) $(2)_test_exes := $$(patsubst %.t.cc, %-utst, $$($(2)_test_srcs)) $(2)_test_outs := $$(patsubst %, %.out, $$($(2)_test_exes)) -$(2)_test_libs := $(1) $$($(2)_reverse_deps) utst +$(2)_test_libs := $(1) $$($(2)_reverse_deps) $(2)_test_libnames := $$(patsubst %, lib%.so, $$($(2)_test_libs)) $(2)_test_libarg := $$(patsubst %, -l%, $$($(2)_test_libs)) diff --git a/config.h.in b/config.h.in index 2981620..b810ecb 100644 --- a/config.h.in +++ b/config.h.in @@ -45,6 +45,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define if subproject MCPPBS_SPROJ_NORM is enabled */ +#undef OPERATORS_ENABLED + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/configure b/configure index e453c26..d3a585e 100755 --- a/configure +++ b/configure @@ -4838,6 +4838,51 @@ $as_echo "#define SOFTFLOAT_ENABLED /**/" >>confdefs.h + # Add subproject to our running list + + subprojects="$subprojects operators" + + # Process the subproject appropriately. If enabled add it to the + # $enabled_subprojects running shell variable, set a + # SUBPROJECT_ENABLED C define, and include the appropriate + # 'subproject.ac'. + + + { $as_echo "$as_me:${as_lineno-$LINENO}: configuring default subproject : operators" >&5 +$as_echo "$as_me: configuring default subproject : operators" >&6;} + ac_config_files="$ac_config_files operators.mk:operators/operators.mk.in" + + enable_operators_sproj="yes" + subprojects_enabled="$subprojects_enabled operators" + +$as_echo "#define OPERATORS_ENABLED /**/" >>confdefs.h + + + + + + + # Determine if this is a required or an optional subproject + + + + # Determine if there is a group with the same name + + + + # Create variations of the subproject name suitable for use as a CPP + # enabled define, a shell enabled variable, and a shell function + + + + + + + + + + + # Add subproject to our running list subprojects="$subprojects spike_main" @@ -4894,6 +4939,8 @@ ac_config_files="$ac_config_files riscv-riscv.pc" ac_config_files="$ac_config_files riscv-softfloat.pc" +ac_config_files="$ac_config_files riscv-operators.pc" + ac_config_files="$ac_config_files riscv-dummy_rocc.pc" ac_config_files="$ac_config_files riscv-spike_main.pc" @@ -5592,12 +5639,14 @@ do "riscv.mk") CONFIG_FILES="$CONFIG_FILES riscv.mk:riscv/riscv.mk.in" ;; "dummy_rocc.mk") CONFIG_FILES="$CONFIG_FILES dummy_rocc.mk:dummy_rocc/dummy_rocc.mk.in" ;; "softfloat.mk") CONFIG_FILES="$CONFIG_FILES softfloat.mk:softfloat/softfloat.mk.in" ;; + "operators.mk") CONFIG_FILES="$CONFIG_FILES operators.mk:operators/operators.mk.in" ;; "spike_main.mk") CONFIG_FILES="$CONFIG_FILES spike_main.mk:spike_main/spike_main.mk.in" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "riscv-spike.pc") CONFIG_FILES="$CONFIG_FILES riscv-spike.pc" ;; "riscv-riscv.pc") CONFIG_FILES="$CONFIG_FILES riscv-riscv.pc" ;; "riscv-softfloat.pc") CONFIG_FILES="$CONFIG_FILES riscv-softfloat.pc" ;; + "riscv-operators.pc") CONFIG_FILES="$CONFIG_FILES riscv-operators.pc" ;; "riscv-dummy_rocc.pc") CONFIG_FILES="$CONFIG_FILES riscv-dummy_rocc.pc" ;; "riscv-spike_main.pc") CONFIG_FILES="$CONFIG_FILES riscv-spike_main.pc" ;; diff --git a/configure.ac b/configure.ac index 0fdcc16..f43083d 100644 --- a/configure.ac +++ b/configure.ac @@ -101,7 +101,7 @@ fi # The '*' suffix indicates an optional subproject. The '**' suffix # indicates an optional subproject which is also the name of a group. -MCPPBS_SUBPROJECTS([ riscv, dummy_rocc, softfloat, spike_main ]) +MCPPBS_SUBPROJECTS([ riscv, dummy_rocc, softfloat, operators, spike_main ]) #------------------------------------------------------------------------- # MCPPBS subproject groups @@ -123,6 +123,7 @@ AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([riscv-spike.pc]) AC_CONFIG_FILES([riscv-riscv.pc]) AC_CONFIG_FILES([riscv-softfloat.pc]) +AC_CONFIG_FILES([riscv-operators.pc]) AC_CONFIG_FILES([riscv-dummy_rocc.pc]) AC_CONFIG_FILES([riscv-spike_main.pc]) AC_OUTPUT diff --git a/operators/operators.ac b/operators/operators.ac new file mode 100644 index 0000000..e69de29 diff --git a/operators/operators.cc b/operators/operators.cc new file mode 100644 index 0000000..e69de29 diff --git a/operators/operators.h b/operators/operators.h new file mode 100644 index 0000000..e69de29 diff --git a/operators/operators.mk.in b/operators/operators.mk.in new file mode 100644 index 0000000..8cf5e80 --- /dev/null +++ b/operators/operators.mk.in @@ -0,0 +1,15 @@ +operators_subproject_deps = \ + softfloat + +operators_hdrs = \ + operators.h \ + +operators_c_srcs = \ + +operators_srcs = \ + operators.cc \ + +operators_test_srcs = \ + operators.t.cc \ + +operators_install_prog_srcs = diff --git a/operators/operators.t.cc b/operators/operators.t.cc new file mode 100644 index 0000000..75bd379 --- /dev/null +++ b/operators/operators.t.cc @@ -0,0 +1,6 @@ +#include + +int main(int argc, char *argv[]) +{ + printf("hello\n"); +} diff --git a/riscv-operators.pc.in b/riscv-operators.pc.in new file mode 100644 index 0000000..a68af5a --- /dev/null +++ b/riscv-operators.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@prefix@ +libdir=${prefix}/@libdir@ +includedir=${prefix}/@includedir@ + +Name: riscv-operators +Description: RISC-V operators library +Version: git +Depends: riscv-softfloat +Libs: -Wl,-rpath,${libdir} -L${libdir} -loperators -lsoftfloat +Cflags: -I${includedir} +URL: http://riscv.org/download.html#tab_spike