GCC Middle and Back End API Reference
generator Struct Reference
Collaboration diagram for generator:

Public Member Functions

 generator (const md_rtx_info &info)
void add_uint (uint64_t)
void add_opcode (expand_opcode opcode)
void add_code (rtx_code code)
void add_match_operator (machine_mode, int, rtvec)
void add_exp (rtx)
void add_vec (rtvec)
const char * gen_table (FILE *, const char *)
const char * gen_exp (FILE *, rtx)
const char * gen_emit_seq (FILE *, rtvec)

Data Fields

const md_rtx_info info
auto_vec< uint8_t > bytes

Detailed Description

A structure used to generate code for a particular expansion.

Constructor & Destructor Documentation

◆ generator()

generator::generator ( const md_rtx_info & info)
inline

References info.

Member Function Documentation

◆ add_code()

void generator::add_code ( rtx_code code)
inline

References add_uint(), and FIRST_CODE.

Referenced by add_exp().

◆ add_exp()

◆ add_match_operator()

void generator::add_match_operator ( machine_mode mode,
int opno,
rtvec vec )
Add the rtx expansion of a MATCH_OPERATOR or MATCH_OP_DUP. OPNO is the number of the matched operand. MODE is the mode that the rtx should have, or NUM_MACHINE_MODES if the operand's original mode should be retained. VEC is the vector of suboperands, which replace those of the original operand.

References add_exp(), add_opcode(), add_uint(), GET_NUM_ELEM, i, MATCH_OPERATOR, MATCH_OPERATOR_WITH_MODE, and RTVEC_ELT.

Referenced by add_exp().

◆ add_opcode()

void generator::add_opcode ( expand_opcode opcode)
inline

References add_uint().

Referenced by add_exp(), and add_match_operator().

◆ add_uint()

void generator::add_uint ( uint64_t value)
Add VALUE to the encoding using "BEB128" (big-endian version of LEB128). This is slightly easier for the consumer.

References bytes, shift, and value.

Referenced by add_code(), add_exp(), add_match_operator(), add_opcode(), and add_vec().

◆ add_vec()

void generator::add_vec ( rtvec vec)
Add the expansion of rtx vector VEC to the encoding.

References add_exp(), add_uint(), GET_NUM_ELEM, i, and RTVEC_ELT.

Referenced by add_exp(), and gen_emit_seq().

◆ gen_emit_seq()

const char * generator::gen_emit_seq ( FILE * file,
rtvec vec )
Output the code necessary for emitting each element of VEC as a separate instruction. Return the name of the C++ array that contains the encoding.

References add_vec(), and gen_table().

Referenced by gen_expand(), and gen_split().

◆ gen_exp()

const char * generator::gen_exp ( FILE * file,
rtx x )
Output the code necessary for generating rtx X and return the name of the C++ array that contains the encoding.

References add_exp(), and gen_table().

Referenced by gen_expand(), and gen_insn().

◆ gen_table()

const char * generator::gen_table ( FILE * file,
const char * name )
Emit the encoding as a static C++ array called NAME. Return NAME.

References bytes, and i.

Referenced by gen_emit_seq(), and gen_exp().

Field Documentation

◆ bytes

auto_vec<uint8_t> generator::bytes

Referenced by add_uint(), and gen_table().

◆ info

const md_rtx_info generator::info

Referenced by add_exp(), and generator().


The documentation for this struct was generated from the following file: