Bitwise and.
This commit is contained in:
parent
1ec15b9409
commit
8d772e20e2
4 changed files with 5 additions and 2 deletions
|
@ -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 *)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -116,6 +116,7 @@ and op ff (f, e_l) =
|
|||
| "~~" -> "~"
|
||||
| "<<<" -> "<<"
|
||||
| ">>>" -> ">>"
|
||||
| "&&&" -> "&"
|
||||
| op -> op
|
||||
in
|
||||
match Names.modul f with
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue