[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 *)
| Lt (** Less-than test *)
| Le (** Less-than-or-equal test *)
| Ugt (** Unordered or greater-than test *)
| Uge (** Unordered or greater-than-or-equal test *)
| Ult (** Unordered or less-than test *)
| Ule (** Unordered or less-than-or-equal test *)
| Ugt (** Unsigned greater-than test *)
| Uge (** Unsigned greater-than-or-equal test *)
| Ult (** Unsigned less-than test *)
| Ule (** Unsigned less-than-or-equal test *)
| Ord (** Ordered test (neither arg is nan) *)
| Uno (** Unordered test (some arg is nan) *)
| 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
| Eq -> binary Exp.eq
| Ne -> binary Exp.dq
| Sgt | Ugt -> binary Exp.gt
| Sge | Uge -> binary Exp.ge
| Slt | Ult -> binary Exp.lt
| Sle | Ule -> binary Exp.le )
| Sgt -> binary Exp.gt
| Sge -> binary Exp.ge
| Slt -> binary Exp.lt
| Sle -> binary Exp.le
| Ugt -> binary Exp.ugt
| Uge -> binary Exp.uge
| Ult -> binary Exp.ult
| Ule -> binary Exp.ule )
| FCmp -> (
match Llvm.fcmp_predicate llv with
| None | Some False -> binary (fun _ _ -> Exp.bool false)

Loading…
Cancel
Save