diff --git a/compiler/global/static.ml b/compiler/global/static.ml index 93574db..1560142 100644 --- a/compiler/global/static.ml +++ b/compiler/global/static.ml @@ -100,6 +100,7 @@ let apply_op partial loc op se_list = | "~-", [Sint n] -> Sint (-n) | "~~", [Sint n] -> Sint (lnot n) | "~-.", [Sfloat f] -> Sfloat (-. f) + | "&&&", [Sint n1; Sint n2] -> Sint (n1 land n2) | f,_ -> Misc.internal_error ("Static evaluation failed of the pervasive operator "^f) ) else ( (* symbolic evaluation *) diff --git a/compiler/obc/c/cgen.ml b/compiler/obc/c/cgen.ml index 4d835ad..46c1f6f 100644 --- a/compiler/obc/c/cgen.ml +++ b/compiler/obc/c/cgen.ml @@ -109,7 +109,7 @@ let copname = function | "+." -> "+" | "-." -> "-" | "<" -> "<" | ">" -> ">" | "<=" -> "<=" | ">=" -> ">=" | "<=." -> "<=" | "<." -> "<" | ">=." -> ">=" | ">." -> ">" | "~-" -> "-" | "not" -> "!" | "%" -> "%" - | ">>>" -> ">>" | "<<<" -> "<<" + | ">>>" -> ">>" | "<<<" -> "<<" | "&&&" -> "&" | op -> op (** Translates an Obc var_dec to a tuple (name, cty). *) @@ -274,7 +274,7 @@ and cop_of_op_aux op_name cexps = match op_name with "=" | "<>" | "&" | "or" | "+" | "-" | "*" | "/" - | "*." | "/." | "+." | "-." | "%" | "<<<" | ">>>" + | "*." | "/." | "+." | "-." | "%" | "<<<" | ">>>" | "&&&" | "<" | ">" | "<=" | ">=" | "<=." | "<." | ">=." | ">."), [el;er] -> Cbop (copname op, el, er) | _ -> Cfun_call(op, cexps) diff --git a/compiler/obc/java/java_printer.ml b/compiler/obc/java/java_printer.ml index c803ee4..ca10fb4 100644 --- a/compiler/obc/java/java_printer.ml +++ b/compiler/obc/java/java_printer.ml @@ -116,6 +116,7 @@ and op ff (f, e_l) = | "~~" -> "~" | "<<<" -> "<<" | ">>>" -> ">>" + | "&&&" -> "&" | op -> op in match Names.modul f with diff --git a/lib/pervasives.epi b/lib/pervasives.epi index 5e68ac2..8b48063 100644 --- a/lib/pervasives.epi +++ b/lib/pervasives.epi @@ -30,6 +30,7 @@ val fun (~-)(int) returns (int) val fun (~~)(int) returns (int) val fun (>>>)(int;int) returns (int) val fun (<<<)(int;int) returns (int) +val fun (&&&)(int;int) returns (int) val fun (~-.)(float) returns (float) val fun do_stuff(int) returns (int) val fun between(int;int) returns (int)