summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-08-29 18:01:50 +0100
committerAlasdair Armstrong2018-08-29 18:35:50 +0100
commita5ad2059821b86ef26a86d78c40cc680c57aa94e (patch)
tree468eb6bb76f995fb24872e028b0f7a9c7af8f06a /lib
parent07e3591e2427db2d9407d554ac57984ca566c6ed (diff)
C: Fix some issues with tuples as arguments to polymorphic constructors
Now all we need to do is make sure the RISC-V builtins are mapped to the correct C functions, and RISC-V in C should work (hopefully). We're still missing some of the functions in sail.c for the mappings so those have to be implemented.
Diffstat (limited to 'lib')
-rw-r--r--lib/sail.c7
-rw-r--r--lib/sail.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/sail.c b/lib/sail.c
index 3223dc14..62801cc7 100644
--- a/lib/sail.c
+++ b/lib/sail.c
@@ -1068,7 +1068,12 @@ void string_of_int(sail_string *str, const sail_int i)
gmp_asprintf(str, "%Zd", i);
}
-void string_of_bits(sail_string *str, const sail_bits op)
+void string_of_mach_bits(sail_string *str, const mach_bits op)
+{
+ exit(EXIT_FAILURE);
+}
+
+void string_of_sail_bits(sail_string *str, const sail_bits op)
{
if ((op.len % 4) == 0) {
gmp_asprintf(str, "0x%*0Zx", op.len / 4, *op.bits);
diff --git a/lib/sail.h b/lib/sail.h
index afff2c65..a8651f50 100644
--- a/lib/sail.h
+++ b/lib/sail.h
@@ -320,7 +320,8 @@ void random_real(real *rop, unit);
/* ***** Printing ***** */
void string_of_int(sail_string *str, const sail_int i);
-void string_of_bits(sail_string *str, const sail_bits op);
+void string_of_sail_bits(sail_string *str, const sail_bits op);
+void string_of_mach_bits(sail_string *str, const mach_bits op);
/*
* Utility function not callable from Sail!