annotate src/opus-1.3/celt/arm/kiss_fft_armv5e.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_ARMv5E_H
Chris@69 27 #define KISS_FFT_ARMv5E_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 #if defined(__thumb__)||defined(__thumb2__)
Chris@69 36 #define LDRD_CONS "Q"
Chris@69 37 #else
Chris@69 38 #define LDRD_CONS "Uq"
Chris@69 39 #endif
Chris@69 40
Chris@69 41 #undef C_MUL
Chris@69 42 #define C_MUL(m,a,b) \
Chris@69 43 do{ \
Chris@69 44 int mr1__; \
Chris@69 45 int mr2__; \
Chris@69 46 int mi__; \
Chris@69 47 long long aval__; \
Chris@69 48 int bval__; \
Chris@69 49 __asm__( \
Chris@69 50 "#C_MUL\n\t" \
Chris@69 51 "ldrd %[aval], %H[aval], %[ap]\n\t" \
Chris@69 52 "ldr %[bval], %[bp]\n\t" \
Chris@69 53 "smulwb %[mi], %H[aval], %[bval]\n\t" \
Chris@69 54 "smulwb %[mr1], %[aval], %[bval]\n\t" \
Chris@69 55 "smulwt %[mr2], %H[aval], %[bval]\n\t" \
Chris@69 56 "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \
Chris@69 57 : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \
Chris@69 58 [aval]"=&r"(aval__), [bval]"=r"(bval__) \
Chris@69 59 : [ap]LDRD_CONS(a), [bp]"m"(b) \
Chris@69 60 ); \
Chris@69 61 (m).r = SHL32(SUB32(mr1__, mr2__), 1); \
Chris@69 62 (m).i = SHL32(mi__, 1); \
Chris@69 63 } \
Chris@69 64 while(0)
Chris@69 65
Chris@69 66 #undef C_MUL4
Chris@69 67 #define C_MUL4(m,a,b) \
Chris@69 68 do{ \
Chris@69 69 int mr1__; \
Chris@69 70 int mr2__; \
Chris@69 71 int mi__; \
Chris@69 72 long long aval__; \
Chris@69 73 int bval__; \
Chris@69 74 __asm__( \
Chris@69 75 "#C_MUL4\n\t" \
Chris@69 76 "ldrd %[aval], %H[aval], %[ap]\n\t" \
Chris@69 77 "ldr %[bval], %[bp]\n\t" \
Chris@69 78 "smulwb %[mi], %H[aval], %[bval]\n\t" \
Chris@69 79 "smulwb %[mr1], %[aval], %[bval]\n\t" \
Chris@69 80 "smulwt %[mr2], %H[aval], %[bval]\n\t" \
Chris@69 81 "smlawt %[mi], %[aval], %[bval], %[mi]\n\t" \
Chris@69 82 : [mr1]"=r"(mr1__), [mr2]"=r"(mr2__), [mi]"=r"(mi__), \
Chris@69 83 [aval]"=&r"(aval__), [bval]"=r"(bval__) \
Chris@69 84 : [ap]LDRD_CONS(a), [bp]"m"(b) \
Chris@69 85 ); \
Chris@69 86 (m).r = SHR32(SUB32(mr1__, mr2__), 1); \
Chris@69 87 (m).i = SHR32(mi__, 1); \
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 mr__; \
Chris@69 95 int mi1__; \
Chris@69 96 int mi2__; \
Chris@69 97 long long aval__; \
Chris@69 98 int bval__; \
Chris@69 99 __asm__( \
Chris@69 100 "#C_MULC\n\t" \
Chris@69 101 "ldrd %[aval], %H[aval], %[ap]\n\t" \
Chris@69 102 "ldr %[bval], %[bp]\n\t" \
Chris@69 103 "smulwb %[mr], %[aval], %[bval]\n\t" \
Chris@69 104 "smulwb %[mi1], %H[aval], %[bval]\n\t" \
Chris@69 105 "smulwt %[mi2], %[aval], %[bval]\n\t" \
Chris@69 106 "smlawt %[mr], %H[aval], %[bval], %[mr]\n\t" \
Chris@69 107 : [mr]"=r"(mr__), [mi1]"=r"(mi1__), [mi2]"=r"(mi2__), \
Chris@69 108 [aval]"=&r"(aval__), [bval]"=r"(bval__) \
Chris@69 109 : [ap]LDRD_CONS(a), [bp]"m"(b) \
Chris@69 110 ); \
Chris@69 111 (m).r = SHL32(mr__, 1); \
Chris@69 112 (m).i = SHL32(SUB32(mi1__, mi2__), 1); \
Chris@69 113 } \
Chris@69 114 while(0)
Chris@69 115
Chris@69 116 #endif /* FIXED_POINT */
Chris@69 117
Chris@69 118 #endif /* KISS_FFT_GUTS_H */