diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/constraint.ml | 2 | ||||
| -rw-r--r-- | src/jib/c_backend.ml | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/constraint.ml b/src/constraint.ml index d8241e1d..1a4129ff 100644 --- a/src/constraint.ml +++ b/src/constraint.ml @@ -181,7 +181,7 @@ let to_smt l vars constr = | Nexp_minus (nexp1, nexp2) -> sfun "-" [smt_nexp nexp1; smt_nexp nexp2] | Nexp_exp nexp -> begin match nexp_simp nexp with - | Nexp_aux (Nexp_constant c, _) when Big_int.greater c Big_int.zero -> + | Nexp_aux (Nexp_constant c, _) when Big_int.greater_equal c Big_int.zero -> Atom (Big_int.to_string (Big_int.pow_int_positive 2 (Big_int.to_int c))) | nexp when !opt_solver.uninterpret_power -> sfun "sailexp" [smt_nexp nexp] | nexp -> sfun "^" [Atom "2"; smt_nexp nexp] diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml index c13b7f3b..242f31b2 100644 --- a/src/jib/c_backend.ml +++ b/src/jib/c_backend.ml @@ -398,14 +398,14 @@ let analyze_primop' ctx id args typ = c_debug (lazy ("Analyzing primop " ^ extern ^ "(" ^ Util.string_of_list ", " (fun aval -> Pretty_print_sail.to_string (pp_aval aval)) args ^ ")")); match extern, args with - | "eq_bits", [AV_cval (v1, _); AV_cval (v2, _)] -> + | "eq_bits", [AV_cval (v1, _); AV_cval (v2, _)] when ctyp_equal (cval_ctyp v1) (cval_ctyp v2) -> begin match cval_ctyp v1 with | CT_fbits _ | CT_sbits _ -> AE_val (AV_cval (V_call (Eq, [v1; v2]), typ)) | _ -> no_change end - | "neq_bits", [AV_cval (v1, _); AV_cval (v2, _)] -> + | "neq_bits", [AV_cval (v1, _); AV_cval (v2, _)] when ctyp_equal (cval_ctyp v1) (cval_ctyp v2) -> begin match cval_ctyp v1 with | CT_fbits _ | CT_sbits _ -> AE_val (AV_cval (V_call (Neq, [v1; v2]), typ)) |
