Skip to content

Commit

Permalink
Remove repeated negations
Browse files Browse the repository at this point in the history
  • Loading branch information
yav committed Aug 5, 2024
1 parent 7ca5f6c commit 8ef45ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/cn/lib/simplify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ module IndexTerms = struct
let a = aux a in
(match (op, IT.term a) with
| Not, Const (Bool b) -> bool_ (not b) the_loc
| Not, Unop (Not, x) -> x
| Negate, Unop (Negate,x) -> x
| Negate, Const (Z z) -> z_ (Z.neg z) the_loc
| Negate, Const (Bits ((sign, width), z)) ->
num_lit_ (Z.neg z) (BT.Bits (sign, width)) the_loc
Expand Down

0 comments on commit 8ef45ec

Please sign in to comment.