This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tue, Mar 10, 2009 at 10:18:10PM +0100, Georg-Johann Lay wrote:
Note that no one is generating an insn that looks like "*jump". Maybe insn combine and peep2 would try to build such a pattern, but that is not what helpd you out here. Write the expander as parallel of a (set (pc) ...) and a (clobber (match_scratch ...)) so that an appropriate insn is expanded.
Like this ?
(define_expand "jump" [(parallel [(set (pc) (label_ref (match_operand 0 "" ""))) (clobber (match_scratch:QI 1 "=&r"))])] "" "" )
Also note that "*jump" is an (implicit) parallel. As constraint for the "*jump" insn use an "X" in the case you do not need the clobber reg and sth. like "=&r" in the case you really need it.
Ok, but the decision on if I need the clobber reg or not is based on the 'length' attribute. So if I could write the following, but where I can put the calculation and the test of the 'length' attribute:
(define_insn "*jump_internal" [(set (pc) (label_ref (match_operand 0 "" ""))) (clobber (match_scratch:QI 1 "X,=&r"))] "" "@ rjmp %0 ldih %1,hi(%l0)\n\t\n\tldil %1,lo(%l0)\n\tijmp (%1)" )
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |