annotate src/opus-1.3/celt/arm/kiss_fft_armv4.h @ 77:4edcd14160a5 pa_catalina

Duplicate for patch testing
author Chris Cannam
date Wed, 30 Oct 2019 11:25:10 +0000
parents 7aeed7906520
children
rev   line source
Chris@69 1 /*Copyright (c) 2013, Xiph.Org Foundation and contributors.
Chris@69 2
Chris@69 3 All rights reserved.
Chris@69 4
Chris@69 5 Redistribution and use in source and binary forms, with or without
Chris@69 6 modification, are permitted provided that the following conditions are met:
Chris@69 7
Chris@69 8 * Redistributions of source code must retain the above copyright notice,
Chris@69 9 this list of conditions and the following disclaimer.
Chris@69 10 * Redistributions in binary form must reproduce the above copyright notice,
Chris@69 11 this list of conditions and the following disclaimer in the
Chris@69 12 documentation and/or other materials provided with the distribution.
Chris@69 13
Chris@69 14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Chris@69 15 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Chris@69 16 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Chris@69 17 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
Chris@69 18 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Chris@69 19 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Chris@69 20 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Chris@69 21 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Chris@69 22 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Chris@69 23 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Chris@69 24 POSSIBILITY OF SUCH DAMAGE.*/
Chris@69 25
Chris@69 26 #ifndef KISS_FFT_ARMv4_H
Chris@69 27 #define KISS_FFT_ARMv4_H
Chris@69 28
Chris@69 29 #if !defined(KISS_FFT_GUTS_H)
Chris@69 30 #error "This file should only be included from _kiss_fft_guts.h"
Chris@69 31 #endif
Chris@69 32
Chris@69 33 #ifdef FIXED_POINT
Chris@69 34
Chris@69 35 #undef C_MUL
Chris@69 36 #define C_MUL(m,a,b) \
Chris@69 37 do{ \
Chris@69 38 int br__; \
Chris@69 39 int bi__; \
Chris@69 40 int tt__; \
Chris@69 41 __asm__ __volatile__( \
Chris@69 42 "#C_MUL\n\t" \
Chris@69 43 "ldrsh %[br], [%[bp], #0]\n\t" \
Chris@69 44 "ldm %[ap], {r0,r1}\n\t" \
Chris@69 45 "ldrsh %[bi], [%[bp], #2]\n\t" \
Chris@69 46 "smull %[tt], %[mi], r1, %[br]\n\t" \
Chris@69 47 "smlal %[tt], %[mi], r0, %[bi]\n\t" \
Chris@69 48 "rsb %[bi], %[bi], #0\n\t" \
Chris@69 49 "smull %[br], %[mr], r0, %[br]\n\t" \
Chris@69 50 "mov %[tt], %[tt], lsr #15\n\t" \
Chris@69 51 "smlal %[br], %[mr], r1, %[bi]\n\t" \
Chris@69 52 "orr %[mi], %[tt], %[mi], lsl #17\n\t" \
Chris@69 53 "mov %[br], %[br], lsr #15\n\t" \
Chris@69 54 "orr %[mr], %[br], %[mr], lsl #17\n\t" \
Chris@69 55 : [mr]"=r"((m).r), [mi]"=r"((m).i), \
Chris@69 56 [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \
Chris@69 57 : [ap]"r"(&(a)), [bp]"r"(&(b)) \
Chris@69 58 : "r0", "r1" \
Chris@69 59 ); \
Chris@69 60 } \
Chris@69 61 while(0)
Chris@69 62
Chris@69 63 #undef C_MUL4
Chris@69 64 #define C_MUL4(m,a,b) \
Chris@69 65 do{ \
Chris@69 66 int br__; \
Chris@69 67 int bi__; \
Chris@69 68 int tt__; \
Chris@69 69 __asm__ __volatile__( \
Chris@69 70 "#C_MUL4\n\t" \
Chris@69 71 "ldrsh %[br], [%[bp], #0]\n\t" \
Chris@69 72 "ldm %[ap], {r0,r1}\n\t" \
Chris@69 73 "ldrsh %[bi], [%[bp], #2]\n\t" \
Chris@69 74 "smull %[tt], %[mi], r1, %[br]\n\t" \
Chris@69 75 "smlal %[tt], %[mi], r0, %[bi]\n\t" \
Chris@69 76 "rsb %[bi], %[bi], #0\n\t" \
Chris@69 77 "smull %[br], %[mr], r0, %[br]\n\t" \
Chris@69 78 "mov %[tt], %[tt], lsr #17\n\t" \
Chris@69 79 "smlal %[br], %[mr], r1, %[bi]\n\t" \
Chris@69 80 "orr %[mi], %[tt], %[mi], lsl #15\n\t" \
Chris@69 81 "mov %[br], %[br], lsr #17\n\t" \
Chris@69 82 "orr %[mr], %[br], %[mr], lsl #15\n\t" \
Chris@69 83 : [mr]"=r"((m).r), [mi]"=r"((m).i), \
Chris@69 84 [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \
Chris@69 85 : [ap]"r"(&(a)), [bp]"r"(&(b)) \
Chris@69 86 : "r0", "r1" \
Chris@69 87 ); \
Chris@69 88 } \
Chris@69 89 while(0)
Chris@69 90
Chris@69 91 #undef C_MULC
Chris@69 92 #define C_MULC(m,a,b) \
Chris@69 93 do{ \
Chris@69 94 int br__; \
Chris@69 95 int bi__; \
Chris@69 96 int tt__; \
Chris@69 97 __asm__ __volatile__( \
Chris@69 98 "#C_MULC\n\t" \
Chris@69 99 "ldrsh %[br], [%[bp], #0]\n\t" \
Chris@69 100 "ldm %[ap], {r0,r1}\n\t" \
Chris@69 101 "ldrsh %[bi], [%[bp], #2]\n\t" \
Chris@69 102 "smull %[tt], %[mr], r0, %[br]\n\t" \
Chris@69 103 "smlal %[tt], %[mr], r1, %[bi]\n\t" \
Chris@69 104 "rsb %[bi], %[bi], #0\n\t" \
Chris@69 105 "smull %[br], %[mi], r1, %[br]\n\t" \
Chris@69 106 "mov %[tt], %[tt], lsr #15\n\t" \
Chris@69 107 "smlal %[br], %[mi], r0, %[bi]\n\t" \
Chris@69 108 "orr %[mr], %[tt], %[mr], lsl #17\n\t" \
Chris@69 109 "mov %[br], %[br], lsr #15\n\t" \
Chris@69 110 "orr %[mi], %[br], %[mi], lsl #17\n\t" \
Chris@69 111 : [mr]"=r"((m).r), [mi]"=r"((m).i), \
Chris@69 112 [br]"=&r"(br__), [bi]"=r"(bi__), [tt]"=r"(tt__) \
Chris@69 113 : [ap]"r"(&(a)), [bp]"r"(&(b)) \
Chris@69 114 : "r0", "r1" \
Chris@69 115 ); \
Chris@69 116 } \
Chris@69 117 while(0)
Chris@69 118
Chris@69 119 #endif /* FIXED_POINT */
Chris@69 120
Chris@69 121 #endif /* KISS_FFT_ARMv4_H */