1 /**************************************************************************//**
2 * @file cmsis_armclang.h
3 * @brief CMSIS compiler armclang (Arm Compiler 6) header file
6 ******************************************************************************/
8 * Copyright (c) 2009-2019 Arm Limited. All rights reserved.
10 * SPDX-License-Identifier: Apache-2.0
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
16 * www.apache.org/licenses/LICENSE-2.0
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.
25 /*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */
27 #ifndef __CMSIS_ARMCLANG_H
28 #define __CMSIS_ARMCLANG_H
30 #pragma clang system_header /* treat file as system include file */
32 #ifndef __ARM_COMPAT_H
33 #include <arm_compat.h> /* Compatibility header for Arm Compiler 5 intrinsics */
36 /* CMSIS compiler specific defines */
41 #define __INLINE __inline
43 #ifndef __STATIC_INLINE
44 #define __STATIC_INLINE static __inline
46 #ifndef __STATIC_FORCEINLINE
47 #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline
50 #define __NO_RETURN __attribute__((__noreturn__))
53 #define __USED __attribute__((used))
56 #define __WEAK __attribute__((weak))
59 #define __PACKED __attribute__((packed, aligned(1)))
61 #ifndef __PACKED_STRUCT
62 #define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
64 #ifndef __PACKED_UNION
65 #define __PACKED_UNION union __attribute__((packed, aligned(1)))
67 #ifndef __UNALIGNED_UINT32 /* deprecated */
68 #pragma clang diagnostic push
69 #pragma clang diagnostic ignored "-Wpacked"
70 /*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */
71 struct __attribute__((packed)) T_UINT32 { uint32_t v; };
72 #pragma clang diagnostic pop
73 #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
75 #ifndef __UNALIGNED_UINT16_WRITE
76 #pragma clang diagnostic push
77 #pragma clang diagnostic ignored "-Wpacked"
78 /*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */
79 __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
80 #pragma clang diagnostic pop
81 #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
83 #ifndef __UNALIGNED_UINT16_READ
84 #pragma clang diagnostic push
85 #pragma clang diagnostic ignored "-Wpacked"
86 /*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */
87 __PACKED_STRUCT T_UINT16_READ { uint16_t v; };
88 #pragma clang diagnostic pop
89 #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
91 #ifndef __UNALIGNED_UINT32_WRITE
92 #pragma clang diagnostic push
93 #pragma clang diagnostic ignored "-Wpacked"
94 /*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */
95 __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
96 #pragma clang diagnostic pop
97 #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
99 #ifndef __UNALIGNED_UINT32_READ
100 #pragma clang diagnostic push
101 #pragma clang diagnostic ignored "-Wpacked"
102 /*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */
103 __PACKED_STRUCT T_UINT32_READ { uint32_t v; };
104 #pragma clang diagnostic pop
105 #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
108 #define __ALIGNED(x) __attribute__((aligned(x)))
111 #define __RESTRICT __restrict
114 /* ######################### Startup and Lowlevel Init ######################## */
116 extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit;
117 extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base;
119 #define __PROGRAM_START __main
120 #define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit
121 #define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base
122 #define __VECTOR_ATTR __attribute((section("RESET")))
124 /* ########################### Core Function Access ########################### */
125 /** \ingroup CMSIS_Core_FunctionInterface
126 \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
131 \brief Enable IRQ Interrupts
132 \details Enables IRQ interrupts by clearing the I-bit in the CPSR.
133 Can only be executed in Privileged modes.
135 /* intrinsic void __enable_irq(); see arm_compat.h */
139 \brief Disable IRQ Interrupts
140 \details Disables IRQ interrupts by setting the I-bit in the CPSR.
141 Can only be executed in Privileged modes.
143 /* intrinsic void __disable_irq(); see arm_compat.h */
147 \brief Get Control Register
148 \details Returns the content of the Control Register.
149 \return Control Register value
151 __STATIC_FORCEINLINE uint32_t __get_CONTROL(void)
155 __ASM volatile ("MRS %0, control" : "=r" (result) );
160 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
162 \brief Get Control Register (non-secure)
163 \details Returns the content of the non-secure Control Register when in secure mode.
164 \return non-secure Control Register value
166 __STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void)
170 __ASM volatile ("MRS %0, control_ns" : "=r" (result) );
177 \brief Set Control Register
178 \details Writes the given value to the Control Register.
179 \param [in] control Control Register value to set
181 __STATIC_FORCEINLINE void __set_CONTROL(uint32_t control)
183 __ASM volatile ("MSR control, %0" : : "r" (control) : "memory");
187 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
189 \brief Set Control Register (non-secure)
190 \details Writes the given value to the non-secure Control Register when in secure state.
191 \param [in] control Control Register value to set
193 __STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control)
195 __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory");
201 \brief Get IPSR Register
202 \details Returns the content of the IPSR Register.
203 \return IPSR Register value
205 __STATIC_FORCEINLINE uint32_t __get_IPSR(void)
209 __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
215 \brief Get APSR Register
216 \details Returns the content of the APSR Register.
217 \return APSR Register value
219 __STATIC_FORCEINLINE uint32_t __get_APSR(void)
223 __ASM volatile ("MRS %0, apsr" : "=r" (result) );
229 \brief Get xPSR Register
230 \details Returns the content of the xPSR Register.
231 \return xPSR Register value
233 __STATIC_FORCEINLINE uint32_t __get_xPSR(void)
237 __ASM volatile ("MRS %0, xpsr" : "=r" (result) );
243 \brief Get Process Stack Pointer
244 \details Returns the current value of the Process Stack Pointer (PSP).
245 \return PSP Register value
247 __STATIC_FORCEINLINE uint32_t __get_PSP(void)
251 __ASM volatile ("MRS %0, psp" : "=r" (result) );
256 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
258 \brief Get Process Stack Pointer (non-secure)
259 \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state.
260 \return PSP Register value
262 __STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void)
266 __ASM volatile ("MRS %0, psp_ns" : "=r" (result) );
273 \brief Set Process Stack Pointer
274 \details Assigns the given value to the Process Stack Pointer (PSP).
275 \param [in] topOfProcStack Process Stack Pointer value to set
277 __STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack)
279 __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : );
283 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
285 \brief Set Process Stack Pointer (non-secure)
286 \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state.
287 \param [in] topOfProcStack Process Stack Pointer value to set
289 __STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack)
291 __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : );
297 \brief Get Main Stack Pointer
298 \details Returns the current value of the Main Stack Pointer (MSP).
299 \return MSP Register value
301 __STATIC_FORCEINLINE uint32_t __get_MSP(void)
305 __ASM volatile ("MRS %0, msp" : "=r" (result) );
310 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
312 \brief Get Main Stack Pointer (non-secure)
313 \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state.
314 \return MSP Register value
316 __STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void)
320 __ASM volatile ("MRS %0, msp_ns" : "=r" (result) );
327 \brief Set Main Stack Pointer
328 \details Assigns the given value to the Main Stack Pointer (MSP).
329 \param [in] topOfMainStack Main Stack Pointer value to set
331 __STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack)
333 __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : );
337 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
339 \brief Set Main Stack Pointer (non-secure)
340 \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state.
341 \param [in] topOfMainStack Main Stack Pointer value to set
343 __STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack)
345 __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : );
350 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
352 \brief Get Stack Pointer (non-secure)
353 \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state.
354 \return SP Register value
356 __STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void)
360 __ASM volatile ("MRS %0, sp_ns" : "=r" (result) );
366 \brief Set Stack Pointer (non-secure)
367 \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state.
368 \param [in] topOfStack Stack Pointer value to set
370 __STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack)
372 __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : );
378 \brief Get Priority Mask
379 \details Returns the current state of the priority mask bit from the Priority Mask Register.
380 \return Priority Mask value
382 __STATIC_FORCEINLINE uint32_t __get_PRIMASK(void)
386 __ASM volatile ("MRS %0, primask" : "=r" (result) );
391 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
393 \brief Get Priority Mask (non-secure)
394 \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state.
395 \return Priority Mask value
397 __STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void)
401 __ASM volatile ("MRS %0, primask_ns" : "=r" (result) );
408 \brief Set Priority Mask
409 \details Assigns the given value to the Priority Mask Register.
410 \param [in] priMask Priority Mask
412 __STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask)
414 __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
418 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
420 \brief Set Priority Mask (non-secure)
421 \details Assigns the given value to the non-secure Priority Mask Register when in secure state.
422 \param [in] priMask Priority Mask
424 __STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask)
426 __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory");
431 #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
432 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
433 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
436 \details Enables FIQ interrupts by clearing the F-bit in the CPSR.
437 Can only be executed in Privileged modes.
439 #define __enable_fault_irq __enable_fiq /* see arm_compat.h */
444 \details Disables FIQ interrupts by setting the F-bit in the CPSR.
445 Can only be executed in Privileged modes.
447 #define __disable_fault_irq __disable_fiq /* see arm_compat.h */
451 \brief Get Base Priority
452 \details Returns the current value of the Base Priority register.
453 \return Base Priority register value
455 __STATIC_FORCEINLINE uint32_t __get_BASEPRI(void)
459 __ASM volatile ("MRS %0, basepri" : "=r" (result) );
464 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
466 \brief Get Base Priority (non-secure)
467 \details Returns the current value of the non-secure Base Priority register when in secure state.
468 \return Base Priority register value
470 __STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void)
474 __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) );
481 \brief Set Base Priority
482 \details Assigns the given value to the Base Priority register.
483 \param [in] basePri Base Priority value to set
485 __STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri)
487 __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory");
491 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
493 \brief Set Base Priority (non-secure)
494 \details Assigns the given value to the non-secure Base Priority register when in secure state.
495 \param [in] basePri Base Priority value to set
497 __STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri)
499 __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory");
505 \brief Set Base Priority with condition
506 \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
507 or the new value increases the BASEPRI priority level.
508 \param [in] basePri Base Priority value to set
510 __STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri)
512 __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory");
517 \brief Get Fault Mask
518 \details Returns the current value of the Fault Mask register.
519 \return Fault Mask register value
521 __STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void)
525 __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
530 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
532 \brief Get Fault Mask (non-secure)
533 \details Returns the current value of the non-secure Fault Mask register when in secure state.
534 \return Fault Mask register value
536 __STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void)
540 __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) );
547 \brief Set Fault Mask
548 \details Assigns the given value to the Fault Mask register.
549 \param [in] faultMask Fault Mask value to set
551 __STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask)
553 __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
557 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
559 \brief Set Fault Mask (non-secure)
560 \details Assigns the given value to the non-secure Fault Mask register when in secure state.
561 \param [in] faultMask Fault Mask value to set
563 __STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask)
565 __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory");
569 #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
570 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
571 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
574 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
575 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
578 \brief Get Process Stack Pointer Limit
579 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
580 Stack Pointer Limit register hence zero is returned always in non-secure
583 \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).
584 \return PSPLIM Register value
586 __STATIC_FORCEINLINE uint32_t __get_PSPLIM(void)
588 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
589 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
590 // without main extensions, the non-secure PSPLIM is RAZ/WI
594 __ASM volatile ("MRS %0, psplim" : "=r" (result) );
599 #if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3))
601 \brief Get Process Stack Pointer Limit (non-secure)
602 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
603 Stack Pointer Limit register hence zero is returned always in non-secure
606 \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
607 \return PSPLIM Register value
609 __STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void)
611 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
612 // without main extensions, the non-secure PSPLIM is RAZ/WI
616 __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) );
624 \brief Set Process Stack Pointer Limit
625 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
626 Stack Pointer Limit register hence the write is silently ignored in non-secure
629 \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).
630 \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set
632 __STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit)
634 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
635 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
636 // without main extensions, the non-secure PSPLIM is RAZ/WI
637 (void)ProcStackPtrLimit;
639 __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit));
644 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
646 \brief Set Process Stack Pointer (non-secure)
647 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
648 Stack Pointer Limit register hence the write is silently ignored in non-secure
651 \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state.
652 \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set
654 __STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit)
656 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
657 // without main extensions, the non-secure PSPLIM is RAZ/WI
658 (void)ProcStackPtrLimit;
660 __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit));
667 \brief Get Main Stack Pointer Limit
668 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
669 Stack Pointer Limit register hence zero is returned always.
671 \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).
672 \return MSPLIM Register value
674 __STATIC_FORCEINLINE uint32_t __get_MSPLIM(void)
676 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
677 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
678 // without main extensions, the non-secure MSPLIM is RAZ/WI
682 __ASM volatile ("MRS %0, msplim" : "=r" (result) );
688 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
690 \brief Get Main Stack Pointer Limit (non-secure)
691 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
692 Stack Pointer Limit register hence zero is returned always.
694 \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state.
695 \return MSPLIM Register value
697 __STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void)
699 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
700 // without main extensions, the non-secure MSPLIM is RAZ/WI
704 __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) );
712 \brief Set Main Stack Pointer Limit
713 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
714 Stack Pointer Limit register hence the write is silently ignored.
716 \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).
717 \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set
719 __STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit)
721 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
722 (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
723 // without main extensions, the non-secure MSPLIM is RAZ/WI
724 (void)MainStackPtrLimit;
726 __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit));
731 #if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3))
733 \brief Set Main Stack Pointer Limit (non-secure)
734 Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
735 Stack Pointer Limit register hence the write is silently ignored.
737 \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state.
738 \param [in] MainStackPtrLimit Main Stack Pointer value to set
740 __STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit)
742 #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)))
743 // without main extensions, the non-secure MSPLIM is RAZ/WI
744 (void)MainStackPtrLimit;
746 __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit));
751 #endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
752 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
756 \details Returns the current value of the Floating Point Status/Control register.
757 \return Floating Point Status/Control register value
759 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
760 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
761 #define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr
763 #define __get_FPSCR() ((uint32_t)0U)
768 \details Assigns the given value to the Floating Point Status/Control register.
769 \param [in] fpscr Floating Point Status/Control value to set
771 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
772 (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
773 #define __set_FPSCR __builtin_arm_set_fpscr
775 #define __set_FPSCR(x) ((void)(x))
779 /*@} end of CMSIS_Core_RegAccFunctions */
782 /* ########################## Core Instruction Access ######################### */
783 /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
784 Access to dedicated instructions
788 /* Define macros for porting to both thumb1 and thumb2.
789 * For thumb1, use low register (r0-r7), specified by constraint "l"
790 * Otherwise, use general registers, specified by constraint "r" */
791 #if defined (__thumb__) && !defined (__thumb2__)
792 #define __CMSIS_GCC_OUT_REG(r) "=l" (r)
793 #define __CMSIS_GCC_RW_REG(r) "+l" (r)
794 #define __CMSIS_GCC_USE_REG(r) "l" (r)
796 #define __CMSIS_GCC_OUT_REG(r) "=r" (r)
797 #define __CMSIS_GCC_RW_REG(r) "+r" (r)
798 #define __CMSIS_GCC_USE_REG(r) "r" (r)
803 \details No Operation does nothing. This instruction can be used for code alignment purposes.
805 #define __NOP __builtin_arm_nop
808 \brief Wait For Interrupt
809 \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
811 #define __WFI __builtin_arm_wfi
815 \brief Wait For Event
816 \details Wait For Event is a hint instruction that permits the processor to enter
817 a low-power state until one of a number of events occurs.
819 #define __WFE __builtin_arm_wfe
824 \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
826 #define __SEV __builtin_arm_sev
830 \brief Instruction Synchronization Barrier
831 \details Instruction Synchronization Barrier flushes the pipeline in the processor,
832 so that all instructions following the ISB are fetched from cache or memory,
833 after the instruction has been completed.
835 #define __ISB() __builtin_arm_isb(0xF)
838 \brief Data Synchronization Barrier
839 \details Acts as a special kind of Data Memory Barrier.
840 It completes when all explicit memory accesses before this instruction complete.
842 #define __DSB() __builtin_arm_dsb(0xF)
846 \brief Data Memory Barrier
847 \details Ensures the apparent order of the explicit memory operations before
848 and after the instruction, without ensuring their completion.
850 #define __DMB() __builtin_arm_dmb(0xF)
854 \brief Reverse byte order (32 bit)
855 \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
856 \param [in] value Value to reverse
857 \return Reversed value
859 #define __REV(value) __builtin_bswap32(value)
863 \brief Reverse byte order (16 bit)
864 \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
865 \param [in] value Value to reverse
866 \return Reversed value
868 #define __REV16(value) __ROR(__REV(value), 16)
872 \brief Reverse byte order (16 bit)
873 \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
874 \param [in] value Value to reverse
875 \return Reversed value
877 #define __REVSH(value) (int16_t)__builtin_bswap16(value)
881 \brief Rotate Right in unsigned value (32 bit)
882 \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
883 \param [in] op1 Value to rotate
884 \param [in] op2 Number of Bits to rotate
885 \return Rotated value
887 __STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
894 return (op1 >> op2) | (op1 << (32U - op2));
900 \details Causes the processor to enter Debug state.
901 Debug tools can use this to investigate system state when the instruction at a particular address is reached.
902 \param [in] value is ignored by the processor.
903 If required, a debugger can use it to store additional information about the breakpoint.
905 #define __BKPT(value) __ASM volatile ("bkpt "#value)
909 \brief Reverse bit order of value
910 \details Reverses the bit order of the given value.
911 \param [in] value Value to reverse
912 \return Reversed value
914 #define __RBIT __builtin_arm_rbit
917 \brief Count leading zeros
918 \details Counts the number of leading zeros of a data value.
919 \param [in] value Value to count the leading zeros
920 \return number of leading zeros in value
922 __STATIC_FORCEINLINE uint8_t __CLZ(uint32_t value)
924 /* Even though __builtin_clz produces a CLZ instruction on ARM, formally
925 __builtin_clz(0) is undefined behaviour, so handle this case specially.
926 This guarantees ARM-compatible results if happening to compile on a non-ARM
927 target, and ensures the compiler doesn't decide to activate any
928 optimisations using the logic "value was passed to __builtin_clz, so it
930 ARM Compiler 6.10 and possibly earlier will optimise this test away, leaving a
931 single CLZ instruction.
937 return __builtin_clz(value);
941 #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
942 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
943 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
944 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
946 \brief LDR Exclusive (8 bit)
947 \details Executes a exclusive LDR instruction for 8 bit value.
948 \param [in] ptr Pointer to data
949 \return value of type uint8_t at (*ptr)
951 #define __LDREXB (uint8_t)__builtin_arm_ldrex
955 \brief LDR Exclusive (16 bit)
956 \details Executes a exclusive LDR instruction for 16 bit values.
957 \param [in] ptr Pointer to data
958 \return value of type uint16_t at (*ptr)
960 #define __LDREXH (uint16_t)__builtin_arm_ldrex
964 \brief LDR Exclusive (32 bit)
965 \details Executes a exclusive LDR instruction for 32 bit values.
966 \param [in] ptr Pointer to data
967 \return value of type uint32_t at (*ptr)
969 #define __LDREXW (uint32_t)__builtin_arm_ldrex
973 \brief STR Exclusive (8 bit)
974 \details Executes a exclusive STR instruction for 8 bit values.
975 \param [in] value Value to store
976 \param [in] ptr Pointer to location
977 \return 0 Function succeeded
978 \return 1 Function failed
980 #define __STREXB (uint32_t)__builtin_arm_strex
984 \brief STR Exclusive (16 bit)
985 \details Executes a exclusive STR instruction for 16 bit values.
986 \param [in] value Value to store
987 \param [in] ptr Pointer to location
988 \return 0 Function succeeded
989 \return 1 Function failed
991 #define __STREXH (uint32_t)__builtin_arm_strex
995 \brief STR Exclusive (32 bit)
996 \details Executes a exclusive STR instruction for 32 bit values.
997 \param [in] value Value to store
998 \param [in] ptr Pointer to location
999 \return 0 Function succeeded
1000 \return 1 Function failed
1002 #define __STREXW (uint32_t)__builtin_arm_strex
1006 \brief Remove the exclusive lock
1007 \details Removes the exclusive lock which is created by LDREX.
1009 #define __CLREX __builtin_arm_clrex
1011 #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
1012 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
1013 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1014 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
1017 #if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
1018 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
1019 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) )
1022 \brief Signed Saturate
1023 \details Saturates a signed value.
1024 \param [in] value Value to be saturated
1025 \param [in] sat Bit position to saturate to (1..32)
1026 \return Saturated value
1028 #define __SSAT __builtin_arm_ssat
1032 \brief Unsigned Saturate
1033 \details Saturates an unsigned value.
1034 \param [in] value Value to be saturated
1035 \param [in] sat Bit position to saturate to (0..31)
1036 \return Saturated value
1038 #define __USAT __builtin_arm_usat
1042 \brief Rotate Right with Extend (32 bit)
1043 \details Moves each bit of a bitstring right by one bit.
1044 The carry input is shifted in at the left end of the bitstring.
1045 \param [in] value Value to rotate
1046 \return Rotated value
1048 __STATIC_FORCEINLINE uint32_t __RRX(uint32_t value)
1052 __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) );
1058 \brief LDRT Unprivileged (8 bit)
1059 \details Executes a Unprivileged LDRT instruction for 8 bit value.
1060 \param [in] ptr Pointer to data
1061 \return value of type uint8_t at (*ptr)
1063 __STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr)
1067 __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) );
1068 return ((uint8_t) result); /* Add explicit type cast here */
1073 \brief LDRT Unprivileged (16 bit)
1074 \details Executes a Unprivileged LDRT instruction for 16 bit values.
1075 \param [in] ptr Pointer to data
1076 \return value of type uint16_t at (*ptr)
1078 __STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr)
1082 __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) );
1083 return ((uint16_t) result); /* Add explicit type cast here */
1088 \brief LDRT Unprivileged (32 bit)
1089 \details Executes a Unprivileged LDRT instruction for 32 bit values.
1090 \param [in] ptr Pointer to data
1091 \return value of type uint32_t at (*ptr)
1093 __STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr)
1097 __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) );
1103 \brief STRT Unprivileged (8 bit)
1104 \details Executes a Unprivileged STRT instruction for 8 bit values.
1105 \param [in] value Value to store
1106 \param [in] ptr Pointer to location
1108 __STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr)
1110 __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1115 \brief STRT Unprivileged (16 bit)
1116 \details Executes a Unprivileged STRT instruction for 16 bit values.
1117 \param [in] value Value to store
1118 \param [in] ptr Pointer to location
1120 __STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr)
1122 __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1127 \brief STRT Unprivileged (32 bit)
1128 \details Executes a Unprivileged STRT instruction for 32 bit values.
1129 \param [in] value Value to store
1130 \param [in] ptr Pointer to location
1132 __STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr)
1134 __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) );
1137 #else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
1138 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
1139 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
1142 \brief Signed Saturate
1143 \details Saturates a signed value.
1144 \param [in] value Value to be saturated
1145 \param [in] sat Bit position to saturate to (1..32)
1146 \return Saturated value
1148 __STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat)
1150 if ((sat >= 1U) && (sat <= 32U))
1152 const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
1153 const int32_t min = -1 - max ;
1167 \brief Unsigned Saturate
1168 \details Saturates an unsigned value.
1169 \param [in] value Value to be saturated
1170 \param [in] sat Bit position to saturate to (0..31)
1171 \return Saturated value
1173 __STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat)
1177 const uint32_t max = ((1U << sat) - 1U);
1178 if (val > (int32_t)max)
1187 return (uint32_t)val;
1190 #endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
1191 (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \
1192 (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */
1195 #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1196 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
1198 \brief Load-Acquire (8 bit)
1199 \details Executes a LDAB instruction for 8 bit value.
1200 \param [in] ptr Pointer to data
1201 \return value of type uint8_t at (*ptr)
1203 __STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr)
1207 __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) );
1208 return ((uint8_t) result);
1213 \brief Load-Acquire (16 bit)
1214 \details Executes a LDAH instruction for 16 bit values.
1215 \param [in] ptr Pointer to data
1216 \return value of type uint16_t at (*ptr)
1218 __STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr)
1222 __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) );
1223 return ((uint16_t) result);
1228 \brief Load-Acquire (32 bit)
1229 \details Executes a LDA instruction for 32 bit values.
1230 \param [in] ptr Pointer to data
1231 \return value of type uint32_t at (*ptr)
1233 __STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr)
1237 __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) );
1243 \brief Store-Release (8 bit)
1244 \details Executes a STLB instruction for 8 bit values.
1245 \param [in] value Value to store
1246 \param [in] ptr Pointer to location
1248 __STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr)
1250 __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1255 \brief Store-Release (16 bit)
1256 \details Executes a STLH instruction for 16 bit values.
1257 \param [in] value Value to store
1258 \param [in] ptr Pointer to location
1260 __STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr)
1262 __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1267 \brief Store-Release (32 bit)
1268 \details Executes a STL instruction for 32 bit values.
1269 \param [in] value Value to store
1270 \param [in] ptr Pointer to location
1272 __STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr)
1274 __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) );
1279 \brief Load-Acquire Exclusive (8 bit)
1280 \details Executes a LDAB exclusive instruction for 8 bit value.
1281 \param [in] ptr Pointer to data
1282 \return value of type uint8_t at (*ptr)
1284 #define __LDAEXB (uint8_t)__builtin_arm_ldaex
1288 \brief Load-Acquire Exclusive (16 bit)
1289 \details Executes a LDAH exclusive instruction for 16 bit values.
1290 \param [in] ptr Pointer to data
1291 \return value of type uint16_t at (*ptr)
1293 #define __LDAEXH (uint16_t)__builtin_arm_ldaex
1297 \brief Load-Acquire Exclusive (32 bit)
1298 \details Executes a LDA exclusive instruction for 32 bit values.
1299 \param [in] ptr Pointer to data
1300 \return value of type uint32_t at (*ptr)
1302 #define __LDAEX (uint32_t)__builtin_arm_ldaex
1306 \brief Store-Release Exclusive (8 bit)
1307 \details Executes a STLB exclusive instruction for 8 bit values.
1308 \param [in] value Value to store
1309 \param [in] ptr Pointer to location
1310 \return 0 Function succeeded
1311 \return 1 Function failed
1313 #define __STLEXB (uint32_t)__builtin_arm_stlex
1317 \brief Store-Release Exclusive (16 bit)
1318 \details Executes a STLH exclusive instruction for 16 bit values.
1319 \param [in] value Value to store
1320 \param [in] ptr Pointer to location
1321 \return 0 Function succeeded
1322 \return 1 Function failed
1324 #define __STLEXH (uint32_t)__builtin_arm_stlex
1328 \brief Store-Release Exclusive (32 bit)
1329 \details Executes a STL exclusive instruction for 32 bit values.
1330 \param [in] value Value to store
1331 \param [in] ptr Pointer to location
1332 \return 0 Function succeeded
1333 \return 1 Function failed
1335 #define __STLEX (uint32_t)__builtin_arm_stlex
1337 #endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
1338 (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */
1340 /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
1343 /* ################### Compiler specific Intrinsics ########################### */
1344 /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
1345 Access to dedicated SIMD instructions
1349 #if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1))
1351 #define __SADD8 __builtin_arm_sadd8
1352 #define __QADD8 __builtin_arm_qadd8
1353 #define __SHADD8 __builtin_arm_shadd8
1354 #define __UADD8 __builtin_arm_uadd8
1355 #define __UQADD8 __builtin_arm_uqadd8
1356 #define __UHADD8 __builtin_arm_uhadd8
1357 #define __SSUB8 __builtin_arm_ssub8
1358 #define __QSUB8 __builtin_arm_qsub8
1359 #define __SHSUB8 __builtin_arm_shsub8
1360 #define __USUB8 __builtin_arm_usub8
1361 #define __UQSUB8 __builtin_arm_uqsub8
1362 #define __UHSUB8 __builtin_arm_uhsub8
1363 #define __SADD16 __builtin_arm_sadd16
1364 #define __QADD16 __builtin_arm_qadd16
1365 #define __SHADD16 __builtin_arm_shadd16
1366 #define __UADD16 __builtin_arm_uadd16
1367 #define __UQADD16 __builtin_arm_uqadd16
1368 #define __UHADD16 __builtin_arm_uhadd16
1369 #define __SSUB16 __builtin_arm_ssub16
1370 #define __QSUB16 __builtin_arm_qsub16
1371 #define __SHSUB16 __builtin_arm_shsub16
1372 #define __USUB16 __builtin_arm_usub16
1373 #define __UQSUB16 __builtin_arm_uqsub16
1374 #define __UHSUB16 __builtin_arm_uhsub16
1375 #define __SASX __builtin_arm_sasx
1376 #define __QASX __builtin_arm_qasx
1377 #define __SHASX __builtin_arm_shasx
1378 #define __UASX __builtin_arm_uasx
1379 #define __UQASX __builtin_arm_uqasx
1380 #define __UHASX __builtin_arm_uhasx
1381 #define __SSAX __builtin_arm_ssax
1382 #define __QSAX __builtin_arm_qsax
1383 #define __SHSAX __builtin_arm_shsax
1384 #define __USAX __builtin_arm_usax
1385 #define __UQSAX __builtin_arm_uqsax
1386 #define __UHSAX __builtin_arm_uhsax
1387 #define __USAD8 __builtin_arm_usad8
1388 #define __USADA8 __builtin_arm_usada8
1389 #define __SSAT16 __builtin_arm_ssat16
1390 #define __USAT16 __builtin_arm_usat16
1391 #define __UXTB16 __builtin_arm_uxtb16
1392 #define __UXTAB16 __builtin_arm_uxtab16
1393 #define __SXTB16 __builtin_arm_sxtb16
1394 #define __SXTAB16 __builtin_arm_sxtab16
1395 #define __SMUAD __builtin_arm_smuad
1396 #define __SMUADX __builtin_arm_smuadx
1397 #define __SMLAD __builtin_arm_smlad
1398 #define __SMLADX __builtin_arm_smladx
1399 #define __SMLALD __builtin_arm_smlald
1400 #define __SMLALDX __builtin_arm_smlaldx
1401 #define __SMUSD __builtin_arm_smusd
1402 #define __SMUSDX __builtin_arm_smusdx
1403 #define __SMLSD __builtin_arm_smlsd
1404 #define __SMLSDX __builtin_arm_smlsdx
1405 #define __SMLSLD __builtin_arm_smlsld
1406 #define __SMLSLDX __builtin_arm_smlsldx
1407 #define __SEL __builtin_arm_sel
1408 #define __QADD __builtin_arm_qadd
1409 #define __QSUB __builtin_arm_qsub
1411 #define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
1412 ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
1414 #define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
1415 ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
1417 __STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
1421 __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
1425 #endif /* (__ARM_FEATURE_DSP == 1) */
1426 /*@} end of group CMSIS_SIMD_intrinsics */
1429 #endif /* __CMSIS_ARMCLANG_H */