2010-08-07 06:59:24     What should I expect from libbfdsp?

Document created by Aaronwu Employee on Sep 26, 2013
Version 1Show Document
  • View in full screen mode

2010-08-07 06:59:24     What should I expect from libbfdsp?

Harold Artes (AUSTRIA)

Message: 92239   



I´d like to use the libbfdsp signal processing libraries included in the bf-elf-gcc bare metal toolchain and stumbled accross the following problems. As I understand the library is a direct copy from AD so I´m aware that ppl here are not responsible for the code. I´d still be happy about some feedback to understand other ppl´s experience and what I should expect from this library.


Problem 1:  convolve_fr16 (convolve_asm.asm) only returned a part of the expected output. After debugging I saw that the register L3 wasn´t initialized to 0. Since my code left L3 at some non-zero value the library function didn´t work.


Question 1: Is this a bug or am I expected to reset all registers to some predefined value before calling library functions? If yes what are these values?


Problem 2: conv2d_fr16 (conv2dasm.asm) has very slow performance. When looking into the source code I saw that it doesn´t make use of the MAC at all. The library function also uses some 32 bit math (instead of the 40 bit Accumulator) which makes me believe that this function is completely generic and not optimized for the blackfin at all. Additionally the function completely swamps the stack using it for some temporary data which might not be necessary if the accumulator had been used.  


Question 2: Should I expect this sort of totally unoptimized performance from the library functions in general? What is your experience with other DSP functions? Do I need to write my own library? I cannot believe that Analog Devices cannot do a better job with this library so I´m wondering what I´m missing/doing wrong here?








2010-08-07 08:50:41     Re: What should I expect from libbfdsp?

Mike Frysinger (UNITED STATES)

Message: 92240   


1) your code is broken.  please read the ABI:



2) as you said, we are not the maintainers of this library.  you can find the latest version bundled with VDSP (Blackfin/lib/src/libdsp/).  if we have an outdated version, let us know, and we can look at getting it updated.  but in the case of conv2dasm.asm, we appear to be using the latest version.


if you think a particular function is too slow and/or not optimized enough/correctly, and we are already up-to-date with VDSP, then the place to seek support is:



(so you should post your conv2d_fr16 question there)




2010-08-07 10:33:43     Re: What should I expect from libbfdsp?

Harold Artes (AUSTRIA)

Message: 92241   


1) Thanks! I missed that one completely


2) Yes, conv2dasm.asm is up to date with VDSP. I´ll go and ask at http://ez.analog.com/ Thanks for that hint as well