GCC Middle and Back End API Reference
conlist Class Reference

Public Member Functions

 conlist ()=default
 
 conlist (const char *ns, unsigned int len, bool numeric)
 
void add (char c)
 
char * out ()
 

Data Fields

std::string name
 
int idx = -1
 

Private Attributes

std::string con
 

Detailed Description

The following is for handling the compact syntax for constraints and
attributes.

The normal syntax looks like this:

    ...
    (match_operand: 0 "s_register_operand" "r,I,k")
    (match_operand: 2 "s_register_operand" "r,k,I")
    ...
    "@
     <asm>
     <asm>
     <asm>"
    ...
    (set_attr "length" "4,8,8")

The compact syntax looks like this:

    ...
    (match_operand: 0 "s_register_operand")
    (match_operand: 2 "s_register_operand")
    ...
    {@ [cons: 0, 2; attrs: length]
     [r,r; 4] <asm>
     [I,k; 8] <asm>
     [k,I; 8] <asm>
    }
    ...
    [<other attributes>]

This is the only place where this syntax needs to be handled.  Relevant
patterns are transformed from compact to the normal syntax before they are
queued, so none of the gen* programs need to know about this syntax at all.

Conversion process (convert_syntax):

0) Check that pattern actually uses new syntax (check for {@ ... }).

1) Get the "layout", i.e. the "[cons: 0 2; attrs: length]" from the above
   example.  cons must come first; both are optional. Set up two vecs,
   convec and attrvec, for holding the results of the transformation.

2) For each alternative: parse the list of constraints and/or attributes,
   and enqueue them in the relevant lists in convec and attrvec.  By the end
   of this process, convec[N].con and attrvec[N].con should contain regular
   syntax constraint/attribute lists like "r,I,k".  Copy the asm to a string
   as we go.

3) Search the rtx and write the constraint and attribute lists into the
   correct places. Write the asm back into the template.   
Helper class for shuffling constraints/attributes in convert_syntax and
add_constraints/add_attributes.  This includes commas but not whitespace.   

Constructor & Destructor Documentation

◆ conlist() [1/2]

conlist::conlist ( )
default

◆ conlist() [2/2]

conlist::conlist ( const char * ns,
unsigned int len,
bool numeric )
inline

References con, i, idx, name, and NULL.

Member Function Documentation

◆ add()

void conlist::add ( char c)
inline

References con.

◆ out()

char * conlist::out ( )
inline

References con.

Field Documentation

◆ con

std::string conlist::con
private

Referenced by add(), conlist(), and out().

◆ idx

int conlist::idx = -1

Referenced by conlist().

◆ name

std::string conlist::name

Referenced by conlist().


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