Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 1 | import numpy as np |
| 2 | import math |
| 3 | import argparse |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 4 | import sys |
| 5 | |
| 6 | sys.path.append("PatternGeneration") |
| 7 | |
| 8 | import Tools |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 9 | |
| 10 | parser = argparse.ArgumentParser(description='Generate C arrays') |
| 11 | parser.add_argument('-f', nargs='?',type = str, default="../Source/CommonTables/arm_mve_tables.c", help="C File path") |
| 12 | parser.add_argument('-he', nargs='?',type = str, default="../Include/arm_mve_tables.h", help="H File path") |
| 13 | |
| 14 | args = parser.parse_args() |
| 15 | |
| 16 | COLLIM = 80 |
| 17 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 18 | condition="""#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_%s_%d) || defined(ARM_TABLE_TWIDDLECOEF_%s_%d) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 19 | """ |
| 20 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 21 | F32 = 1 |
| 22 | Q31 = 2 |
| 23 | Q15 = 3 |
| 24 | Q7 = 4 |
| 25 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 26 | def printCUInt32Array(f,name,arr): |
| 27 | nb = 0 |
| 28 | print("uint32_t %s[%d]={" % (name,len(arr)),file=f) |
| 29 | |
| 30 | for d in arr: |
| 31 | val = "%d," % d |
| 32 | nb = nb + len(val) |
| 33 | if nb > COLLIM: |
| 34 | print("",file=f) |
| 35 | nb = len(val) |
| 36 | print(val,end="",file=f) |
| 37 | |
| 38 | print("};\n",file=f) |
| 39 | |
| 40 | def printCFloat32Array(f,name,arr): |
| 41 | nb = 0 |
| 42 | print("float32_t %s[%d]={" % (name,len(arr)),file=f) |
| 43 | |
| 44 | for d in arr: |
| 45 | val = "%.20ff," % d |
| 46 | nb = nb + len(val) |
| 47 | if nb > COLLIM: |
| 48 | print("",file=f) |
| 49 | nb = len(val) |
| 50 | print(val,end="",file=f) |
| 51 | |
| 52 | print("};\n",file=f) |
| 53 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 54 | def printCQ31Array(f,name,arr): |
| 55 | nb = 0 |
| 56 | print("q31_t %s[%d]={" % (name,len(arr)),file=f) |
| 57 | |
| 58 | for d in arr: |
| 59 | val = "%s," % Tools.to_q31(d) |
| 60 | nb = nb + len(val) |
| 61 | if nb > COLLIM: |
| 62 | print("",file=f) |
| 63 | nb = len(val) |
| 64 | print(val,end="",file=f) |
| 65 | |
| 66 | print("};\n",file=f) |
| 67 | |
| 68 | def printCQ15Array(f,name,arr): |
| 69 | nb = 0 |
| 70 | print("q15_t %s[%d]={" % (name,len(arr)),file=f) |
| 71 | |
| 72 | for d in arr: |
| 73 | val = "%s," % Tools.to_q15(d) |
| 74 | nb = nb + len(val) |
| 75 | if nb > COLLIM: |
| 76 | print("",file=f) |
| 77 | nb = len(val) |
| 78 | print(val,end="",file=f) |
| 79 | |
| 80 | print("};\n",file=f) |
| 81 | |
| 82 | def printCQ7Array(f,name,arr): |
| 83 | nb = 0 |
| 84 | print("q7_t %s[%d]={" % (name,len(arr)),file=f) |
| 85 | |
| 86 | for d in arr: |
| 87 | val = "%s," % Tools.to_q7(d) |
| 88 | nb = nb + len(val) |
| 89 | if nb > COLLIM: |
| 90 | print("",file=f) |
| 91 | nb = len(val) |
| 92 | print(val,end="",file=f) |
| 93 | |
| 94 | print("};\n",file=f) |
| 95 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 96 | def printHUInt32Array(f,name,arr): |
| 97 | print("extern uint32_t %s[%d];" % (name,len(arr)),file=f) |
| 98 | |
| 99 | def printHFloat32Array(f,name,arr): |
| 100 | print("extern float32_t %s[%d];" % (name,len(arr)),file=f) |
| 101 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 102 | def printHQ31Array(f,name,arr): |
| 103 | print("extern q31_t %s[%d];" % (name,len(arr)),file=f) |
| 104 | |
| 105 | def printHQ15Array(f,name,arr): |
| 106 | print("extern q15_t %s[%d];" % (name,len(arr)),file=f) |
| 107 | |
| 108 | def printHQ7Array(f,name,arr): |
| 109 | print("extern q7_t %s[%d];" % (name,len(arr)),file=f) |
| 110 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 111 | def twiddle(n): |
| 112 | a=2.0*math.pi*np.linspace(0,n,num=n,endpoint=False)/n |
| 113 | c=np.cos(a) |
| 114 | s=np.sin(a) |
| 115 | |
| 116 | r = np.empty((c.size + s.size,), dtype=c.dtype) |
| 117 | r[0::2] = c |
| 118 | r[1::2] = s |
| 119 | return(r) |
| 120 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 121 | def reorderTwiddle(theType,conjugate,f,h,n): |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 122 | numStages = 6 |
| 123 | coefs= twiddle(n) |
| 124 | |
| 125 | |
| 126 | if n == 4096: |
| 127 | numStages = 6 |
| 128 | arraySize = 1364 |
| 129 | |
| 130 | if n == 1024: |
| 131 | numStages = 5 |
| 132 | arraySize = 340 |
| 133 | |
| 134 | if n == 256: |
| 135 | numStages = 4 |
| 136 | arraySize = 84 |
| 137 | |
| 138 | if n == 64: |
| 139 | numStages = 3 |
| 140 | arraySize = 20 |
| 141 | |
| 142 | if n == 16: |
| 143 | numStages = 2 |
| 144 | arraySize = 4 |
| 145 | |
| 146 | incr = 1 |
| 147 | nbOfElt = n |
| 148 | |
| 149 | maxNb = 0 |
| 150 | |
| 151 | tab1 = np.zeros(2*arraySize) |
| 152 | tab2 = np.zeros(2*arraySize) |
| 153 | tab3 = np.zeros(2*arraySize) |
| 154 | |
| 155 | tab1Index=0 |
| 156 | tab2Index=0 |
| 157 | tab3Index=0 |
| 158 | |
| 159 | tab1Offset = np.zeros(numStages) |
| 160 | tab2Offset = np.zeros(numStages) |
| 161 | tab3Offset = np.zeros(numStages) |
| 162 | |
| 163 | |
| 164 | |
| 165 | for stage in range(0,numStages-1): |
| 166 | nbOfElt = nbOfElt >> 2 |
| 167 | pVectCoef1 = 0 |
| 168 | pVectCoef2 = 0 |
| 169 | pVectCoef3 = 0 |
| 170 | |
| 171 | tab1Offset[stage] = tab1Index |
| 172 | tab2Offset[stage] = tab2Index |
| 173 | tab3Offset[stage] = tab3Index |
| 174 | |
| 175 | for i in range(0,nbOfElt): |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 176 | tab1[tab1Index] = coefs[pVectCoef1] |
| 177 | if not conjugate: |
| 178 | tab1[tab1Index + 1] = coefs[pVectCoef1 + 1] |
| 179 | else: |
| 180 | tab1[tab1Index + 1] = -coefs[pVectCoef1 + 1] |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 181 | tab1Index = tab1Index + 2 |
| 182 | pVectCoef1 = pVectCoef1 + (incr * 1 * 2) |
| 183 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 184 | tab2[tab2Index] = coefs[pVectCoef2] |
| 185 | if not conjugate: |
| 186 | tab2[tab2Index + 1] = coefs[pVectCoef2 + 1] |
| 187 | else: |
| 188 | tab2[tab2Index + 1] = -coefs[pVectCoef2 + 1] |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 189 | tab2Index = tab2Index + 2 |
| 190 | pVectCoef2 = pVectCoef2 + (incr * 2 * 2) |
| 191 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 192 | tab3[tab3Index] = coefs[pVectCoef3] |
| 193 | if not conjugate: |
| 194 | tab3[tab3Index + 1] = coefs[pVectCoef3 + 1] |
| 195 | else: |
| 196 | tab3[tab3Index + 1] = -coefs[pVectCoef3 + 1] |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 197 | tab3Index = tab3Index + 2 |
| 198 | pVectCoef3 = pVectCoef3 + (incr * 3 * 2) |
| 199 | |
| 200 | maxNb = maxNb + 1 |
| 201 | |
| 202 | incr = 4 * incr |
| 203 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 204 | # F32 SECTION FOR THIS FFT LENGTH |
| 205 | if theType == F32: |
| 206 | print(condition % ("F32",n, "F32",n << 1),file=f) |
| 207 | print(condition % ("F32",n, "F32",n << 1),file=h) |
| 208 | printCUInt32Array(f,"rearranged_twiddle_tab_stride1_arr_%d_f32" % n,list(tab1Offset)) |
| 209 | printHUInt32Array(h,"rearranged_twiddle_tab_stride1_arr_%d_f32" % n,list(tab1Offset)) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 210 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 211 | printCUInt32Array(f,"rearranged_twiddle_tab_stride2_arr_%d_f32" % n,list(tab2Offset)) |
| 212 | printHUInt32Array(h,"rearranged_twiddle_tab_stride2_arr_%d_f32" % n,list(tab2Offset)) |
| 213 | |
| 214 | printCUInt32Array(f,"rearranged_twiddle_tab_stride3_arr_%d_f32" % n,list(tab3Offset)) |
| 215 | printHUInt32Array(h,"rearranged_twiddle_tab_stride3_arr_%d_f32" % n,list(tab3Offset)) |
| 216 | |
| 217 | printCFloat32Array(f,"rearranged_twiddle_stride1_%d_f32" % n,list(tab1)) |
| 218 | printHFloat32Array(h,"rearranged_twiddle_stride1_%d_f32" % n,list(tab1)) |
| 219 | |
| 220 | printCFloat32Array(f,"rearranged_twiddle_stride2_%d_f32" % n,list(tab2)) |
| 221 | printHFloat32Array(h,"rearranged_twiddle_stride2_%d_f32" % n,list(tab2)) |
| 222 | |
| 223 | printCFloat32Array(f,"rearranged_twiddle_stride3_%d_f32" % n,list(tab3)) |
| 224 | printHFloat32Array(h,"rearranged_twiddle_stride3_%d_f32" % n,list(tab3)) |
| 225 | print("#endif\n",file=f) |
| 226 | print("#endif\n",file=h) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 227 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 228 | # Q31 SECTION FOR THIS FFT LENGTH |
| 229 | if theType == Q31: |
| 230 | print(condition % ("Q31",n, "Q31",n << 1),file=f) |
| 231 | print(condition % ("Q31",n, "Q31",n << 1),file=h) |
| 232 | printCUInt32Array(f,"rearranged_twiddle_tab_stride1_arr_%d_q31" % n,list(tab1Offset)) |
| 233 | printHUInt32Array(h,"rearranged_twiddle_tab_stride1_arr_%d_q31" % n,list(tab1Offset)) |
| 234 | |
| 235 | printCUInt32Array(f,"rearranged_twiddle_tab_stride2_arr_%d_q31" % n,list(tab2Offset)) |
| 236 | printHUInt32Array(h,"rearranged_twiddle_tab_stride2_arr_%d_q31" % n,list(tab2Offset)) |
| 237 | |
| 238 | printCUInt32Array(f,"rearranged_twiddle_tab_stride3_arr_%d_q31" % n,list(tab3Offset)) |
| 239 | printHUInt32Array(h,"rearranged_twiddle_tab_stride3_arr_%d_q31" % n,list(tab3Offset)) |
| 240 | |
| 241 | printCQ31Array(f,"rearranged_twiddle_stride1_%d_q31" % n,list(tab1)) |
| 242 | printHQ31Array(h,"rearranged_twiddle_stride1_%d_q31" % n,list(tab1)) |
| 243 | |
| 244 | printCQ31Array(f,"rearranged_twiddle_stride2_%d_q31" % n,list(tab2)) |
| 245 | printHQ31Array(h,"rearranged_twiddle_stride2_%d_q31" % n,list(tab2)) |
| 246 | |
| 247 | printCQ31Array(f,"rearranged_twiddle_stride3_%d_q31" % n,list(tab3)) |
| 248 | printHQ31Array(h,"rearranged_twiddle_stride3_%d_q31" % n,list(tab3)) |
| 249 | print("#endif\n",file=f) |
| 250 | print("#endif\n",file=h) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 251 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 252 | # Q15 SECTION FOR THIS FFT LENGTH |
| 253 | if theType == Q15: |
| 254 | print(condition % ("Q15",n, "Q15",n << 1),file=f) |
| 255 | print(condition % ("Q15",n, "Q15",n << 1),file=h) |
| 256 | printCUInt32Array(f,"rearranged_twiddle_tab_stride1_arr_%d_q15" % n,list(tab1Offset)) |
| 257 | printHUInt32Array(h,"rearranged_twiddle_tab_stride1_arr_%d_q15" % n,list(tab1Offset)) |
| 258 | |
| 259 | printCUInt32Array(f,"rearranged_twiddle_tab_stride2_arr_%d_q15" % n,list(tab2Offset)) |
| 260 | printHUInt32Array(h,"rearranged_twiddle_tab_stride2_arr_%d_q15" % n,list(tab2Offset)) |
| 261 | |
| 262 | printCUInt32Array(f,"rearranged_twiddle_tab_stride3_arr_%d_q15" % n,list(tab3Offset)) |
| 263 | printHUInt32Array(h,"rearranged_twiddle_tab_stride3_arr_%d_q15" % n,list(tab3Offset)) |
| 264 | |
| 265 | printCQ15Array(f,"rearranged_twiddle_stride1_%d_q15" % n,list(tab1)) |
| 266 | printHQ15Array(h,"rearranged_twiddle_stride1_%d_q15" % n,list(tab1)) |
| 267 | |
| 268 | printCQ15Array(f,"rearranged_twiddle_stride2_%d_q15" % n,list(tab2)) |
| 269 | printHQ15Array(h,"rearranged_twiddle_stride2_%d_q15" % n,list(tab2)) |
| 270 | |
| 271 | printCQ15Array(f,"rearranged_twiddle_stride3_%d_q15" % n,list(tab3)) |
| 272 | printHQ15Array(h,"rearranged_twiddle_stride3_%d_q15" % n,list(tab3)) |
| 273 | print("#endif\n",file=f) |
| 274 | print("#endif\n",file=h) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 275 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 276 | |
| 277 | |
| 278 | |
| 279 | #test = twiddle(16) |
| 280 | #printCFloat32Array("Test",list(test)) |
| 281 | |
| 282 | cheader="""/* ---------------------------------------------------------------------- |
| 283 | * Project: CMSIS DSP Library |
| 284 | * Title: arm_mve_tables.c |
| 285 | * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc |
| 286 | * used for MVE implementation only |
| 287 | * |
| 288 | * $Date: 08. January 2020 |
| 289 | * $Revision: V1.7.0 |
| 290 | * |
| 291 | * Target Processor: Cortex-M cores |
| 292 | * -------------------------------------------------------------------- */ |
| 293 | /* |
| 294 | * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. |
| 295 | * |
| 296 | * SPDX-License-Identifier: Apache-2.0 |
| 297 | * |
| 298 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| 299 | * not use this file except in compliance with the License. |
| 300 | * You may obtain a copy of the License at |
| 301 | * |
| 302 | * www.apache.org/licenses/LICENSE-2.0 |
| 303 | * |
| 304 | * Unless required by applicable law or agreed to in writing, software |
| 305 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 306 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 307 | * See the License for the specific language governing permissions and |
| 308 | * limitations under the License. |
| 309 | */ |
| 310 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 311 | """ |
| 312 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 313 | cifdeMVEF="""#include "arm_math.h" |
| 314 | |
| 315 | #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) |
| 316 | |
| 317 | #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) |
| 318 | """ |
| 319 | |
| 320 | cfooterMVEF=""" |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 321 | |
| 322 | #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ |
| 323 | #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ |
| 324 | """ |
| 325 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 326 | cifdeMVEI="""#include "arm_math.h" |
| 327 | |
| 328 | #if defined(ARM_MATH_MVEI) |
| 329 | |
| 330 | #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) |
| 331 | """ |
| 332 | |
| 333 | cfooterMVEI=""" |
| 334 | |
| 335 | #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ |
| 336 | #endif /* defined(ARM_MATH_MVEI) */ |
| 337 | """ |
| 338 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 339 | hheader="""/* ---------------------------------------------------------------------- |
| 340 | * Project: CMSIS DSP Library |
| 341 | * Title: arm_mve_tables.h |
| 342 | * Description: common tables like fft twiddle factors, Bitreverse, reciprocal etc |
| 343 | * used for MVE implementation only |
| 344 | * |
| 345 | * $Date: 08. January 2020 |
| 346 | * $Revision: V1.7.0 |
| 347 | * |
| 348 | * Target Processor: Cortex-M cores |
| 349 | * -------------------------------------------------------------------- */ |
| 350 | /* |
| 351 | * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved. |
| 352 | * |
| 353 | * SPDX-License-Identifier: Apache-2.0 |
| 354 | * |
| 355 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| 356 | * not use this file except in compliance with the License. |
| 357 | * You may obtain a copy of the License at |
| 358 | * |
| 359 | * www.apache.org/licenses/LICENSE-2.0 |
| 360 | * |
| 361 | * Unless required by applicable law or agreed to in writing, software |
| 362 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 363 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 364 | * See the License for the specific language governing permissions and |
| 365 | * limitations under the License. |
| 366 | */ |
| 367 | |
| 368 | #ifndef _ARM_MVE_TABLES_H |
| 369 | #define _ARM_MVE_TABLES_H |
| 370 | |
| 371 | #include "arm_math.h" |
| 372 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 373 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 374 | |
| 375 | |
| 376 | """ |
| 377 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 378 | hifdefMVEF=""" |
| 379 | #if defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) |
| 380 | |
| 381 | #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) |
| 382 | """ |
| 383 | |
| 384 | hfooterMVEF=""" |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 385 | #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ |
| 386 | |
| 387 | #endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */ |
| 388 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 389 | """ |
| 390 | |
| 391 | hifdefMVEI=""" |
| 392 | #if defined(ARM_MATH_MVEI) |
| 393 | |
| 394 | #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) |
| 395 | """ |
| 396 | |
| 397 | hfooterMVEI=""" |
| 398 | #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */ |
| 399 | |
| 400 | #endif /* defined(ARM_MATH_MVEI) */ |
| 401 | |
| 402 | """ |
| 403 | |
| 404 | hfooter=""" |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 405 | #endif /*_ARM_MVE_TABLES_H*/ |
| 406 | """ |
| 407 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 408 | |
| 409 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 410 | with open(args.f,'w') as f: |
| 411 | with open(args.he,'w') as h: |
| 412 | print(cheader,file=f) |
| 413 | print(hheader,file=h) |
| 414 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 415 | |
| 416 | print(cifdeMVEF,file=f) |
| 417 | print(hifdefMVEF,file=h) |
| 418 | reorderTwiddle(F32,False,f,h,16) |
| 419 | reorderTwiddle(F32,False,f,h,64) |
| 420 | reorderTwiddle(F32,False,f,h,256) |
| 421 | reorderTwiddle(F32,False,f,h,1024) |
| 422 | reorderTwiddle(F32,False,f,h,4096) |
| 423 | print(cfooterMVEF,file=f) |
| 424 | print(hfooterMVEF,file=h) |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 425 | |
Christophe Favergeon | d5e0a04 | 2020-01-10 14:31:14 +0100 | [diff] [blame^] | 426 | print(cifdeMVEI,file=f) |
| 427 | print(hifdefMVEI,file=h) |
| 428 | reorderTwiddle(Q31,True,f,h,16) |
| 429 | reorderTwiddle(Q31,True,f,h,64) |
| 430 | reorderTwiddle(Q31,True,f,h,256) |
| 431 | reorderTwiddle(Q31,True,f,h,1024) |
| 432 | reorderTwiddle(Q31,True,f,h,4096) |
| 433 | print(cfooterMVEI,file=f) |
| 434 | print(hfooterMVEI,file=h) |
| 435 | |
| 436 | print(cifdeMVEI,file=f) |
| 437 | print(hifdefMVEI,file=h) |
| 438 | reorderTwiddle(Q15,True,f,h,16) |
| 439 | reorderTwiddle(Q15,True,f,h,64) |
| 440 | reorderTwiddle(Q15,True,f,h,256) |
| 441 | reorderTwiddle(Q15,True,f,h,1024) |
| 442 | reorderTwiddle(Q15,True,f,h,4096) |
| 443 | print(cfooterMVEI,file=f) |
| 444 | print(hfooterMVEI,file=h) |
| 445 | |
| 446 | print(cifdeMVEI,file=f) |
| 447 | print(hifdefMVEI,file=h) |
| 448 | reorderTwiddle(Q7,True,f,h,16) |
| 449 | reorderTwiddle(Q7,True,f,h,64) |
| 450 | reorderTwiddle(Q7,True,f,h,256) |
| 451 | reorderTwiddle(Q7,True,f,h,1024) |
| 452 | reorderTwiddle(Q7,True,f,h,4096) |
| 453 | print(cfooterMVEI,file=f) |
| 454 | print(hfooterMVEI,file=h) |
| 455 | |
Christophe Favergeon | aefd277 | 2020-01-08 09:01:17 +0100 | [diff] [blame] | 456 | print(hfooter,file=h) |