This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
RFA: hardware can have ISA attributes, too
- From: Doug Evans <dje at transmeta dot com>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: cgen at sources dot redhat dot com
- Date: Thu, 25 Sep 2003 07:34:08 -0700 (PDT)
- Subject: RFA: hardware can have ISA attributes, too
- References: <vt24qz2oz1a.fsf@zenia.home>
Jim Blandy writes:
> I don't really feel like I understand CGEN's data model well enough to
> know whether this is really appropriate, or just a kludge.
>
> Here's the motivation. We have a toolchain that supports several
> different machines within a family; some register sets are present on
> some machines, but not on others. Given an ISA, we want to be able to
> traverse the hardware list and see which register sets are available
> on that ISA.
>
> So along with this will come another patch that produces an extern
> declaration for @arch@_cgen_hw_table, so we can traverse it.
>
> What's the best way to do this?
The patch to mach.scm is fine.
I'm not sure about the patch to provide extern @arch@_cgen_hw_table though.
If it's ultimately needed, great.
The way it's intended to normally work is that you access the CGEN_HW_ENTRY
elements via struct cgen_cpu_desc . hw_table.
struct cgen_cpu_desc is filled by the call to @arch@_cgen_cpu_open,
and the hw_table member is filled in based on the requested machs, not isas.
That's why, I think, I didn't initially add the extern declaration.
OTOH, if that were the case I would have made it static ...
And if it's not static, where's its entry in some header?
I don't know enough about the application at hand to know whether
all the hw entries you want to look at are in cgen_cpu_desc . hw_table,
but given that I didn't make the hw_table static, it should have
an extern declaration anyway. Thus go for it.
[There are other tables in the same boat, but we can to them on
an as-needed basis.]