This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: peephole2 question
- From: Alan Lehotsky <apl at alum dot mit dot edu>
- To: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 23 Apr 2002 18:45:32 -0400
- Subject: Re: peephole2 question
- References: <200204232210.g3NMAhM30480@hyper.wm.sps.mot.com>
You use a "match_dup" in the peephole result and an action statement that
does something like
(define_peephole2
[(set (match_operand:DF 0 "m68k_freg_operand" "")
(mem:DF (match_operand:SI 1 "m68k_areg_operand" "")))
(set (match_operand:DF 2 "m68k_freg_operand" "")
(match_operator:DF 3 "plus_or_mult_operator"
[(match_dup 2)
(match_dup 0)]))]
"0 && TARGET_CFV4E
&& peep2_reg_dead_p (2, operands[0])
&& REGNO (operands[0]) != REGNO (operands[2])"
[(set (match_dup 2)
(match_dup 3)
)]
"
operands[3] = gen_rtx (..... operands[2], operands[1])
")
You might want to make your "plus_or_mult_operator()" function leave the
right code somewhere global so that you don't have to grovel thru the pattern
to find if it's PLUS or MULT....
At 6:10 PM -0400 4/23/02, Peter Barada wrote:
>I've got a peephole2 that uses match_operator to select both PLUS and
>MULT. How to I specify in the new-insn-pattern the result of the
>match_operator? In the following, what do I put in place of 'xxx'
>that means the operator that I think is in operands[3]:
>
--
Quality Software Management
http://home.earthlink.net/~qsmgmt
apl@alum.mit.edu
(978)287-0435 Voice
(978)808-6836 Cell
Software Process Improvement / Management Consulting
Language Design / Compiler Implementation