From: sharp@cadence.com
Date: Wed May 05 2004 - 11:10:58 PDT
>Number: 580
>Notify-List:
>Category: enhancement
>Originator: sharp@cadence.com (Behavioral Task Force)
>Environment:
>Description:
If enhancement/387 is approved, allowing certain system
functions to be used in constant expressions, there may
be some new system functions that would be useful with
this. The most obvious example would be to add a
ceiling-of-log-base-2 function, for use in setting address
bus widths based on memory size, or data width needed to
represent a certain maximum value.
We would need to solicit other suggestions from users.
I could suggest others that are difficult to compute
generally with the existing operators, but I don't know
if they are actually useful. Shalom seemed to think that
some of them might be, though I don't know whether he
meant in general or in constant expressions.
Possible examples might include find-first-bit-set,
though I think this could be computed fairly easily given
a log-base-2 function. A find-first-bit-clear would be
trivial to compute given a find-first-bit-set, using ~.
These would find the MSB. Shalom also mentioned that
finding the LSB set would be useful. It turns out that
this can be computed given a function that finds the MSB
set plus some additional math, though the tricks involved
may not be widely known.
Another related example might be a population count, which
counts the number of set bits in a value. There are also
some other enhancement requests that could be satisfied by
new system functions (e.g. rotates, bit-reversal), and such
functions would also be suitable for constant expressions
(though they might not be useful there).
Again, I don't think we should put any of these in unless
they would actually be useful to users.
This archive was generated by hypermail 2.1.4
: Wed May 05 2004 - 11:11:22 PDT
and
sponsored by Boyd Technology, Inc.