This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Efficiently encoding a hierarchy
- From: Diego Novillo <dnovillo at google dot com>
- To: Kannan Goundan <cakoose at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 17 Jul 2007 09:45:57 -0400
- Subject: Re: Efficiently encoding a hierarchy
- References: <f7bld3$a9d$1@sea.gmane.org>
On 7/14/07 7:14 PM, Kannan Goundan wrote:
> - A (0,5)
> - B (1,1)
> - C (2,4)
> - D (3,3)
> - E (4,4)
> - F (5,5)
> - G (6,7)
> - H (7,7)
>
> A given instance is of type "C" if its "code" field is between 2 and 4,
> inclusive.
Interesting, thanks. In this case, we probably should rename subcode as
it really is a set of flags, which in some cases happen to be code from
the 'tree' data structures.
The hierarchy is actually flat. We use code ranges in a way similar to
your proposal to group related codes. For instance, all the codes that
take operands have consecutive numbers. Admittedly, this is fairly
primitive but so is the language we have to deal with.