This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adapting switch(x){case(y):...} with hashing
- To: Robert Dewar <dewar at gnat dot com>
- Subject: Re: Adapting switch(x){case(y):...} with hashing
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Mon, 4 Dec 2000 20:11:41 -0500
- Cc: jawalker at stl dot quik dot com, meissner at cygnus dot com, gcc at gcc dot gnu dot org
- References: <20001201203441.DB43434D8A@nile.gnat.com>
On Fri, Dec 01, 2000 at 03:34:41PM -0500, Robert Dewar wrote:
> <<One concern is that many of our embedded machines don't have divide
> instructions, and/or the divide instructions takes an ungoodly amount of cycles
> (also if the divide emulation functions happened to contain a switch that the
> compiler would do via hashing).
> >>
>
> Why on earth would one choose to do a divide, given that this is indeed
> the case?
Obviously, but I assumed that at least some readers are only familiar with
hosted GCC implementations (or even embedded implmentations using chips that
have all of the instructions GCC normally wants to use) and didn't consider
what the effect of calculating a hash value via division if the machine in
question doesn't have a division instruction.
--
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482