[Speex-dev] Errors in speex lib with Blackfin

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Jan 18 18:36:14 PST 2006


> I am trying to port speex lib to Blackfin processor.
> I am using VisualDSP++ 4.0.

I've never used VisualDSP++ 4.0. All the development on Blackfin has
been done with gcc, which may explain some problems with the inline asm.
Does VisualDSP++ support a syntax close to what gcc uses (with
constraints) or more like the MS compilers.

> If I am compiling source codes with using floating point everything
> ok.
> When I am compiling with FIXED_POINT defined everything's ok and code
> works about two times faster.

Strange that it's *only* 2x faster...

> But when I am defining BFIN_ASM I am getting several compiling errors
> in Blackfin assembler functions.
> Here they are:
> 1) In the inline assembler functions (blackfin asm) in every loop
> there is a syntax error. May be I am wrong, but I can't understood
> what is written there(and compiler too).
> Example:
> 
> __asm__ __volatile__
>          (
>          "I0 = %0;\n\t"
>          "I1 = %1;\n\t"
>          "L0 = 0;\n\t"
>          "L1 = 0;\n\t"
>          "LOOP tupdate%= LC0 = %3;\n\t"
>                       ^//here is the problem
>          "LOOP_BEGIN tupdate%=;\n\t"
>                             ^//here is the same problem
>             "R0.L = W[I0] || R1.L = W[I1++];\n\t"
>             "R1 = (A1 = R1.L*%2.L) (IS);\n\t"
>             "R1 >>>= 11;\n\t"
>             "R0.L = R0.L - R1.L;\n\t"
>             "W[I0++] = R0.L;\n\t"
>          "LOOP_END tupdate%=;\n\t"
>                           ^//and here
>    :
>    : "a" (t), "a" (r), "d" (g), "a" (len)
>    : "R0", "R1", "A1", "I0", "I1", "L0", "L1"
>          ); 
> 
>   So, I removed the signs '%=' from loops and this problems were
>   solved.

In the gcc syntax, %= gets replaced by something different (random)
every time the asm block is evaluated. That prevents redefined symbols
when the asm block is part of an inline function. 

> 2)Some errors in arithmetical operations.
> Example:
>         "R0.L = R0.L - R1.L;\n\t"//compiler error
>         //Need to be written (s)-saturate or (ns)-not saturate after operation
>         "R0.L = R0.L - R1.L(ns);\n\t"
> Here is only one example. But I'v got a lot.

Wasn't aware that the flag was required (gnu as doesn't require it). The
whole fixed-point code assumes no saturation is required, but it
probably doesn't hurt to use (s) either.

> 3)When I am trying to correct previus errors - compiler don't compile some functions with message:
>  gnu asm requires too much Preg registers.

Not sure what that means. Any idea?

> So, did you compile your library in Visual DPS++? 

No, only gcc.

> May be it;s some
> problems with versions. May be I am wrong, and I don't understand
> something?
> Please, clarify this questions.

Probably a compiler issue. If you find a workaround, please let me know.

	Jean-Marc


More information about the Speex-dev mailing list