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_ARMv4_H |
michael@0 | 27 | #define KISS_FFT_ARMv4_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 | #undef C_MUL |
michael@0 | 36 | #define C_MUL(m,a,b) \ |
michael@0 | 37 | do{ \ |
michael@0 | 38 | int br__; \ |
michael@0 | 39 | int bi__; \ |
michael@0 | 40 | int tt__; \ |
michael@0 | 41 | __asm__ __volatile__( \ |
michael@0 | 42 | "#C_MUL\n\t" \ |
michael@0 | 43 | "ldrsh %[br], [%[bp], #0]\n\t" \ |
michael@0 | 44 | "ldm %[ap], {r0,r1}\n\t" \ |
michael@0 | 45 | "ldrsh %[bi], [%[bp], #2]\n\t" \ |
michael@0 | 46 | "smull %[tt], %[mi], r1, %[br]\n\t" \ |
michael@0 | 47 | "smlal %[tt], %[mi], r0, %[bi]\n\t" \ |
michael@0 | 48 | "rsb %[bi], %[bi], #0\n\t" \ |
michael@0 | 49 | "smull %[br], %[mr], r0, %[br]\n\t" \ |
michael@0 | 50 | "mov %[tt], %[tt], lsr #15\n\t" \ |
michael@0 | 51 | "smlal %[br], %[mr], r1, %[bi]\n\t" \ |
michael@0 | 52 | "orr %[mi], %[tt], %[mi], lsl #17\n\t" \ |
michael@0 | 53 | "mov %[br], %[br], lsr #15\n\t" \ |
michael@0 | 54 | "orr %[mr], %[br], %[mr], lsl #17\n\t" \ |
michael@0 | 55 | : [mr]"=r"((m).r), [mi]"=r"((m).i), \ |
michael@0 | 56 | [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \ |
michael@0 | 57 | : [ap]"r"(&(a)), [bp]"r"(&(b)) \ |
michael@0 | 58 | : "r0", "r1" \ |
michael@0 | 59 | ); \ |
michael@0 | 60 | } \ |
michael@0 | 61 | while(0) |
michael@0 | 62 | |
michael@0 | 63 | #undef C_MUL4 |
michael@0 | 64 | #define C_MUL4(m,a,b) \ |
michael@0 | 65 | do{ \ |
michael@0 | 66 | int br__; \ |
michael@0 | 67 | int bi__; \ |
michael@0 | 68 | int tt__; \ |
michael@0 | 69 | __asm__ __volatile__( \ |
michael@0 | 70 | "#C_MUL4\n\t" \ |
michael@0 | 71 | "ldrsh %[br], [%[bp], #0]\n\t" \ |
michael@0 | 72 | "ldm %[ap], {r0,r1}\n\t" \ |
michael@0 | 73 | "ldrsh %[bi], [%[bp], #2]\n\t" \ |
michael@0 | 74 | "smull %[tt], %[mi], r1, %[br]\n\t" \ |
michael@0 | 75 | "smlal %[tt], %[mi], r0, %[bi]\n\t" \ |
michael@0 | 76 | "rsb %[bi], %[bi], #0\n\t" \ |
michael@0 | 77 | "smull %[br], %[mr], r0, %[br]\n\t" \ |
michael@0 | 78 | "mov %[tt], %[tt], lsr #17\n\t" \ |
michael@0 | 79 | "smlal %[br], %[mr], r1, %[bi]\n\t" \ |
michael@0 | 80 | "orr %[mi], %[tt], %[mi], lsl #15\n\t" \ |
michael@0 | 81 | "mov %[br], %[br], lsr #17\n\t" \ |
michael@0 | 82 | "orr %[mr], %[br], %[mr], lsl #15\n\t" \ |
michael@0 | 83 | : [mr]"=r"((m).r), [mi]"=r"((m).i), \ |
michael@0 | 84 | [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \ |
michael@0 | 85 | : [ap]"r"(&(a)), [bp]"r"(&(b)) \ |
michael@0 | 86 | : "r0", "r1" \ |
michael@0 | 87 | ); \ |
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 br__; \ |
michael@0 | 95 | int bi__; \ |
michael@0 | 96 | int tt__; \ |
michael@0 | 97 | __asm__ __volatile__( \ |
michael@0 | 98 | "#C_MULC\n\t" \ |
michael@0 | 99 | "ldrsh %[br], [%[bp], #0]\n\t" \ |
michael@0 | 100 | "ldm %[ap], {r0,r1}\n\t" \ |
michael@0 | 101 | "ldrsh %[bi], [%[bp], #2]\n\t" \ |
michael@0 | 102 | "smull %[tt], %[mr], r0, %[br]\n\t" \ |
michael@0 | 103 | "smlal %[tt], %[mr], r1, %[bi]\n\t" \ |
michael@0 | 104 | "rsb %[bi], %[bi], #0\n\t" \ |
michael@0 | 105 | "smull %[br], %[mi], r1, %[br]\n\t" \ |
michael@0 | 106 | "mov %[tt], %[tt], lsr #15\n\t" \ |
michael@0 | 107 | "smlal %[br], %[mi], r0, %[bi]\n\t" \ |
michael@0 | 108 | "orr %[mr], %[tt], %[mr], lsl #17\n\t" \ |
michael@0 | 109 | "mov %[br], %[br], lsr #15\n\t" \ |
michael@0 | 110 | "orr %[mi], %[br], %[mi], lsl #17\n\t" \ |
michael@0 | 111 | : [mr]"=r"((m).r), [mi]"=r"((m).i), \ |
michael@0 | 112 | [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \ |
michael@0 | 113 | : [ap]"r"(&(a)), [bp]"r"(&(b)) \ |
michael@0 | 114 | : "r0", "r1" \ |
michael@0 | 115 | ); \ |
michael@0 | 116 | } \ |
michael@0 | 117 | while(0) |
michael@0 | 118 | |
michael@0 | 119 | #endif /* FIXED_POINT */ |
michael@0 | 120 | |
michael@0 | 121 | #endif /* KISS_FFT_ARMv4_H */ |