add operators library to contain operator-overloads of +/-/*/div/>/>= etc
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 10 Oct 2018 08:49:43 +0000 (09:49 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 10 Oct 2018 08:49:43 +0000 (09:49 +0100)
for all types int8, uint8, float16_t, float32_t etc.

all to be template-ified

Makefile.in
config.h.in
configure
configure.ac
operators/operators.ac [new file with mode: 0644]
operators/operators.cc [new file with mode: 0644]
operators/operators.h [new file with mode: 0644]
operators/operators.mk.in [new file with mode: 0644]
operators/operators.t.cc [new file with mode: 0644]
riscv-operators.pc.in [new file with mode: 0644]

index c09fc505881b393afd7ac1f34b03a513d7ab50f6..0bf8303d71d1fe184ab9c127360007f04945464c 100644 (file)
@@ -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))
 
index 29816208bd0a9a8918ba523257ac5ea648eaafe5..b810ecb090fc51b0fc898c908da7f99331c762e9 100644 (file)
@@ -45,6 +45,9 @@
 /* Define to 1 if you have the <unistd.h> 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
 
index e453c26d9cccc146189609b000bf3efcf62b8725..d3a585e1c7d90bc0fe9b19a7450d00fbec9b39f5 100755 (executable)
--- 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" ;;
 
index 0fdcc168226b3724fe9cc2b4ac166857a4fbd48a..f43083dbef381927127ec66480f0b8d9504217f9 100644 (file)
@@ -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 (file)
index 0000000..e69de29
diff --git a/operators/operators.cc b/operators/operators.cc
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/operators/operators.h b/operators/operators.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/operators/operators.mk.in b/operators/operators.mk.in
new file mode 100644 (file)
index 0000000..8cf5e80
--- /dev/null
@@ -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 (file)
index 0000000..75bd379
--- /dev/null
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+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 (file)
index 0000000..a68af5a
--- /dev/null
@@ -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