Skip to content
Snippets Groups Projects
Commit 6c7bc562 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

soc2c: make _assign_<arrays> statements 3 args instead of 2

As suggested by Willie, it allows it to be specialized when it is
called more than once.
parent 7be3ffc0
No related branches found
No related tags found
No related merge requests found
(** Automatically generated from Makefile *)
let tool = "lus2lic"
let branch = "(no"
let commit = "530"
let sha_1 = "fb10a7040944aa3799dcf5767893dbdab2088d74"
let commit = "531"
let sha_1 = "7be3ffc07adcd4e02b8fae3068d2d9bf01483569"
let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
let maintainer = "jahier@imag.fr"
(* Time-stamp: <modified the 02/10/2014 (at 17:41) by Erwan Jahier> *)
(* Time-stamp: <modified the 03/10/2014 (at 17:03) by Erwan Jahier> *)
module OrderedData = struct
type t = Data.t
......@@ -43,7 +43,7 @@ let (f: Data.t -> string) =
let t_str = Soc2cIdent.type_to_short_string t in
let t_def = Printf.sprintf "
#ifndef _assign_%s
#define _assign_%s(dest, source) memcpy(dest, source, sizeof(dest))
#define _assign_%s(dest, source, size) memcpy(dest, source, size)
#endif
"
t_str t_str
......
(* Time-stamp: <modified the 03/10/2014 (at 10:22) by Erwan Jahier> *)
(* Time-stamp: <modified the 03/10/2014 (at 17:04) by Erwan Jahier> *)
open Soc2cUtil
open Soc2cIdent
......@@ -39,12 +39,12 @@ let rec (gen_assign : Data.t -> string -> string -> string -> string) =
| Data.Alpha(_) (* dead code ? *)
| Data.Array(_) ->
let t_str = Soc2cIdent.type_to_short_string t in
Printf.sprintf " _assign_%s(%s, %s);\n" t_str vi vo
Printf.sprintf " _assign_%s(%s, %s, sizeof(%s));\n" t_str vi vo vi
| Data.Extern (id) ->
(* what should i do for extern types? Ask the user to provide the
copy function I guess *)
Printf.sprintf " _assign_%s(&%s, %s);\n" (id2s id) vi vo
Printf.sprintf " _assign_%s(&%s, %s, sizeof(%s));\n" (id2s id) vi vo vo
let (gen_assign_var_expr : Soc.t -> Soc.var_expr -> Soc.var_expr -> string) =
fun soc vi vo ->
......
==> lus2lic0.sum <==
Test Run By jahier on Fri Oct 3 16:55:58
Test Run By jahier on Fri Oct 3 17:14:32
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic0 tests ===
......@@ -63,7 +63,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
==> lus2lic1.sum <==
Test Run By jahier on Fri Oct 3 16:55:52
Test Run By jahier on Fri Oct 3 17:14:36
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic1 tests ===
......@@ -397,7 +397,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus {}
==> lus2lic2.sum <==
Test Run By jahier on Fri Oct 3 16:55:52
Test Run By jahier on Fri Oct 3 17:14:32
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic2 tests ===
......@@ -727,7 +727,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus {}
==> lus2lic3.sum <==
Test Run By jahier on Fri Oct 3 16:55:56
Test Run By jahier on Fri Oct 3 17:14:34
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic3 tests ===
......@@ -1230,7 +1230,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
==> lus2lic4.sum <==
Test Run By jahier on Fri Oct 3 16:55:54
Test Run By jahier on Fri Oct 3 17:14:34
Native configuration is x86_64-unknown-linux-gnu
=== lus2lic4 tests ===
......@@ -1727,13 +1727,13 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
===============================
# Total number of failures: 14
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 31 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 75 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 49 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 136 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 35 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 79 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 51 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 138 seconds
* Ref time:
0.06user 0.06system 5:31.68elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
96inputs+0outputs (0major+14861minor)pagefaults 0swaps
0.06user 0.08system 4:46.77elapsed 0%CPU (0avgtext+0avgdata 3000maxresident)k
120inputs+0outputs (0major+14868minor)pagefaults 0swaps
* Quick time (-j 4):
0.07user 0.06system 2:18.15elapsed 0%CPU (0avgtext+0avgdata 2464maxresident)k
1816inputs+0outputs (5major+12547minor)pagefaults 0swaps
0.10user 0.05system 2:19.89elapsed 0%CPU (0avgtext+0avgdata 2464maxresident)k
96inputs+0outputs (0major+12565minor)pagefaults 0swaps
lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 31 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 75 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 49 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 136 seconds
lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 35 seconds
lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 79 seconds
lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 51 seconds
lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 138 seconds
* Ref time:
0.06user 0.06system 5:31.68elapsed 0%CPU (0avgtext+0avgdata 3004maxresident)k
96inputs+0outputs (0major+14861minor)pagefaults 0swaps
0.06user 0.08system 4:46.77elapsed 0%CPU (0avgtext+0avgdata 3000maxresident)k
120inputs+0outputs (0major+14868minor)pagefaults 0swaps
* Quick time (-j 4):
0.07user 0.06system 2:18.15elapsed 0%CPU (0avgtext+0avgdata 2464maxresident)k
1816inputs+0outputs (5major+12547minor)pagefaults 0swaps
0.10user 0.05system 2:19.89elapsed 0%CPU (0avgtext+0avgdata 2464maxresident)k
96inputs+0outputs (0major+12565minor)pagefaults 0swaps
......@@ -563,3 +563,9 @@ by using the stack, I mean something like
#+BEGIN_SRC C
step(i,o);
#+END_SRC
** in Soc2cextern.cpy_def: shouldn't I use macro instead of function to be consistent ?
file:~/lus2lic/src/soc2cExtern.ml::28
I could even define a default version using memcpy as for arrays BTW.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment