[sdiy] SHARC DSP programming

Eric Brombaugh ebrombaugh1 at cox.net
Sat Sep 24 18:30:19 CEST 2016


Interesting omission if it *doesn't* have that. The accumulator scaling 
& saturation operations in the dsPIC architecture were one of its nicer 
features.

SHARC seems to be heavily optimized for high level languages. Do they 
have a library of intrinsics you can use from C? If so perhaps you'll 
find the optimum implementation in that?

Eric

On 09/24/2016 09:21 AM, Richie Burnett wrote:
> Anyone programming Analog Device's SHARC DSP who can answer a quick
> question?
>
> Is there an instruction to left/right shift the MAC accumulator result
> (MRF or MRB)?
>
> I think that surely there must be, as this is essential for normalising
> results of accumulated MAC operations, but I can't find it!  On the
> dsPIC you can specify an accumulator shift as part of the "Round and
> Store Accumulator" instruction "sac.r", where the double-word
> accumulator is optionally rounded and truncated back to single-precision
> before being stored.  I can't seem to find a similar instruction for the
> SHARC, which seems crazy, but the documentation for the instruction set
> is a bit of a mess, rather than having logical groups of instructions
> together, etc.
>
> The best I can come up with so far is to saturate the MAC result, then
> move the multiplier result into a general purpose register, then clip
> it, then left shift it to multiply by 2 or 4 or whatever.  But this is
> many more instructions, and it obviously doesn't shift in the bits from
> the lower half of the MAC accumulator that it really should do if you do
> a real double-word shift operation.  There doesn't seem much point in
> having an extended precision accumulator (with overflow bits added onto
> the left, and underflow bits to the right,) if you can't shift it left
> or right to normalise it when you store the result.
>
> Am I missing something!?!?
>
> -Richie,
> _______________________________________________
> 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