Llair.Exp
Expressions
Pure (heap-independent) expressions are complex arithmetic, bitwise-logical, etc. operations over literal values and registers.
type op1 =
| Signed of {
}
Ap1 (Signed {bits= n}, dst, arg)
is arg
interpreted as an n
-bit signed integer and injected into the dst
type. That is, it two's-complement--decodes the low n
bits of the infinite two's-complement encoding of arg
. The injection into dst
is a no-op, so dst
must be an integer type with bitwidth at least n
. This expression can also be lifted to operate element-wise over arrays. When dst
is an array arg
must also be an array of the same length, with element types satisfying the aforementioned constraints on integer types.
| Unsigned of {
}
Ap1 (Unsigned {bits= n}, dst, arg)
is arg
interpreted as an n
-bit unsigned integer and injected into the dst
type. That is, it unsigned-binary--decodes the low n
bits of the infinite two's-complement encoding of arg
. The injection into dst
is a no-op, so dst
must be an integer type with bitwidth greater than n
. This expression can be lifted to arrays, as described for Signed
just above.
| Splat
Iterated concatenation of a single byte
*)| Select of int
Select an index from a record
*)val sexp_of_op1 : op1 -> Sexplib0.Sexp.t
val op1_of_sexp : Sexplib0.Sexp.t -> op1
type op2 =
| Eq
Equal test
*)| Dq
Disequal test
*)| Gt
Greater-than test
*)| Ge
Greater-than-or-equal test
*)| Lt
Less-than test
*)| Le
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
*)| Sub
Subtraction
*)| Mul
Multiplication
*)| Div
Division, for integers result is truncated toward zero
*)| Rem
Remainder of division, satisfies a = b * div a b + rem a b
and for integers rem a b
has same sign as a
, and |rem a b| < |b|
| Udiv
Unsigned division
*)| Urem
Remainder of unsigned division
*)| And
Conjunction, boolean or bitwise
*)| Or
Disjunction, boolean or bitwise
*)| Xor
Exclusive-or, bitwise
*)| Shl
Shift left, bitwise
*)| Lshr
Logical shift right, bitwise
*)| Ashr
Arithmetic shift right, bitwise
*)| Update of int
Constant record with updated index
*)val sexp_of_op2 : op2 -> Sexplib0.Sexp.t
val op2_of_sexp : Sexplib0.Sexp.t -> op2
val sexp_of_op3 : op3 -> Sexplib0.Sexp.t
val op3_of_sexp : Sexplib0.Sexp.t -> op3
val sexp_of_opN : opN -> Sexplib0.Sexp.t
val opN_of_sexp : Sexplib0.Sexp.t -> opN
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S with type t := t
val equal : t Base__Ppx_compare_lib.equal
include NS.Invariant.S with type t := t
val invariant : t -> unit
module Reg : sig ... end
Exp.Reg is re-exported as Reg
module Global : sig ... end
Exp.Global is re-exported as Global
module FuncName : sig ... end
Exp.FuncName is re-exported as FuncName
Construct
val funcname : FuncName.t -> t
val label : parent:string -> name:string -> t
val null : t
val bool : bool -> t
val true_ : t
val false_ : t
val float : Llair__.LlairTyp.t -> string -> t
Traverse
Query
val is_true : t -> bool
val is_false : t -> bool
val typ_of : t -> Llair__.LlairTyp.t