Make Cmmgen understand constant bools

master
Pierre Chambart 2016-03-30 12:05:30 +02:00
parent 7542c34f1d
commit 2923d4d294
1 changed files with 5 additions and 0 deletions

View File

@ -437,6 +437,11 @@ let safe_mod_bi =
let test_bool = function
Cop(Caddi, [Cop(Clsl, [c; Cconst_int 1]); Cconst_int 1]) -> c
| Cconst_int n ->
if n = 1 then
Cconst_int 0
else
Cconst_int 1
| c -> Cop(Ccmpi Cne, [c; Cconst_int 1])
(* Float *)