This is the mail archive of the 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]

symbol_refs vs. eq_attr in define_insn_reservations


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
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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]