let bool_cmp_binop ?(not=false) op ty e1 e2 =
let op = if not then cmp_binop_neg op else op in
if Types.is_ptr_ltype ty then ptr_bool_cmp_binop op e1 e2
else if Cil.isLogicIntegralType ty then int_bool_cmp_binop_name op e1 e2
else if Cil.isLogicRealOrFloatType ty then real_bool_cmp_binop_name op e1 e2
else
let str = Pretty_utils.sfprintf "%a" !Ast_printer.d_logic_type ty in
raise (UnnamedCilOp ("comparison for type "^str))