ex

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers misc_bfin.h Source File

misc_bfin.h

Go to the documentation of this file.
00001 /* Copyright (C) 2005 Analog Devices */
00002 /**
00003    @file misc_bfin.h
00004    @author Jean-Marc Valin 
00005    @brief Various compatibility routines for Speex (Blackfin version)
00006 */
00007 /*
00008    Redistribution and use in source and binary forms, with or without
00009    modification, are permitted provided that the following conditions
00010    are met:
00011    
00012    - Redistributions of source code must retain the above copyright
00013    notice, this list of conditions and the following disclaimer.
00014    
00015    - Redistributions in binary form must reproduce the above copyright
00016    notice, this list of conditions and the following disclaimer in the
00017    documentation and/or other materials provided with the distribution.
00018    
00019    - Neither the name of the Xiph.org Foundation nor the names of its
00020    contributors may be used to endorse or promote products derived from
00021    this software without specific prior written permission.
00022    
00023    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00027    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00028    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00029    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00030    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00031    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00032    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00033    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 */
00035 
00036 #define OVERRIDE_SPEEX_MOVE
00037 void *speex_move (void *dest, void *src, int n)
00038 {
00039    __asm__ __volatile__
00040          (
00041          "L0 = 0;\n\t"
00042          "I0 = %0;\n\t"
00043          "R0 = [I0++];\n\t"
00044          "LOOP move%= LC0 = %2;\n\t"
00045          "LOOP_BEGIN move%=;\n\t"
00046             "[%1++] = R0 || R0 = [I0++];\n\t"
00047          "LOOP_END move%=;\n\t"
00048          "[%1++] = R0;\n\t"
00049    : "=a" (src), "=a" (dest)
00050    : "a" ((n>>2)-1), "0" (src), "1" (dest)
00051    : "R0", "I0", "L0", "memory"
00052          );
00053    return dest;
00054 }