RFA: Process '*' in '@'-output-template alternatives

Joern Rennecke amylaar@spamcop.net
Wed Sep 19 12:07:00 GMT 2012


Quoting Richard Guenther <richard.guenther@gmail.com>:


> I think that needs to be documented somewhere in the internals manual,

I suppose it should logically go to the current end of the Output  
Statement node in md.texi .  Line 668 in revision 191429, just before  
the Predicates
node.

> possibly with an example.

AFAICT the existing examples are pieces of real machine descriptions.
One possibility would be the movsi_insn from the arc-4_4-20090909-branch:

(define_insn "*movsi_insn"
   [(set (match_operand:SI 0 "move_dest_operand" "=Rcq,Rcq#q,w, w,w,   
w,???w, ?w,  w,Rcq#q, w,Rcq,  S,Us<,RcqRck,!*x,r,m,???m,VUsc")
         (match_operand:SI 1 "move_src_operand"  "  
cL,cP,Rcq#q,cL,I,Crr,?Rac,Cpc,Clb,?Cal,?Cal,T,Rcq,RcqRck,Us>,Usd,m,c,?Rac,C32"))]
   "register_operand (operands[0], SImode)
    || register_operand (operands[1], SImode)
    || (CONSTANT_P (operands[1])
        /* Don't use a LIMM that we could load with a single insn - we loose
           delay-slot filling opportunities.  */
        && !satisfies_constraint_I (operands[1])
        && satisfies_constraint_Usc (operands[0]))"
   "@
    mov%? %0,%1%&
    mov%? %0,%1%&
    mov%? %0,%1%&
    mov%? %0,%1
    mov%? %0,%1
    ror %0,((%1*2+1) & 0x3f)
    mov%? %0,%1
    add %0,%S1
    * return arc_get_unalign () ? \"add %0,pcl,%1-.+2\" : \"add %0,pcl,%1-.\";
    mov%? %0,%S1%&
    mov%? %0,%S1
    ld%? %0,%1%&
    st%? %1,%0%&
    * return arc_short_long (insn, \"push%? %1%&\", \"st%U0 %1,%0%&\");
    * return arc_short_long (insn, \"pop%? %0%&\",  \"ld%U1 %0,%1%&\");
    ld%? %0,%1%&
    ld%U1%V1 %0,%1
    st%U0%V0 %1,%0
    st%U0%V0 %1,%0
    st%U0%V0 %S1,%0"
   [(set_attr "type"  
"move,move,move,move,move,two_cycle_core,move,binary,binary,move,move,load,store,store,load,load,load,store,store,store")
    (set_attr "iscompact"  
"maybe,maybe,maybe,false,false,false,false,false,false,maybe_limm,false,true,true,true,true,true,false,false,false,false")
    ; Use default length for iscompact to mark length varying.  But set length
    ; of Crr to 4.
    (set_attr "length" "*,*,*,4,4,4,4,8,8,*,8,*,*,*,*,*,*,*,*,8")
    (set_attr "cond"  
"canuse,canuse_limm,canuse,canuse,canuse_limm,canuse_limm,canuse,nocond,nocond,canuse,canuse,nocond,nocond,nocond,nocond,nocond,nocond,nocond,nocond,nocond")])

Although the number of different concepts combined here might a bit
distract from the point.  Also, it'll need steering commitee approval
to put this code, which was previously contributed under the GPL (on the
branch) into GFDL documentation.

Or should I make up a reduced/synthetic example for a simpler - but
probably pointless as an actual output template - example?



More information about the Gcc-patches mailing list