From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,80f21c0575c616e8 X-Google-Attributes: gid111c93,public From: Alex Rhomberg Subject: Re: fast array calculation in C Date: 1999/10/12 Message-ID: <38039F48.DA6247A9@ife.ee.ethz.ch>#1/1 X-Deja-AN: 535957626 Content-Transfer-Encoding: 7bit References: <3801A6BC.21E8653E@ife.ee.ethz.ch> <7tt2o3$15m0@news1.newsguy.com> <3802454b.1730032204@news.onramp.net> <3802E47C.3CF0CDE9@ife.ee.ethz.ch> <380360a0.1802565782@news.onramp.net> Content-Type: text/plain; charset=us-ascii X-Trace: 12 Oct 1999 22:51:20 +0100, beethoven.ee.ethz.ch Organization: Electronics Lab, ETH Zurich, Switzerland MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha memore0@yahoo.com wrote: > > On Tue, 12 Oct 1999 09:34:20 +0200, Alex Rhomberg > wrote: > >No, this is optimized C. I just looked at the assembler to find the > >parts where the compiler produces bad code and write those differently, > >but still in C. > > In response to you and Greg, "oops". > > My first thought after that was to wonder why? > > I guess that my practice has pretty much been that if I > look at the assembly, I change it there and save it as > such. Obviously this has maintenance implications, but > for embedded stuff, it's usually "write once, run forever". There are some differences. To change the assembler efficiently (meaning I don't just reorder a bunch of instructions but try to eliminate loads and stores) I'd have to look at a bigger picture (in Assembler). I optimized by finding bad code and changing that in C so the compiler makes better code. This takes not too much time, and I still have one portable code. To do it in Assembler, I'd hve to keep in mind all the issues about pipeline depth and superscalar instruction (which the compiler knows about). You normally have a lot less of those in embedded programming. I'm not afraid of doing Assembler for e.g. a DSP, but for a superscalar RISC, I'd only use it for some core things (like the BLAS or math library) - Alex