From: "Jonathan Bromley"
Subject: Re: To C or not to C
Date: Mon, 6 Jan 2003 15:48:32 -0000
References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
Reply-To: "Jonathan Bromley"
NNTP-Posting-Date: Mon, 6 Jan 2003 15:48:33 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
[On compilers replacing multiply-by-constant with shift-and-add...]
> I just tried it, and AVR-GCC is indeed that smart, slightly
> to my surprise!
> Colour me impressed.
I'm not sure why we should be impressed, really. This optimisation
happens essentially at the source code level, 'coz it's independent
of the target architecture (the architecture dependence comes later
when the back end has to choose **whether** to do it); and compiler
front-ends have been doing it for at least 15 years to my personal
knowledge (Metaware High-C, vintage 1988) and probably much longer.
In any case, it's only Booth's algorithm in disguise, and we
bit-pushers got there before C was thought of :-)
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: firstname.lastname@example.org
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.