This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
symbol_refs vs. eq_attr in define_insn_reservations
- From: Quentin Neill <quentin dot neill dot gnu at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 13 Feb 2012 17:52:00 -0600
- Subject: symbol_refs vs. eq_attr in define_insn_reservations
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"))
But then in http://gcc.gnu.org/onlinedocs/gccint/Constant-Attributes.html#Constant-Attributes
we find:
"RTL expressions used to define the value of a constant attribute
may use the symbol_ref form, but may not use either the match_operand
form or eq_attr forms involving insn attributes."
Does that restriction also apply to the regexp part of
(define_insn_reservation ...) statements?
Or do I need to do something like:
(define_insn_reservation "insn1" 0 (..some expression using symbol_ref))
I couldn't find any examples of symbol_ref using constants - only C
code or functions, so if I do need to use a symbol_ref with a
constant, what would it look like?
--
Quentin