[sledge] Distinguish signed and unsigned integer comparisons

Reviewed By: mbouaziz

Differential Revision: D10488406

fbshipit-source-id: cc5b325c6
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent ea7b185b6b
commit 8074eea927

@ -42,10 +42,10 @@ type t = private
| Ge (** Greater-than-or-equal test *) | Ge (** Greater-than-or-equal test *)
| Lt (** Less-than test *) | Lt (** Less-than test *)
| Le (** Less-than-or-equal test *) | Le (** Less-than-or-equal test *)
| Ugt (** Unordered or greater-than test *) | Ugt (** Unsigned greater-than test *)
| Uge (** Unordered or greater-than-or-equal test *) | Uge (** Unsigned greater-than-or-equal test *)
| Ult (** Unordered or less-than test *) | Ult (** Unsigned less-than test *)
| Ule (** Unordered or less-than-or-equal test *) | Ule (** Unsigned less-than-or-equal test *)
| Ord (** Ordered test (neither arg is nan) *) | Ord (** Ordered test (neither arg is nan) *)
| Uno (** Unordered test (some arg is nan) *) | Uno (** Unordered test (some arg is nan) *)
| Add (** Addition *) | Add (** Addition *)

@ -444,10 +444,14 @@ and xlate_opcode : x -> Llvm.llvalue -> Llvm.Opcode.t -> Exp.t =
match Option.value_exn (Llvm.icmp_predicate llv) with match Option.value_exn (Llvm.icmp_predicate llv) with
| Eq -> binary Exp.eq | Eq -> binary Exp.eq
| Ne -> binary Exp.dq | Ne -> binary Exp.dq
| Sgt | Ugt -> binary Exp.gt | Sgt -> binary Exp.gt
| Sge | Uge -> binary Exp.ge | Sge -> binary Exp.ge
| Slt | Ult -> binary Exp.lt | Slt -> binary Exp.lt
| Sle | Ule -> binary Exp.le ) | Sle -> binary Exp.le
| Ugt -> binary Exp.ugt
| Uge -> binary Exp.uge
| Ult -> binary Exp.ult
| Ule -> binary Exp.ule )
| FCmp -> ( | FCmp -> (
match Llvm.fcmp_predicate llv with match Llvm.fcmp_predicate llv with
| None | Some False -> binary (fun _ _ -> Exp.bool false) | None | Some False -> binary (fun _ _ -> Exp.bool false)

Loading…
Cancel
Save