1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libopus/celt/arm/kiss_fft_armv5e.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,118 @@ 1.4 +/*Copyright (c) 2013, Xiph.Org Foundation and contributors. 1.5 + 1.6 + All rights reserved. 1.7 + 1.8 + Redistribution and use in source and binary forms, with or without 1.9 + modification, are permitted provided that the following conditions are met: 1.10 + 1.11 + * Redistributions of source code must retain the above copyright notice, 1.12 + this list of conditions and the following disclaimer. 1.13 + * Redistributions in binary form must reproduce the above copyright notice, 1.14 + this list of conditions and the following disclaimer in the 1.15 + documentation and/or other materials provided with the distribution. 1.16 + 1.17 + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.18 + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.19 + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.20 + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1.21 + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.22 + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.23 + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.24 + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.25 + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.26 + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 1.27 + POSSIBILITY OF SUCH DAMAGE.*/ 1.28 + 1.29 +#ifndef KISS_FFT_ARMv5E_H 1.30 +#define KISS_FFT_ARMv5E_H 1.31 + 1.32 +#if !defined(KISS_FFT_GUTS_H) 1.33 +#error "This file should only be included from _kiss_fft_guts.h" 1.34 +#endif 1.35 + 1.36 +#ifdef FIXED_POINT 1.37 + 1.38 +#if defined(__thumb__)||defined(__thumb2__) 1.39 +#define LDRD_CONS "Q" 1.40 +#else 1.41 +#define LDRD_CONS "Uq" 1.42 +#endif 1.43 + 1.44 +#undef C_MUL 1.45 +#define C_MUL(m,a,b) \ 1.46 + do{ \ 1.47 + int mr1__; \ 1.48 + int mr2__; \ 1.49 + int mi__; \ 1.50 + long long aval__; \ 1.51 + int bval__; \ 1.52 + __asm__( \ 1.53 + "#C_MUL\n\t" \ 1.54 + "ldrd %[aval], %H[aval], %[ap]\n\t" \ 1.55 + "ldr %[bval], %[bp]\n\t" \ 1.56 + "smulwb %[mi], %H[aval], %[bval]\n\t" \ 1.57 + "smulwb %[mr1], %[aval], %[bval]\n\t" \ 1.58 + "smulwt %[mr2], %H[aval], %[bval]\n\t" \ 1.59 + "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \ 1.60 + : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \ 1.61 + [aval]"=&r"(aval__), [bval]"=r"(bval__) \ 1.62 + : [ap]LDRD_CONS(a), [bp]"m"(b) \ 1.63 + ); \ 1.64 + (m).r = SHL32(SUB32(mr1__, mr2__), 1); \ 1.65 + (m).i = SHL32(mi__, 1); \ 1.66 + } \ 1.67 + while(0) 1.68 + 1.69 +#undef C_MUL4 1.70 +#define C_MUL4(m,a,b) \ 1.71 + do{ \ 1.72 + int mr1__; \ 1.73 + int mr2__; \ 1.74 + int mi__; \ 1.75 + long long aval__; \ 1.76 + int bval__; \ 1.77 + __asm__( \ 1.78 + "#C_MUL4\n\t" \ 1.79 + "ldrd %[aval], %H[aval], %[ap]\n\t" \ 1.80 + "ldr %[bval], %[bp]\n\t" \ 1.81 + "smulwb %[mi], %H[aval], %[bval]\n\t" \ 1.82 + "smulwb %[mr1], %[aval], %[bval]\n\t" \ 1.83 + "smulwt %[mr2], %H[aval], %[bval]\n\t" \ 1.84 + "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \ 1.85 + : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \ 1.86 + [aval]"=&r"(aval__), [bval]"=r"(bval__) \ 1.87 + : [ap]LDRD_CONS(a), [bp]"m"(b) \ 1.88 + ); \ 1.89 + (m).r = SHR32(SUB32(mr1__, mr2__), 1); \ 1.90 + (m).i = SHR32(mi__, 1); \ 1.91 + } \ 1.92 + while(0) 1.93 + 1.94 +#undef C_MULC 1.95 +#define C_MULC(m,a,b) \ 1.96 + do{ \ 1.97 + int mr__; \ 1.98 + int mi1__; \ 1.99 + int mi2__; \ 1.100 + long long aval__; \ 1.101 + int bval__; \ 1.102 + __asm__( \ 1.103 + "#C_MULC\n\t" \ 1.104 + "ldrd %[aval], %H[aval], %[ap]\n\t" \ 1.105 + "ldr %[bval], %[bp]\n\t" \ 1.106 + "smulwb %[mr], %[aval], %[bval]\n\t" \ 1.107 + "smulwb %[mi1], %H[aval], %[bval]\n\t" \ 1.108 + "smulwt %[mi2], %[aval], %[bval]\n\t" \ 1.109 + "smlawt %[mr], %H[aval], %[bval], %[mr]\n\t" \ 1.110 + : [mr]"=r"(mr__), [mi1]"=r"(mi1__), [mi2]"=r"(mi2__), \ 1.111 + [aval]"=&r"(aval__), [bval]"=r"(bval__) \ 1.112 + : [ap]LDRD_CONS(a), [bp]"m"(b) \ 1.113 + ); \ 1.114 + (m).r = SHL32(mr__, 1); \ 1.115 + (m).i = SHL32(SUB32(mi1__, mi2__), 1); \ 1.116 + } \ 1.117 + while(0) 1.118 + 1.119 +#endif /* FIXED_POINT */ 1.120 + 1.121 +#endif /* KISS_FFT_GUTS_H */