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

Handle attributes defined in terms of another


In a new port, I have

(define_attr "units62" "unknown,d,d_addr,l,m,s,dl,dls,ls"
  (const_string "unknown"))

(define_attr "units64" "unknown,d,d_addr,l,m,s,dl,dls,ls"
  (const_string "unknown"))

(define_attr "units" "unknown,d,d_addr,l,m,s,dl,dls,ls"
  (cond [(eq_attr "cpu" "c62x") (attr "units62")
	 (eq_attr "cpu" "c64x") (attr "units64")]
	(const_string "unknown")))

which is intended to allow each insn either to define a single "units"
attribute, or more specific "units62" and "units64" if there are
differences between CPUs.

Tests of the form (eq_attr "units" "something") fail in genattrtab.c,
since evaluate_eq_attr can e.g. end up with (attr "units62") in the
value, and it doesn't handle this.

I don't know this code very well.  I've copied a block of code from
elsewhere to look up attributes in this case.  That seems to work on the
port I'm working on, and it also bootstraps ok on i686-linux.  Ok?


Bernd

Attachment: gt-evaluate.diff
Description: Text document


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