Module IR.Binop

The Smallfoot Intermediate Language: Binary Operators

type t =
  1. | PlusA of Typ.ikind option
    (*

    arithmetic +

    *)
  2. | PlusPI
    (*

    pointer + integer

    *)
  3. | MinusA of Typ.ikind option
    (*

    arithmetic -

    *)
  4. | MinusPI
    (*

    pointer - integer

    *)
  5. | MinusPP
    (*

    pointer - pointer

    *)
  6. | Mult of Typ.ikind option
    (*

    *

    *)
  7. | DivI
    (*

    / for integers

    *)
  8. | DivF
    (*

    / for floats

    *)
  9. | Mod
    (*

    %

    *)
  10. | Shiftlt
    (*

    shift left

    *)
  11. | Shiftrt
    (*

    shift right

    *)
  12. | Lt
    (*

    < (arithmetic comparison)

    *)
  13. | Gt
    (*

    > (arithmetic comparison)

    *)
  14. | Le
    (*

    <= (arithmetic comparison)

    *)
  15. | Ge
    (*

    >= (arithmetic comparison)

    *)
  16. | Eq
    (*

    == (arithmetic comparison)

    *)
  17. | Ne
    (*

    != (arithmetic comparison)

    *)
  18. | BAnd
    (*

    bitwise and

    *)
  19. | BXor
    (*

    exclusive-or

    *)
  20. | BOr
    (*

    inclusive-or

    *)
  21. | LAnd
    (*

    logical and. Does not always evaluate both operands.

    *)
  22. | LOr
    (*

    logical or. Does not always evaluate both operands.

    *)

Binary operations

include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
include Ppx_hash_lib.Hashable.S with type t := t
val hash_fold_t : t Base__Ppx_hash_lib.hash_fold
val hash : t -> Base__Ppx_hash_lib.Std.Hash.hash_value
val hash_normalize : t -> t
val hash_normalize_opt : t option -> t option
val hash_normalize_list : t list -> t list
val str : IStdlib.Pp.env -> t -> string
val pp : IStdlib.IStd.Formatter.t -> t -> unit
val equal : t -> t -> bool
val injective : t -> bool

This function returns true if the operation is injective wrt. each argument: op(e,-) and op(-, e) is injective for all e. The return value false means "don't know".

val is_zero_runit : t -> bool

This function returns true if 0 is the right unit of binop. The return value false means "don't know".