Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /*Copyright (c) 2013, Xiph.Org Foundation and contributors. |
michael@0 | 2 | |
michael@0 | 3 | All rights reserved. |
michael@0 | 4 | |
michael@0 | 5 | Redistribution and use in source and binary forms, with or without |
michael@0 | 6 | modification, are permitted provided that the following conditions are met: |
michael@0 | 7 | |
michael@0 | 8 | * Redistributions of source code must retain the above copyright notice, |
michael@0 | 9 | this list of conditions and the following disclaimer. |
michael@0 | 10 | * Redistributions in binary form must reproduce the above copyright notice, |
michael@0 | 11 | this list of conditions and the following disclaimer in the |
michael@0 | 12 | documentation and/or other materials provided with the distribution. |
michael@0 | 13 | |
michael@0 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
michael@0 | 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
michael@0 | 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
michael@0 | 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
michael@0 | 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
michael@0 | 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
michael@0 | 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
michael@0 | 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
michael@0 | 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
michael@0 | 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
michael@0 | 24 | POSSIBILITY OF SUCH DAMAGE.*/ |
michael@0 | 25 | |
michael@0 | 26 | #ifndef KISS_FFT_ARMv5E_H |
michael@0 | 27 | #define KISS_FFT_ARMv5E_H |
michael@0 | 28 | |
michael@0 | 29 | #if !defined(KISS_FFT_GUTS_H) |
michael@0 | 30 | #error "This file should only be included from _kiss_fft_guts.h" |
michael@0 | 31 | #endif |
michael@0 | 32 | |
michael@0 | 33 | #ifdef FIXED_POINT |
michael@0 | 34 | |
michael@0 | 35 | #if defined(__thumb__)||defined(__thumb2__) |
michael@0 | 36 | #define LDRD_CONS "Q" |
michael@0 | 37 | #else |
michael@0 | 38 | #define LDRD_CONS "Uq" |
michael@0 | 39 | #endif |
michael@0 | 40 | |
michael@0 | 41 | #undef C_MUL |
michael@0 | 42 | #define C_MUL(m,a,b) \ |
michael@0 | 43 | do{ \ |
michael@0 | 44 | int mr1__; \ |
michael@0 | 45 | int mr2__; \ |
michael@0 | 46 | int mi__; \ |
michael@0 | 47 | long long aval__; \ |
michael@0 | 48 | int bval__; \ |
michael@0 | 49 | __asm__( \ |
michael@0 | 50 | "#C_MUL\n\t" \ |
michael@0 | 51 | "ldrd %[aval], %H[aval], %[ap]\n\t" \ |
michael@0 | 52 | "ldr %[bval], %[bp]\n\t" \ |
michael@0 | 53 | "smulwb %[mi], %H[aval], %[bval]\n\t" \ |
michael@0 | 54 | "smulwb %[mr1], %[aval], %[bval]\n\t" \ |
michael@0 | 55 | "smulwt %[mr2], %H[aval], %[bval]\n\t" \ |
michael@0 | 56 | "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \ |
michael@0 | 57 | : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \ |
michael@0 | 58 | [aval]"=&r"(aval__), [bval]"=r"(bval__) \ |
michael@0 | 59 | : [ap]LDRD_CONS(a), [bp]"m"(b) \ |
michael@0 | 60 | ); \ |
michael@0 | 61 | (m).r = SHL32(SUB32(mr1__, mr2__), 1); \ |
michael@0 | 62 | (m).i = SHL32(mi__, 1); \ |
michael@0 | 63 | } \ |
michael@0 | 64 | while(0) |
michael@0 | 65 | |
michael@0 | 66 | #undef C_MUL4 |
michael@0 | 67 | #define C_MUL4(m,a,b) \ |
michael@0 | 68 | do{ \ |
michael@0 | 69 | int mr1__; \ |
michael@0 | 70 | int mr2__; \ |
michael@0 | 71 | int mi__; \ |
michael@0 | 72 | long long aval__; \ |
michael@0 | 73 | int bval__; \ |
michael@0 | 74 | __asm__( \ |
michael@0 | 75 | "#C_MUL4\n\t" \ |
michael@0 | 76 | "ldrd %[aval], %H[aval], %[ap]\n\t" \ |
michael@0 | 77 | "ldr %[bval], %[bp]\n\t" \ |
michael@0 | 78 | "smulwb %[mi], %H[aval], %[bval]\n\t" \ |
michael@0 | 79 | "smulwb %[mr1], %[aval], %[bval]\n\t" \ |
michael@0 | 80 | "smulwt %[mr2], %H[aval], %[bval]\n\t" \ |
michael@0 | 81 | "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \ |
michael@0 | 82 | : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \ |
michael@0 | 83 | [aval]"=&r"(aval__), [bval]"=r"(bval__) \ |
michael@0 | 84 | : [ap]LDRD_CONS(a), [bp]"m"(b) \ |
michael@0 | 85 | ); \ |
michael@0 | 86 | (m).r = SHR32(SUB32(mr1__, mr2__), 1); \ |
michael@0 | 87 | (m).i = SHR32(mi__, 1); \ |
michael@0 | 88 | } \ |
michael@0 | 89 | while(0) |
michael@0 | 90 | |
michael@0 | 91 | #undef C_MULC |
michael@0 | 92 | #define C_MULC(m,a,b) \ |
michael@0 | 93 | do{ \ |
michael@0 | 94 | int mr__; \ |
michael@0 | 95 | int mi1__; \ |
michael@0 | 96 | int mi2__; \ |
michael@0 | 97 | long long aval__; \ |
michael@0 | 98 | int bval__; \ |
michael@0 | 99 | __asm__( \ |
michael@0 | 100 | "#C_MULC\n\t" \ |
michael@0 | 101 | "ldrd %[aval], %H[aval], %[ap]\n\t" \ |
michael@0 | 102 | "ldr %[bval], %[bp]\n\t" \ |
michael@0 | 103 | "smulwb %[mr], %[aval], %[bval]\n\t" \ |
michael@0 | 104 | "smulwb %[mi1], %H[aval], %[bval]\n\t" \ |
michael@0 | 105 | "smulwt %[mi2], %[aval], %[bval]\n\t" \ |
michael@0 | 106 | "smlawt %[mr], %H[aval], %[bval], %[mr]\n\t" \ |
michael@0 | 107 | : [mr]"=r"(mr__), [mi1]"=r"(mi1__), [mi2]"=r"(mi2__), \ |
michael@0 | 108 | [aval]"=&r"(aval__), [bval]"=r"(bval__) \ |
michael@0 | 109 | : [ap]LDRD_CONS(a), [bp]"m"(b) \ |
michael@0 | 110 | ); \ |
michael@0 | 111 | (m).r = SHL32(mr__, 1); \ |
michael@0 | 112 | (m).i = SHL32(SUB32(mi1__, mi2__), 1); \ |
michael@0 | 113 | } \ |
michael@0 | 114 | while(0) |
michael@0 | 115 | |
michael@0 | 116 | #endif /* FIXED_POINT */ |
michael@0 | 117 | |
michael@0 | 118 | #endif /* KISS_FFT_GUTS_H */ |