OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//build/config/arm.gni") |
| 6 |
5 declare_args() { | 7 declare_args() { |
6 # Override this value to build with small float FFT tables | 8 # Override this value to build with small float FFT tables |
7 openmax_big_float_fft = true | 9 openmax_big_float_fft = true |
8 } | 10 } |
9 | 11 |
10 config("dl_config") { | 12 config("dl_config") { |
11 include_dirs = [ ".." ] | 13 include_dirs = [ ".." ] |
| 14 if (cpu_arch == "arm") { |
| 15 if (arm_use_neon) { |
| 16 # Enable build-time NEON selection. |
| 17 defines = [ "DL_ARM_NEON" ] |
| 18 } else if (is_android) { |
| 19 # Enable run-time NEON selection. |
| 20 defines = [ "DL_ARM_NEON_OPTIONAL" ] |
| 21 } |
| 22 } |
| 23 else if (cpu_arch == "arm64") { |
| 24 # Enable build-time NEON selection. |
| 25 defines = [ "DL_ARM_NEON" ] |
| 26 } |
12 } | 27 } |
13 | 28 |
14 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl | 29 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl |
15 source_set("dl") { | 30 source_set("dl") { |
16 public_configs = [ ":dl_config" ] | 31 public_configs = [ ":dl_config" ] |
17 sources = [ | 32 sources = [ |
18 "api/omxtypes.h", | 33 "api/omxtypes.h", |
19 "sp/api/omxSP.h", | 34 "sp/api/omxSP.h", |
20 "sp/src/armSP_FFT_F32TwiddleTable.c", | 35 "sp/src/armSP_FFT_F32TwiddleTable.c", |
21 ] | 36 ] |
(...skipping 18 matching lines...) Expand all Loading... |
40 "sp/src/arm/omxSP_FFTGetBufSize_C_FC32.c", | 55 "sp/src/arm/omxSP_FFTGetBufSize_C_FC32.c", |
41 "sp/src/arm/omxSP_FFTGetBufSize_C_SC32.c", | 56 "sp/src/arm/omxSP_FFTGetBufSize_C_SC32.c", |
42 "sp/src/arm/omxSP_FFTGetBufSize_R_F32.c", | 57 "sp/src/arm/omxSP_FFTGetBufSize_R_F32.c", |
43 "sp/src/arm/omxSP_FFTGetBufSize_R_S32.c", | 58 "sp/src/arm/omxSP_FFTGetBufSize_R_S32.c", |
44 "sp/src/arm/omxSP_FFTInit_C_FC32.c", | 59 "sp/src/arm/omxSP_FFTInit_C_FC32.c", |
45 "sp/src/arm/omxSP_FFTInit_R_F32.c", | 60 "sp/src/arm/omxSP_FFTInit_R_F32.c", |
46 ] | 61 ] |
47 } | 62 } |
48 | 63 |
49 if (cpu_arch == "arm") { | 64 if (cpu_arch == "arm") { |
| 65 if (arm_use_neon || is_android) { |
| 66 deps += [ |
| 67 ":openmax_dl_armv7" |
| 68 ] |
| 69 } |
50 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 70 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] |
51 cflags += [ | 71 cflags += [ |
52 "-mfpu=neon" | 72 "-mfpu=neon" |
53 ] | 73 ] |
54 | 74 |
55 deps += [ | 75 if (arm_use_neon || is_android) { |
56 ":openmax_dl_armv7" | 76 sources += [ |
57 ] | 77 # Common files that are used by both the NEON and non-NEON code. |
| 78 "api/armCOMM_s.h", |
| 79 "sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c", |
| 80 "sp/src/arm/omxSP_FFTGetBufSize_R_S16.c", |
| 81 "sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c", |
| 82 "sp/src/arm/omxSP_FFTInit_C_SC16.c", |
| 83 "sp/src/arm/omxSP_FFTInit_C_SC32.c", |
| 84 "sp/src/arm/omxSP_FFTInit_R_S16.c", |
| 85 "sp/src/arm/omxSP_FFTInit_R_S16S32.c", |
| 86 "sp/src/arm/omxSP_FFTInit_R_S32.c", |
58 | 87 |
59 sources += [ | 88 # Complex 32-bit fixed-point FFT. |
60 # Common files that are used by both the NEON and non-NEON code. | 89 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S", |
61 "api/armCOMM_s.h", | 90 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S", |
62 "sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c", | 91 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S", |
63 "sp/src/arm/omxSP_FFTGetBufSize_R_S16.c", | 92 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S", |
64 "sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c", | 93 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S", |
65 "sp/src/arm/omxSP_FFTInit_C_SC16.c", | 94 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S", |
66 "sp/src/arm/omxSP_FFTInit_C_SC32.c", | 95 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S", |
67 "sp/src/arm/omxSP_FFTInit_R_S16.c", | 96 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S", |
68 "sp/src/arm/omxSP_FFTInit_R_S16S32.c", | 97 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S", |
69 "sp/src/arm/omxSP_FFTInit_R_S32.c", | 98 # Real 32-bit fixed-point FFT |
70 | 99 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S", |
71 # Complex 32-bit fixed-point FFT. | 100 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S", |
72 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S", | 101 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S", |
73 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S", | 102 # Complex 16-bit fixed-point FFT |
74 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S", | 103 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S", |
75 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S", | 104 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S", |
76 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S", | 105 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S", |
77 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S", | 106 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S", |
78 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S", | 107 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S", |
79 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S", | 108 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S", |
80 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S", | 109 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S", |
81 # Real 32-bit fixed-point FFT | 110 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S", |
82 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S", | 111 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S", |
83 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S", | 112 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S", |
84 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S", | 113 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S", |
85 # Complex 16-bit fixed-point FFT | 114 # Real 16-bit fixed-point FFT |
86 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S", | 115 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S", |
87 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S", | 116 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S", |
88 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S", | 117 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S", |
89 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S", | 118 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S", |
90 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S", | 119 # Complex floating-point FFT |
91 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S", | 120 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", |
92 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S", | 121 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S", |
93 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S", | 122 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S", |
94 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S", | 123 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", |
95 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S", | 124 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S", |
96 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S", | 125 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", |
97 # Real 16-bit fixed-point FFT | 126 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", |
98 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S", | 127 "sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", |
99 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S", | 128 "sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S", |
100 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S", | 129 # Real floating-point FFT |
101 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S", | 130 "sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", |
102 # Complex floating-point FFT | 131 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", |
103 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", | 132 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", |
104 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S", | 133 ] |
105 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S", | 134 } |
106 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", | |
107 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S", | |
108 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", | |
109 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", | |
110 "sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", | |
111 "sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S", | |
112 # Real floating-point FFT | |
113 "sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", | |
114 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", | |
115 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", | |
116 ] | |
117 } | 135 } |
118 | 136 |
119 if (cpu_arch == "ia32" || cpu_arch == "x64") { | 137 if (cpu_arch == "ia32" || cpu_arch == "x64") { |
120 cflags += [ | 138 cflags += [ |
121 "-msse2" | 139 "-msse2" |
122 ] | 140 ] |
123 | 141 |
124 sources += [ | 142 sources += [ |
125 # Real 32-bit floating-point FFT. | 143 # Real 32-bit floating-point FFT. |
126 "sp/api/x86SP.h", | 144 "sp/api/x86SP.h", |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ] | 214 ] |
197 } | 215 } |
198 } | 216 } |
199 | 217 |
200 if (cpu_arch == "arm") { | 218 if (cpu_arch == "arm") { |
201 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl | 219 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl |
202 # Non-NEON implementation of FFT. This library is NOT | 220 # Non-NEON implementation of FFT. This library is NOT |
203 # standalone. Applications must link with openmax_dl. | 221 # standalone. Applications must link with openmax_dl. |
204 source_set("openmax_dl_armv7") { | 222 source_set("openmax_dl_armv7") { |
205 configs += [ ":dl_config" ] | 223 configs += [ ":dl_config" ] |
206 deps = [ "//third_party/android_tools:cpu_features" ] | |
207 visibility = [ ":*" ] | 224 visibility = [ ":*" ] |
208 | 225 |
209 #TODO(GYP): | 226 #TODO(GYP): |
210 #'cflags!': [ | 227 #'cflags!': [ |
211 #'-mfpu=neon', | 228 #'-mfpu=neon', |
212 #], | 229 #], |
213 | 230 |
214 libs = [ "log" ] | |
215 | |
216 sources = [ | 231 sources = [ |
217 # Detection routine | |
218 "sp/src/arm/detect.c", | |
219 # Complex floating-point FFT | 232 # Complex floating-point FFT |
220 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", | 233 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", |
221 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", | 234 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", |
222 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", | 235 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", |
223 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", | 236 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", |
224 "sp/src/arm/armv7/omxSP_FFTInv_CToC_FC32_Sfs_s.S", | 237 "sp/src/arm/armv7/omxSP_FFTInv_CToC_FC32_Sfs_s.S", |
225 "sp/src/arm/armv7/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", | 238 "sp/src/arm/armv7/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", |
226 # Real floating-point FFT | 239 # Real floating-point FFT |
227 "sp/src/arm/armv7/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", | 240 "sp/src/arm/armv7/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", |
228 "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", | 241 "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", |
229 "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", | 242 "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", |
230 ] | 243 ] |
| 244 if (is_android) { |
| 245 # We only do run-time NEON detection on Android. |
| 246 deps = [ "//third_party/android_tools:cpu_features" ] |
| 247 libs = [ "log" ] |
| 248 # Detection routine |
| 249 sources += [ "sp/src/arm/detect.c" ] |
| 250 } |
231 } | 251 } |
232 } | 252 } |
OLD | NEW |