1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

SIMD with blackfin-gcc

Discussion in 'Embedded' started by Atilla, Sep 21, 2010.

  1. Atilla

    Atilla Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I'm developing a bare-metal firmware on BF537(Surveyor SVS board). I don't have
    the time to learn assembly for blackfin, fortunately I saw SIMD i spossible with
    plain C. So

    1- Does the compiler automatically use SIMD features if I do some loop unrolling
    like:
    instead of

    for(i=0;i<N;i++)
    c=a+b;

    this:
    for(i=0;i<N;i+=2)
    {
    c=a+b;
    c[i+1]=a[i+1]+b[i+1];
    }

    2- I saw some gcc built-in constructs like "__attribute__ ((mode(V2HI)))" to
    pack data for SIMD operations. I think this is two short integers packed. Is
    there a list of such attributes? Do I really need to use them?

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.10 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iEYEARECAAYFAkyYlAsACgkQyjWa9oynuqDN1ACfQKFjHVT5HTaYDoLxoexUhADQ
    6XAAn1h8ZAEjxDfgURXjoGCr91uvHtYo
    =/OjB
    -----END PGP SIGNATURE-----
     
    Atilla, Sep 21, 2010
    #1
    1. Advertisements

  2. Op Tue, 21 Sep 2010 13:16:29 +0200 schreef Atilla
    Which compiler?


    Most compilers can perform loop unrolling themselves.
    http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html
    6.37.1 Blackfin Variable Attributes

    Your attribute is not on the list, so that attribute is either not a GCC
    attribute and/or your compiler is not standard GCC.
    It depends what they really do.
     
    Boudewijn Dijkstra, Sep 21, 2010
    #2
    1. Advertisements

  3. Atilla

    Atilla Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    $ bfin-elf-gcc --version
    bfin-elf-gcc (GCC) 4.1.2 (ADI svn)

    $ bfin-elf-gcc -v
    Using built-in specs.
    Target: bfin-elf
    Configured with:
    /usr/src/packages/BUILD/blackfin-toolchain-09r1/../gcc-4.1/configure
    - --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=bfin-elf
    - --prefix=/opt/uClinux/bfin-elf --with-newlib --disable-libstdcxx-pch
    - --enable-languages=c,c++ --disable-symvers --disable-libssp --disable-libffi
    - --enable-clocale=generic --enable-version-specific-runtime-libs
    - --enable-__cxa_atexit
    - --with-bugurl=URL:http://blackfin.uclinux.org/gf/project/toolchain/tracker
    - --with-pkgversion=ADI-09r1-10
    Thread model: single
    gcc version 4.1.2 (ADI svn)
    It is standard gcc for blackfin. For some reason that list does not include
    packing attributes. See http://ds9a.nl/gcc-simd/example.html for x86 packing.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.10 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iEYEARECAAYFAkyYtrcACgkQyjWa9oynuqDw9gCfSsjgGQ4whDWM6IPf4IC09SIq
    gGUAoKWS7KyMWpTlASY17WmMwcsIOwzX
    =HnSI
    -----END PGP SIGNATURE-----
     
    Atilla, Sep 21, 2010
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.