summaryrefslogtreecommitdiff
path: root/src/jib
diff options
context:
space:
mode:
Diffstat (limited to 'src/jib')
-rw-r--r--src/jib/c_backend.ml22
-rw-r--r--src/jib/jib_compile.ml2
-rw-r--r--src/jib/jib_ssa.ml1
-rw-r--r--src/jib/jib_util.ml14
4 files changed, 9 insertions, 30 deletions
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml
index d21d219c..b98c53c4 100644
--- a/src/jib/c_backend.ml
+++ b/src/jib/c_backend.ml
@@ -86,7 +86,7 @@ let optimize_primops = ref false
let optimize_hoist_allocations = ref false
let optimize_struct_updates = ref false
let optimize_alias = ref false
-let optimize_int128 = ref false
+let optimize_int128 = ref false
let c_debug str =
if !c_verbosity > 0 then prerr_endline (Lazy.force str) else ()
@@ -522,26 +522,6 @@ let analyze_primop' ctx id args typ =
no_change
end
- (*
- | "undefined_vector", [AV_C_fragment (len, _, _); _] ->
- begin match destruct_vector ctx.tc_env typ with
- | Some (Nexp_aux (Nexp_constant n, _), _, Typ_aux (Typ_id id, _))
- when string_of_id id = "bit" && Big_int.less_equal n (Big_int.of_int 64) ->
- AE_val (AV_C_fragment (F_lit (V_bit Sail2_values.B0), typ, ctyp_of_typ ctx typ))
- | _ -> no_change
- end
-
- | "neg_int", [AV_C_fragment (frag, _, _)] ->
- AE_val (AV_C_fragment (F_op (v_int 0, "-", frag), typ, CT_fint 64))
-
- | "vector_update_subrange", [AV_C_fragment (xs, _, CT_fbits (n, true));
- AV_C_fragment (hi, _, CT_fint 64);
- AV_C_fragment (lo, _, CT_fint 64);
- AV_C_fragment (ys, _, CT_fbits (m, true))] ->
- AE_val (AV_C_fragment (F_call ("fast_update_subrange", [xs; hi; lo; ys]), typ, CT_fbits (n, true)))
-
- *)
-
| "undefined_bit", _ ->
AE_val (AV_cval (V_lit (VL_bit Sail2_values.B0, CT_bit), typ))
diff --git a/src/jib/jib_compile.ml b/src/jib/jib_compile.ml
index a5a411f5..ad60d224 100644
--- a/src/jib/jib_compile.ml
+++ b/src/jib/jib_compile.ml
@@ -435,7 +435,7 @@ let optimize_call l ctx clexp id args arg_ctyps ret_ctyp =
if not ctx.specialize_calls && Env.is_extern id ctx.tc_env "c" then
let extern = Env.get_extern id ctx.tc_env "c" in
begin match extern, List.map cval_ctyp args, clexp_ctyp clexp with
- | "slice", [CT_fbits _; _; _], CT_fbits (n, _) ->
+ | "slice", [CT_fbits _; CT_lint; _], CT_fbits (n, _) ->
let start = ngensym () in
[iinit (CT_fint 64) start (List.nth args 1);
icopy l clexp (V_call (Slice n, [List.nth args 0; V_id (start, CT_fint 64)]))]
diff --git a/src/jib/jib_ssa.ml b/src/jib/jib_ssa.ml
index 19dff7b1..c8027ee5 100644
--- a/src/jib/jib_ssa.ml
+++ b/src/jib/jib_ssa.ml
@@ -672,7 +672,6 @@ let ssa instrs =
place_phi_functions cfg df;
rename_variables cfg start children;
place_pi_functions cfg start idom children;
- (* remove_guard_nodes (function CF_guard _ -> true | CF_label _ -> true | _ -> false) cfg; *)
start, cfg
(* Debugging utilities for outputing Graphviz files. *)
diff --git a/src/jib/jib_util.ml b/src/jib/jib_util.ml
index 1c2e9530..c98c325c 100644
--- a/src/jib/jib_util.ml
+++ b/src/jib/jib_util.ml
@@ -295,13 +295,13 @@ let string_of_op = function
| Igteq -> "@gteq"
| Iadd -> "@iadd"
| Isub -> "@isub"
- | Unsigned n -> "@unsigned::<" ^ string_of_int n ^ "@>"
- | Signed n -> "@signed::<" ^ string_of_int n ^ "@>"
- | Zero_extend n -> "@zero_extend::<" ^ string_of_int n ^ "@>"
- | Sign_extend n -> "@sign_extend::<" ^ string_of_int n ^ "@>"
- | Slice n -> "@slice::<" ^ string_of_int n ^ "@>"
- | Sslice n -> "@sslice::<" ^ string_of_int n ^ "@>"
- | Replicate n -> "@replicate::<" ^ string_of_int n ^ "@>"
+ | Unsigned n -> "@unsigned::<" ^ string_of_int n ^ ">"
+ | Signed n -> "@signed::<" ^ string_of_int n ^ ">"
+ | Zero_extend n -> "@zero_extend::<" ^ string_of_int n ^ ">"
+ | Sign_extend n -> "@sign_extend::<" ^ string_of_int n ^ ">"
+ | Slice n -> "@slice::<" ^ string_of_int n ^ ">"
+ | Sslice n -> "@sslice::<" ^ string_of_int n ^ ">"
+ | Replicate n -> "@replicate::<" ^ string_of_int n ^ ">"
| Set_slice -> "@set_slice"
| Concat -> "@concat"