]> begriffs open source - cmsis/blob - CMSIS/Core/Include/cmsis_armclang.h
Enhanced RTOS2 documentation to state clearly that a user provided stack memory must...
[cmsis] / CMSIS / Core / Include / cmsis_armclang.h
1 /**************************************************************************//**
2  * @file     cmsis_armclang.h
3  * @brief    CMSIS compiler ARMCLANG (ARM compiler V6) header file
4  * @version  V5.0.2
5  * @date     13. February 2017
6  ******************************************************************************/
7 /*
8  * Copyright (c) 2009-2017 ARM Limited. All rights reserved.
9  *
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the License); you may
13  * not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24
25 #ifndef __CMSIS_ARMCLANG_H
26 #define __CMSIS_ARMCLANG_H
27
28 #ifndef __ARM_COMPAT_H
29 #include <arm_compat.h>    /* Compatibility header for ARM Compiler 5 intrinsics */
30 #endif
31
32 /* CMSIS compiler specific defines */
33 #ifndef   __ASM
34   #define __ASM                                  __asm
35 #endif
36 #ifndef   __INLINE
37   #define __INLINE                               __inline
38 #endif
39 #ifndef   __STATIC_INLINE
40   #define __STATIC_INLINE                        static __inline
41 #endif
42 #ifndef   __NO_RETURN
43   #define __NO_RETURN                            __attribute__((noreturn))
44 #endif
45 #ifndef   __USED
46   #define __USED                                 __attribute__((used))
47 #endif
48 #ifndef   __WEAK
49   #define __WEAK                                 __attribute__((weak))
50 #endif
51 #ifndef   __PACKED
52   #define __PACKED                               __attribute__((packed, aligned(1)))
53 #endif
54 #ifndef   __PACKED_STRUCT
55   #define __PACKED_STRUCT                        struct __attribute__((packed, aligned(1)))
56 #endif
57 #ifndef   __UNALIGNED_UINT32        /* deprecated */
58   #pragma clang diagnostic push
59   #pragma clang diagnostic ignored "-Wpacked"
60   struct __attribute__((packed)) T_UINT32 { uint32_t v; };
61   #pragma clang diagnostic pop
62   #define __UNALIGNED_UINT32(x)                  (((struct T_UINT32 *)(x))->v)
63 #endif
64 #ifndef   __UNALIGNED_UINT16_WRITE
65   #pragma clang diagnostic push
66   #pragma clang diagnostic ignored "-Wpacked"
67   __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
68   #pragma clang diagnostic pop
69   #define __UNALIGNED_UINT16_WRITE(addr, val)    (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
70 #endif
71 #ifndef   __UNALIGNED_UINT16_READ
72   #pragma clang diagnostic push
73   #pragma clang diagnostic ignored "-Wpacked"
74   __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
75   #pragma clang diagnostic pop
76   #define __UNALIGNED_UINT16_READ(addr)          (((const struct T_UINT16_READ *)(const void *)(addr))->v)
77 #endif
78 #ifndef   __UNALIGNED_UINT32_WRITE
79   #pragma clang diagnostic push
80   #pragma clang diagnostic ignored "-Wpacked"
81   __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
82   #pragma clang diagnostic pop
83   #define __UNALIGNED_UINT32_WRITE(addr, val)    (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
84 #endif
85 #ifndef   __UNALIGNED_UINT32_READ
86   #pragma clang diagnostic push
87   #pragma clang diagnostic ignored "-Wpacked"
88   __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
89   #pragma clang diagnostic pop
90   #define __UNALIGNED_UINT32_READ(addr)          (((const struct T_UINT32_READ *)(const void *)(addr))->v)
91 #endif
92 #ifndef   __ALIGNED
93   #define __ALIGNED(x)                           __attribute__((aligned(x)))
94 #endif
95
96
97 /* ###########################  Core Function Access  ########################### */
98 /** \ingroup  CMSIS_Core_FunctionInterface
99     \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
100   @{
101  */
102
103 /**
104   \brief   Enable IRQ Interrupts
105   \details Enables IRQ interrupts by clearing the I-bit in the CPSR.
106            Can only be executed in Privileged modes.
107  */
108 /* intrinsic void __enable_irq();  see arm_compat.h */
109
110
111 /**
112   \brief   Disable IRQ Interrupts
113   \details Disables IRQ interrupts by setting the I-bit in the CPSR.
114            Can only be executed in Privileged modes.
115  */
116 /* intrinsic void __disable_irq();  see arm_compat.h */
117
118
119 /**
120   \brief   Get Control Register
121   \details Returns the content of the Control Register.
122   \return               Control Register value
123  */
124 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void)
125 {
126   uint32_t result;
127
128   __ASM volatile ("MRS %0, control" : "=r" (result) );
129   return(result);
130 }
131
132
133 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
134 /**
135   \brief   Get Control Register (non-secure)
136   \details Returns the content of the non-secure Control Register when in secure mode.
137   \return               non-secure Control Register value
138  */
139 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_CONTROL_NS(void)
140 {
141   uint32_t result;
142
143   __ASM volatile ("MRS %0, control_ns" : "=r" (result) );
144   return(result);
145 }
146 #endif
147
148
149 /**
150   \brief   Set Control Register
151   \details Writes the given value to the Control Register.
152   \param [in]    control  Control Register value to set
153  */
154 __attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control)
155 {
156   __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
157 }
158
159
160 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
161 /**
162   \brief   Set Control Register (non-secure)
163   \details Writes the given value to the non-secure Control Register when in secure state.
164   \param [in]    control  Control Register value to set
165  */
166 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_CONTROL_NS(uint32_t control)
167 {
168   __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");
169 }
170 #endif
171
172
173 /**
174   \brief   Get IPSR Register
175   \details Returns the content of the IPSR Register.
176   \return               IPSR Register value
177  */
178 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void)
179 {
180   uint32_t result;
181
182   __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
183   return(result);
184 }
185
186
187 /**
188   \brief   Get APSR Register
189   \details Returns the content of the APSR Register.
190   \return               APSR Register value
191  */
192 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void)
193 {
194   uint32_t result;
195
196   __ASM volatile ("MRS %0, apsr" : "=r" (result) );
197   return(result);
198 }
199
200
201 /**
202   \brief   Get xPSR Register
203   \details Returns the content of the xPSR Register.
204   \return               xPSR Register value
205  */
206 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void)
207 {
208   uint32_t result;
209
210   __ASM volatile ("MRS %0, xpsr" : "=r" (result) );
211   return(result);
212 }
213
214
215 /**
216   \brief   Get Process Stack Pointer
217   \details Returns the current value of the Process Stack Pointer (PSP).
218   \return               PSP Register value
219  */
220 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void)
221 {
222   register uint32_t result;
223
224   __ASM volatile ("MRS %0, psp"  : "=r" (result) );
225   return(result);
226 }
227
228
229 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
230 /**
231   \brief   Get Process Stack Pointer (non-secure)
232   \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.
233   \return               PSP Register value
234  */
235 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void)
236 {
237   register uint32_t result;
238
239   __ASM volatile ("MRS %0, psp_ns"  : "=r" (result) );
240   return(result);
241 }
242 #endif
243
244
245 /**
246   \brief   Set Process Stack Pointer
247   \details Assigns the given value to the Process Stack Pointer (PSP).
248   \param [in]    topOfProcStack  Process Stack Pointer value to set
249  */
250 __attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
251 {
252   __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );
253 }
254
255
256 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
257 /**
258   \brief   Set Process Stack Pointer (non-secure)
259   \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.
260   \param [in]    topOfProcStack  Process Stack Pointer value to set
261  */
262 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)
263 {
264   __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : );
265 }
266 #endif
267
268
269 /**
270   \brief   Get Main Stack Pointer
271   \details Returns the current value of the Main Stack Pointer (MSP).
272   \return               MSP Register value
273  */
274 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void)
275 {
276   register uint32_t result;
277
278   __ASM volatile ("MRS %0, msp" : "=r" (result) );
279   return(result);
280 }
281
282
283 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
284 /**
285   \brief   Get Main Stack Pointer (non-secure)
286   \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.
287   \return               MSP Register value
288  */
289 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void)
290 {
291   register uint32_t result;
292
293   __ASM volatile ("MRS %0, msp_ns" : "=r" (result) );
294   return(result);
295 }
296 #endif
297
298
299 /**
300   \brief   Set Main Stack Pointer
301   \details Assigns the given value to the Main Stack Pointer (MSP).
302   \param [in]    topOfMainStack  Main Stack Pointer value to set
303  */
304 __attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
305 {
306   __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );
307 }
308
309
310 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
311 /**
312   \brief   Set Main Stack Pointer (non-secure)
313   \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.
314   \param [in]    topOfMainStack  Main Stack Pointer value to set
315  */
316 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
317 {
318   __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : );
319 }
320 #endif
321
322
323 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
324 /**
325   \brief   Get Stack Pointer (non-secure)
326   \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.
327   \return               SP Register value
328  */
329 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_SP_NS(void)
330 {
331   register uint32_t result;
332
333   __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );
334   return(result);
335 }
336
337
338 /**
339   \brief   Set Stack Pointer (non-secure)
340   \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state.
341   \param [in]    topOfStack  Stack Pointer value to set
342  */
343 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_SP_NS(uint32_t topOfStack)
344 {
345   __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : );
346 }
347 #endif
348
349
350 /**
351   \brief   Get Priority Mask
352   \details Returns the current state of the priority mask bit from the Priority Mask Register.
353   \return               Priority Mask value
354  */
355 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void)
356 {
357   uint32_t result;
358
359   __ASM volatile ("MRS %0, primask" : "=r" (result) );
360   return(result);
361 }
362
363
364 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
365 /**
366   \brief   Get Priority Mask (non-secure)
367   \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.
368   \return               Priority Mask value
369  */
370 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PRIMASK_NS(void)
371 {
372   uint32_t result;
373
374   __ASM volatile ("MRS %0, primask_ns" : "=r" (result) );
375   return(result);
376 }
377 #endif
378
379
380 /**
381   \brief   Set Priority Mask
382   \details Assigns the given value to the Priority Mask Register.
383   \param [in]    priMask  Priority Mask
384  */
385 __attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
386 {
387   __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
388 }
389
390
391 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
392 /**
393   \brief   Set Priority Mask (non-secure)
394   \details Assigns the given value to the non-secure Priority Mask Register when in secure state.
395   \param [in]    priMask  Priority Mask
396  */
397 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)
398 {
399   __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");
400 }
401 #endif
402
403
404 #if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
405      (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
406      (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )
407 /**
408   \brief   Enable FIQ
409   \details Enables FIQ interrupts by clearing the F-bit in the CPSR.
410            Can only be executed in Privileged modes.
411  */
412 #define __enable_fault_irq                __enable_fiq   /* see arm_compat.h */
413
414
415 /**
416   \brief   Disable FIQ
417   \details Disables FIQ interrupts by setting the F-bit in the CPSR.
418            Can only be executed in Privileged modes.
419  */
420 #define __disable_fault_irq               __disable_fiq   /* see arm_compat.h */
421
422
423 /**
424   \brief   Get Base Priority
425   \details Returns the current value of the Base Priority register.
426   \return               Base Priority register value
427  */
428 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void)
429 {
430   uint32_t result;
431
432   __ASM volatile ("MRS %0, basepri" : "=r" (result) );
433   return(result);
434 }
435
436
437 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
438 /**
439   \brief   Get Base Priority (non-secure)
440   \details Returns the current value of the non-secure Base Priority register when in secure state.
441   \return               Base Priority register value
442  */
443 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_BASEPRI_NS(void)
444 {
445   uint32_t result;
446
447   __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) );
448   return(result);
449 }
450 #endif
451
452
453 /**
454   \brief   Set Base Priority
455   \details Assigns the given value to the Base Priority register.
456   \param [in]    basePri  Base Priority value to set
457  */
458 __attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
459 {
460   __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");
461 }
462
463
464 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
465 /**
466   \brief   Set Base Priority (non-secure)
467   \details Assigns the given value to the non-secure Base Priority register when in secure state.
468   \param [in]    basePri  Base Priority value to set
469  */
470 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)
471 {
472   __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");
473 }
474 #endif
475
476
477 /**
478   \brief   Set Base Priority with condition
479   \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
480            or the new value increases the BASEPRI priority level.
481   \param [in]    basePri  Base Priority value to set
482  */
483 __attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
484 {
485   __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");
486 }
487
488
489 /**
490   \brief   Get Fault Mask
491   \details Returns the current value of the Fault Mask register.
492   \return               Fault Mask register value
493  */
494 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void)
495 {
496   uint32_t result;
497
498   __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
499   return(result);
500 }
501
502
503 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
504 /**
505   \brief   Get Fault Mask (non-secure)
506   \details Returns the current value of the non-secure Fault Mask register when in secure state.
507   \return               Fault Mask register value
508  */
509 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FAULTMASK_NS(void)
510 {
511   uint32_t result;
512
513   __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) );
514   return(result);
515 }
516 #endif
517
518
519 /**
520   \brief   Set Fault Mask
521   \details Assigns the given value to the Fault Mask register.
522   \param [in]    faultMask  Fault Mask value to set
523  */
524 __attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
525 {
526   __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
527 }
528
529
530 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
531 /**
532   \brief   Set Fault Mask (non-secure)
533   \details Assigns the given value to the non-secure Fault Mask register when in secure state.
534   \param [in]    faultMask  Fault Mask value to set
535  */
536 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
537 {
538   __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");
539 }
540 #endif
541
542 #endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
543            (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
544            (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */
545
546
547 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
548      (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )
549
550 /**
551   \brief   Get Process Stack Pointer Limit
552   \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).
553   \return               PSPLIM Register value
554  */
555 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void)
556 {
557   register uint32_t result;
558
559   __ASM volatile ("MRS %0, psplim"  : "=r" (result) );
560   return(result);
561 }
562
563
564 #if ((defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3)) && \
565      (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1))    )
566 /**
567   \brief   Get Process Stack Pointer Limit (non-secure)
568   \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
569   \return               PSPLIM Register value
570  */
571 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void)
572 {
573   register uint32_t result;
574
575   __ASM volatile ("MRS %0, psplim_ns"  : "=r" (result) );
576   return(result);
577 }
578 #endif
579
580
581 /**
582   \brief   Set Process Stack Pointer Limit
583   \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).
584   \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set
585  */
586 __attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
587 {
588   __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));
589 }
590
591
592 #if ((defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3)) && \
593      (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1))    )
594 /**
595   \brief   Set Process Stack Pointer (non-secure)
596   \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
597   \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set
598  */
599 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
600 {
601   __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));
602 }
603 #endif
604
605
606 /**
607   \brief   Get Main Stack Pointer Limit
608   \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).
609   \return               MSPLIM Register value
610  */
611 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void)
612 {
613   register uint32_t result;
614
615   __ASM volatile ("MRS %0, msplim" : "=r" (result) );
616
617   return(result);
618 }
619
620
621 #if ((defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3)) && \
622      (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1))    )
623 /**
624   \brief   Get Main Stack Pointer Limit (non-secure)
625   \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.
626   \return               MSPLIM Register value
627  */
628 __attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void)
629 {
630   register uint32_t result;
631
632   __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );
633   return(result);
634 }
635 #endif
636
637
638 /**
639   \brief   Set Main Stack Pointer Limit
640   \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).
641   \param [in]    MainStackPtrLimit  Main Stack Pointer Limit value to set
642  */
643 __attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
644 {
645   __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));
646 }
647
648
649 #if ((defined (__ARM_FEATURE_CMSE  ) && (__ARM_FEATURE_CMSE   == 3)) && \
650      (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1))    )
651 /**
652   \brief   Set Main Stack Pointer Limit (non-secure)
653   \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.
654   \param [in]    MainStackPtrLimit  Main Stack Pointer value to set
655  */
656 __attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
657 {
658   __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));
659 }
660 #endif
661
662 #endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
663            (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */
664
665
666 #if ((defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
667      (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )
668
669 /**
670   \brief   Get FPSCR
671   \details Returns the current value of the Floating Point Status/Control register.
672   \return               Floating Point Status/Control register value
673  */
674 /* #define __get_FPSCR      __builtin_arm_get_fpscr */
675 __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void)
676 {
677 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
678      (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )
679   uint32_t result;
680
681   __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );
682   return(result);
683 #else
684   return(0U);
685 #endif
686 }
687
688
689 /**
690   \brief   Set FPSCR
691   \details Assigns the given value to the Floating Point Status/Control register.
692   \param [in]    fpscr  Floating Point Status/Control value to set
693  */
694 /* #define __set_FPSCR      __builtin_arm_set_fpscr */
695 __attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
696 {
697 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
698      (defined (__FPU_USED   ) && (__FPU_USED    == 1U))     )
699   __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "memory");
700 #else
701   (void)fpscr;
702 #endif
703 }
704
705 #endif /* ((defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
706            (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */
707
708
709
710 /*@} end of CMSIS_Core_RegAccFunctions */
711
712
713 /* ##########################  Core Instruction Access  ######################### */
714 /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
715   Access to dedicated instructions
716   @{
717 */
718
719 /* Define macros for porting to both thumb1 and thumb2.
720  * For thumb1, use low register (r0-r7), specified by constraint "l"
721  * Otherwise, use general registers, specified by constraint "r" */
722 #if defined (__thumb__) && !defined (__thumb2__)
723 #define __CMSIS_GCC_OUT_REG(r) "=l" (r)
724 #define __CMSIS_GCC_USE_REG(r) "l" (r)
725 #else
726 #define __CMSIS_GCC_OUT_REG(r) "=r" (r)
727 #define __CMSIS_GCC_USE_REG(r) "r" (r)
728 #endif
729
730 /**
731   \brief   No Operation
732   \details No Operation does nothing. This instruction can be used for code alignment purposes.
733  */
734 #define __NOP          __builtin_arm_nop
735
736 /**
737   \brief   Wait For Interrupt
738   \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
739  */
740 #define __WFI          __builtin_arm_wfi
741
742
743 /**
744   \brief   Wait For Event
745   \details Wait For Event is a hint instruction that permits the processor to enter
746            a low-power state until one of a number of events occurs.
747  */
748 #define __WFE          __builtin_arm_wfe
749
750
751 /**
752   \brief   Send Event
753   \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
754  */
755 #define __SEV          __builtin_arm_sev
756
757
758 /**
759   \brief   Instruction Synchronization Barrier
760   \details Instruction Synchronization Barrier flushes the pipeline in the processor,
761            so that all instructions following the ISB are fetched from cache or memory,
762            after the instruction has been completed.
763  */
764 #define __ISB()        __builtin_arm_isb(0xF);
765
766 /**
767   \brief   Data Synchronization Barrier
768   \details Acts as a special kind of Data Memory Barrier.
769            It completes when all explicit memory accesses before this instruction complete.
770  */
771 #define __DSB()        __builtin_arm_dsb(0xF);
772
773
774 /**
775   \brief   Data Memory Barrier
776   \details Ensures the apparent order of the explicit memory operations before
777            and after the instruction, without ensuring their completion.
778  */
779 #define __DMB()        __builtin_arm_dmb(0xF);
780
781
782 /**
783   \brief   Reverse byte order (32 bit)
784   \details Reverses the byte order in integer value.
785   \param [in]    value  Value to reverse
786   \return               Reversed value
787  */
788 #define __REV          __builtin_bswap32
789
790
791 /**
792   \brief   Reverse byte order (16 bit)
793   \details Reverses the byte order in two unsigned short values.
794   \param [in]    value  Value to reverse
795   \return               Reversed value
796  */
797 #define __REV16          __builtin_bswap16                /* ToDo ARMCLANG: check if __builtin_bswap16 could be used */
798 #if 0
799 __attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value)
800 {
801   uint32_t result;
802
803   __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
804   return(result);
805 }
806 #endif
807
808
809 /**
810   \brief   Reverse byte order in signed short value
811   \details Reverses the byte order in a signed short value with sign extension to integer.
812   \param [in]    value  Value to reverse
813   \return               Reversed value
814  */
815                                                           /* ToDo ARMCLANG: check if __builtin_bswap16 could be used */
816 __attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value)
817 {
818   int32_t result;
819
820   __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
821   return(result);
822 }
823
824
825 /**
826   \brief   Rotate Right in unsigned value (32 bit)
827   \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
828   \param [in]    op1  Value to rotate
829   \param [in]    op2  Number of Bits to rotate
830   \return               Rotated value
831  */
832 __attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
833 {
834   return (op1 >> op2) | (op1 << (32U - op2));
835 }
836
837
838 /**
839   \brief   Breakpoint
840   \details Causes the processor to enter Debug state.
841            Debug tools can use this to investigate system state when the instruction at a particular address is reached.
842   \param [in]    value  is ignored by the processor.
843                  If required, a debugger can use it to store additional information about the breakpoint.
844  */
845 #define __BKPT(value)                       __ASM volatile ("bkpt "#value)
846
847
848 /**
849   \brief   Reverse bit order of value
850   \details Reverses the bit order of the given value.
851   \param [in]    value  Value to reverse
852   \return               Reversed value
853  */
854                                                           /* ToDo ARMCLANG: check if __builtin_arm_rbit is supported */
855 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
856 {
857   uint32_t result;
858
859 #if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
860      (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
861      (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )
862    __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
863 #else
864   int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */
865
866   result = value;                      /* r will be reversed bits of v; first get LSB of v */
867   for (value >>= 1U; value; value >>= 1U)
868   {
869     result <<= 1U;
870     result |= value & 1U;
871     s--;
872   }
873   result <<= s;                        /* shift when v's highest bits are zero */
874 #endif
875   return(result);
876 }
877
878
879 /**
880   \brief   Count leading zeros
881   \details Counts the number of leading zeros of a data value.
882   \param [in]  value  Value to count the leading zeros
883   \return             number of leading zeros in value
884  */
885 #define __CLZ             __builtin_clz
886
887
888 #if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
889      (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
890      (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
891      (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )
892 /**
893   \brief   LDR Exclusive (8 bit)
894   \details Executes a exclusive LDR instruction for 8 bit value.
895   \param [in]    ptr  Pointer to data
896   \return             value of type uint8_t at (*ptr)
897  */
898 #define __LDREXB        (uint8_t)__builtin_arm_ldrex
899
900
901 /**
902   \brief   LDR Exclusive (16 bit)
903   \details Executes a exclusive LDR instruction for 16 bit values.
904   \param [in]    ptr  Pointer to data
905   \return        value of type uint16_t at (*ptr)
906  */
907 #define __LDREXH        (uint16_t)__builtin_arm_ldrex
908
909
910 /**
911   \brief   LDR Exclusive (32 bit)
912   \details Executes a exclusive LDR instruction for 32 bit values.
913   \param [in]    ptr  Pointer to data
914   \return        value of type uint32_t at (*ptr)
915  */
916 #define __LDREXW        (uint32_t)__builtin_arm_ldrex
917
918
919 /**
920   \brief   STR Exclusive (8 bit)
921   \details Executes a exclusive STR instruction for 8 bit values.
922   \param [in]  value  Value to store
923   \param [in]    ptr  Pointer to location
924   \return          0  Function succeeded
925   \return          1  Function failed
926  */
927 #define __STREXB        (uint32_t)__builtin_arm_strex
928
929
930 /**
931   \brief   STR Exclusive (16 bit)
932   \details Executes a exclusive STR instruction for 16 bit values.
933   \param [in]  value  Value to store
934   \param [in]    ptr  Pointer to location
935   \return          0  Function succeeded
936   \return          1  Function failed
937  */
938 #define __STREXH        (uint32_t)__builtin_arm_strex
939
940
941 /**
942   \brief   STR Exclusive (32 bit)
943   \details Executes a exclusive STR instruction for 32 bit values.
944   \param [in]  value  Value to store
945   \param [in]    ptr  Pointer to location
946   \return          0  Function succeeded
947   \return          1  Function failed
948  */
949 #define __STREXW        (uint32_t)__builtin_arm_strex
950
951
952 /**
953   \brief   Remove the exclusive lock
954   \details Removes the exclusive lock which is created by LDREX.
955  */
956 #define __CLREX             __builtin_arm_clrex
957
958 #endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
959            (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
960            (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
961            (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */
962
963
964 #if ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
965      (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
966      (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    )
967 /**
968   \brief   Signed Saturate
969   \details Saturates a signed value.
970   \param [in]  value  Value to be saturated
971   \param [in]    sat  Bit position to saturate to (1..32)
972   \return             Saturated value
973  */
974 #define __SSAT             __builtin_arm_ssat
975
976
977 /**
978   \brief   Unsigned Saturate
979   \details Saturates an unsigned value.
980   \param [in]  value  Value to be saturated
981   \param [in]    sat  Bit position to saturate to (0..31)
982   \return             Saturated value
983  */
984 #define __USAT             __builtin_arm_usat
985
986
987 /**
988   \brief   Rotate Right with Extend (32 bit)
989   \details Moves each bit of a bitstring right by one bit.
990            The carry input is shifted in at the left end of the bitstring.
991   \param [in]    value  Value to rotate
992   \return               Rotated value
993  */
994 __attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value)
995 {
996   uint32_t result;
997
998   __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
999   return(result);
1000 }
1001
1002
1003 /**
1004   \brief   LDRT Unprivileged (8 bit)
1005   \details Executes a Unprivileged LDRT instruction for 8 bit value.
1006   \param [in]    ptr  Pointer to data
1007   \return             value of type uint8_t at (*ptr)
1008  */
1009 __attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *ptr)
1010 {
1011   uint32_t result;
1012
1013   __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) );
1014   return ((uint8_t) result);    /* Add explicit type cast here */
1015 }
1016
1017
1018 /**
1019   \brief   LDRT Unprivileged (16 bit)
1020   \details Executes a Unprivileged LDRT instruction for 16 bit values.
1021   \param [in]    ptr  Pointer to data
1022   \return        value of type uint16_t at (*ptr)
1023  */
1024 __attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *ptr)
1025 {
1026   uint32_t result;
1027
1028   __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) );
1029   return ((uint16_t) result);    /* Add explicit type cast here */
1030 }
1031
1032
1033 /**
1034   \brief   LDRT Unprivileged (32 bit)
1035   \details Executes a Unprivileged LDRT instruction for 32 bit values.
1036   \param [in]    ptr  Pointer to data
1037   \return        value of type uint32_t at (*ptr)
1038  */
1039 __attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *ptr)
1040 {
1041   uint32_t result;
1042
1043   __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) );
1044   return(result);
1045 }
1046
1047
1048 /**
1049   \brief   STRT Unprivileged (8 bit)
1050   \details Executes a Unprivileged STRT instruction for 8 bit values.
1051   \param [in]  value  Value to store
1052   \param [in]    ptr  Pointer to location
1053  */
1054 __attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *ptr)
1055 {
1056   __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1057 }
1058
1059
1060 /**
1061   \brief   STRT Unprivileged (16 bit)
1062   \details Executes a Unprivileged STRT instruction for 16 bit values.
1063   \param [in]  value  Value to store
1064   \param [in]    ptr  Pointer to location
1065  */
1066 __attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *ptr)
1067 {
1068   __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1069 }
1070
1071
1072 /**
1073   \brief   STRT Unprivileged (32 bit)
1074   \details Executes a Unprivileged STRT instruction for 32 bit values.
1075   \param [in]  value  Value to store
1076   \param [in]    ptr  Pointer to location
1077  */
1078 __attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr)
1079 {
1080   __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );
1081 }
1082
1083 #endif /* ((defined (__ARM_ARCH_7M__      ) && (__ARM_ARCH_7M__      == 1)) || \
1084            (defined (__ARM_ARCH_7EM__     ) && (__ARM_ARCH_7EM__     == 1)) || \
1085            (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))    ) */
1086
1087
1088 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1089      (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    )
1090 /**
1091   \brief   Load-Acquire (8 bit)
1092   \details Executes a LDAB instruction for 8 bit value.
1093   \param [in]    ptr  Pointer to data
1094   \return             value of type uint8_t at (*ptr)
1095  */
1096 __attribute__((always_inline)) __STATIC_INLINE uint8_t __LDAB(volatile uint8_t *ptr)
1097 {
1098   uint32_t result;
1099
1100   __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) );
1101   return ((uint8_t) result);
1102 }
1103
1104
1105 /**
1106   \brief   Load-Acquire (16 bit)
1107   \details Executes a LDAH instruction for 16 bit values.
1108   \param [in]    ptr  Pointer to data
1109   \return        value of type uint16_t at (*ptr)
1110  */
1111 __attribute__((always_inline)) __STATIC_INLINE uint16_t __LDAH(volatile uint16_t *ptr)
1112 {
1113   uint32_t result;
1114
1115   __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) );
1116   return ((uint16_t) result);
1117 }
1118
1119
1120 /**
1121   \brief   Load-Acquire (32 bit)
1122   \details Executes a LDA instruction for 32 bit values.
1123   \param [in]    ptr  Pointer to data
1124   \return        value of type uint32_t at (*ptr)
1125  */
1126 __attribute__((always_inline)) __STATIC_INLINE uint32_t __LDA(volatile uint32_t *ptr)
1127 {
1128   uint32_t result;
1129
1130   __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) );
1131   return(result);
1132 }
1133
1134
1135 /**
1136   \brief   Store-Release (8 bit)
1137   \details Executes a STLB instruction for 8 bit values.
1138   \param [in]  value  Value to store
1139   \param [in]    ptr  Pointer to location
1140  */
1141 __attribute__((always_inline)) __STATIC_INLINE void __STLB(uint8_t value, volatile uint8_t *ptr)
1142 {
1143   __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1144 }
1145
1146
1147 /**
1148   \brief   Store-Release (16 bit)
1149   \details Executes a STLH instruction for 16 bit values.
1150   \param [in]  value  Value to store
1151   \param [in]    ptr  Pointer to location
1152  */
1153 __attribute__((always_inline)) __STATIC_INLINE void __STLH(uint16_t value, volatile uint16_t *ptr)
1154 {
1155   __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1156 }
1157
1158
1159 /**
1160   \brief   Store-Release (32 bit)
1161   \details Executes a STL instruction for 32 bit values.
1162   \param [in]  value  Value to store
1163   \param [in]    ptr  Pointer to location
1164  */
1165 __attribute__((always_inline)) __STATIC_INLINE void __STL(uint32_t value, volatile uint32_t *ptr)
1166 {
1167   __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1168 }
1169
1170
1171 /**
1172   \brief   Load-Acquire Exclusive (8 bit)
1173   \details Executes a LDAB exclusive instruction for 8 bit value.
1174   \param [in]    ptr  Pointer to data
1175   \return             value of type uint8_t at (*ptr)
1176  */
1177 #define     __LDAEXB                 (uint8_t)__builtin_arm_ldaex
1178
1179
1180 /**
1181   \brief   Load-Acquire Exclusive (16 bit)
1182   \details Executes a LDAH exclusive instruction for 16 bit values.
1183   \param [in]    ptr  Pointer to data
1184   \return        value of type uint16_t at (*ptr)
1185  */
1186 #define     __LDAEXH                 (uint16_t)__builtin_arm_ldaex
1187
1188
1189 /**
1190   \brief   Load-Acquire Exclusive (32 bit)
1191   \details Executes a LDA exclusive instruction for 32 bit values.
1192   \param [in]    ptr  Pointer to data
1193   \return        value of type uint32_t at (*ptr)
1194  */
1195 #define     __LDAEX                  (uint32_t)__builtin_arm_ldaex
1196
1197
1198 /**
1199   \brief   Store-Release Exclusive (8 bit)
1200   \details Executes a STLB exclusive instruction for 8 bit values.
1201   \param [in]  value  Value to store
1202   \param [in]    ptr  Pointer to location
1203   \return          0  Function succeeded
1204   \return          1  Function failed
1205  */
1206 #define     __STLEXB                 (uint32_t)__builtin_arm_stlex
1207
1208
1209 /**
1210   \brief   Store-Release Exclusive (16 bit)
1211   \details Executes a STLH exclusive instruction for 16 bit values.
1212   \param [in]  value  Value to store
1213   \param [in]    ptr  Pointer to location
1214   \return          0  Function succeeded
1215   \return          1  Function failed
1216  */
1217 #define     __STLEXH                 (uint32_t)__builtin_arm_stlex
1218
1219
1220 /**
1221   \brief   Store-Release Exclusive (32 bit)
1222   \details Executes a STL exclusive instruction for 32 bit values.
1223   \param [in]  value  Value to store
1224   \param [in]    ptr  Pointer to location
1225   \return          0  Function succeeded
1226   \return          1  Function failed
1227  */
1228 #define     __STLEX                  (uint32_t)__builtin_arm_stlex
1229
1230 #endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1231            (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1))    ) */
1232
1233 /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
1234
1235
1236 /* ###################  Compiler specific Intrinsics  ########################### */
1237 /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
1238   Access to dedicated SIMD instructions
1239   @{
1240 */
1241
1242 #if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
1243
1244 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2)
1245 {
1246   uint32_t result;
1247
1248   __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1249   return(result);
1250 }
1251
1252 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2)
1253 {
1254   uint32_t result;
1255
1256   __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1257   return(result);
1258 }
1259
1260 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2)
1261 {
1262   uint32_t result;
1263
1264   __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1265   return(result);
1266 }
1267
1268 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2)
1269 {
1270   uint32_t result;
1271
1272   __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1273   return(result);
1274 }
1275
1276 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2)
1277 {
1278   uint32_t result;
1279
1280   __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1281   return(result);
1282 }
1283
1284 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2)
1285 {
1286   uint32_t result;
1287
1288   __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1289   return(result);
1290 }
1291
1292
1293 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2)
1294 {
1295   uint32_t result;
1296
1297   __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1298   return(result);
1299 }
1300
1301 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2)
1302 {
1303   uint32_t result;
1304
1305   __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1306   return(result);
1307 }
1308
1309 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
1310 {
1311   uint32_t result;
1312
1313   __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1314   return(result);
1315 }
1316
1317 __attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2)
1318 {
1319   uint32_t result;
1320
1321   __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1322   return(result);
1323 }
1324
1325 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
1326 {
1327   uint32_t result;
1328
1329   __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1330   return(result);
1331 }
1332
1333 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
1334 {
1335   uint32_t result;
1336
1337   __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1338   return(result);
1339 }
1340
1341
1342 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2)
1343 {
1344   uint32_t result;
1345
1346   __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1347   return(result);
1348 }
1349
1350 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2)
1351 {
1352   uint32_t result;
1353
1354   __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1355   return(result);
1356 }
1357
1358 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2)
1359 {
1360   uint32_t result;
1361
1362   __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1363   return(result);
1364 }
1365
1366 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2)
1367 {
1368   uint32_t result;
1369
1370   __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1371   return(result);
1372 }
1373
1374 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2)
1375 {
1376   uint32_t result;
1377
1378   __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1379   return(result);
1380 }
1381
1382 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2)
1383 {
1384   uint32_t result;
1385
1386   __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1387   return(result);
1388 }
1389
1390 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2)
1391 {
1392   uint32_t result;
1393
1394   __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1395   return(result);
1396 }
1397
1398 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2)
1399 {
1400   uint32_t result;
1401
1402   __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1403   return(result);
1404 }
1405
1406 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
1407 {
1408   uint32_t result;
1409
1410   __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1411   return(result);
1412 }
1413
1414 __attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2)
1415 {
1416   uint32_t result;
1417
1418   __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1419   return(result);
1420 }
1421
1422 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
1423 {
1424   uint32_t result;
1425
1426   __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1427   return(result);
1428 }
1429
1430 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
1431 {
1432   uint32_t result;
1433
1434   __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1435   return(result);
1436 }
1437
1438 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2)
1439 {
1440   uint32_t result;
1441
1442   __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1443   return(result);
1444 }
1445
1446 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2)
1447 {
1448   uint32_t result;
1449
1450   __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1451   return(result);
1452 }
1453
1454 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2)
1455 {
1456   uint32_t result;
1457
1458   __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1459   return(result);
1460 }
1461
1462 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2)
1463 {
1464   uint32_t result;
1465
1466   __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1467   return(result);
1468 }
1469
1470 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2)
1471 {
1472   uint32_t result;
1473
1474   __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1475   return(result);
1476 }
1477
1478 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2)
1479 {
1480   uint32_t result;
1481
1482   __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1483   return(result);
1484 }
1485
1486 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2)
1487 {
1488   uint32_t result;
1489
1490   __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1491   return(result);
1492 }
1493
1494 __attribute__((always_inline)) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2)
1495 {
1496   uint32_t result;
1497
1498   __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1499   return(result);
1500 }
1501
1502 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2)
1503 {
1504   uint32_t result;
1505
1506   __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1507   return(result);
1508 }
1509
1510 __attribute__((always_inline)) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2)
1511 {
1512   uint32_t result;
1513
1514   __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1515   return(result);
1516 }
1517
1518 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2)
1519 {
1520   uint32_t result;
1521
1522   __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1523   return(result);
1524 }
1525
1526 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2)
1527 {
1528   uint32_t result;
1529
1530   __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1531   return(result);
1532 }
1533
1534 __attribute__((always_inline)) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2)
1535 {
1536   uint32_t result;
1537
1538   __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1539   return(result);
1540 }
1541
1542 __attribute__((always_inline)) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
1543 {
1544   uint32_t result;
1545
1546   __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
1547   return(result);
1548 }
1549
1550 #define __SSAT16(ARG1,ARG2) \
1551 ({                          \
1552   int32_t __RES, __ARG1 = (ARG1); \
1553   __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \
1554   __RES; \
1555  })
1556
1557 #define __USAT16(ARG1,ARG2) \
1558 ({                          \
1559   uint32_t __RES, __ARG1 = (ARG1); \
1560   __ASM ("usat16 %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \
1561   __RES; \
1562  })
1563
1564 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1)
1565 {
1566   uint32_t result;
1567
1568   __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
1569   return(result);
1570 }
1571
1572 __attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
1573 {
1574   uint32_t result;
1575
1576   __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1577   return(result);
1578 }
1579
1580 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1)
1581 {
1582   uint32_t result;
1583
1584   __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
1585   return(result);
1586 }
1587
1588 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
1589 {
1590   uint32_t result;
1591
1592   __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1593   return(result);
1594 }
1595
1596 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUAD  (uint32_t op1, uint32_t op2)
1597 {
1598   uint32_t result;
1599
1600   __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1601   return(result);
1602 }
1603
1604 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2)
1605 {
1606   uint32_t result;
1607
1608   __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1609   return(result);
1610 }
1611
1612 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
1613 {
1614   uint32_t result;
1615
1616   __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
1617   return(result);
1618 }
1619
1620 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
1621 {
1622   uint32_t result;
1623
1624   __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
1625   return(result);
1626 }
1627
1628 __attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc)
1629 {
1630   union llreg_u{
1631     uint32_t w32[2];
1632     uint64_t w64;
1633   } llr;
1634   llr.w64 = acc;
1635
1636 #ifndef __ARMEB__   /* Little endian */
1637   __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
1638 #else               /* Big endian */
1639   __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
1640 #endif
1641
1642   return(llr.w64);
1643 }
1644
1645 __attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc)
1646 {
1647   union llreg_u{
1648     uint32_t w32[2];
1649     uint64_t w64;
1650   } llr;
1651   llr.w64 = acc;
1652
1653 #ifndef __ARMEB__   /* Little endian */
1654   __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
1655 #else               /* Big endian */
1656   __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
1657 #endif
1658
1659   return(llr.w64);
1660 }
1661
1662 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSD  (uint32_t op1, uint32_t op2)
1663 {
1664   uint32_t result;
1665
1666   __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1667   return(result);
1668 }
1669
1670 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
1671 {
1672   uint32_t result;
1673
1674   __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1675   return(result);
1676 }
1677
1678 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
1679 {
1680   uint32_t result;
1681
1682   __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
1683   return(result);
1684 }
1685
1686 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
1687 {
1688   uint32_t result;
1689
1690   __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
1691   return(result);
1692 }
1693
1694 __attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc)
1695 {
1696   union llreg_u{
1697     uint32_t w32[2];
1698     uint64_t w64;
1699   } llr;
1700   llr.w64 = acc;
1701
1702 #ifndef __ARMEB__   /* Little endian */
1703   __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
1704 #else               /* Big endian */
1705   __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
1706 #endif
1707
1708   return(llr.w64);
1709 }
1710
1711 __attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc)
1712 {
1713   union llreg_u{
1714     uint32_t w32[2];
1715     uint64_t w64;
1716   } llr;
1717   llr.w64 = acc;
1718
1719 #ifndef __ARMEB__   /* Little endian */
1720   __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
1721 #else               /* Big endian */
1722   __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) );
1723 #endif
1724
1725   return(llr.w64);
1726 }
1727
1728 __attribute__((always_inline)) __STATIC_INLINE uint32_t __SEL  (uint32_t op1, uint32_t op2)
1729 {
1730   uint32_t result;
1731
1732   __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1733   return(result);
1734 }
1735
1736 __attribute__((always_inline)) __STATIC_INLINE  int32_t __QADD( int32_t op1,  int32_t op2)
1737 {
1738   int32_t result;
1739
1740   __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1741   return(result);
1742 }
1743
1744 __attribute__((always_inline)) __STATIC_INLINE  int32_t __QSUB( int32_t op1,  int32_t op2)
1745 {
1746   int32_t result;
1747
1748   __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
1749   return(result);
1750 }
1751
1752 #if 0
1753 #define __PKHBT(ARG1,ARG2,ARG3) \
1754 ({                          \
1755   uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
1756   __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \
1757   __RES; \
1758  })
1759
1760 #define __PKHTB(ARG1,ARG2,ARG3) \
1761 ({                          \
1762   uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \
1763   if (ARG3 == 0) \
1764     __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2)  ); \
1765   else \
1766     __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) :  "r" (__ARG1), "r" (__ARG2), "I" (ARG3)  ); \
1767   __RES; \
1768  })
1769 #endif
1770
1771 #define __PKHBT(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0x0000FFFFUL) |  \
1772                                            ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL)  )
1773
1774 #define __PKHTB(ARG1,ARG2,ARG3)          ( ((((uint32_t)(ARG1))          ) & 0xFFFF0000UL) |  \
1775                                            ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL)  )
1776
1777 __attribute__((always_inline)) __STATIC_INLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
1778 {
1779   int32_t result;
1780
1781   __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r"  (op1), "r" (op2), "r" (op3) );
1782   return(result);
1783 }
1784
1785 #endif /* (__ARM_FEATURE_DSP == 1) */
1786 /*@} end of group CMSIS_SIMD_intrinsics */
1787
1788
1789 #endif /* __CMSIS_ARMCLANG_H */