jon.recoil.org

Module Cfg_intf.S

type func_call_operation =
  1. | Indirect of Cmm.symbol list option
  2. | Direct of Cmm.symbol
type external_call_operation = {
  1. func_symbol : string;
  2. alloc : bool;
  3. effects : Cmm.effects;
  4. ty_res : Cmm.machtype;
  5. ty_args : Cmm.exttype list;
  6. stack_ofs : int;
  7. stack_align : Cmm.stack_align;
}
type prim_call_operation =
  1. | External of Cfg_intf.S.external_call_operation
  2. | Probe of {
    1. name : string;
    2. handler_code_sym : string;
    3. enabled_at_init : bool;
    }
type bool_test = {
  1. ifso : Label.t;
    (*

    if test is true goto ifso label

    *)
  2. ifnot : Label.t;
    (*

    if test is false goto ifnot label

    *)
}
type int_test = {
  1. lt : Label.t;
    (*

    if x < y (resp. x < n) goto lt label

    *)
  2. eq : Label.t;
    (*

    if x = y (resp. x = n) goto eq label

    *)
  3. gt : Label.t;
    (*

    if x > y (resp. x > n) goto gt label

    *)
  4. is_signed : Scalar.Signedness.t;
  5. imm : int option;
}

int_test represents all possible outcomes of a comparison between two integers. When imm field is None, compare variables x and y, specified by the arguments of the enclosing instruction. When imm field is Some n, compare variable x and immediate n. This corresponds to Mach.Iinttest and Mach.Iinttest_imm in the compiler.

type float_test = {
  1. width : Cmm.float_width;
  2. lt : Label.t;
  3. eq : Label.t;
  4. gt : Label.t;
  5. uo : Label.t;
    (*

    if at least one of x or y is NaN

    *)
}

float_test represents possible outcomes of comparison between arguments x and y of type float. It is not enough to check "=,<,>" because possible outcomes of comparison include "unordered" (see e.g. x86-64 emitter) when the arguments involve NaNs.

type 'a instruction = {
  1. desc : 'a;
  2. id : InstructionId.t;
  3. mutable arg : Reg.t array;
  4. mutable res : Reg.t array;
  5. mutable dbg : Debuginfo.t;
  6. mutable fdo : Fdo_info.t;
  7. mutable live : Reg.Set.t;
  8. mutable stack_offset : int;
  9. mutable available_before : Reg_availability_set.t;
  10. mutable available_across : Reg_availability_set.t;
    (*

    The availability sets will be set to Unreachable prior to the availability analysis having run.

    *)
}
type basic =
  1. | Op of Operation.t
  2. | Reloadretaddr
    (*

    This instruction loads the return address from a predefined hidden address (e.g. bottom of the current frame) and stores it in a special hidden register. It can use standard registers for that purpose. They are defined in Proc.destroyed_at_reloadretaddr.

    *)
  3. | Pushtrap of {
    1. lbl_handler : Label.t;
    }
  4. | Poptrap of {
    1. lbl_handler : Label.t;
    }
  5. | Prologue
  6. | Epilogue
  7. | Stack_check of {
    1. max_frame_size_bytes : int;
    }
type 'a with_label_after = {
  1. op : 'a;
  2. label_after : Label.t;
}
type terminator =
  1. | Never
  2. | Always of Label.t
  3. | Parity_test of Cfg_intf.S.bool_test
    (*

    Check if the argument is even or odd

    *)
  4. | Truth_test of Cfg_intf.S.bool_test
    (*

    Check if the argument is true or false.

    *)
  5. | Float_test of Cfg_intf.S.float_test
  6. | Int_test of Cfg_intf.S.int_test
  7. | Switch of Label.t array
  8. | Return
  9. | Raise of Lambda.raise_kind
  10. | Tailcall_self of {
    1. destination : Label.t;
    }
  11. | Tailcall_func of Cfg_intf.S.func_call_operation
  12. | Call_no_return of Cfg_intf.S.external_call_operation
  13. | Call of Cfg_intf.S.func_call_operation Cfg_intf.S.with_label_after
  14. | Prim of Cfg_intf.S.prim_call_operation Cfg_intf.S.with_label_after
type basic_or_terminator =
  1. | Basic of Cfg_intf.S.basic
  2. | Terminator of Cfg_intf.S.terminator