This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


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

Re: sim's -DPROFILE=1 conflicts with CGEN's PROFILE attribute


Doug Evans <dje@transmeta.com> writes:

>  >    1) fix desc-cpu.scm to no longer define & use A(x), but rather generate
>  >       (1<<CGEN_HW_x) in-line.  Same for other definitions & uses of shorthand A(x).
> 
> I like the readability that the use of A() and others of its ilk adds.

You *can* have that *if* A() uses `##' directly rather than via CONCAT2.
The extra level of expansion allows the PROFILE -> 1 substitution.

There is a third solution solution:

3) Define A like so (e.g., for _HW_):

#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define A(a) (1 << CGEN_HW_##a)
#else
#define A(a) (1 << CGEN_HW_/**/a)
#endif

This replaces the shorter, more attractive, but dangerous definition:

#define A(a) (1 << CONCAT2 (CGEN_HW_,a))

> [pedantic: _[A-Z]* is owned of compiler]

Agreed.  It wasn't a real solution anyway...

> An alternative is to rename CGEN_{FOO}_{ATTRIBUTE} to
> CGEN_{FOO}_A_{ATTRIBUTE}.  Having attributes named like
> CGEN_INSN_RELAXABLE kinda bothered me anyway, whereas
> I much more like CGEN_INSN_A_RELAXABLE [or s/_A_/_ATTR_/].

How does this address the original problem?

> For the time being, if a fix is needed sooner rather than later is
> there a patch that can be done to the i960 simulator?
> (if we're going to have a bandaid, let's localize it as much as possible)

There's no rush.  One can sidestep by configuring with `--disable-sim-profile'.

Note that this is a generic problem, and not specific to i960.  Many
CPUs have `-DPROFILE=1' by default in sim/*/configure, and many CGEN
cpu descriptions have have a PROFILE attribute.

Greg

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