* CGEN_BITSET
@ 2009-06-20 22:39 Doug Evans
2009-06-22 16:00 ` CGEN_BITSET Dave Brolley
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2009-06-20 22:39 UTC (permalink / raw)
To: brolley, cgen
Treating "isa" specially is a bit of a hack. What's the story behind
CGEN_BITSET?
(define (gen-attr-type attr)
(if (string=? (string-downcase (gen-sym attr)) "isa")
"CGEN_BITSET"
(case (attr-kind attr)
((boolean) "int")
((bitset) "unsigned int")
((integer) "int")
((enum) (string-append "enum " (string-downcase (gen-sym
attr)) "_attr"))
))
)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: CGEN_BITSET
2009-06-20 22:39 CGEN_BITSET Doug Evans
@ 2009-06-22 16:00 ` Dave Brolley
2009-06-22 16:19 ` CGEN_BITSET Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Dave Brolley @ 2009-06-22 16:00 UTC (permalink / raw)
To: Doug Evans; +Cc: cgen
Hi Doug,
The mep port required an inderminate and configurable number of ISA's to
be possible, so we needed something that could represent an unspecified
number of bits (more then 32 or 64 possibly) in a mask. The intent was
not to treat isa specially. It just turned out to be the first bit mask
to require this treatment.
CGEN_BITSET is simply a bit mask represented by character strings as
opposed to integers.
Dave
Doug Evans wrote:
> Treating "isa" specially is a bit of a hack. What's the story behind
> CGEN_BITSET?
>
> (define (gen-attr-type attr)
> (if (string=? (string-downcase (gen-sym attr)) "isa")
> "CGEN_BITSET"
> (case (attr-kind attr)
> ((boolean) "int")
> ((bitset) "unsigned int")
> ((integer) "int")
> ((enum) (string-append "enum " (string-downcase (gen-sym
> attr)) "_attr"))
> ))
> )
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: CGEN_BITSET
2009-06-22 16:00 ` CGEN_BITSET Dave Brolley
@ 2009-06-22 16:19 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2009-06-22 16:19 UTC (permalink / raw)
To: Dave Brolley; +Cc: cgen
Hi. Thanks.
More than 32 ISAs? Yikes!
Going forward, we could add a vbitset attribute kind (or some such), or
we could convert all bitsets to use CGEN_BITSET. I guess I'm leaning
toward the latter, but I can imagine situations where one would rather
just have an unsigned int.
Dave Brolley wrote:
> Hi Doug,
>
> The mep port required an inderminate and configurable number of ISA's
> to be possible, so we needed something that could represent an
> unspecified number of bits (more then 32 or 64 possibly) in a mask.
> The intent was not to treat isa specially. It just turned out to be
> the first bit mask to require this treatment.
>
> CGEN_BITSET is simply a bit mask represented by character strings as
> opposed to integers.
>
> Dave
>
> Doug Evans wrote:
>> Treating "isa" specially is a bit of a hack. What's the story behind
>> CGEN_BITSET?
>>
>> (define (gen-attr-type attr)
>> (if (string=? (string-downcase (gen-sym attr)) "isa")
>> "CGEN_BITSET"
>> (case (attr-kind attr)
>> ((boolean) "int")
>> ((bitset) "unsigned int")
>> ((integer) "int")
>> ((enum) (string-append "enum " (string-downcase (gen-sym
>> attr)) "_attr"))
>> ))
>> )
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-22 16:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-20 22:39 CGEN_BITSET Doug Evans
2009-06-22 16:00 ` CGEN_BITSET Dave Brolley
2009-06-22 16:19 ` CGEN_BITSET Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).