Commit 6bc72bb
[microTVM] Replace arm_nnsupportfunctions.h with arm_acle.h (#13363)
* [microTVM] Replace arm_nnsupportfunctions.h with arm_acle.h
This attempts to replace the CMSIS-NN header with a more portable
alternative and avoid dependence on CMSIS
* Remove CMSIS __STATIC_FORCEINLINE macro
* Replace more intrinsics with ACLE variants
* Use builtins for intrinsics missing in older GCC
* Re-use common_includes to propagate shared functions
The packing definitions aren't implemented as ACLE intrinsics nor is there a simple way to convince a C compiler to generate them.
* Properly align memory access for
Introduce `memcpy` to explain to the compiler that we're changing
the alignment of `int16_t` to `int32_t`. What this appears to actually
do is encourage the compiler to use three loads rather than one double
load plus a regular load.
The padded array is aligned as an `int16_t`, it isn't guaranteed to
behave like an `int32_t` aligned array. One of the side effects of the
type punning from `int16_t*` to `int32_t*` is that we're effectively
lying to the compiler that this is correctly aligned and it can use
instructions which load multiple `int32_t`s at the same time - this does
not work 😿
Co-authored-by: Ashutosh Parkhi <[email protected]>1 parent a435cbb commit 6bc72bb
File tree
5 files changed
+93
-42
lines changed- python/tvm/topi/arm_cpu/mprofile/dsp/micro_kernel
5 files changed
+93
-42
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
31 | 63 | | |
32 | 64 | | |
33 | 65 | | |
| |||
Lines changed: 43 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
138 | 156 | | |
139 | 157 | | |
140 | | - | |
| 158 | + | |
141 | 159 | | |
142 | 160 | | |
143 | 161 | | |
| |||
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
183 | | - | |
| 201 | + | |
184 | 202 | | |
185 | 203 | | |
186 | 204 | | |
| |||
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
204 | | - | |
| 222 | + | |
205 | 223 | | |
206 | 224 | | |
207 | 225 | | |
| |||
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
229 | | - | |
| 247 | + | |
230 | 248 | | |
231 | 249 | | |
232 | 250 | | |
| |||
246 | 264 | | |
247 | 265 | | |
248 | 266 | | |
249 | | - | |
| 267 | + | |
250 | 268 | | |
251 | 269 | | |
252 | 270 | | |
| |||
289 | 307 | | |
290 | 308 | | |
291 | 309 | | |
292 | | - | |
| 310 | + | |
293 | 311 | | |
294 | 312 | | |
295 | 313 | | |
| |||
307 | 325 | | |
308 | 326 | | |
309 | 327 | | |
310 | | - | |
| 328 | + | |
311 | 329 | | |
312 | 330 | | |
313 | 331 | | |
| |||
332 | 350 | | |
333 | 351 | | |
334 | 352 | | |
335 | | - | |
| 353 | + | |
336 | 354 | | |
337 | 355 | | |
338 | 356 | | |
| |||
349 | 367 | | |
350 | 368 | | |
351 | 369 | | |
352 | | - | |
| 370 | + | |
353 | 371 | | |
354 | 372 | | |
355 | 373 | | |
| |||
367 | 385 | | |
368 | 386 | | |
369 | 387 | | |
370 | | - | |
| 388 | + | |
371 | 389 | | |
372 | 390 | | |
373 | 391 | | |
| |||
388 | 406 | | |
389 | 407 | | |
390 | 408 | | |
391 | | - | |
| 409 | + | |
392 | 410 | | |
393 | 411 | | |
394 | 412 | | |
| |||
405 | 423 | | |
406 | 424 | | |
407 | 425 | | |
408 | | - | |
409 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
410 | 430 | | |
411 | 431 | | |
412 | 432 | | |
413 | | - | |
414 | | - | |
| 433 | + | |
415 | 434 | | |
416 | 435 | | |
417 | 436 | | |
| |||
430 | 449 | | |
431 | 450 | | |
432 | 451 | | |
433 | | - | |
| 452 | + | |
434 | 453 | | |
435 | 454 | | |
436 | 455 | | |
| |||
448 | 467 | | |
449 | 468 | | |
450 | 469 | | |
451 | | - | |
| 470 | + | |
452 | 471 | | |
453 | 472 | | |
454 | 473 | | |
| |||
466 | 485 | | |
467 | 486 | | |
468 | 487 | | |
469 | | - | |
| 488 | + | |
470 | 489 | | |
471 | 490 | | |
472 | 491 | | |
| |||
478 | 497 | | |
479 | 498 | | |
480 | 499 | | |
481 | | - | |
482 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
483 | 504 | | |
484 | 505 | | |
485 | 506 | | |
486 | | - | |
487 | | - | |
| 507 | + | |
488 | 508 | | |
489 | 509 | | |
490 | 510 | | |
| |||
500 | 520 | | |
501 | 521 | | |
502 | 522 | | |
503 | | - | |
| 523 | + | |
504 | 524 | | |
505 | 525 | | |
506 | 526 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
| |||
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | | - | |
124 | | - | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
128 | | - | |
129 | | - | |
| 126 | + | |
| 127 | + | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
| |||
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
175 | | - | |
| 173 | + | |
| 174 | + | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
| |||
0 commit comments