[sdiy] The Chameleon Guitar
Eric Brombaugh
ebrombaugh1 at cox.net
Thu Apr 9 01:03:39 CEST 2009
Matthew Smith wrote:
> Quoth Csaba Zvekan at 2009-04-09 07:14...
> <snip/>
>> Sure you loose performance
>> the code is not as optimized as it would be in Assembler
> <snip/>
>
> I should probably point out at this juncture that the output of a DECENT
> C compiler can be more efficient than hand-coded assembly.
Good point - for general-purpose processor architectures this can often
be true. In most cases these days, compiler output is so tight that it's
almost not worth bothering to look at the disassembly to check. Trouble
is that DSPs contain a lot of highly specialized structures that are
fairly difficult to use in general computing applications, and hence the
compiler writers ignore them. MACs in particular don't get the love they
deserve, and so need assembly to use to their fullest potential.
An emerging trend over the last few years has been the use of hinting,
pragmas and intrinsics which are ways to to explicitly tell the compiler
"Hey - I'm trying to do something odd here - pay attention!". Most often
these look like comments or function calls that cause special behavior
to help optimize the output.
Another approach is the use of in-line assembly, with special syntax to
allow the low-level code to merge almost seamlessly with the surrounding
high-level constructs. This allows things like using variable names
instead of register names when specifying operands of assembly
instructions and makes coding a lot easier.
Finally, the DSP56 used in the Symphony Soundbite has a couple of
accelerators for speeding up filter and buffer processing which no
compiler could know about. This has to be treated as a separate
resource, and while assembly isn't required to use it, some serious
research is needed to grok its function.
Eric
More information about the Synth-diy
mailing list