40 bits accumulator

Hello

How can I use Blackfin 40 bits accumulator.

Can I use it in C, or must I use assembler.

Avinoam

  • That depends on what you are what you want to do. There are compiler intrinsics which use the accumulators for saturating arithmetic, ones which allow the use of the accumulator for Viterbi algorithms, and also intrinsics which improve the probability of specialised MAC instructions being generated if that's what you're after. That being said the compiler is often very good at recognising cases where the dual MACs in the Blackfin core can be utilised.
    However there's no built in support for a special accumulator data type or functions which directly manipulate the accumulator.
    If you could post a little snippet or describe in a little detail what you need, I should be able to point you in the right direction.
    FYI: An "intrinsic" is how we refer to a special kind of built-in function which allows you to express parts of your algorithm so that the compiler can generate better code (since it usually knows how well the intrinsic maps to the capabilities of the hardware).

    Message was edited by: Sean McLemon  (defined what I meant by "intrinsic")

  • 0
    •  Analog Employees 
    on Apr 27, 2010 7:10 PM over 10 years ago

    We're also improving support for direct access to the accumulators, for the next major release of VisualDSP++, code-named Andromeda, due out next year. We're doing this in a couple of ways.

    The first is that we're adding compiler intrinsics that specifically employ the accumulators (rather than it being a side-effect of the compiler optimizing the arithmetic). For example:

        acc40 sum = 0;

        /* Compute vector dot product for given output */
        for (j = min_j; j <= max_j; j++) {
          acc40 prod = multr_fr1x32x32(input_x[j], input_y[k - j]);
          sum = A_add(sum, prod);
        }

    Here, A_add() is an intrinsic that specifically works with accumulators.

    (just like fract16 and fract32, acc40 is just a typedef to an underlying integer type - in this case, to a 64-bit integer so that all 40 bits will fit.)

    The second way we're improving support is that we're adding support for Embedded C, so that accum is a native type in C, not just a typedef to an integer. The equivalent code is:

        accum sum = 0.0k;

        /* Compute vector dot product for given output */
        for (j = min_j; j <= max_j; j++) {
          sum += input_x[j] * input_y[k - j];
        }

    Since accum is a native type, the multr_fr1x32x32() and A_add() intrinsics are not necessary; += and * just work.

    The compiler for VisualDSP++ Andromeda is currently in Beta test. If you're interested in getting an early peek, we can put you in contact with the Beta Programme manager.

    steve

  • Hello

     

    I am adding numbers,  32 bits integers, and the result is bigget than 32 bit. I think it is usefull to use the 40 bit accumulator for such operation. I am not sure how to do this in C. Must I use assembler .

     

    Avinoam Danieli

     

    Hardware Engineer

     

    ITL OPTRONICS

     

    PHONE :         03-9277576      03-9277444  

     

    CELL :             054-2889956 

     

    Email :         avinoam_d@itlasers.com

     

    Address :       פתח תקוה 11 גרניט  49002

     

    From: Sean McLemon analog@sgaur.hosted.jivesoftware.com

    Sent: Tuesday, April 27, 2010 4:46 PM

    To: Avinoam Danieli

    Subject: New message: "40 bits accumulator"

     

    <http://ez.analog.com/index.jspa> Analog Devices EngineerZone

    40 bits accumulator

    reply from Sean <http://ez.analog.com/people/SeanM>  McLemon in Blackfin Processors - View the full discussion <http://ez.analog.com/message/9509#9509

  • Hello

     

    I would like to get a beta version of new compiler.

    Until then, can you send me assembler example how to use 40 bit accumulator .

     

    Thank you,

     

    Avinoam Danieli

     

    Hardware Engineer

     

    ITL OPTRONICS

     

    PHONE :         03-9277576      03-9277444  

     

    CELL :             054-2889956 

     

    Email :         avinoam_d@itlasers.com

     

    Address :       פתח תקוה 11 גרניט  49002

     

    From: stevek analog@sgaur.hosted.jivesoftware.com

    Sent: Tuesday, April 27, 2010 5:10 PM

    To: Avinoam Danieli

    Subject: New message: "40 bits accumulator"

     

    <http://ez.analog.com/index.jspa> Analog Devices EngineerZone

    40 bits accumulator

    reply from stevek <http://ez.analog.com/people/stevek>  in Blackfin Processors - View the full discussion <http://ez.analog.com/message/9500#9500

  • 0
    •  Analog Employees 
    on Apr 28, 2010 12:33 PM over 10 years ago

    Is there a reason why you can't use 64-bit integers, if you're concerned about the precision? Long long and unsigned long long are both supported in C and C++.

    steve