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