This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: symbol_refs vs. eq_attr in define_insn_reservations
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Quentin Neill <quentin dot neill dot gnu at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 16 Feb 2012 19:37:07 +0000
- Subject: Re: symbol_refs vs. eq_attr in define_insn_reservations
- References: <CAEhygDo3mvryuw6YxUQU6V6Y2AZP=PFi2o-G9vTuAYseukFC-A@mail.gmail.com>
Quentin Neill <quentin.neill.gnu@gmail.com> writes:
> Hi,
>
> For readability (and correctness) I'm interested in rewriting a bunch of:
>
> (define_insn_reservation "insn1" 0 (eq_attr "attr1" "val1,val2"))
>
> into something like:
>
> (define attr "consattr1" "val1,val2"
> (const (cond [
> (eq_attr "attr1" "val1") (const_string "cvaly")
> (eq_attr "attr1" "val2") (const_string "cvaly")]
> (const_string "cvaln"))))
>
> (define_insn_reservation "insn1" 0 (eq_attr "consattr1" "cval"))
The general idea should work, but I don't think the (cond ...)
should be wrapped in a (const ...)
Richard