Previous - Up - Next

SIM_instruction_get_reg_info()

NAME
SIM_instruction_get_reg_info — get info about instruction register

SYNOPSIS
reg_info_t *
SIM_instruction_get_reg_info(instruction_id_t ii, 
                             int n);

DESCRIPTION
This function can by used to get information about which register an instruction uses as input and/or output. The function takes as arguments the instruction id, ii, and a number for the n:th used register. If successful, a pointer to a reg_info_t will be returned. The structure is only available for immediate use. 0 is return if there is no n:th register. Typically this function is used in a loop to retrieve all registers until it returns 0.

The reg_info_t is defined like this:

struct reg_info {
        register_type_t type;   /* register type */
        register_id_t id;       /* register id */
        unsigned input:1;       /* used as input */
        unsigned output:1;      /* used as output */
};

The register_id_t refers to the different registers of the architecture in question. Only registers that are targets for register renaming are reported by this function.

EXCEPTIONS
General If the instruction is not decoded.
Index Thrown if ii is illegal.
RETURN VALUE
pointer to a reg_info_t structure or NULL if there is no n:th register.
SEE ALSO
SIM_instruction_read_input_reg

Previous - Up - Next