[sdiy] Quick C query

cheater cheater cheater00 at gmail.com
Sun Nov 21 20:56:47 CET 2010


high performance programs (simulations, audio applications, computer
games) where execution speed is critical - as opposed to desktop
applications where it doesn't matter if calculating a spreadsheet will
take 2x longer - do use hand-coded assembly in the high-performance
parts (so, for example, 8 VCF's executing in an interleaved mode). On
the other hand sometimes there are things that are inaccessible with
higher level languages and you have to break out to assembler (be it
use of SIMD, or atomic changes to data)

There is a real demand for this kind of work being performed.


With MCU's you're dealing with something that's slower than a 386.
Most applications for the 386 were written in pure assembler.

Cheers,
D.

On Sun, Nov 21, 2010 at 20:47, Ben Lincoln <blincoln at eventualdecline.com> wrote:
> On 11/21/2010 10:38 AM, cheater cheater wrote:
>>
>> if(flags&  (A | B))
>>
>> is different from
>>
>> if(flags&  (A | B) == (A | B))
>>
>> in that the first will be active when either A or B are set in flags,
>> whereas the second will trigger only when A and B are set in the
>> flags.
>
> This is one of the main reasons I avoid "programming shorthand". It takes a
> little longer to type out the full statement, but I'm a lot less likely to
> end up with something that behaves subtly differently than what I expect,
> and it's a lot easier to determine my original intent if I'm looking at the
> code again after a long time.
>
> FWIW, I'm not a professional developer either, but I've coded in a lot of
> languages over the years, and when I use flag arrays, I tend to use this
> method rather than a struct (although in higher-level languages like C#, I
> would use a struct or class with boolean values because it's easier to read
> IMO).
>
> On the subject of this type of hardware, is hand-tuned assembly still
> necessary these days? I know in the world of general-purpose PC hardware,
> the threshold was passed long ago, and it's generally considered not worth
> the trade-off in terms of the code becoming less -portable and
> less-maintainable by non-specialists (as well as the compiler being able to
> out-perform human optimization in most cases). I'm not familiar enough with
> embedded/programmable hardware to have an informed understanding of that
> side of things, though.
>
> Obviously even if it's not strictly necessary, there's nothing wrong with
> enthusiasts doing it to squeeze the last possible drop of performance out of
> the hardware (which e.g. demo scene coders still do in the PC world).
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>



More information about the Synth-diy mailing list